Skip to content

Commit 0ecee61

Browse files
committed
fix multi-context memory leak in CreateArgumentsNode
1 parent e1eaacd commit 0ecee61

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/argument/CreateArgumentsNode.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public static CreateArgumentsNode getUncached() {
9797
return CreateArgumentsNodeGen.getUncached();
9898
}
9999

100-
@Specialization(guards = {"isMethod(method)", "method == cachedMethod"}, limit = "getVariableArgumentInlineCacheLimit()")
100+
@Specialization(guards = {"isMethod(method)", "method == cachedMethod"}, limit = "getVariableArgumentInlineCacheLimit()", assumptions = "singleContextAssumption()")
101101
Object[] doMethodCached(PythonObject method, Object[] userArguments, PKeyword[] keywords,
102102
@Cached("create()") CreateAndCheckArgumentsNode createAndCheckArgumentsNode,
103103
@Cached("create()") GetSignatureNode getSignatureNode,
@@ -115,7 +115,7 @@ Object[] doMethodCached(PythonObject method, Object[] userArguments, PKeyword[]
115115
}
116116

117117
@Specialization(guards = {"isMethod(method)", "getFunction(method) == cachedFunction",
118-
"getSelf(method) == cachedSelf"}, limit = "getVariableArgumentInlineCacheLimit()", replaces = "doMethodCached")
118+
"getSelf(method) == cachedSelf"}, limit = "getVariableArgumentInlineCacheLimit()", replaces = "doMethodCached", assumptions = "singleContextAssumption()")
119119
Object[] doMethodFunctionAndSelfCached(PythonObject method, Object[] userArguments, PKeyword[] keywords,
120120
@Cached("create()") CreateAndCheckArgumentsNode createAndCheckArgumentsNode,
121121
@Cached("getFunction(method)") @SuppressWarnings("unused") Object cachedFunction,
@@ -132,7 +132,7 @@ Object[] doMethodFunctionAndSelfCached(PythonObject method, Object[] userArgumen
132132
return createAndCheckArgumentsNode.execute(method, userArguments, keywords, signature, cachedSelf, defaults, kwdefaults, isMethodCall(cachedSelf));
133133
}
134134

135-
@Specialization(guards = {"isMethod(method)", "getFunction(method) == cachedFunction"}, limit = "getVariableArgumentInlineCacheLimit()", replaces = "doMethodFunctionAndSelfCached")
135+
@Specialization(guards = {"isMethod(method)", "getFunction(method) == cachedFunction"}, limit = "getVariableArgumentInlineCacheLimit()", replaces = "doMethodFunctionAndSelfCached", assumptions = "singleContextAssumption()")
136136
Object[] doMethodFunctionCached(PythonObject method, Object[] userArguments, PKeyword[] keywords,
137137
@Cached("create()") CreateAndCheckArgumentsNode createAndCheckArgumentsNode,
138138
@Cached("create()") GetSignatureNode getSignatureNode,
@@ -149,7 +149,7 @@ Object[] doMethodFunctionCached(PythonObject method, Object[] userArguments, PKe
149149
return createAndCheckArgumentsNode.execute(method, userArguments, keywords, signature, self, defaults, kwdefaults, isMethodCall(self));
150150
}
151151

152-
@Specialization(guards = {"isFunction(callable)", "callable == cachedCallable"}, limit = "getVariableArgumentInlineCacheLimit()")
152+
@Specialization(guards = {"isFunction(callable)", "callable == cachedCallable"}, limit = "getVariableArgumentInlineCacheLimit()", assumptions = "singleContextAssumption()")
153153
Object[] doFunctionCached(PythonObject callable, Object[] userArguments, PKeyword[] keywords,
154154
@Cached("create()") CreateAndCheckArgumentsNode createAndCheckArgumentsNode,
155155
@Cached("create()") GetSignatureNode getSignatureNode,

0 commit comments

Comments
 (0)