Skip to content

Commit 1d5d01c

Browse files
committed
remove native ctypes helper
1 parent 8af9215 commit 1d5d01c

File tree

6 files changed

+31
-477
lines changed

6 files changed

+31
-477
lines changed

graalpython/com.oracle.graal.python.cext/ctypes/ctypes_helper.c

Lines changed: 0 additions & 137 deletions
This file was deleted.

graalpython/com.oracle.graal.python.cext/setup.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -534,9 +534,6 @@ def build(capi_home):
534534
libname="liblzmasupport",
535535
deps=[LZMADepedency("lzma", "xz==5.2.5", "XZ-5.2.5")],
536536
extra_link_args=["-Wl,-rpath,%s/lib/%s/" % (relative_rpath, SOABI)])
537-
build_nativelibsupport(capi_home,
538-
subdir="ctypes",
539-
libname="libctypes")
540537
build_libpython(capi_home)
541538
build_builtin_exts(capi_home)
542539
finally:

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/ctypes/CtypesModuleBuiltins.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@
123123
import com.oracle.truffle.api.TruffleLanguage.Env;
124124
import com.oracle.truffle.api.TruffleLogger;
125125
import com.oracle.truffle.api.dsl.Cached;
126-
import com.oracle.truffle.api.dsl.CachedContext;
127126
import com.oracle.truffle.api.dsl.CachedLanguage;
128127
import com.oracle.truffle.api.dsl.Fallback;
129128
import 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

Comments
 (0)