123
123
import com .oracle .truffle .api .TruffleLanguage .Env ;
124
124
import com .oracle .truffle .api .TruffleLogger ;
125
125
import com .oracle .truffle .api .dsl .Cached ;
126
- import com .oracle .truffle .api .dsl .CachedContext ;
127
126
import com .oracle .truffle .api .dsl .CachedLanguage ;
128
127
import com .oracle .truffle .api .dsl .Fallback ;
129
128
import com .oracle .truffle .api .dsl .GenerateNodeFactory ;
@@ -332,7 +331,7 @@ public static class CtypesThreadState {
332
331
EconomicMapStorage ptrtype_cache ;
333
332
EconomicMapStorage cache ;
334
333
335
- CtypesThreadState () {
334
+ public CtypesThreadState () {
336
335
this .ptrtype_cache = EconomicMapStorage .create ();
337
336
this .cache = EconomicMapStorage .create ();
338
337
this .backendType = NFIBackend .NATIVE ;
@@ -1200,7 +1199,6 @@ protected abstract static class ConvParamNode extends PNodeWithRaise {
1200
1199
void ConvParam (VirtualFrame frame , Object obj , int index , argument pa , PythonObjectFactory factory , Env env ,
1201
1200
@ Cached PyTypeCheckExact pyTypeCheckExact ,
1202
1201
@ Cached PyLongCheckNode longCheckNode ,
1203
- @ CachedContext (PythonLanguage .class ) PythonContext context ,
1204
1202
@ CachedLibrary (limit = "1" ) PythonObjectLibrary lib ,
1205
1203
@ Cached PyNumberAsSizeNode asInt ,
1206
1204
@ Cached LookupAttributeInMRONode .Dynamic lookupAttr ,
@@ -1215,7 +1213,7 @@ void ConvParam(VirtualFrame frame, Object obj, int index, argument pa, PythonObj
1215
1213
pa .ffi_type = carg .pffi_type ;
1216
1214
// memcpy(&pa.value, &carg.value, sizeof(pa.value)); TODO
1217
1215
assert carg .value .offset == 0 : "TODO" ;
1218
- pa .value = carg .value .ptr .getNativeObject (context . getCtypesSupport () );
1216
+ pa .value = carg .value .ptr .getNativeObject (env );
1219
1217
pa .keep = carg ;
1220
1218
return ;
1221
1219
}
@@ -1226,7 +1224,7 @@ void ConvParam(VirtualFrame frame, Object obj, int index, argument pa, PythonObj
1226
1224
pa .keep = obj ;
1227
1225
assert carg .value .offset == 0 : "TODO" ;
1228
1226
// 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 );
1230
1228
return ;
1231
1229
}
1232
1230
@@ -1275,7 +1273,7 @@ void ConvParam(VirtualFrame frame, Object obj, int index, argument pa, PythonObj
1275
1273
* classes as parameters (they have to expose the '_as_parameter_' attribute)
1276
1274
*/
1277
1275
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 );
1279
1277
return ;
1280
1278
}
1281
1279
throw raise (TypeError , "Don't know how to convert parameter %d" , index );
0 commit comments