@@ -14211,6 +14211,8 @@ private List<CodeExecutableElement> createContinueAt() {
14211
14211
b.declaration(arrayOf(type(byte.class)), "bc", uncheckedCast(type(byte[].class), "this.bytecodes"));
14212
14212
if (tier.isCached()) {
14213
14213
ex.addAnnotationMirror(createExplodeLoopAnnotation("MERGE_EXPLODE"));
14214
+ b.declaration(type(int.class), "counter", "0");
14215
+ b.declaration(loopCounter.asType(), "loopCounter", "null");
14214
14216
}
14215
14217
14216
14218
b.startIf().startStaticCall(types.HostCompilerDirectives, "inInterpreterFastPath").end().end().startBlock();
@@ -14219,20 +14221,19 @@ private List<CodeExecutableElement> createContinueAt() {
14219
14221
if (tier.isCached()) {
14220
14222
b.startStatement().startStaticCall(type(Reference.class), "reachabilityFence").tree(uncheckedCast(arrayOf(types.Node), "this.cachedNodes_")).end().end();
14221
14223
}
14222
- b.end();
14223
-
14224
- b.statement("int bci = ", decodeBci("startState"));
14225
- b.statement("int sp = ", decodeSp("startState"));
14226
-
14227
14224
if (tier.isCached()) {
14228
- b.declaration(type(int.class), "counter", "0");
14229
- b.declaration(loopCounter.asType(), "loopCounter", "null");
14230
- b.startIf().startStaticCall(types.CompilerDirectives, "hasNextTier").end().string("&& !").startStaticCall(types.CompilerDirectives, "inInterpreter").end().end().startBlock();
14225
+ b.end().startElseIf().startStaticCall(types.CompilerDirectives, "hasNextTier").end().end().startBlock();
14231
14226
b.lineComment("Using a class for the loop counter is a workaround to prevent PE from merging it at the end of the loop.");
14232
14227
b.lineComment("We need to use a class with PE, in the interpreter we can use a regular counter.");
14233
14228
b.startAssign("loopCounter").startNew(loopCounter.asType()).end().end();
14234
14229
b.end();
14230
+ } else {
14231
+ b.end();
14235
14232
}
14233
+
14234
+ b.statement("int bci = ", decodeBci("startState"));
14235
+ b.statement("int sp = ", decodeSp("startState"));
14236
+
14236
14237
if (model.needsBciSlot() && !model.storeBciInFrame && !tier.isUncached()) {
14237
14238
// If a bci slot is allocated but not used for non-uncached interpreters, set it to
14238
14239
// an invalid value just in case it gets read during a stack walk.
0 commit comments