Skip to content

Commit 83595c7

Browse files
committed
DefaultPythonIntegerExports: revert changes, reverse of __eq__ is handled by LookupAndCallBinaryNode
1 parent b61eec4 commit 83595c7

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/object/DefaultPythonIntegerExports.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,8 @@ static boolean il(Integer receiver, long other, PythonObjectLibrary oLib, Thread
199199
}
200200

201201
@Specialization
202-
static boolean iI(Integer receiver, PInt other, PythonObjectLibrary oLib, ThreadState threadState,
203-
@Shared("isBuiltin") @Cached IsBuiltinClassProfile isBuiltin) {
204-
if (isBuiltin.profileIsAnyBuiltinClass(oLib.getLazyPythonClass(other))) {
205-
return other.compareTo((int) receiver) == 0;
206-
} else {
207-
return oLib.equalsInternal(other, receiver, threadState) == 1;
208-
}
202+
static boolean iI(Integer receiver, PInt other, PythonObjectLibrary oLib, ThreadState threadState) {
203+
return other.compareTo((int) receiver) == 0;
209204
}
210205

211206
@Specialization
@@ -225,16 +220,15 @@ static boolean iF(Integer receiver, PFloat other, PythonObjectLibrary oLib, Thre
225220
}
226221

227222
@Specialization(replaces = {"ib", "ii", "il", "iI", "id", "iF"})
228-
static boolean iO(Integer receiver, Object other, PythonObjectLibrary oLib, ThreadState threadState,
229-
@Shared("isBuiltin") @Cached IsBuiltinClassProfile isBuiltin) {
223+
static boolean iO(Integer receiver, Object other, PythonObjectLibrary oLib, ThreadState threadState) {
230224
if (other instanceof Boolean) {
231225
return ib(receiver, (boolean) other, oLib, threadState);
232226
} else if (other instanceof Integer) {
233227
return ii(receiver, (int) other, oLib, threadState);
234228
} else if (other instanceof Long) {
235229
return il(receiver, (long) other, oLib, threadState);
236230
} else if (other instanceof PInt) {
237-
return iI(receiver, (PInt) other, oLib, threadState, isBuiltin);
231+
return iI(receiver, (PInt) other, oLib, threadState);
238232
} else if (other instanceof Double) {
239233
return id(receiver, (double) other, oLib, threadState);
240234
} else {

0 commit comments

Comments
 (0)