Skip to content

Commit 45c7d73

Browse files
committed
Don't use hasNextTier for loopCount, it confuses the loop merge
1 parent bd32b2a commit 45c7d73

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/bytecode/PBytecodeRootNode.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,7 +1078,7 @@ private Object executeInner(VirtualFrame virtualFrame, boolean resumingAfterOSR,
10781078
break;
10791079
}
10801080
case OpCodesConstants.RETURN_VALUE: {
1081-
if (CompilerDirectives.hasNextTier() && loopCount > 0) {
1081+
if (CompilerDirectives.inInterpreter() && loopCount > 0) {
10821082
LoopNode.reportLoopCount(this, loopCount);
10831083
}
10841084
Object value = localFrame.getObject(stackTop);
@@ -1230,7 +1230,7 @@ private Object executeInner(VirtualFrame virtualFrame, boolean resumingAfterOSR,
12301230
case OpCodesConstants.JUMP_BACKWARD: {
12311231
oparg |= Byte.toUnsignedInt(localBC[bci + 1]);
12321232
bci -= oparg;
1233-
if (CompilerDirectives.hasNextTier()) {
1233+
if (CompilerDirectives.inInterpreter()) {
12341234
loopCount++;
12351235
}
12361236
if (CompilerDirectives.inInterpreter() && BytecodeOSRNode.pollOSRBackEdge(this)) {
@@ -1246,7 +1246,7 @@ private Object executeInner(VirtualFrame virtualFrame, boolean resumingAfterOSR,
12461246
*/
12471247
Object osrResult = BytecodeOSRNode.tryOSR(this, bci, stackTop, null, virtualFrame);
12481248
if (osrResult != null) {
1249-
if (CompilerDirectives.hasNextTier() && loopCount > 0) {
1249+
if (CompilerDirectives.inInterpreter() && loopCount > 0) {
12501250
LoopNode.reportLoopCount(this, loopCount);
12511251
}
12521252
return osrResult;
@@ -1368,7 +1368,7 @@ private Object executeInner(VirtualFrame virtualFrame, boolean resumingAfterOSR,
13681368
throw bytecodeEndExcHandler(virtualFrame, localFrame, stackTop);
13691369
}
13701370
case OpCodesConstants.YIELD_VALUE: {
1371-
if (CompilerDirectives.hasNextTier() && loopCount > 0) {
1371+
if (CompilerDirectives.inInterpreter() && loopCount > 0) {
13721372
LoopNode.reportLoopCount(this, loopCount);
13731373
}
13741374
Object value = localFrame.getObject(stackTop);
@@ -1455,7 +1455,7 @@ private Object executeInner(VirtualFrame virtualFrame, boolean resumingAfterOSR,
14551455
}
14561456
if (newTarget == -1) {
14571457
localFrame.setInt(bcioffset, beginBci);
1458-
if (CompilerDirectives.hasNextTier() && loopCount > 0) {
1458+
if (CompilerDirectives.inInterpreter() && loopCount > 0) {
14591459
LoopNode.reportLoopCount(this, loopCount);
14601460
}
14611461
if (e == pe) {

0 commit comments

Comments
 (0)