Skip to content

Commit 259bbb9

Browse files
committed
weak callable caches in CreateArgumentsNode
1 parent e26e77c commit 259bbb9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Object[] doMethodCached(PythonObject method, Object[] userArguments, PKeyword[]
103103
@Cached("create()") GetSignatureNode getSignatureNode,
104104
@Cached("create()") GetDefaultsNode getDefaultsNode,
105105
@Cached("create()") GetKeywordDefaultsNode getKwDefaultsNode,
106-
@Cached("method") @SuppressWarnings("unused") PythonObject cachedMethod) {
106+
@Cached(value = "method", weak = true) @SuppressWarnings("unused") PythonObject cachedMethod) {
107107

108108
// We do not directly cache these objects because they are compilation final anyway and the
109109
// getter check the appropriate assumptions.
@@ -118,11 +118,11 @@ Object[] doMethodCached(PythonObject method, Object[] userArguments, PKeyword[]
118118
"getSelf(method) == cachedSelf"}, limit = "getVariableArgumentInlineCacheLimit()", replaces = "doMethodCached", assumptions = "singleContextAssumption()")
119119
Object[] doMethodFunctionAndSelfCached(PythonObject method, Object[] userArguments, PKeyword[] keywords,
120120
@Cached("create()") CreateAndCheckArgumentsNode createAndCheckArgumentsNode,
121-
@Cached("getFunction(method)") @SuppressWarnings("unused") Object cachedFunction,
121+
@Cached(value = "getFunction(method)", weak = true) @SuppressWarnings("unused") Object cachedFunction,
122122
@Cached("create()") GetSignatureNode getSignatureNode,
123123
@Cached("create()") GetDefaultsNode getDefaultsNode,
124124
@Cached("create()") GetKeywordDefaultsNode getKwDefaultsNode,
125-
@Cached("getSelf(method)") Object cachedSelf) {
125+
@Cached(value = "getSelf(method)", weak = true) Object cachedSelf) {
126126

127127
// We do not directly cache these objects because they are compilation final anyway and the
128128
// getter check the appropriate assumptions.
@@ -138,7 +138,7 @@ Object[] doMethodFunctionCached(PythonObject method, Object[] userArguments, PKe
138138
@Cached("create()") GetSignatureNode getSignatureNode,
139139
@Cached("create()") GetDefaultsNode getDefaultsNode,
140140
@Cached("create()") GetKeywordDefaultsNode getKwDefaultsNode,
141-
@Cached("getFunction(method)") @SuppressWarnings("unused") Object cachedFunction) {
141+
@Cached(value = "getFunction(method)", weak = true) @SuppressWarnings("unused") Object cachedFunction) {
142142

143143
// We do not directly cache these objects because they are compilation final anyway and the
144144
// getter check the appropriate assumptions.
@@ -155,7 +155,7 @@ Object[] doFunctionCached(PythonObject callable, Object[] userArguments, PKeywor
155155
@Cached("create()") GetSignatureNode getSignatureNode,
156156
@Cached("create()") GetDefaultsNode getDefaultsNode,
157157
@Cached("create()") GetKeywordDefaultsNode getKwDefaultsNode,
158-
@Cached("callable") @SuppressWarnings("unused") PythonObject cachedCallable) {
158+
@Cached(value = "callable", weak = true) @SuppressWarnings("unused") PythonObject cachedCallable) {
159159

160160
// We do not directly cache these objects because they are compilation final anyway and the
161161
// getter check the appropriate assumptions.

0 commit comments

Comments
 (0)