@@ -62,19 +62,19 @@ public static AltrepDownCallNodeImpl getUncached() {
6262 return AltrepDownCallNodeImplNodeGen .getUncached ();
6363 }
6464
65- @ Specialization (guards = "cachedLength == args.length" , limit = "3" )
65+ @ Specialization (limit = "3" )
6666 public Object doIt (AltrepMethodDescriptor altrepDowncallIn , boolean unwrapResult , boolean [] wrapArguments , Object [] args ,
67- @ Cached ("args.length" ) int cachedLength ,
6867 @ CachedLibrary ("altrepDowncallIn.method" ) InteropLibrary methodInterop ,
6968 @ Cached (value = "createUnwrapNode(unwrapResult)" , uncached = "createUncachedUnwrapNode()" ) FFIUnwrapNode unwrapNode ,
7069 @ CachedContext (TruffleRLanguage .class ) ContextReference <RContext > ctxRef ,
71- @ Cached ("createMaterialized(wrapArguments)" ) FFIMaterializeNode [] materializeNodes ,
72- @ Cached ("createToNatives(wrapArguments)" ) FFIToNativeMirrorNode [] toNativeNodes ,
70+ @ Cached (value = "createMaterialized(wrapArguments)" , allowUncached = true ) FFIMaterializeNode [] materializeNodes ,
71+ @ Cached (value = "createToNatives(wrapArguments)" , allowUncached = true ) FFIToNativeMirrorNode [] toNativeNodes ,
7372 @ Cached ("createBinaryProfile()" ) ConditionProfile isLLVMProfile ,
7473 @ Cached BranchProfile unwrapResultProfile ,
7574 @ Cached ("createIdentityProfile()" ) ValueProfile identityProfile ,
7675 @ Cached AfterDownCallProfiles afterDownCallProfiles ) {
7776 CompilerAsserts .partialEvaluationConstant (unwrapResult );
77+ CompilerAsserts .partialEvaluationConstant (args .length );
7878 AltrepMethodDescriptor altrepMethodDescriptor = identityProfile .profile (altrepDowncallIn );
7979
8080 assert methodInterop .isExecutable (altrepMethodDescriptor .method );
@@ -88,7 +88,7 @@ public Object doIt(AltrepMethodDescriptor altrepDowncallIn, boolean unwrapResult
8888 }
8989
9090 Object ret ;
91- try (FFIDownCallWrap ffiWrap = new FFIDownCallWrap (cachedLength )) {
91+ try (FFIDownCallWrap ffiWrap = new FFIDownCallWrap (args . length )) {
9292 Object [] wrappedArgs = ffiWrap .wrapSome (args , materializeNodes , toNativeNodes , wrapArguments );
9393 ret = methodInterop .execute (altrepMethodDescriptor .method , wrappedArgs );
9494 if (unwrapResult ) {
@@ -108,26 +108,6 @@ public Object doIt(AltrepMethodDescriptor altrepDowncallIn, boolean unwrapResult
108108 return ret ;
109109 }
110110
111- @ Specialization (guards = "cachedLength == args.length" , replaces = "doIt" )
112- public Object doItWithDispatchedMethodInterop (
113- AltrepMethodDescriptor altrepDowncall , boolean unwrapResult , boolean [] wrapArguments , Object [] args ,
114- @ Cached ("args.length" ) int cachedLength ,
115- @ CachedLibrary (limit = "3" ) InteropLibrary methodInterop ,
116- @ Cached (value = "createUnwrapNode(unwrapResult)" , uncached = "createUncachedUnwrapNode()" ) FFIUnwrapNode unwrapNode ,
117- @ CachedContext (TruffleRLanguage .class ) ContextReference <RContext > ctxRef ,
118- @ Cached (value = "createMaterialized(wrapArguments)" , allowUncached = true ) FFIMaterializeNode [] materializeNodes ,
119- @ Cached (value = "createToNatives(wrapArguments)" , allowUncached = true ) FFIToNativeMirrorNode [] toNativeNodes ,
120- @ Cached ("createBinaryProfile()" ) ConditionProfile isLLVMProfile ,
121- @ Cached BranchProfile unwrapResultProfile ,
122- @ Cached ("createIdentityProfile()" ) ValueProfile identityProfile ,
123- @ Cached AfterDownCallProfiles afterDownCallProfiles ) {
124- return doIt (altrepDowncall , unwrapResult , wrapArguments , args , cachedLength , methodInterop , unwrapNode ,
125- ctxRef , materializeNodes , toNativeNodes , isLLVMProfile , unwrapResultProfile , identityProfile ,
126- afterDownCallProfiles );
127- }
128-
129- // TODO: Implement some uncached specialization?
130-
131111 protected static FFIUnwrapNode createUnwrapNode (boolean unwrapFlag ) {
132112 if (unwrapFlag ) {
133113 return FFIUnwrapNode .create ();
0 commit comments