|
50 | 50 | import static com.oracle.graal.python.builtins.objects.cext.capi.transitions.ArgDescriptor.PyObjectTransfer;
|
51 | 51 | import static com.oracle.graal.python.builtins.objects.cext.capi.transitions.ArgDescriptor.PyTypeObject;
|
52 | 52 | import static com.oracle.graal.python.builtins.objects.cext.capi.transitions.ArgDescriptor.Py_ssize_t;
|
53 |
| -import static com.oracle.graal.python.builtins.objects.cext.capi.transitions.ArgDescriptor.Void; |
54 | 53 | import static com.oracle.graal.python.builtins.objects.cext.common.CExtContext.METH_CLASS;
|
55 | 54 | import static com.oracle.graal.python.nodes.SpecialAttributeNames.T___DOC__;
|
56 | 55 | import static com.oracle.graal.python.nodes.SpecialAttributeNames.T___NAME__;
|
|
69 | 68 | import com.oracle.graal.python.builtins.modules.cext.PythonCextBuiltins.PyObjectSetAttrNode;
|
70 | 69 | import com.oracle.graal.python.builtins.modules.cext.PythonCextBuiltinsFactory.CreateFunctionNodeGen;
|
71 | 70 | import com.oracle.graal.python.builtins.objects.PNone;
|
72 |
| -import com.oracle.graal.python.builtins.objects.cext.PythonAbstractNativeObject; |
73 | 71 | import com.oracle.graal.python.builtins.objects.cext.PythonNativeClass;
|
74 | 72 | import com.oracle.graal.python.builtins.objects.cext.capi.CApiContext;
|
75 | 73 | import com.oracle.graal.python.builtins.objects.cext.capi.CApiMemberAccessNodes.ReadMemberNode;
|
|
82 | 80 | import com.oracle.graal.python.builtins.objects.cext.common.CExtContext;
|
83 | 81 | import com.oracle.graal.python.builtins.objects.cext.common.CExtContext.Store;
|
84 | 82 | import com.oracle.graal.python.builtins.objects.cext.common.NativeCExtSymbol;
|
85 |
| -import com.oracle.graal.python.builtins.objects.cext.structs.CFields; |
86 |
| -import com.oracle.graal.python.builtins.objects.cext.structs.CStructAccess; |
87 | 83 | import com.oracle.graal.python.builtins.objects.common.DynamicObjectStorage;
|
88 | 84 | import com.oracle.graal.python.builtins.objects.dict.PDict;
|
89 | 85 | import com.oracle.graal.python.builtins.objects.function.PBuiltinFunction;
|
|
92 | 88 | import com.oracle.graal.python.builtins.objects.object.PythonObject;
|
93 | 89 | import com.oracle.graal.python.builtins.objects.tuple.PTuple;
|
94 | 90 | import com.oracle.graal.python.builtins.objects.type.PythonAbstractClass;
|
95 |
| -import com.oracle.graal.python.builtins.objects.type.PythonManagedClass; |
96 | 91 | import com.oracle.graal.python.builtins.objects.type.SpecialMethodSlot;
|
97 | 92 | import com.oracle.graal.python.builtins.objects.type.TypeNodes;
|
98 | 93 | import com.oracle.graal.python.lib.PyDictSetDefault;
|
@@ -390,56 +385,4 @@ int doGeneric(Object cls, PDict dict, TruffleString name, Object getter, Object
|
390 | 385 | return 0;
|
391 | 386 | }
|
392 | 387 | }
|
393 |
| - /*- |
394 |
| - @CApiBuiltin(ret = Void, args = {Pointer, PyTypeObject}, call = Ignored) |
395 |
| - abstract static class PyTruffle_InitializeTypeStructure extends CApiBinaryBuiltinNode { |
396 |
| -
|
397 |
| - static Object init(Object struct, PythonManagedClass clazz, |
398 |
| - @Cached CStructAccess.ReadI64Node readI64, |
399 |
| - @Cached CStructAccess.ReadPointerNode readPointer |
400 |
| - ) { |
401 |
| - long original_flags = readI64.read(struct, CFields.PyTypeObject__tp_flags); |
402 |
| - long basicsize = readI64.read(struct, CFields.PyTypeObject__tp_basicsize); |
403 |
| - long itemsize = readI64.read(struct, CFields.PyTypeObject__tp_itemsize); |
404 |
| - Object alloc_fun = readPointer.read(struct, CFields.PyTypeObject__tp_alloc); |
405 |
| - Object dealloc_fun = readPointer.read(struct, CFields.PyTypeObject__tp_dealloc); |
406 |
| - Object free_fun = readPointer.read(struct, CFields.PyTypeObject__tp_free); |
407 |
| - long vectorcall_offset = readI64.read(struct, CFields.PyTypeObject__tp_vectorcall_offset); |
408 |
| - Object as_buffer = readPointer.read(struct, CFields.PyTypeObject__tp_as_buffer); |
409 |
| -
|
410 |
| -
|
411 |
| - // unsigned long original_flags = structure->tp_flags; |
412 |
| - // Py_ssize_t basicsize = structure->tp_basicsize; |
413 |
| - // Py_ssize_t itemsize = structure->tp_itemsize; |
414 |
| - // allocfunc alloc_fun = structure->tp_alloc; |
415 |
| - // destructor dealloc_fun = structure->tp_dealloc; |
416 |
| - // freefunc free_fun = structure->tp_free; |
417 |
| - // Py_ssize_t vectorcall_offset = structure->tp_vectorcall_offset; |
418 |
| - // PyBufferProcs* as_buffer = structure->tp_as_buffer; |
419 |
| - // PyTypeObject* type_handle = assign_managed(structure, ptype); |
420 |
| - // // write flags as specified in the dummy to the PythonClass object |
421 |
| - // set_PyTypeObject_tp_flags(type_handle, original_flags | Py_TPFLAGS_READY | Py_TPFLAGS_IMMUTABLETYPE); |
422 |
| - // set_PyTypeObject_tp_basicsize(type_handle, basicsize); |
423 |
| - // set_PyTypeObject_tp_itemsize(type_handle, itemsize); |
424 |
| - // if (alloc_fun) { |
425 |
| - // set_PyTypeObject_tp_alloc(type_handle, alloc_fun); |
426 |
| - // } |
427 |
| - // if (dealloc_fun) { |
428 |
| - // set_PyTypeObject_tp_dealloc(type_handle, dealloc_fun); |
429 |
| - // } |
430 |
| - // if (free_fun) { |
431 |
| - // set_PyTypeObject_tp_free(type_handle, free_fun); |
432 |
| - // } |
433 |
| - // if (vectorcall_offset) { |
434 |
| - // set_PyTypeObject_tp_vectorcall_offset (type_handle, vectorcall_offset); |
435 |
| - // } |
436 |
| - // if (as_buffer) { |
437 |
| - // set_PyTypeObject_tp_as_buffer(type_handle, as_buffer); |
438 |
| - // } |
439 |
| -
|
440 |
| - return PNone.NO_VALUE; |
441 |
| - } |
442 |
| - |
443 |
| - } |
444 |
| - */ |
445 | 388 | }
|
0 commit comments