Skip to content

Commit a72b6f6

Browse files
committed
Make store fence unconditional in the interpreter to avoid shared shape check.
1 parent 11abeb3 commit a72b6f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

truffle/src/com.oracle.truffle.api.object/src/com/oracle/truffle/api/object/DynamicObjectSupport.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import java.util.Map;
4646
import java.util.Objects;
4747

48+
import com.oracle.truffle.api.CompilerDirectives;
4849
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
4950

5051
final class DynamicObjectSupport {
@@ -53,7 +54,8 @@ private DynamicObjectSupport() {
5354
}
5455

5556
static void setShapeWithStoreFence(DynamicObject object, Shape shape) {
56-
if (shape.isShared()) {
57+
// unconditional fence in the interpreter to avoid an extra shared shape branch
58+
if (CompilerDirectives.inInterpreter() || shape.isShared()) {
5759
VarHandle.storeStoreFence();
5860
}
5961
object.setShape(shape);

0 commit comments

Comments
 (0)