You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This tool automatically obtains a limited JIT trace log for a miscompiled method. It works by using preexistence
4
+
and a hooked internal API to repeatedly run a test by sequentially reverting JIT methods to be executed in the interpreter.
5
+
By repeatedly executing a test in a controlled environment we are able to devertmine which JIT method needs to be interpreted
6
+
for the test to start passing. This is how the tool determines which JIT method _may_ be responsible for the test case failure.
7
+
8
+
Once the JIT method is identified the tool performs a `lastOptIndex` search by recompiling the JIT method at different
9
+
optimization levels. Once again, when the test starts passing we have determined the minimal `lastOptIndex` which causes the
10
+
failure. At that point the tool gather a _"good"_ and _"bad"_ JIT trace log with the optimization included and excluded for
11
+
JIT developers to investigate.
12
+
13
+
# When to use this tool
14
+
15
+
This tool should be used for highly intermittent JIT defects from automated testing environments where we are either not able
16
+
to determine the JIT method responsible for the failure, or we are unable to trace the suspect JIT method due to a Heisenbug.
17
+
18
+
# How to use this tool
19
+
20
+
1. Using maven and running the command `$ mvn install` in this directory will package the agent into a jar file, you will find it in the `target` directory.
21
+
2. add the java agent option to your `java` execution which would look like this: `-javaagent: jit-debug-agent-1.0.jar`
22
+
3. Run the test by forcing preexistence.
23
+
24
+
Currently the tool is not robust enough to enable this automatically, so we have to force every JIT method compilation to use
25
+
preexistence. This is to ensure that we have a _revert to interpreter_ stub inserted in the preprologue of every method.
26
+
Inserting this stub happens at binary encoding and should not affect the semantics of the method itself.
0 commit comments