195
195
import com .oracle .truffle .api .interop .InteropException ;
196
196
import com .oracle .truffle .api .interop .InteropLibrary ;
197
197
import com .oracle .truffle .api .interop .InvalidArrayIndexException ;
198
- import com .oracle .truffle .api .interop .TruffleObject ;
199
198
import com .oracle .truffle .api .interop .UnknownIdentifierException ;
200
199
import com .oracle .truffle .api .interop .UnsupportedMessageException ;
201
200
import com .oracle .truffle .api .interop .UnsupportedTypeException ;
@@ -520,7 +519,7 @@ static Object runAbstractObject(@SuppressWarnings("unused") CExtContext cextCont
520
519
}
521
520
522
521
@ Specialization (guards = {"isForeignObjectNode.execute(object)" , "!isNativeWrapper(object)" , "!isNativeNull(object)" })
523
- static Object doForeignObject (@ SuppressWarnings ("unused" ) CExtContext cextContext , TruffleObject object ,
522
+ static Object doForeignObject (@ SuppressWarnings ("unused" ) CExtContext cextContext , Object object ,
524
523
@ SuppressWarnings ("unused" ) @ Cached IsForeignObjectNode isForeignObjectNode ) {
525
524
return TruffleObjectNativeWrapper .wrap (object );
526
525
}
@@ -785,7 +784,7 @@ static Object runAbstractObject(@SuppressWarnings("unused") CExtContext cextCont
785
784
}
786
785
787
786
@ Specialization (guards = {"isForeignObjectNode.execute(object)" , "!isNativeWrapper(object)" , "!isNativeNull(object)" })
788
- static Object doForeignObject (CExtContext cextContext , TruffleObject object ,
787
+ static Object doForeignObject (CExtContext cextContext , Object object ,
789
788
@ Cached IsForeignObjectNode isForeignObjectNode ) {
790
789
// this will always be a new wrapper; it's implicitly always a new reference in any case
791
790
return ToSulongNode .doForeignObject (cextContext , object , isForeignObjectNode );
@@ -960,7 +959,7 @@ static Object runAbstractObject(@SuppressWarnings("unused") CExtContext cextCont
960
959
}
961
960
962
961
@ Specialization (guards = {"isForeignObjectNode.execute(object)" , "!isNativeWrapper(object)" , "!isNativeNull(object)" })
963
- static Object doForeignObject (CExtContext cextContext , TruffleObject object ,
962
+ static Object doForeignObject (CExtContext cextContext , Object object ,
964
963
@ Cached IsForeignObjectNode isForeignObjectNode ) {
965
964
// this will always be a new wrapper; it's implicitly always a new reference in any case
966
965
return ToSulongNode .doForeignObject (cextContext , object , isForeignObjectNode );
@@ -1137,7 +1136,7 @@ protected static boolean isPrimitiveNativeWrapper(PythonNativeWrapper object) {
1137
1136
public abstract static class AsPythonObjectNode extends AsPythonObjectBaseNode {
1138
1137
1139
1138
@ Specialization (guards = {"isForeignObjectNode.execute(object)" , "!isNativeWrapper(object)" , "!isNativeNull(object)" }, limit = "2" )
1140
- static PythonAbstractObject doNativeObject (@ SuppressWarnings ("unused" ) CExtContext cextContext , TruffleObject object ,
1139
+ static PythonAbstractObject doNativeObject (@ SuppressWarnings ("unused" ) CExtContext cextContext , Object object ,
1141
1140
@ SuppressWarnings ("unused" ) @ Cached IsForeignObjectNode isForeignObjectNode ,
1142
1141
@ Cached ConditionProfile newRefProfile ,
1143
1142
@ Cached ConditionProfile validRefProfile ,
@@ -1163,7 +1162,7 @@ static PythonAbstractObject doNativeObject(@SuppressWarnings("unused") CExtConte
1163
1162
public abstract static class AsPythonObjectStealingNode extends AsPythonObjectBaseNode {
1164
1163
1165
1164
@ Specialization (guards = {"isForeignObjectNode.execute(object)" , "!isNativeWrapper(object)" , "!isNativeNull(object)" }, limit = "1" )
1166
- static PythonAbstractObject doNativeObject (@ SuppressWarnings ("unused" ) CExtContext cextContext , TruffleObject object ,
1165
+ static PythonAbstractObject doNativeObject (@ SuppressWarnings ("unused" ) CExtContext cextContext , Object object ,
1167
1166
@ SuppressWarnings ("unused" ) @ Cached IsForeignObjectNode isForeignObjectNode ,
1168
1167
@ Cached ConditionProfile newRefProfile ,
1169
1168
@ Cached ConditionProfile validRefProfile ,
@@ -1188,7 +1187,7 @@ static PythonAbstractObject doNativeObject(@SuppressWarnings("unused") CExtConte
1188
1187
public abstract static class WrapVoidPtrNode extends AsPythonObjectBaseNode {
1189
1188
1190
1189
@ Specialization (guards = {"isForeignObjectNode.execute(object)" , "!isNativeWrapper(object)" , "!isNativeNull(object)" }, limit = "1" )
1191
- static Object doNativeObject (@ SuppressWarnings ("unused" ) CExtContext cextContext , TruffleObject object ,
1190
+ static Object doNativeObject (@ SuppressWarnings ("unused" ) CExtContext cextContext , Object object ,
1192
1191
@ SuppressWarnings ("unused" ) @ Cached IsForeignObjectNode isForeignObjectNode ) {
1193
1192
// TODO(fa): should we use a different wrapper for non-'PyObject*' pointers; they cannot
1194
1193
// be used in the user value space but might be passed-through
@@ -1204,7 +1203,7 @@ static Object doNativeObject(@SuppressWarnings("unused") CExtContext cextContext
1204
1203
public abstract static class WrapCharPtrNode extends AsPythonObjectBaseNode {
1205
1204
1206
1205
@ Specialization (guards = {"isForeignObjectNode.execute(object)" , "!isNativeWrapper(object)" , "!isNativeNull(object)" }, limit = "1" )
1207
- static Object doNativeObject (@ SuppressWarnings ("unused" ) CExtContext cextContext , TruffleObject object ,
1206
+ static Object doNativeObject (@ SuppressWarnings ("unused" ) CExtContext cextContext , Object object ,
1208
1207
@ SuppressWarnings ("unused" ) @ Cached IsForeignObjectNode isForeignObjectNode ,
1209
1208
@ Cached FromCharPointerNode fromCharPointerNode ) {
1210
1209
return fromCharPointerNode .execute (object );
@@ -3226,20 +3225,20 @@ static long doOther(Object object,
3226
3225
3227
3226
@ GenerateUncached
3228
3227
public abstract static class GetLLVMType extends Node {
3229
- public abstract TruffleObject execute (LLVMType llvmType );
3228
+ public abstract Object execute (LLVMType llvmType );
3230
3229
3231
3230
@ Specialization (guards = "llvmType == cachedType" , limit = "typeCount()" )
3232
- TruffleObject doGeneric (@ SuppressWarnings ("unused" ) LLVMType llvmType ,
3231
+ Object doGeneric (@ SuppressWarnings ("unused" ) LLVMType llvmType ,
3233
3232
@ Cached ("llvmType" ) LLVMType cachedType ) {
3234
3233
3235
3234
CApiContext cApiContext = PythonContext .get (this ).getCApiContext ();
3236
- TruffleObject llvmTypeID = cApiContext .getLLVMTypeID (cachedType );
3235
+ Object llvmTypeID = cApiContext .getLLVMTypeID (cachedType );
3237
3236
3238
3237
// TODO(fa): get rid of lazy initialization for better sharing
3239
3238
if (llvmTypeID == null ) {
3240
3239
CompilerDirectives .transferToInterpreterAndInvalidate ();
3241
3240
NativeCAPISymbol getterFunctionSymbol = LLVMType .getGetterFunctionName (llvmType );
3242
- llvmTypeID = ( TruffleObject ) PCallCapiFunction .getUncached ().call (getterFunctionSymbol );
3241
+ llvmTypeID = PCallCapiFunction .getUncached ().call (getterFunctionSymbol );
3243
3242
cApiContext .setLLVMTypeID (cachedType , llvmTypeID );
3244
3243
}
3245
3244
return llvmTypeID ;
@@ -3508,16 +3507,16 @@ private static Object callBuiltin(PythonContext context, String builtinName, Obj
3508
3507
@ GenerateUncached
3509
3508
public abstract static class AttachLLVMTypeNode extends Node {
3510
3509
3511
- public abstract TruffleObject execute (TruffleObject ptr );
3510
+ public abstract Object execute (Object ptr );
3512
3511
3513
3512
@ Specialization (guards = "lib.hasMetaObject(ptr)" , limit = "1" )
3514
- static TruffleObject doTyped (TruffleObject ptr ,
3513
+ static Object doTyped (Object ptr ,
3515
3514
@ CachedLibrary ("ptr" ) @ SuppressWarnings ("unused" ) InteropLibrary lib ) {
3516
3515
return ptr ;
3517
3516
}
3518
3517
3519
3518
@ Specialization (guards = "!lib.hasMetaObject(ptr)" , limit = "1" , replaces = "doTyped" )
3520
- static TruffleObject doUntyped (TruffleObject ptr ,
3519
+ static Object doUntyped (Object ptr ,
3521
3520
@ CachedLibrary ("ptr" ) @ SuppressWarnings ("unused" ) InteropLibrary lib ,
3522
3521
@ Shared ("getSulongTypeNode" ) @ Cached GetSulongTypeNode getSulongTypeNode ,
3523
3522
@ Shared ("getLLVMType" ) @ Cached GetLLVMType getLLVMType ,
@@ -3529,11 +3528,11 @@ static TruffleObject doUntyped(TruffleObject ptr,
3529
3528
if (llvmType == null ) {
3530
3529
llvmType = getLLVMType .execute (LLVMType .PyObject );
3531
3530
}
3532
- return ( TruffleObject ) callPolyglotFromTypedNode .call (FUN_POLYGLOT_FROM_TYPED , ptr , llvmType );
3531
+ return callPolyglotFromTypedNode .call (FUN_POLYGLOT_FROM_TYPED , ptr , llvmType );
3533
3532
}
3534
3533
3535
3534
@ Specialization (limit = "1" , replaces = {"doTyped" , "doUntyped" })
3536
- static TruffleObject doGeneric (TruffleObject ptr ,
3535
+ static Object doGeneric (Object ptr ,
3537
3536
@ CachedLibrary ("ptr" ) InteropLibrary lib ,
3538
3537
@ Shared ("getSulongTypeNode" ) @ Cached GetSulongTypeNode getSulongTypeNode ,
3539
3538
@ Shared ("getLLVMType" ) @ Cached GetLLVMType getLLVMType ,
0 commit comments