Skip to content

Commit 258a927

Browse files
committed
CallTernaryMethodNode uses PythonLanguage#isSingleContext
1 parent 060e313 commit 258a927

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

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

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ static Object callSpecialMethodSlotCallTarget(VirtualFrame frame, TernaryBuiltin
9191
return invokeNode.execute(frame, callTarget, arguments);
9292
}
9393

94-
@Specialization(guards = {"func == cachedFunc", "builtinNode != null", "!isReverse",
95-
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()", assumptions = "singleContextAssumption()")
94+
@Specialization(guards = {"isSingleContext()", "func == cachedFunc", "builtinNode != null", "!isReverse",
95+
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
9696
static Object doBuiltinFunctionCached(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinFunction func, Object arg1, Object arg2, Object arg3,
9797
@SuppressWarnings("unused") @Cached("func") PBuiltinFunction cachedFunc,
9898
@SuppressWarnings("unused") @Cached("isForReverseBinaryOperation(func.getCallTarget())") boolean isReverse,
@@ -101,8 +101,8 @@ static Object doBuiltinFunctionCached(VirtualFrame frame, @SuppressWarnings("unu
101101
return builtinNode.execute(frame, arg1, arg2, arg3);
102102
}
103103

104-
@Specialization(guards = {"func == cachedFunc", "builtinNode != null", "isReverse",
105-
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()", assumptions = "singleContextAssumption()")
104+
@Specialization(guards = {"isSingleContext()", "func == cachedFunc", "builtinNode != null", "isReverse",
105+
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
106106
static Object doBuiltinFunctionCachedReverse(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinFunction func, Object arg1, Object arg2, Object arg3,
107107
@SuppressWarnings("unused") @Cached("func") PBuiltinFunction cachedFunc,
108108
@SuppressWarnings("unused") @Cached("isForReverseBinaryOperation(func.getCallTarget())") boolean isReverse,
@@ -111,7 +111,8 @@ static Object doBuiltinFunctionCachedReverse(VirtualFrame frame, @SuppressWarnin
111111
return builtinNode.execute(frame, arg2, arg1, arg3);
112112
}
113113

114-
@Specialization(guards = {"func.getCallTarget() == ct", "builtinNode != null", "!isReverse", "frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
114+
@Specialization(guards = {"func.getCallTarget() == ct", "builtinNode != null", "!isReverse", "frame != null || unusedFrame"}, //
115+
limit = "getCallSiteInlineCacheMaxDepth()")
115116
static Object doBuiltinFunctionCtCached(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinFunction func, Object arg1, Object arg2, Object arg3,
116117
@SuppressWarnings("unused") @Cached("func.getCallTarget()") RootCallTarget ct,
117118
@SuppressWarnings("unused") @Cached("isForReverseBinaryOperation(func.getCallTarget())") boolean isReverse,
@@ -120,7 +121,8 @@ static Object doBuiltinFunctionCtCached(VirtualFrame frame, @SuppressWarnings("u
120121
return builtinNode.execute(frame, arg1, arg2, arg3);
121122
}
122123

123-
@Specialization(guards = {"func.getCallTarget() == ct", "builtinNode != null", "isReverse", "frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
124+
@Specialization(guards = {"func.getCallTarget() == ct", "builtinNode != null", "isReverse", "frame != null || unusedFrame"}, //
125+
limit = "getCallSiteInlineCacheMaxDepth()")
124126
static Object doBuiltinFunctionCtCachedReverse(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinFunction func, Object arg1, Object arg2, Object arg3,
125127
@SuppressWarnings("unused") @Cached("func.getCallTarget()") RootCallTarget ct,
126128
@SuppressWarnings("unused") @Cached("isForReverseBinaryOperation(func.getCallTarget())") boolean isReverse,
@@ -129,8 +131,8 @@ static Object doBuiltinFunctionCtCachedReverse(VirtualFrame frame, @SuppressWarn
129131
return builtinNode.execute(frame, arg2, arg1, arg3);
130132
}
131133

132-
@Specialization(guards = {"func == cachedFunc", "builtinNode != null", "!takesSelfArg",
133-
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()", assumptions = "singleContextAssumption()")
134+
@Specialization(guards = {"isSingleContext()", "func == cachedFunc", "builtinNode != null", "!takesSelfArg",
135+
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
134136
static Object doBuiltinMethodCached(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinMethod func, Object arg1, Object arg2, Object arg3,
135137
@SuppressWarnings("unused") @Cached("func") PBuiltinMethod cachedFunc,
136138
@SuppressWarnings("unused") @Cached("takesSelfArg(func)") boolean takesSelfArg,
@@ -139,7 +141,8 @@ static Object doBuiltinMethodCached(VirtualFrame frame, @SuppressWarnings("unuse
139141
return builtinNode.execute(frame, arg1, arg2, arg3);
140142
}
141143

142-
@Specialization(guards = {"builtinNode != null", "getCallTarget(func, getCt) == ct", "!takesSelfArg", "frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
144+
@Specialization(guards = {"builtinNode != null", "getCallTarget(func, getCt) == ct", "!takesSelfArg",
145+
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
143146
static Object doBuiltinMethodCtCached(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinMethod func, Object arg1, Object arg2, Object arg3,
144147
@SuppressWarnings("unused") @Cached GetCallTargetNode getCt,
145148
@SuppressWarnings("unused") @Cached("getCallTarget(func, getCt)") RootCallTarget ct,
@@ -149,8 +152,8 @@ static Object doBuiltinMethodCtCached(VirtualFrame frame, @SuppressWarnings("unu
149152
return builtinNode.execute(frame, arg1, arg2, arg3);
150153
}
151154

152-
@Specialization(guards = {"func == cachedFunc", "builtinNode != null", "takesSelfArg",
153-
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()", assumptions = "singleContextAssumption()")
155+
@Specialization(guards = {"isSingleContext()", "func == cachedFunc", "builtinNode != null", "takesSelfArg",
156+
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
154157
static Object callSelfMethodSingleContext(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinMethod func, Object arg1, Object arg2, Object arg3,
155158
@SuppressWarnings("unused") @Cached(value = "func", weak = true) PBuiltinMethod cachedFunc,
156159
@SuppressWarnings("unused") @Cached("takesSelfArg(func)") boolean takesSelfArg,
@@ -159,7 +162,8 @@ static Object callSelfMethodSingleContext(VirtualFrame frame, @SuppressWarnings(
159162
return builtinNode.execute(frame, func.getSelf(), arg1, arg2, arg3);
160163
}
161164

162-
@Specialization(guards = {"builtinNode != null", "getCallTarget(func, getCt) == ct", "takesSelfArg", "frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
165+
@Specialization(guards = {"builtinNode != null", "getCallTarget(func, getCt) == ct", "takesSelfArg",
166+
"frame != null || unusedFrame"}, limit = "getCallSiteInlineCacheMaxDepth()")
163167
static Object callSelfMethod(VirtualFrame frame, @SuppressWarnings("unused") PBuiltinMethod func, Object arg1, Object arg2, Object arg3,
164168
@SuppressWarnings("unused") @Cached GetCallTargetNode getCt,
165169
@SuppressWarnings("unused") @Cached("getCallTarget(func, getCt)") RootCallTarget ct,

0 commit comments

Comments
 (0)