Skip to content

Commit 32828e0

Browse files
committed
Re-parse graphs in OptimizeLongJumpsTest.
1 parent f696872 commit 32828e0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/asm/amd64/test/OptimizeLongJumpsTest.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ private void testOptimizeLongJumps(String method, OptionValues opts, Object... p
9999
* Why using a loop: The optimization is considered successful, if there are fewer
100100
* jmp/jcc instructions compared to the unoptimized code. To assert this condition,
101101
* checkCode counts long jump / jcc opcodes in the raw code byte arrays. Thus, under
102-
* rare circumstances, bytes from constants, displacements, etc can "look" like the
102+
* rare circumstances, bytes from constants, displacements, etc. can "look" like the
103103
* opcodes we are searching for which can lead to false counts. If the success condition
104104
* does not hold, we redo the code emits trying to rule out false positives and only
105105
* fail if the success condition does not hold repeatedly.
@@ -111,10 +111,13 @@ private void testOptimizeLongJumps(String method, OptionValues opts, Object... p
111111
codeOptimized = getCode(graphOptimized.method(), graphOptimized, true, true, optionsOptimized);
112112
Object resultOptimized = codeOptimized.executeVarargs(params);
113113

114-
assertTrue(String.format("Optimized code should behave identically! Result (default): %d | Result (optimized): %d", resultDefault, resultOptimized), resultDefault.equals(resultOptimized));
114+
assertTrue(String.format("Optimized code should behave identically! Result (default): %s | Result (optimized): %s", resultDefault, resultOptimized), resultDefault.equals(resultOptimized));
115115
if (checkCode(codeDefault, codeOptimized)) {
116116
return;
117117
}
118+
119+
graphDefault = parseEager(method, AllowAssumptions.NO, optionsDefault);
120+
graphOptimized = parseEager(method, AllowAssumptions.NO, optionsOptimized);
118121
}
119122
fail(String.format("Optimized code should have fewer long jumps!\n\tDefault code: %s\n\tOptimized code: %s", byteArrayToHexArray(codeDefault.getCode()),
120123
byteArrayToHexArray(codeOptimized.getCode())));

0 commit comments

Comments
 (0)