Skip to content

Commit ad28986

Browse files
committed
Avoid unnecessary getLazyPythonClass call
1 parent 4cb3990 commit ad28986

File tree

5 files changed

+10
-15
lines changed

5 files changed

+10
-15
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,9 @@ public static Object lookupAttributeInternal(Boolean receiver, ThreadState state
297297
}
298298

299299
@ExportMessage
300-
public static Object lookupAttributeOnTypeInternal(Boolean receiver, String name, boolean strict,
301-
@CachedLibrary("receiver") PythonObjectLibrary lib,
300+
public static Object lookupAttributeOnTypeInternal(@SuppressWarnings("unused") Boolean receiver, String name, boolean strict,
302301
@Exclusive @Cached PythonAbstractObject.LookupAttributeOnTypeNode lookup) {
303-
return lookup.execute(lib.getLazyPythonClass(receiver), name, strict);
302+
return lookup.execute(PythonBuiltinClassType.Boolean, name, strict);
304303
}
305304

306305
@ExportMessage

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,9 @@ public static Object lookupAttributeInternal(Double receiver, ThreadState state,
216216
}
217217

218218
@ExportMessage
219-
public static Object lookupAttributeOnTypeInternal(Double receiver, String name, boolean strict,
220-
@CachedLibrary("receiver") PythonObjectLibrary lib,
219+
public static Object lookupAttributeOnTypeInternal(@SuppressWarnings("unused") Double receiver, String name, boolean strict,
221220
@Exclusive @Cached PythonAbstractObject.LookupAttributeOnTypeNode lookup) {
222-
return lookup.execute(lib.getLazyPythonClass(receiver), name, strict);
221+
return lookup.execute(PythonBuiltinClassType.PFloat, name, strict);
223222
}
224223

225224
@ExportMessage

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,9 @@ public static Object lookupAttributeInternal(Integer receiver, ThreadState state
294294
}
295295

296296
@ExportMessage
297-
public static Object lookupAttributeOnTypeInternal(Integer receiver, String name, boolean strict,
298-
@CachedLibrary("receiver") PythonObjectLibrary lib,
297+
public static Object lookupAttributeOnTypeInternal(@SuppressWarnings("unused") Integer receiver, String name, boolean strict,
299298
@Exclusive @Cached PythonAbstractObject.LookupAttributeOnTypeNode lookup) {
300-
return lookup.execute(lib.getLazyPythonClass(receiver), name, strict);
299+
return lookup.execute(PythonBuiltinClassType.PInt, name, strict);
301300
}
302301

303302
@ExportMessage

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,10 +325,9 @@ public static Object lookupAttributeInternal(Long receiver, ThreadState state, S
325325
}
326326

327327
@ExportMessage
328-
public static Object lookupAttributeOnTypeInternal(Long receiver, String name, boolean strict,
329-
@CachedLibrary("receiver") PythonObjectLibrary lib,
328+
public static Object lookupAttributeOnTypeInternal(@SuppressWarnings("unused") Long receiver, String name, boolean strict,
330329
@Exclusive @Cached PythonAbstractObject.LookupAttributeOnTypeNode lookup) {
331-
return lookup.execute(lib.getLazyPythonClass(receiver), name, strict);
330+
return lookup.execute(PythonBuiltinClassType.PInt, name, strict);
332331
}
333332

334333
@ExportMessage

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,9 @@ public static Object lookupAttributeInternal(String receiver, ThreadState state,
209209
}
210210

211211
@ExportMessage
212-
public static Object lookupAttributeOnTypeInternal(String receiver, String name, boolean strict,
213-
@CachedLibrary("receiver") PythonObjectLibrary lib,
212+
public static Object lookupAttributeOnTypeInternal(@SuppressWarnings("unused") String receiver, String name, boolean strict,
214213
@Exclusive @Cached PythonAbstractObject.LookupAttributeOnTypeNode lookup) {
215-
return lookup.execute(lib.getLazyPythonClass(receiver), name, strict);
214+
return lookup.execute(PythonBuiltinClassType.PString, name, strict);
216215
}
217216

218217
@ExportMessage

0 commit comments

Comments
 (0)