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 33
33
import com .oracle .graal .python .nodes .PNode ;
34
34
import com .oracle .graal .python .nodes .attributes .ReadAttributeFromObjectNode ;
35
35
import com .oracle .graal .python .nodes .subscript .GetItemNode ;
36
+ import com .oracle .graal .python .runtime .PythonContext ;
37
+ import com .oracle .graal .python .runtime .PythonCore ;
36
38
import com .oracle .graal .python .runtime .exception .PException ;
37
39
import com .oracle .truffle .api .CompilerDirectives ;
38
40
import com .oracle .truffle .api .dsl .Cached ;
@@ -101,7 +103,15 @@ private Object returnGlobalOrBuiltin(Object result) {
101
103
CompilerDirectives .transferToInterpreterAndInvalidate ();
102
104
readFromBuiltinsNode = insert (ReadAttributeFromObjectNode .create ());
103
105
}
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
+ }
105
115
if (isBuiltinProfile .profile (builtin != PNone .NO_VALUE )) {
106
116
return builtin ;
107
117
} else {
You can’t perform that action at this time.
0 commit comments