|
64 | 64 | import com.oracle.graal.python.builtins.objects.common.SequenceNodes.GetObjectArrayNode;
|
65 | 65 | import com.oracle.graal.python.builtins.objects.common.SequenceStorageNodes;
|
66 | 66 | import com.oracle.graal.python.builtins.objects.exception.OSErrorEnum;
|
| 67 | +import com.oracle.graal.python.builtins.objects.function.PArguments; |
67 | 68 | import com.oracle.graal.python.builtins.objects.memoryview.PMemoryView;
|
| 69 | +import com.oracle.graal.python.builtins.objects.object.PythonObjectLibrary; |
68 | 70 | import com.oracle.graal.python.builtins.objects.tuple.PTuple;
|
69 | 71 | import com.oracle.graal.python.nodes.call.special.LookupAndCallTernaryNode;
|
70 | 72 | import com.oracle.graal.python.nodes.call.special.LookupAndCallUnaryNode;
|
|
73 | 75 | import com.oracle.graal.python.nodes.function.builtins.PythonBinaryBuiltinNode;
|
74 | 76 | import com.oracle.graal.python.nodes.function.builtins.PythonTernaryBuiltinNode;
|
75 | 77 | import com.oracle.graal.python.nodes.function.builtins.PythonUnaryBuiltinNode;
|
76 |
| -import com.oracle.graal.python.nodes.util.CastToIndexNode; |
77 | 78 | import com.oracle.graal.python.runtime.sequence.storage.ByteSequenceStorage;
|
78 | 79 | import com.oracle.graal.python.runtime.sequence.storage.SequenceStorage;
|
79 | 80 | import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
|
|
82 | 83 | import com.oracle.truffle.api.dsl.NodeFactory;
|
83 | 84 | import com.oracle.truffle.api.dsl.Specialization;
|
84 | 85 | import com.oracle.truffle.api.frame.VirtualFrame;
|
| 86 | +import com.oracle.truffle.api.library.CachedLibrary; |
85 | 87 | import com.oracle.truffle.api.profiles.ConditionProfile;
|
86 | 88 |
|
87 | 89 | @CoreFunctions(extendClasses = PythonBuiltinClassType.PSocket)
|
@@ -375,10 +377,10 @@ protected static SequenceStorageNodes.SetItemNode createSetItem() {
|
375 | 377 | @Specialization
|
376 | 378 | Object recvInto(VirtualFrame frame, PSocket socket, PMemoryView buffer, Object flags,
|
377 | 379 | @Cached("createBinaryProfile()") ConditionProfile byteStorage,
|
378 |
| - @Cached CastToIndexNode cast, |
| 380 | + @CachedLibrary(limit = "getCallSiteInlineCacheMaxDepth()") PythonObjectLibrary lib, |
379 | 381 | @Cached("create(__LEN__)") LookupAndCallUnaryNode callLen,
|
380 | 382 | @Cached("create(__SETITEM__)") LookupAndCallTernaryNode setItem) {
|
381 |
| - int bufferLen = cast.execute(frame, callLen.executeObject(frame, buffer)); |
| 383 | + int bufferLen = lib.asIndexWithState(callLen.executeObject(frame, buffer), PArguments.getThreadState(frame)); |
382 | 384 | byte[] targetBuffer = new byte[bufferLen];
|
383 | 385 | ByteBuffer byteBuffer = ByteBuffer.wrap(targetBuffer);
|
384 | 386 | int length;
|
|
0 commit comments