Skip to content

Commit c95cb23

Browse files
committed
Fix: cache key for CallTargets for external method wrappers should include isStatic flag
1 parent 043935b commit c95cb23

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/PythonLanguage.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,9 +1100,10 @@ public RootCallTarget createCachedCallTarget(Function<PythonLanguage, RootNode>
11001100
* functions. This may hold onto call targets created by one extension used in a context that
11011101
* was closed in the meanwhile and no other context ever loads the extension.
11021102
*/
1103-
public RootCallTarget createCachedCallTarget(Function<PythonLanguage, RootNode> rootNodeFunction, Class<? extends RootNode> klass, Enum<?> signature, TruffleString name,
1104-
boolean doArgumentAndResultConversion) {
1105-
return createCachedCallTargetUnsafe(rootNodeFunction, true, klass, signature, name, doArgumentAndResultConversion);
1103+
public RootCallTarget createCachedExternalFunWrapperCallTarget(Function<PythonLanguage, RootNode> rootNodeFunction,
1104+
Class<? extends RootNode> klass, Enum<?> signature, TruffleString name,
1105+
boolean doArgumentAndResultConversion, boolean isStatic) {
1106+
return createCachedCallTargetUnsafe(rootNodeFunction, true, klass, signature, name, doArgumentAndResultConversion, isStatic);
11061107
}
11071108

11081109
public RootCallTarget createCachedCallTarget(Function<PythonLanguage, RootNode> rootNodeFunction, Enum<?> signature, TruffleString name,

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/cext/PythonCextTypeBuiltins.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,13 +448,13 @@ static GetSetDescriptor createGetSet(Node inliningTarget, TruffleString name, Ob
448448
@TruffleBoundary
449449
private static RootCallTarget getterCallTarget(TruffleString name, PythonLanguage lang) {
450450
Function<PythonLanguage, RootNode> rootNodeFunction = l -> new GetterRoot(l, name, PExternalFunctionWrapper.GETTER);
451-
return lang.createCachedCallTarget(rootNodeFunction, GetterRoot.class, PExternalFunctionWrapper.GETTER, name, true);
451+
return lang.createCachedExternalFunWrapperCallTarget(rootNodeFunction, GetterRoot.class, PExternalFunctionWrapper.GETTER, name, true, false);
452452
}
453453

454454
@TruffleBoundary
455455
private static RootCallTarget setterCallTarget(TruffleString name, PythonLanguage lang) {
456456
Function<PythonLanguage, RootNode> rootNodeFunction = l -> new SetterRoot(l, name, PExternalFunctionWrapper.SETTER);
457-
return lang.createCachedCallTarget(rootNodeFunction, SetterRoot.class, PExternalFunctionWrapper.SETTER, name, true);
457+
return lang.createCachedExternalFunWrapperCallTarget(rootNodeFunction, SetterRoot.class, PExternalFunctionWrapper.SETTER, name, true, false);
458458
}
459459
}
460460

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/ExternalFunctionNodes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ static RootCallTarget getOrCreateCallTarget(PExternalFunctionWrapper sig, Python
621621
default:
622622
throw CompilerDirectives.shouldNotReachHere();
623623
}
624-
return language.createCachedCallTarget(rootNodeFunction, nodeKlass, sig, name, doArgAndResultConversion);
624+
return language.createCachedExternalFunWrapperCallTarget(rootNodeFunction, nodeKlass, sig, name, doArgAndResultConversion, isStatic);
625625
}
626626

627627
public static PBuiltinFunction createWrapperFunction(TruffleString name, Object callable, Object enclosingType, int flags, int sig,

0 commit comments

Comments
 (0)