Skip to content

Commit 0d84e21

Browse files
committed
Fix: use existing CallTarget in PFrame.
1 parent 15da5f6 commit 0d84e21

File tree

1 file changed

+7
-1
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/frame

1 file changed

+7
-1
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/frame/PFrame.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import com.oracle.truffle.api.Truffle;
5656
import com.oracle.truffle.api.frame.Frame;
5757
import com.oracle.truffle.api.nodes.Node;
58+
import com.oracle.truffle.api.nodes.RootNode;
5859
import com.oracle.truffle.api.source.SourceSection;
5960

6061
public final class PFrame extends PythonBuiltinObject {
@@ -298,7 +299,12 @@ public RootCallTarget getTarget() {
298299

299300
@TruffleBoundary
300301
private static RootCallTarget createCallTarget(Node location) {
301-
return Truffle.getRuntime().createCallTarget(location.getRootNode());
302+
RootNode rootNode = location.getRootNode();
303+
RootCallTarget ct = rootNode.getCallTarget();
304+
if (ct == null) {
305+
ct = Truffle.getRuntime().createCallTarget(rootNode);
306+
}
307+
return ct;
302308
}
303309

304310
public Object[] getArguments() {

0 commit comments

Comments
 (0)