Skip to content

Commit 0e5c2b7

Browse files
committed
[GR-64489][GR-64298] Refactor call dispatch
PullRequest: graalpython/3759
2 parents afbeabe + 738ffa2 commit 0e5c2b7

File tree

55 files changed

+732
-1405
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+732
-1405
lines changed

graalpython/com.oracle.graal.python.test/src/com/oracle/graal/python/test/builtin/modules/ConversionNodeTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
import com.oracle.graal.python.builtins.objects.function.PArguments;
5050
import com.oracle.graal.python.builtins.objects.function.Signature;
5151
import com.oracle.graal.python.nodes.PRootNode;
52-
import com.oracle.graal.python.nodes.call.CallTargetInvokeNode;
52+
import com.oracle.graal.python.nodes.call.CallDispatchers;
5353
import com.oracle.graal.python.nodes.function.builtins.clinic.ArgumentCastNode;
5454
import com.oracle.graal.python.runtime.ExecutionContext.CalleeContext;
5555
import com.oracle.graal.python.runtime.ExecutionContext.IndirectCalleeContext;
@@ -103,7 +103,7 @@ public boolean isPythonInternal() {
103103
PythonThreadState threadState = pythonContext.getThreadState(language);
104104
Object state = IndirectCalleeContext.enter(threadState, arguments, callTarget);
105105
try {
106-
return CallTargetInvokeNode.invokeUncached(callTarget, arguments);
106+
return CallDispatchers.SimpleIndirectInvokeNode.executeUncached(callTarget, arguments);
107107
} finally {
108108
IndirectCalleeContext.exit(threadState, state);
109109
}

graalpython/com.oracle.graal.python.test/src/tests/unittest_tags/test_concurrent_futures.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ test.test_concurrent_futures.test_shutdown.ProcessPoolSpawnProcessPoolShutdownTe
6868
test.test_concurrent_futures.test_shutdown.ProcessPoolSpawnProcessPoolShutdownTest.test_context_manager_shutdown @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64
6969
# Transiently times out GR-52666
7070
!test.test_concurrent_futures.test_shutdown.ProcessPoolSpawnProcessPoolShutdownTest.test_del_shutdown
71-
test.test_concurrent_futures.test_shutdown.ProcessPoolSpawnProcessPoolShutdownTest.test_hang_gh94440 @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64
71+
!test.test_concurrent_futures.test_shutdown.ProcessPoolSpawnProcessPoolShutdownTest.test_hang_gh94440
7272
test.test_concurrent_futures.test_shutdown.ProcessPoolSpawnProcessPoolShutdownTest.test_hang_issue12364 @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64
7373
test.test_concurrent_futures.test_shutdown.ProcessPoolSpawnProcessPoolShutdownTest.test_processes_terminate @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64
7474
test.test_concurrent_futures.test_shutdown.ProcessPoolSpawnProcessPoolShutdownTest.test_run_after_shutdown @ darwin-arm64,darwin-x86_64,linux-aarch64,linux-x86_64

graalpython/com.oracle.graal.python.test/src/tests/unittest_tags_bytecode_dsl/test_concurrent_futures.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ test.test_concurrent_futures.test_shutdown.ProcessPoolSpawnProcessPoolShutdownTe
7373
!test.test_concurrent_futures.test_shutdown.ProcessPoolSpawnProcessPoolShutdownTest.test_submit_after_interpreter_shutdown @ linux-x86_64
7474
test.test_concurrent_futures.test_shutdown.ThreadPoolShutdownTest.test_cancel_futures @ linux-x86_64
7575
test.test_concurrent_futures.test_shutdown.ThreadPoolShutdownTest.test_context_manager_shutdown @ linux-x86_64
76-
test.test_concurrent_futures.test_shutdown.ThreadPoolShutdownTest.test_hang_gh94440 @ linux-x86_64
76+
!test.test_concurrent_futures.test_shutdown.ThreadPoolShutdownTest.test_hang_gh94440 @ linux-x86_64
7777
test.test_concurrent_futures.test_shutdown.ThreadPoolShutdownTest.test_hang_issue12364 @ linux-x86_64
7878
test.test_concurrent_futures.test_shutdown.ThreadPoolShutdownTest.test_run_after_shutdown @ linux-x86_64
7979
test.test_concurrent_futures.test_shutdown.ThreadPoolShutdownTest.test_shutdown_no_wait @ linux-x86_64

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/PythonLanguage.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
import com.oracle.graal.python.nodes.bytecode.PBytecodeRootNode;
8787
import com.oracle.graal.python.nodes.bytecode_dsl.BytecodeDSLCodeUnit;
8888
import com.oracle.graal.python.nodes.call.CallNode;
89-
import com.oracle.graal.python.nodes.call.GenericInvokeNode;
89+
import com.oracle.graal.python.nodes.call.CallDispatchers;
9090
import com.oracle.graal.python.nodes.exception.TopLevelExceptionHandler;
9191
import com.oracle.graal.python.nodes.frame.GetFrameLocalsNode;
9292
import com.oracle.graal.python.nodes.frame.MaterializeFrameNode;
@@ -783,7 +783,7 @@ public ExecutableNode parse(InlineParsingRequest request) {
783783
RootCallTarget callTarget = parse(context, request.getSource(), InputType.EVAL, false, 0, false, null, EnumSet.noneOf(FutureFeature.class));
784784
return new ExecutableNode(this) {
785785
@Child private GilNode gilNode = GilNode.create();
786-
@Child private GenericInvokeNode invokeNode = GenericInvokeNode.create();
786+
@Child private CallDispatchers.SimpleIndirectInvokeNode invokeNode = CallDispatchers.SimpleIndirectInvokeNode.create();
787787
@Child private MaterializeFrameNode materializeFrameNode = MaterializeFrameNode.create();
788788
@Child private GetFrameLocalsNode getFrameLocalsNode = GetFrameLocalsNode.create();
789789

@@ -797,7 +797,7 @@ public Object execute(VirtualFrame frame) {
797797
PArguments.setGlobals(arguments, PArguments.getGlobals(frame));
798798
boolean wasAcquired = gilNode.acquire();
799799
try {
800-
return invokeNode.execute(callTarget, arguments);
800+
return invokeNode.executeCached(frame, callTarget, arguments);
801801
} finally {
802802
gilNode.release(wasAcquired);
803803
}

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/Python3Core.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@
373373
import com.oracle.graal.python.nodes.BuiltinNames;
374374
import com.oracle.graal.python.nodes.attributes.ReadAttributeFromPythonObjectNode;
375375
import com.oracle.graal.python.nodes.attributes.WriteAttributeToPythonObjectNode;
376-
import com.oracle.graal.python.nodes.call.GenericInvokeNode;
376+
import com.oracle.graal.python.nodes.call.CallDispatchers;
377377
import com.oracle.graal.python.nodes.object.GetForeignObjectClassNode;
378378
import com.oracle.graal.python.nodes.statement.AbstractImportNode;
379379
import com.oracle.graal.python.pegparser.FutureFeature;
@@ -1312,7 +1312,7 @@ private void loadFile(TruffleString s, TruffleString prefix, PythonModule mod) {
13121312
return getLanguage().parse(getContext(), source, InputType.FILE, false, 0, false, null, EnumSet.noneOf(FutureFeature.class));
13131313
};
13141314
RootCallTarget callTarget = (RootCallTarget) getLanguage().cacheCode(s, getCode);
1315-
GenericInvokeNode.getUncached().execute(callTarget, PArguments.withGlobals(mod));
1315+
CallDispatchers.SimpleIndirectInvokeNode.executeUncached(callTarget, PArguments.withGlobals(mod));
13161316
}
13171317

13181318
public final PInt getTrue() {

0 commit comments

Comments
 (0)