Skip to content

Commit 26578d2

Browse files
committed
fix memory leak of threads in single context mode
1 parent 06a7b2c commit 26578d2

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/call/special/CallBinaryMethodNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ Object callMethodSingleContext(VirtualFrame frame, @SuppressWarnings("unused") P
347347
@Specialization(guards = {"func == cachedFunc", "builtinNode != null", "takesSelfArg",
348348
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()", assumptions = "singleContextAssumption()")
349349
Object callSelfMethodSingleContext(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinMethod func, Object arg1, Object arg2,
350-
@SuppressWarnings("unused") @Cached("func") PBuiltinMethod cachedFunc,
350+
@SuppressWarnings("unused") @Cached(value = "func", weak = true) PBuiltinMethod cachedFunc,
351351
@SuppressWarnings("unused") @Cached("takesSelfArg(func)") boolean takesSelfArg,
352352
@Cached("getTernary(frame, func.getFunction())") PythonTernaryBuiltinNode builtinNode,
353353
@SuppressWarnings("unused") @Cached("frameIsUnused(builtinNode)") boolean unusedFrame) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/call/special/CallQuaternaryMethodNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ Object call(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinFunction fun
8181
@Specialization(guards = {"func == cachedFunc", "builtinNode != null", "!takesSelfArg",
8282
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()", assumptions = "singleContextAssumption()")
8383
Object callMethodSingle(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinMethod func, Object arg1, Object arg2, Object arg3, Object arg4,
84-
@SuppressWarnings("unused") @Cached("func") PBuiltinMethod cachedFunc,
84+
@SuppressWarnings("unused") @Cached(value = "func", weak = true) PBuiltinMethod cachedFunc,
8585
@SuppressWarnings("unused") @Cached("takesSelfArg(func)") boolean takesSelfArg,
8686
@Cached("getQuaternary(frame, func.getFunction())") PythonQuaternaryBuiltinNode builtinNode,
8787
@SuppressWarnings("unused") @Cached("frameIsUnused(builtinNode)") boolean unusedFrame) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/call/special/CallTernaryMethodNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static Object doBuiltinMethodCtCached(VirtualFrame frame, @SuppressWarnings("unu
211211
@Specialization(guards = {"func == cachedFunc", "builtinNode != null", "takesSelfArg",
212212
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()", assumptions = "singleContextAssumption()")
213213
static Object callSelfMethodSingleContext(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinMethod func, Object arg1, Object arg2, Object arg3,
214-
@SuppressWarnings("unused") @Cached("func") PBuiltinMethod cachedFunc,
214+
@SuppressWarnings("unused") @Cached(value = "func", weak = true) PBuiltinMethod cachedFunc,
215215
@SuppressWarnings("unused") @Cached("takesSelfArg(func)") boolean takesSelfArg,
216216
@Cached("getQuaternary(frame, func.getFunction())") PythonQuaternaryBuiltinNode builtinNode,
217217
@SuppressWarnings("unused") @Cached("frameIsUnused(builtinNode)") boolean unusedFrame) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/call/special/CallUnaryMethodNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ Object callMethodSingleContext(VirtualFrame frame, @SuppressWarnings("unused") P
225225
@Specialization(guards = {"func == cachedFunc", "builtinNode != null", "takesSelfArg",
226226
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()", assumptions = "singleContextAssumption()")
227227
Object callSelfMethodSingleContext(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinMethod func, Object arg,
228-
@SuppressWarnings("unused") @Cached("func") PBuiltinMethod cachedFunc,
228+
@SuppressWarnings("unused") @Cached(value = "func", weak = true) PBuiltinMethod cachedFunc,
229229
@SuppressWarnings("unused") @Cached("takesSelfArg(func)") boolean takesSelfArg,
230230
@Cached("getBinary(frame, func.getFunction())") PythonBinaryBuiltinNode builtinNode,
231231
@SuppressWarnings("unused") @Cached("frameIsUnused(builtinNode)") boolean unusedFrame) {

0 commit comments

Comments
 (0)