Skip to content

Commit eec5113

Browse files
woessbulasevich
authored andcommitted
Fix TraceTransferToInterpreter in WasmFunctionNode.profileCondition.
(cherry picked from commit 66c83744b3edc6a4b2488f93704727e5f3f3aa0f)
1 parent 3d1909c commit eec5113

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

wasm/src/org.graalvm.wasm/src/org/graalvm/wasm/nodes/WasmFunctionNode.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4644,31 +4644,31 @@ private static boolean profileCondition(byte[] data, final int profileOffset, bo
46444644
int f = rawPeekU8(data, profileOffset + 1);
46454645
boolean val = condition;
46464646
if (val) {
4647+
if (t == 0) {
4648+
CompilerDirectives.transferToInterpreterAndInvalidate();
4649+
}
46474650
if (!CompilerDirectives.inInterpreter()) {
4648-
if (t == 0) {
4649-
CompilerDirectives.transferToInterpreterAndInvalidate();
4650-
}
46514651
if (f == 0) {
46524652
// Make this branch fold during PE
46534653
val = true;
46544654
}
46554655
} else {
46564656
if (t < MAX_PROFILE_VALUE) {
4657-
data[profileOffset]++;
4657+
data[profileOffset] = (byte) (t + 1);
46584658
}
46594659
}
46604660
} else {
4661+
if (f == 0) {
4662+
CompilerDirectives.transferToInterpreterAndInvalidate();
4663+
}
46614664
if (!CompilerDirectives.inInterpreter()) {
4662-
if (f == 0) {
4663-
CompilerDirectives.transferToInterpreterAndInvalidate();
4664-
}
46654665
if (t == 0) {
46664666
// Make this branch fold during PE
46674667
val = false;
46684668
}
46694669
} else {
46704670
if (f < MAX_PROFILE_VALUE) {
4671-
data[profileOffset + 1]++;
4671+
data[profileOffset + 1] = (byte) (f + 1);
46724672
}
46734673
}
46744674
}

0 commit comments

Comments
 (0)