Skip to content

Commit 39cb4c2

Browse files
committed
Remove usage of getDelegatedValue
1 parent 167f25e commit 39cb4c2

File tree

1 file changed

+7
-12
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi

1 file changed

+7
-12
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/capi/CExtNodes.java

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@
131131
import com.oracle.graal.python.builtins.objects.method.PBuiltinMethod;
132132
import com.oracle.graal.python.builtins.objects.module.ModuleGetNameNode;
133133
import com.oracle.graal.python.builtins.objects.module.PythonModule;
134-
import com.oracle.graal.python.builtins.objects.object.PythonObjectLibrary;
135134
import com.oracle.graal.python.builtins.objects.str.NativeCharSequence;
136135
import com.oracle.graal.python.builtins.objects.str.PString;
137136
import com.oracle.graal.python.builtins.objects.type.PythonAbstractClass;
@@ -527,12 +526,10 @@ static Object doForeignObject(@SuppressWarnings("unused") CExtContext cextContex
527526

528527
@Specialization(guards = "isFallback(object, isForeignObjectNode)")
529528
static Object run(@SuppressWarnings("unused") CExtContext cextContext, Object object,
530-
@SuppressWarnings("unused") @Cached IsForeignObjectNode isForeignObjectNode,
531-
@CachedLibrary(limit = "3") PythonObjectLibrary lib) {
529+
@SuppressWarnings("unused") @Cached IsForeignObjectNode isForeignObjectNode) {
532530
assert object != null : "Java 'null' cannot be a Sulong value";
533-
Object o = lib.getDelegatedValue(object);
534-
assert CApiGuards.isNativeWrapper(o) : "unknown object cannot be a Sulong value";
535-
return o;
531+
assert CApiGuards.isNativeWrapper(object) : "unknown object cannot be a Sulong value";
532+
return object;
536533
}
537534

538535
protected static PythonClassNativeWrapper wrapNativeClass(PythonManagedClass object) {
@@ -796,9 +793,8 @@ static Object doForeignObject(CExtContext cextContext, TruffleObject object,
796793

797794
@Specialization(guards = "isFallback(object, isForeignObjectNode)")
798795
static Object run(CExtContext cextContext, Object object,
799-
@Cached IsForeignObjectNode isForeignObjectNode,
800-
@CachedLibrary(limit = "3") PythonObjectLibrary lib) {
801-
return ToSulongNode.run(cextContext, object, isForeignObjectNode, lib);
796+
@Cached IsForeignObjectNode isForeignObjectNode) {
797+
return ToSulongNode.run(cextContext, object, isForeignObjectNode);
802798
}
803799

804800
protected static PythonClassNativeWrapper wrapNativeClass(PythonManagedClass object) {
@@ -972,9 +968,8 @@ static Object doForeignObject(CExtContext cextContext, TruffleObject object,
972968

973969
@Specialization(guards = "isFallback(object, isForeignObjectNode)")
974970
static Object run(CExtContext cextContext, Object object,
975-
@Cached IsForeignObjectNode isForeignObjectNode,
976-
@CachedLibrary(limit = "3") PythonObjectLibrary lib) {
977-
return ToSulongNode.run(cextContext, object, isForeignObjectNode, lib);
971+
@Cached IsForeignObjectNode isForeignObjectNode) {
972+
return ToSulongNode.run(cextContext, object, isForeignObjectNode);
978973
}
979974

980975
protected static PythonClassNativeWrapper wrapNativeClass(PythonManagedClass object) {

0 commit comments

Comments
 (0)