File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/frame Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 3333import com .oracle .graal .python .nodes .PNode ;
3434import com .oracle .graal .python .nodes .attributes .ReadAttributeFromObjectNode ;
3535import com .oracle .graal .python .nodes .subscript .GetItemNode ;
36+ import com .oracle .graal .python .runtime .PythonContext ;
37+ import com .oracle .graal .python .runtime .PythonCore ;
3638import com .oracle .graal .python .runtime .exception .PException ;
3739import com .oracle .truffle .api .CompilerDirectives ;
3840import com .oracle .truffle .api .dsl .Cached ;
@@ -101,7 +103,15 @@ private Object returnGlobalOrBuiltin(Object result) {
101103 CompilerDirectives .transferToInterpreterAndInvalidate ();
102104 readFromBuiltinsNode = insert (ReadAttributeFromObjectNode .create ());
103105 }
104- Object builtin = readFromBuiltinsNode .execute (getCore ().isInitialized () ? getContext ().getBuiltins () : getCore ().lookupBuiltinModule ("builtins" ), attributeId );
106+ PythonContext context = getContext ();
107+ PythonCore core = context .getCore ();
108+ Object builtin ;
109+ if (core .isInitialized ()) {
110+ builtin = readFromBuiltinsNode .execute (context .getBuiltins (), attributeId );
111+ } else {
112+ CompilerDirectives .transferToInterpreter ();
113+ builtin = readFromBuiltinsNode .execute (core .lookupBuiltinModule ("builtins" ), attributeId );
114+ }
105115 if (isBuiltinProfile .profile (builtin != PNone .NO_VALUE )) {
106116 return builtin ;
107117 } else {
You can’t perform that action at this time.
0 commit comments