Skip to content

Commit c084844

Browse files
committed
Add missing boundary
1 parent 788863f commit c084844

File tree

1 file changed

+13
-2
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/thread

1 file changed

+13
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/thread/ThreadLocalNodes.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import com.oracle.graal.python.nodes.SpecialMethodNames;
4747
import com.oracle.graal.python.nodes.call.CallNode;
4848
import com.oracle.graal.python.runtime.object.PythonObjectFactory;
49+
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
4950
import com.oracle.truffle.api.dsl.Cached;
5051
import com.oracle.truffle.api.dsl.Specialization;
5152
import com.oracle.truffle.api.frame.VirtualFrame;
@@ -60,14 +61,24 @@ PDict get(VirtualFrame frame, PThreadLocal self,
6061
@Cached PythonObjectFactory factory,
6162
@Cached PyObjectLookupAttr lookup,
6263
@Cached CallNode callNode) {
63-
PDict storage = self.getThreadLocalDict().get();
64+
PDict storage = getStorage(self);
6465
if (storage == null) {
6566
storage = factory.createDict();
66-
self.getThreadLocalDict().set(storage);
67+
setStorage(self, storage);
6768
Object initMethod = lookup.execute(frame, self, SpecialMethodNames.__INIT__);
6869
callNode.execute(frame, initMethod, self.getArgs(), self.getKeywords());
6970
}
7071
return storage;
7172
}
73+
74+
@TruffleBoundary
75+
private PDict getStorage(PThreadLocal self) {
76+
return self.getThreadLocalDict().get();
77+
}
78+
79+
@TruffleBoundary
80+
private void setStorage(PThreadLocal self, PDict storage) {
81+
self.getThreadLocalDict().set(storage);
82+
}
7283
}
7384
}

0 commit comments

Comments
 (0)