220220import com .oracle .graal .python .nodes .bytecode .GetAIterNode ;
221221import com .oracle .graal .python .nodes .bytecode .PBytecodeRootNode ;
222222import 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 ;
224224import com .oracle .graal .python .nodes .call .CallNode ;
225- import com .oracle .graal .python .nodes .call .GenericInvokeNode ;
226225import com .oracle .graal .python .nodes .call .special .CallUnaryMethodNode ;
227226import com .oracle .graal .python .nodes .call .special .LookupAndCallBinaryNode ;
228227import com .oracle .graal .python .nodes .call .special .LookupAndCallUnaryNode ;
@@ -791,7 +790,6 @@ static Object doObject(VirtualFrame frame, Object a, Object b,
791790 @ GenerateNodeFactory
792791 public abstract static class EvalNode extends PythonBuiltinNode {
793792 @ Child protected CompileNode compileNode ;
794- @ Child private GenericInvokeNode invokeNode = GenericInvokeNode .create ();
795793 @ Child private GetOrCreateDictNode getOrCreateDictNode ;
796794
797795 final void assertNoFreeVars (Node inliningTarget , PCode code , PRaiseNode raiseNode ) {
@@ -855,21 +853,23 @@ Object execInheritGlobalsInheritLocals(VirtualFrame frame, Object source, @Suppr
855853 @ Exclusive @ Cached ReadCallerFrameNode readCallerFrameNode ,
856854 @ Exclusive @ Cached CodeNodes .GetCodeCallTargetNode getCt ,
857855 @ Cached GetFrameLocalsNode getFrameLocalsNode ,
856+ @ Shared @ Cached CallDispatchers .SimpleIndirectInvokeNode invoke ,
858857 @ Exclusive @ Cached PRaiseNode raiseNode ) {
859858 PCode code = createAndCheckCode (frame , inliningTarget , source , raiseNode );
860859 PFrame callerFrame = readCallerFrameNode .executeWith (frame , 0 );
861860 Object [] args = PArguments .create ();
862861 inheritGlobals (callerFrame , args );
863862 inheritLocals (inliningTarget , callerFrame , args , getFrameLocalsNode );
864863
865- return invokeNode .execute (frame , getCt .execute (inliningTarget , code ), args );
864+ return invoke .execute (frame , inliningTarget , getCt .execute (inliningTarget , code ), args );
866865 }
867866
868867 @ Specialization
869868 Object execCustomGlobalsGlobalLocals (VirtualFrame frame , Object source , PDict globals , @ SuppressWarnings ("unused" ) PNone locals ,
870869 @ Bind ("this" ) Node inliningTarget ,
871870 @ Shared @ Cached HashingCollectionNodes .SetItemNode setBuiltins ,
872871 @ Shared ("getCt" ) @ Cached CodeNodes .GetCodeCallTargetNode getCt ,
872+ @ Shared @ Cached CallDispatchers .SimpleIndirectInvokeNode invoke ,
873873 @ Shared @ Cached PRaiseNode raiseNode ) {
874874 PCode code = createAndCheckCode (frame , inliningTarget , source , raiseNode );
875875 Object [] args = PArguments .create ();
@@ -880,7 +880,7 @@ Object execCustomGlobalsGlobalLocals(VirtualFrame frame, Object source, PDict gl
880880 throw raiseNode .raise (inliningTarget , ValueError , ErrorMessages .CANNOT_CREATE_CALL_TARGET , code );
881881 }
882882
883- return invokeNode .execute (frame , rootCallTarget , args );
883+ return invoke .execute (frame , inliningTarget , rootCallTarget , args );
884884 }
885885
886886 @ Specialization (guards = {"isMapping(inliningTarget, mappingCheckNode, locals)" })
@@ -890,14 +890,15 @@ Object execInheritGlobalsCustomLocals(VirtualFrame frame, Object source, @Suppre
890890 @ SuppressWarnings ("unused" ) @ Shared @ Cached PyMappingCheckNode mappingCheckNode ,
891891 @ Exclusive @ Cached ReadCallerFrameNode readCallerFrameNode ,
892892 @ Shared ("getCt" ) @ Cached CodeNodes .GetCodeCallTargetNode getCt ,
893+ @ Shared @ Cached CallDispatchers .SimpleIndirectInvokeNode invoke ,
893894 @ Shared @ Cached PRaiseNode raiseNode ) {
894895 PCode code = createAndCheckCode (frame , inliningTarget , source , raiseNode );
895896 PFrame callerFrame = readCallerFrameNode .executeWith (frame , 0 );
896897 Object [] args = PArguments .create ();
897898 inheritGlobals (callerFrame , args );
898899 setCustomLocals (args , locals );
899900
900- return invokeNode .execute (frame , getCt .execute (inliningTarget , code ), args );
901+ return invoke .execute (frame , inliningTarget , getCt .execute (inliningTarget , code ), args );
901902 }
902903
903904 @ Specialization (guards = {"isMapping(inliningTarget, mappingCheckNode, locals)" })
@@ -907,13 +908,14 @@ Object execCustomGlobalsCustomLocals(VirtualFrame frame, Object source, PDict gl
907908 @ SuppressWarnings ("unused" ) @ Shared @ Cached PyMappingCheckNode mappingCheckNode ,
908909 @ Shared @ Cached HashingCollectionNodes .SetItemNode setBuiltins ,
909910 @ Shared ("getCt" ) @ Cached CodeNodes .GetCodeCallTargetNode getCt ,
911+ @ Shared @ Cached CallDispatchers .SimpleIndirectInvokeNode invoke ,
910912 @ Shared @ Cached PRaiseNode raiseNode ) {
911913 PCode code = createAndCheckCode (frame , inliningTarget , source , raiseNode );
912914 Object [] args = PArguments .create ();
913915 setCustomGlobals (frame , inliningTarget , globals , setBuiltins , args );
914916 setCustomLocals (args , locals );
915917
916- return invokeNode .execute (frame , getCt .execute (inliningTarget , code ), args );
918+ return invoke .execute (frame , inliningTarget , getCt .execute (inliningTarget , code ), args );
917919 }
918920
919921 @ Specialization (guards = {"!isAnyNone(globals)" , "!isDict(globals)" })
@@ -2488,12 +2490,12 @@ private static Object buildJavaClass(Object namespace, TruffleString name, Objec
24882490 }
24892491
24902492 @ 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 ,
24922494 TruffleString name ) {
24932495 PDict ns = PFactory .createDict (language , new DynamicObjectStorage (language ));
24942496 Object [] args = PArguments .create (0 );
24952497 PArguments .setSpecialArgument (args , ns );
2496- callBody . executeCall (frame , function , args );
2498+ invokeBody . execute (frame , inliningTarget , function , args );
24972499 return buildJavaClass (ns , name , arguments [1 ]);
24982500 }
24992501
@@ -2507,7 +2509,7 @@ protected Object doItNonFunction(VirtualFrame frame, Object function, Object[] a
25072509 @ Cached PyMappingCheckNode pyMappingCheckNode ,
25082510 @ Cached CallNode callPrep ,
25092511 @ Cached CallNode callType ,
2510- @ Cached CallDispatchNode callBody ,
2512+ @ Cached CallDispatchers . FunctionInvokeNode invokeBody ,
25112513 @ Cached UpdateBasesNode update ,
25122514 @ Cached PyObjectSetItem setOrigBases ,
25132515 @ Cached GetClassNode getClass ,
@@ -2537,7 +2539,7 @@ protected Object doItNonFunction(VirtualFrame frame, Object function, Object[] a
25372539
25382540 if (arguments .length == 2 && env .isHostObject (arguments [1 ]) && env .asHostObject (arguments [1 ]) instanceof Class <?>) {
25392541 // 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 );
25412543 }
25422544
25432545 class InitializeBuildClass {
@@ -2606,7 +2608,7 @@ class InitializeBuildClass {
26062608 }
26072609 Object [] bodyArguments = PArguments .create (0 );
26082610 PArguments .setSpecialArgument (bodyArguments , ns );
2609- callBody . executeCall (frame , (PFunction ) function , bodyArguments );
2611+ invokeBody . execute (frame , inliningTarget , (PFunction ) function , bodyArguments );
26102612 if (init .bases != origBases ) {
26112613 setOrigBases .execute (frame , inliningTarget , ns , SpecialAttributeNames .T___ORIG_BASES__ , origBases );
26122614 }
0 commit comments