123123import com .oracle .truffle .api .TruffleLanguage .Env ;
124124import com .oracle .truffle .api .TruffleLogger ;
125125import com .oracle .truffle .api .dsl .Cached ;
126- import com .oracle .truffle .api .dsl .CachedContext ;
127126import com .oracle .truffle .api .dsl .CachedLanguage ;
128127import com .oracle .truffle .api .dsl .Fallback ;
129128import com .oracle .truffle .api .dsl .GenerateNodeFactory ;
@@ -332,7 +331,7 @@ public static class CtypesThreadState {
332331 EconomicMapStorage ptrtype_cache ;
333332 EconomicMapStorage cache ;
334333
335- CtypesThreadState () {
334+ public CtypesThreadState () {
336335 this .ptrtype_cache = EconomicMapStorage .create ();
337336 this .cache = EconomicMapStorage .create ();
338337 this .backendType = NFIBackend .NATIVE ;
@@ -1200,7 +1199,6 @@ protected abstract static class ConvParamNode extends PNodeWithRaise {
12001199 void ConvParam (VirtualFrame frame , Object obj , int index , argument pa , PythonObjectFactory factory , Env env ,
12011200 @ Cached PyTypeCheckExact pyTypeCheckExact ,
12021201 @ Cached PyLongCheckNode longCheckNode ,
1203- @ CachedContext (PythonLanguage .class ) PythonContext context ,
12041202 @ CachedLibrary (limit = "1" ) PythonObjectLibrary lib ,
12051203 @ Cached PyNumberAsSizeNode asInt ,
12061204 @ Cached LookupAttributeInMRONode .Dynamic lookupAttr ,
@@ -1215,7 +1213,7 @@ void ConvParam(VirtualFrame frame, Object obj, int index, argument pa, PythonObj
12151213 pa .ffi_type = carg .pffi_type ;
12161214 // memcpy(&pa.value, &carg.value, sizeof(pa.value)); TODO
12171215 assert carg .value .offset == 0 : "TODO" ;
1218- pa .value = carg .value .ptr .getNativeObject (context . getCtypesSupport () );
1216+ pa .value = carg .value .ptr .getNativeObject (env );
12191217 pa .keep = carg ;
12201218 return ;
12211219 }
@@ -1226,7 +1224,7 @@ void ConvParam(VirtualFrame frame, Object obj, int index, argument pa, PythonObj
12261224 pa .keep = obj ;
12271225 assert carg .value .offset == 0 : "TODO" ;
12281226 // memcpy(&pa.value, &carg.value, sizeof(pa.value)); TODO
1229- pa .value = carg .value .ptr .getNativeObject (context . getCtypesSupport () );
1227+ pa .value = carg .value .ptr .getNativeObject (env );
12301228 return ;
12311229 }
12321230
@@ -1275,7 +1273,7 @@ void ConvParam(VirtualFrame frame, Object obj, int index, argument pa, PythonObj
12751273 * classes as parameters (they have to expose the '_as_parameter_' attribute)
12761274 */
12771275 if (arg != null ) {
1278- ConvParam (frame , arg , index , pa , factory , env , pyTypeCheckExact , longCheckNode , context , lib , asInt , lookupAttr , pyObjectStgDictNode );
1276+ ConvParam (frame , arg , index , pa , factory , env , pyTypeCheckExact , longCheckNode , lib , asInt , lookupAttr , pyObjectStgDictNode );
12791277 return ;
12801278 }
12811279 throw raise (TypeError , "Don't know how to convert parameter %d" , index );
0 commit comments