|
32 | 32 | import com.oracle.graal.python.PythonLanguage; |
33 | 33 | import com.oracle.graal.python.builtins.PythonBuiltinClassType; |
34 | 34 | import com.oracle.graal.python.builtins.modules.SysModuleBuiltins; |
35 | | -import com.oracle.graal.python.builtins.modules.WarningsModuleBuiltins.WarnNode; |
36 | 35 | import com.oracle.graal.python.builtins.objects.cext.capi.PythonNativeWrapperLibrary; |
37 | | -import com.oracle.graal.python.builtins.objects.function.PArguments; |
38 | 36 | import com.oracle.graal.python.builtins.objects.function.PArguments.ThreadState; |
39 | 37 | import com.oracle.graal.python.builtins.objects.object.PythonBuiltinObject; |
40 | 38 | import com.oracle.graal.python.builtins.objects.object.PythonObjectLibrary; |
41 | 39 | import com.oracle.graal.python.nodes.ErrorMessages; |
42 | 40 | import com.oracle.graal.python.nodes.PRaiseNode; |
43 | | -import com.oracle.graal.python.nodes.object.IsBuiltinClassProfile; |
44 | 41 | import com.oracle.graal.python.nodes.util.CastToJavaDoubleNode; |
45 | 42 | import com.oracle.graal.python.nodes.util.CastToJavaIntExactNode; |
46 | 43 | import com.oracle.graal.python.nodes.util.CastToJavaLongExactNode; |
|
54 | 51 | import com.oracle.truffle.api.dsl.Cached.Exclusive; |
55 | 52 | import com.oracle.truffle.api.dsl.Cached.Shared; |
56 | 53 | import com.oracle.truffle.api.dsl.CachedContext; |
57 | | -import com.oracle.truffle.api.frame.VirtualFrame; |
58 | 54 | import com.oracle.truffle.api.interop.InteropLibrary; |
59 | 55 | import com.oracle.truffle.api.interop.UnsupportedMessageException; |
60 | 56 | import com.oracle.truffle.api.library.CachedLibrary; |
@@ -231,19 +227,7 @@ public boolean canBeIndex() { |
231 | 227 | } |
232 | 228 |
|
233 | 229 | @ExportMessage |
234 | | - public Object asIndexWithState(@SuppressWarnings("unused") ThreadState threadState, |
235 | | - @Cached ConditionProfile gotState, |
236 | | - @Cached IsBuiltinClassProfile isInt, |
237 | | - @Cached WarnNode warnNode) { |
238 | | - if (!isInt.profileObject(this, PythonBuiltinClassType.PInt)) { |
239 | | - VirtualFrame frame = null; |
240 | | - if (gotState.profile(threadState != null)) { |
241 | | - frame = PArguments.frameForCall(threadState); |
242 | | - } |
243 | | - warnNode.warnFormat(frame, null, PythonBuiltinClassType.DeprecationWarning, 1, |
244 | | - ErrorMessages.P_RETURNED_NON_P, |
245 | | - this, "__index__", "int", this, "int"); |
246 | | - } |
| 230 | + public Object asIndexWithState(@SuppressWarnings("unused") ThreadState threadState) { |
247 | 231 | return this; |
248 | 232 | } |
249 | 233 |
|
@@ -275,10 +259,9 @@ public boolean canBeJavaDouble() { |
275 | 259 | } |
276 | 260 |
|
277 | 261 | @ExportMessage |
278 | | - public double asJavaDoubleWithState(ThreadState threadState, |
279 | | - @CachedLibrary("this") PythonObjectLibrary lib, |
| 262 | + public double asJavaDoubleWithState(@SuppressWarnings("unused") ThreadState threadState, |
280 | 263 | @Cached CastToJavaDoubleNode castToDouble) { |
281 | | - return castToDouble.execute(lib.asIndexWithState(this, threadState)); |
| 264 | + return castToDouble.execute(this); |
282 | 265 | } |
283 | 266 |
|
284 | 267 | @SuppressWarnings("static-method") |
|
0 commit comments