Skip to content

Commit b6b7617

Browse files
committed
create factory per node
1 parent ee46560 commit b6b7617

File tree

1 file changed

+5
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes

1 file changed

+5
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/PBaseNode.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ public abstract class PBaseNode extends Node {
6060
@CompilationFinal private ContextReference<PythonContext> contextRef;
6161

6262
protected final PythonObjectFactory factory() {
63-
return getCore().factory();
63+
if (factory == null) {
64+
CompilerDirectives.transferToInterpreterAndInvalidate();
65+
factory = insert(PythonObjectFactory.create());
66+
}
67+
return factory;
6468
}
6569

6670
public final PythonCore getCore() {

0 commit comments

Comments
 (0)