Skip to content

Commit 86e0d47

Browse files
committed
missing truffle boundary
style fix
1 parent f74c176 commit 86e0d47

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/BuiltinFunctions.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
import com.oracle.graal.python.runtime.PythonContext;
164164
import com.oracle.graal.python.runtime.PythonCore;
165165
import com.oracle.graal.python.runtime.PythonOptions;
166+
import com.oracle.graal.python.runtime.PythonParser;
166167
import com.oracle.graal.python.runtime.PythonParser.ParserMode;
167168
import com.oracle.graal.python.runtime.exception.PException;
168169
import com.oracle.graal.python.runtime.exception.PythonErrorType;
@@ -685,18 +686,24 @@ Object execCustomGlobalsGlobalLocals(Object source, PDict globals, @SuppressWarn
685686
PArguments.setPFrame(args, factory().createPFrame(globals));
686687
RootCallTarget rootCallTarget = code.getRootCallTarget();
687688
if (rootCallTarget == null) {
688-
Source src = Source.newBuilder("python", new String(code.getCodestring()), code.getName()).build();
689-
Node root = getCore().getParser().parse(ParserMode.File, getCore(), src, null);
690-
if (root instanceof RootNode) {
691-
rootCallTarget = Truffle.getRuntime().createCallTarget((RootNode) root);
692-
}
689+
rootCallTarget = extractRootCallTargetFromSource(code);
693690
}
694691
if (rootCallTarget == null) {
695692
throw raise(ValueError, "cannot create the rootCallTarget from the code object: %p", code);
696693
}
697694
return indirectCallNode.call(rootCallTarget, args);
698695
}
699696

697+
@TruffleBoundary
698+
private RootCallTarget extractRootCallTargetFromSource(PCode code) {
699+
Source src = Source.newBuilder("python", new String(code.getCodestring()), code.getName()).build();
700+
Node root = getCore().getParser().parse(ParserMode.File, getCore(), src, null);
701+
if (root instanceof RootNode) {
702+
return Truffle.getRuntime().createCallTarget((RootNode) root);
703+
}
704+
return null;
705+
}
706+
700707
@Specialization(guards = {"isMapping(locals)"})
701708
Object execInheritGlobalsCustomLocals(VirtualFrame frame, Object source, @SuppressWarnings("unused") PNone globals, Object locals,
702709
@Cached("create()") ReadCallerFrameNode readCallerFrameNode) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/expression/ExpressionNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ private ExpressionWithSideEffects(ExpressionNode node, StatementNode[] sideEffec
179179
this.node = node;
180180
this.sideEffects = sideEffects;
181181
SourceSection sourceSection = node.getSourceSection();
182-
if (sourceSection!=null) {
182+
if (sourceSection != null) {
183183
Source source = sourceSection.getSource();
184184
this.assignSourceSection(source.createSection(0, source.getLength()));
185185
}

0 commit comments

Comments
 (0)