Skip to content

Commit 16ce49f

Browse files
committed
[GR-11293] Allow cloning our relevant root nodes.
PullRequest: graalpython/161
2 parents d2de6d7 + f37a8c1 commit 16ce49f

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,11 @@ public final PythonContext getContext() {
692692
public String getName() {
693693
return name;
694694
}
695+
696+
@Override
697+
public boolean isCloningAllowed() {
698+
return true;
699+
}
695700
}
696701

697702
abstract static class PNativeToPTypeNode extends PForeignToPTypeNode {
@@ -1422,6 +1427,11 @@ protected MethodDescriptorRoot(PythonLanguage language, PythonObjectFactory fact
14221427
this.readSelfNode = ReadIndexedArgumentNode.create(0);
14231428
this.directCallNode = Truffle.getRuntime().createDirectCallNode(callTarget);
14241429
}
1430+
1431+
@Override
1432+
public boolean isCloningAllowed() {
1433+
return true;
1434+
}
14251435
}
14261436

14271437
static class MethKeywordsRoot extends MethodDescriptorRoot {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/common/HashingStorage.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ public Object execute(VirtualFrame frame) {
129129
public SourceSection getSourceSection() {
130130
return null;
131131
}
132+
133+
@Override
134+
public boolean isCloningAllowed() {
135+
return true;
136+
}
132137
}
133138

134139
private static class EqualsRootNode extends RootNode {
@@ -149,6 +154,11 @@ public Object execute(VirtualFrame frame) {
149154
public SourceSection getSourceSection() {
150155
return null;
151156
}
157+
158+
@Override
159+
public boolean isCloningAllowed() {
160+
return true;
161+
}
152162
}
153163

154164
public static class SlowPathEquivalence extends Equivalence {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,9 @@ public void setNeedsCallerFrame() {
7272
public boolean isCaptureFramesForTrace() {
7373
return true;
7474
}
75+
76+
@Override
77+
public boolean isCloningAllowed() {
78+
return true;
79+
}
7580
}

0 commit comments

Comments
 (0)