Skip to content

Commit 060e313

Browse files
committed
CallBinaryMethodNode uses PythonLanguage#isSingleContext
1 parent 5153cbb commit 060e313

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

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

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ Object callSpecialMethodSlotCallTarget(VirtualFrame frame, BuiltinMethodDescript
131131
return invokeNode.execute(frame, callTarget, arguments);
132132
}
133133

134-
@Specialization(guards = {"func == cachedFunc", "builtinNode != null",
135-
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()", assumptions = "singleContextAssumption()")
134+
@Specialization(guards = {"isSingleContext()", "func == cachedFunc", "builtinNode != null",
135+
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
136136
static Object callObjectSingleContext(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinFunction func, Object arg1, Object arg2,
137137
@SuppressWarnings("unused") @Cached("func") PBuiltinFunction cachedFunc,
138138
@SuppressWarnings("unused") @Cached("isForReverseBinaryOperation(func.getCallTarget())") boolean isReverse,
@@ -145,7 +145,8 @@ static Object callObjectSingleContext(VirtualFrame frame, @SuppressWarnings("unu
145145
}
146146
}
147147

148-
@Specialization(guards = {"func.getCallTarget() == ct", "builtinNode != null", "frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
148+
@Specialization(guards = {"func.getCallTarget() == ct", "builtinNode != null", "frame != null || unusedFrame"}, //
149+
limit = "getCallSiteInlineCacheMaxDepth()")
149150
static Object callObject(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinFunction func, Object arg1, Object arg2,
150151
@SuppressWarnings("unused") @Cached("func.getCallTarget()") RootCallTarget ct,
151152
@SuppressWarnings("unused") @Cached("isForReverseBinaryOperation(func.getCallTarget())") boolean isReverse,
@@ -158,8 +159,8 @@ static Object callObject(VirtualFrame frame, @SuppressWarnings("unused") PBuilti
158159
}
159160
}
160161

161-
@Specialization(guards = {"func == cachedFunc", "builtinNode != null", "!takesSelfArg",
162-
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()", assumptions = "singleContextAssumption()")
162+
@Specialization(guards = {"isSingleContext()", "func == cachedFunc", "builtinNode != null", "!takesSelfArg",
163+
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
163164
static Object callMethodSingleContext(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinMethod func, Object arg1, Object arg2,
164165
@SuppressWarnings("unused") @Cached("func") PBuiltinMethod cachedFunc,
165166
@SuppressWarnings("unused") @Cached("takesSelfArg(func)") boolean takesSelfArg,
@@ -168,8 +169,8 @@ static Object callMethodSingleContext(VirtualFrame frame, @SuppressWarnings("unu
168169
return builtinNode.execute(frame, arg1, arg2);
169170
}
170171

171-
@Specialization(guards = {"func == cachedFunc", "builtinNode != null", "takesSelfArg",
172-
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()", assumptions = "singleContextAssumption()")
172+
@Specialization(guards = {"isSingleContext()", "func == cachedFunc", "builtinNode != null", "takesSelfArg",
173+
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
173174
static Object callSelfMethodSingleContext(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinMethod func, Object arg1, Object arg2,
174175
@SuppressWarnings("unused") @Cached(value = "func", weak = true) PBuiltinMethod cachedFunc,
175176
@SuppressWarnings("unused") @Cached("takesSelfArg(func)") boolean takesSelfArg,
@@ -178,7 +179,8 @@ static Object callSelfMethodSingleContext(VirtualFrame frame, @SuppressWarnings(
178179
return builtinNode.execute(frame, func.getSelf(), arg1, arg2);
179180
}
180181

181-
@Specialization(guards = {"builtinNode != null", "getCallTarget(func, getCt) == ct", "!takesSelfArg", "frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
182+
@Specialization(guards = {"builtinNode != null", "getCallTarget(func, getCt) == ct", "!takesSelfArg",
183+
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
182184
static Object callMethod(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinMethod func, Object arg1, Object arg2,
183185
@SuppressWarnings("unused") @Cached GetCallTargetNode getCt,
184186
@SuppressWarnings("unused") @Cached("getCallTarget(func, getCt)") RootCallTarget ct,
@@ -188,7 +190,8 @@ static Object callMethod(VirtualFrame frame, @SuppressWarnings("unused") PBuilti
188190
return builtinNode.execute(frame, arg1, arg2);
189191
}
190192

191-
@Specialization(guards = {"builtinNode != null", "getCallTarget(func, getCt) == ct", "takesSelfArg", "frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
193+
@Specialization(guards = {"builtinNode != null", "getCallTarget(func, getCt) == ct", "takesSelfArg",
194+
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
192195
static Object callSelfMethod(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinMethod func, Object arg1, Object arg2,
193196
@SuppressWarnings("unused") @Cached GetCallTargetNode getCt,
194197
@SuppressWarnings("unused") @Cached("getCallTarget(func, getCt)") RootCallTarget ct,
@@ -202,7 +205,8 @@ static Object callSelfMethod(VirtualFrame frame, @SuppressWarnings("unused") PBu
202205
* In case the function takes less or equal to 2 arguments (so it is <it>at least</it> binary)
203206
* we also try to call a ternary function.
204207
*/
205-
@Specialization(guards = {"builtinNode != null", "minArgs <= 2", "func.getCallTarget() == ct", "frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
208+
@Specialization(guards = {"builtinNode != null", "minArgs <= 2", "func.getCallTarget() == ct", "frame != null || unusedFrame"}, //
209+
limit = "getCallSiteInlineCacheMaxDepth()")
206210
static Object callTernaryFunction(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinFunction func, Object arg1, Object arg2,
207211
@SuppressWarnings("unused") @Cached("func.getCallTarget()") RootCallTarget ct,
208212
@SuppressWarnings("unused") @Cached("getMinArgs(func)") int minArgs,
@@ -219,7 +223,8 @@ static Object callTernaryFunction(VirtualFrame frame, @SuppressWarnings("unused"
219223
* In case the function takes less or equal to 2 arguments (so it is <it>at least</it> binary)
220224
* we also try to call a quaternary function.
221225
*/
222-
@Specialization(guards = {"builtinNode != null", "minArgs <= 2", "func.getCallTarget() == ct", "frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
226+
@Specialization(guards = {"builtinNode != null", "minArgs <= 2", "func.getCallTarget() == ct", "frame != null || unusedFrame"}, //
227+
limit = "getCallSiteInlineCacheMaxDepth()")
223228
static Object callQuaternaryFunction(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinFunction func, Object arg1, Object arg2,
224229
@SuppressWarnings("unused") @Cached("func.getCallTarget()") RootCallTarget ct,
225230
@SuppressWarnings("unused") @Cached("getMinArgs(func)") int minArgs,

0 commit comments

Comments
 (0)