|
35 | 35 | import static com.oracle.graal.python.builtins.objects.cext.capi.NativeCAPISymbol.FUN_PY_TRUFFLE_LONG_ARRAY_TO_NATIVE; |
36 | 36 | import static com.oracle.graal.python.builtins.objects.cext.capi.NativeCAPISymbol.FUN_PY_TRUFFLE_OBJECT_ARRAY_REALLOC; |
37 | 37 | import static com.oracle.graal.python.builtins.objects.cext.capi.NativeCAPISymbol.FUN_PY_TRUFFLE_OBJECT_ARRAY_TO_NATIVE; |
| 38 | +import static com.oracle.graal.python.builtins.objects.cext.capi.NativeCAPISymbol.FUN_PY_TRUFFLE_SET_STORAGE_ITEM; |
38 | 39 | import static com.oracle.graal.python.builtins.objects.iterator.IteratorBuiltins.NextNode.STOP_MARKER; |
39 | 40 | import static com.oracle.graal.python.runtime.exception.PythonErrorType.IndexError; |
40 | 41 | import static com.oracle.graal.python.runtime.exception.PythonErrorType.MemoryError; |
@@ -1284,14 +1285,9 @@ protected static void doNativeByte(NativeSequenceStorage storage, int idx, Objec |
1284 | 1285 |
|
1285 | 1286 | @Specialization(guards = "isObjectStorage(storage)") |
1286 | 1287 | protected static void doNativeObject(NativeSequenceStorage storage, int idx, Object value, |
1287 | | - @Shared("lib") @CachedLibrary(limit = "1") InteropLibrary lib, |
| 1288 | + @Cached PCallCapiFunction call, |
1288 | 1289 | @Cached ToNewRefNode toSulongNode) { |
1289 | | - // TODO xdecref previous value |
1290 | | - try { |
1291 | | - lib.writeArrayElement(storage.getPtr(), idx, toSulongNode.execute(value)); |
1292 | | - } catch (UnsupportedMessageException | UnsupportedTypeException | InvalidArrayIndexException e) { |
1293 | | - throw CompilerDirectives.shouldNotReachHere(e); |
1294 | | - } |
| 1290 | + call.call(FUN_PY_TRUFFLE_SET_STORAGE_ITEM, storage.getPtr(), idx, toSulongNode.execute(value)); |
1295 | 1291 | } |
1296 | 1292 |
|
1297 | 1293 | @Fallback |
|
0 commit comments