220
220
import com .oracle .graal .python .nodes .bytecode .GetAIterNode ;
221
221
import com .oracle .graal .python .nodes .bytecode .PBytecodeRootNode ;
222
222
import com .oracle .graal .python .nodes .bytecode_dsl .PBytecodeDSLRootNode ;
223
- import com .oracle .graal .python .nodes .call .CallDispatchNode ;
223
+ import com .oracle .graal .python .nodes .call .CallDispatchers ;
224
224
import com .oracle .graal .python .nodes .call .CallNode ;
225
- import com .oracle .graal .python .nodes .call .GenericInvokeNode ;
226
225
import com .oracle .graal .python .nodes .call .special .CallUnaryMethodNode ;
227
226
import com .oracle .graal .python .nodes .call .special .LookupAndCallBinaryNode ;
228
227
import com .oracle .graal .python .nodes .call .special .LookupAndCallUnaryNode ;
@@ -791,7 +790,6 @@ static Object doObject(VirtualFrame frame, Object a, Object b,
791
790
@ GenerateNodeFactory
792
791
public abstract static class EvalNode extends PythonBuiltinNode {
793
792
@ Child protected CompileNode compileNode ;
794
- @ Child private GenericInvokeNode invokeNode = GenericInvokeNode .create ();
795
793
@ Child private GetOrCreateDictNode getOrCreateDictNode ;
796
794
797
795
final void assertNoFreeVars (Node inliningTarget , PCode code , PRaiseNode raiseNode ) {
@@ -855,21 +853,23 @@ Object execInheritGlobalsInheritLocals(VirtualFrame frame, Object source, @Suppr
855
853
@ Exclusive @ Cached ReadCallerFrameNode readCallerFrameNode ,
856
854
@ Exclusive @ Cached CodeNodes .GetCodeCallTargetNode getCt ,
857
855
@ Cached GetFrameLocalsNode getFrameLocalsNode ,
856
+ @ Shared @ Cached CallDispatchers .SimpleIndirectInvokeNode invoke ,
858
857
@ Exclusive @ Cached PRaiseNode raiseNode ) {
859
858
PCode code = createAndCheckCode (frame , inliningTarget , source , raiseNode );
860
859
PFrame callerFrame = readCallerFrameNode .executeWith (frame , 0 );
861
860
Object [] args = PArguments .create ();
862
861
inheritGlobals (callerFrame , args );
863
862
inheritLocals (inliningTarget , callerFrame , args , getFrameLocalsNode );
864
863
865
- return invokeNode .execute (frame , getCt .execute (inliningTarget , code ), args );
864
+ return invoke .execute (frame , inliningTarget , getCt .execute (inliningTarget , code ), args );
866
865
}
867
866
868
867
@ Specialization
869
868
Object execCustomGlobalsGlobalLocals (VirtualFrame frame , Object source , PDict globals , @ SuppressWarnings ("unused" ) PNone locals ,
870
869
@ Bind ("this" ) Node inliningTarget ,
871
870
@ Shared @ Cached HashingCollectionNodes .SetItemNode setBuiltins ,
872
871
@ Shared ("getCt" ) @ Cached CodeNodes .GetCodeCallTargetNode getCt ,
872
+ @ Shared @ Cached CallDispatchers .SimpleIndirectInvokeNode invoke ,
873
873
@ Shared @ Cached PRaiseNode raiseNode ) {
874
874
PCode code = createAndCheckCode (frame , inliningTarget , source , raiseNode );
875
875
Object [] args = PArguments .create ();
@@ -880,7 +880,7 @@ Object execCustomGlobalsGlobalLocals(VirtualFrame frame, Object source, PDict gl
880
880
throw raiseNode .raise (inliningTarget , ValueError , ErrorMessages .CANNOT_CREATE_CALL_TARGET , code );
881
881
}
882
882
883
- return invokeNode .execute (frame , rootCallTarget , args );
883
+ return invoke .execute (frame , inliningTarget , rootCallTarget , args );
884
884
}
885
885
886
886
@ Specialization (guards = {"isMapping(inliningTarget, mappingCheckNode, locals)" })
@@ -890,14 +890,15 @@ Object execInheritGlobalsCustomLocals(VirtualFrame frame, Object source, @Suppre
890
890
@ SuppressWarnings ("unused" ) @ Shared @ Cached PyMappingCheckNode mappingCheckNode ,
891
891
@ Exclusive @ Cached ReadCallerFrameNode readCallerFrameNode ,
892
892
@ Shared ("getCt" ) @ Cached CodeNodes .GetCodeCallTargetNode getCt ,
893
+ @ Shared @ Cached CallDispatchers .SimpleIndirectInvokeNode invoke ,
893
894
@ Shared @ Cached PRaiseNode raiseNode ) {
894
895
PCode code = createAndCheckCode (frame , inliningTarget , source , raiseNode );
895
896
PFrame callerFrame = readCallerFrameNode .executeWith (frame , 0 );
896
897
Object [] args = PArguments .create ();
897
898
inheritGlobals (callerFrame , args );
898
899
setCustomLocals (args , locals );
899
900
900
- return invokeNode .execute (frame , getCt .execute (inliningTarget , code ), args );
901
+ return invoke .execute (frame , inliningTarget , getCt .execute (inliningTarget , code ), args );
901
902
}
902
903
903
904
@ Specialization (guards = {"isMapping(inliningTarget, mappingCheckNode, locals)" })
@@ -907,13 +908,14 @@ Object execCustomGlobalsCustomLocals(VirtualFrame frame, Object source, PDict gl
907
908
@ SuppressWarnings ("unused" ) @ Shared @ Cached PyMappingCheckNode mappingCheckNode ,
908
909
@ Shared @ Cached HashingCollectionNodes .SetItemNode setBuiltins ,
909
910
@ Shared ("getCt" ) @ Cached CodeNodes .GetCodeCallTargetNode getCt ,
911
+ @ Shared @ Cached CallDispatchers .SimpleIndirectInvokeNode invoke ,
910
912
@ Shared @ Cached PRaiseNode raiseNode ) {
911
913
PCode code = createAndCheckCode (frame , inliningTarget , source , raiseNode );
912
914
Object [] args = PArguments .create ();
913
915
setCustomGlobals (frame , inliningTarget , globals , setBuiltins , args );
914
916
setCustomLocals (args , locals );
915
917
916
- return invokeNode .execute (frame , getCt .execute (inliningTarget , code ), args );
918
+ return invoke .execute (frame , inliningTarget , getCt .execute (inliningTarget , code ), args );
917
919
}
918
920
919
921
@ Specialization (guards = {"!isAnyNone(globals)" , "!isDict(globals)" })
@@ -2488,12 +2490,12 @@ private static Object buildJavaClass(Object namespace, TruffleString name, Objec
2488
2490
}
2489
2491
2490
2492
@ InliningCutoff
2491
- private static Object buildJavaClass (VirtualFrame frame , PythonLanguage language , PFunction function , Object [] arguments , CallDispatchNode callBody ,
2493
+ private static Object buildJavaClass (VirtualFrame frame , Node inliningTarget , PythonLanguage language , PFunction function , Object [] arguments , CallDispatchers . FunctionInvokeNode invokeBody ,
2492
2494
TruffleString name ) {
2493
2495
PDict ns = PFactory .createDict (language , new DynamicObjectStorage (language ));
2494
2496
Object [] args = PArguments .create (0 );
2495
2497
PArguments .setSpecialArgument (args , ns );
2496
- callBody . executeCall (frame , function , args );
2498
+ invokeBody . execute (frame , inliningTarget , function , args );
2497
2499
return buildJavaClass (ns , name , arguments [1 ]);
2498
2500
}
2499
2501
@@ -2507,7 +2509,7 @@ protected Object doItNonFunction(VirtualFrame frame, Object function, Object[] a
2507
2509
@ Cached PyMappingCheckNode pyMappingCheckNode ,
2508
2510
@ Cached CallNode callPrep ,
2509
2511
@ Cached CallNode callType ,
2510
- @ Cached CallDispatchNode callBody ,
2512
+ @ Cached CallDispatchers . FunctionInvokeNode invokeBody ,
2511
2513
@ Cached UpdateBasesNode update ,
2512
2514
@ Cached PyObjectSetItem setOrigBases ,
2513
2515
@ Cached GetClassNode getClass ,
@@ -2537,7 +2539,7 @@ protected Object doItNonFunction(VirtualFrame frame, Object function, Object[] a
2537
2539
2538
2540
if (arguments .length == 2 && env .isHostObject (arguments [1 ]) && env .asHostObject (arguments [1 ]) instanceof Class <?>) {
2539
2541
// we want to subclass a Java class
2540
- return buildJavaClass (frame , language , (PFunction ) function , arguments , callBody , name );
2542
+ return buildJavaClass (frame , inliningTarget , language , (PFunction ) function , arguments , invokeBody , name );
2541
2543
}
2542
2544
2543
2545
class InitializeBuildClass {
@@ -2606,7 +2608,7 @@ class InitializeBuildClass {
2606
2608
}
2607
2609
Object [] bodyArguments = PArguments .create (0 );
2608
2610
PArguments .setSpecialArgument (bodyArguments , ns );
2609
- callBody . executeCall (frame , (PFunction ) function , bodyArguments );
2611
+ invokeBody . execute (frame , inliningTarget , (PFunction ) function , bodyArguments );
2610
2612
if (init .bases != origBases ) {
2611
2613
setOrigBases .execute (frame , inliningTarget , ns , SpecialAttributeNames .T___ORIG_BASES__ , origBases );
2612
2614
}
0 commit comments