4343import com .oracle .graal .python .nodes .arrow .capsule .ArrowArrayCapsuleDestructor ;
4444import com .oracle .graal .python .nodes .arrow .capsule .ArrowSchemaCapsuleDestructor ;
4545import com .oracle .graal .python .nodes .arrow .release_callback .ArrowSchemaReleaseCallback ;
46+ import com .oracle .graal .python .nodes .arrow .vector .VectorArrowArrayReleaseCallback ;
4647import com .oracle .graal .python .runtime .PythonContext ;
4748import com .oracle .graal .python .util .PythonUtils ;
4849import com .oracle .truffle .api .CompilerAsserts ;
4950import com .oracle .truffle .api .CompilerDirectives ;
5051import com .oracle .truffle .api .CompilerDirectives .CompilationFinal ;
5152import com .oracle .truffle .api .CompilerDirectives .TruffleBoundary ;
5253import com .oracle .truffle .api .interop .InteropLibrary ;
54+ import com .oracle .truffle .api .source .Source ;
5355import com .oracle .truffle .nfi .api .SignatureLibrary ;
5456
55- public class ArrowSupport extends AbstractArrowSupport {
57+ import static com .oracle .graal .python .nodes .StringLiterals .J_NFI_LANGUAGE ;
58+
59+ public class ArrowSupport {
60+
61+ protected final PythonContext ctx ;
62+
63+ public ArrowSupport (PythonContext ctx ) {
64+ this .ctx = ctx ;
65+ }
5666
5767 // ArrowArray destructor
5868 private Object arrowArrayDestructorNFIClosure ;
@@ -66,10 +76,6 @@ public class ArrowSupport extends AbstractArrowSupport {
6676 private Object arrowSchemaNFIClosure ;
6777 @ CompilationFinal private long arrowSchemaReleaseCallback ;
6878
69- public ArrowSupport (PythonContext ctx ) {
70- super (ctx );
71- }
72-
7379 public long getArrowSchemaDestructor () {
7480 if (arrowSchemaDestructorCallback == 0 ) {
7581 CompilerDirectives .transferToInterpreterAndInvalidate ();
@@ -97,7 +103,7 @@ public long getArrowSchemaReleaseCallback() {
97103 @ TruffleBoundary
98104 private void initArrowArrayDestructor () {
99105 CompilerAsserts .neverPartOfCompilation ();
100- var signature = createNfiSignature ("(POINTER):VOID" );
106+ var signature = ArrowUtil . createNfiSignature ("(POINTER):VOID" , ctx );
101107 var executable = new ArrowArrayCapsuleDestructor ();
102108 this .arrowArrayDestructorNFIClosure = SignatureLibrary .getUncached ().createClosure (signature , executable );
103109 this .arrowArrayDestructor = PythonUtils .coerceToLong (arrowArrayDestructorNFIClosure , InteropLibrary .getUncached ());
@@ -106,7 +112,7 @@ private void initArrowArrayDestructor() {
106112 @ TruffleBoundary
107113 private void initArrowSchemaDestructor () {
108114 CompilerAsserts .neverPartOfCompilation ();
109- var signature = createNfiSignature ("(POINTER):VOID" );
115+ var signature = ArrowUtil . createNfiSignature ("(POINTER):VOID" , ctx );
110116 var executable = new ArrowSchemaCapsuleDestructor ();
111117 this .arrowSchemaDestructorNFIClosure = SignatureLibrary .getUncached ().createClosure (signature , executable );
112118 this .arrowSchemaDestructorCallback = PythonUtils .coerceToLong (arrowSchemaDestructorNFIClosure , InteropLibrary .getUncached ());
@@ -115,7 +121,7 @@ private void initArrowSchemaDestructor() {
115121 @ TruffleBoundary
116122 private void initArrowSchemaReleaseCallback () {
117123 CompilerAsserts .neverPartOfCompilation ();
118- var signature = createNfiSignature ("(UINT64):VOID" );
124+ var signature = ArrowUtil . createNfiSignature ("(UINT64):VOID" , ctx );
119125 var executable = new ArrowSchemaReleaseCallback ();
120126 this .arrowSchemaNFIClosure = SignatureLibrary .getUncached ().createClosure (signature , executable );
121127 this .arrowSchemaReleaseCallback = PythonUtils .coerceToLong (arrowSchemaNFIClosure , InteropLibrary .getUncached ());
0 commit comments