Skip to content

Commit d7574b1

Browse files
committed
Use 'GenericInvokeNode' to call 'AsyncHandler.CallRootNode'.
1 parent 8266767 commit d7574b1

File tree

1 file changed

+2
-20
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime

1 file changed

+2
-20
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/runtime/AsyncHandler.java

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,11 @@
5151
import java.util.function.Supplier;
5252

5353
import com.oracle.graal.python.PythonLanguage;
54-
import com.oracle.graal.python.builtins.objects.frame.PFrame;
55-
import com.oracle.graal.python.builtins.objects.frame.PFrame.Reference;
5654
import com.oracle.graal.python.builtins.objects.function.PArguments;
5755
import com.oracle.graal.python.builtins.objects.function.Signature;
5856
import com.oracle.graal.python.nodes.PRootNode;
5957
import com.oracle.graal.python.nodes.call.CallNode;
58+
import com.oracle.graal.python.nodes.call.GenericInvokeNode;
6059
import com.oracle.graal.python.nodes.frame.MaterializeFrameNode;
6160
import com.oracle.graal.python.nodes.frame.MaterializeFrameNodeGen;
6261
import com.oracle.graal.python.nodes.frame.ReadCallerFrameNode;
@@ -68,7 +67,6 @@
6867
import com.oracle.truffle.api.frame.VirtualFrame;
6968
import com.oracle.truffle.api.nodes.Node;
7069
import com.oracle.truffle.api.nodes.Node.Child;
71-
import com.oracle.truffle.api.nodes.RootNode;
7270
import com.oracle.truffle.api.profiles.BranchProfile;
7371

7472
/**
@@ -158,14 +156,6 @@ public Object execute(VirtualFrame frame) {
158156
int frameIndex = (int) PArguments.getArgument(frameArguments, 1);
159157
Object[] arguments = Arrays.copyOfRange(frameArguments, PArguments.USER_ARGUMENTS_OFFSET + ASYNC_ARGS, frameArguments.length);
160158

161-
// TODO: frames: This should eventually go away as soon as this root node is properly
162-
// called using an invoke node.
163-
PFrame.Reference callerInfo = PArguments.getCallerFrameInfo(frame);
164-
if (callerInfo != null) {
165-
VirtualFrame callerFrame = (VirtualFrame) PArguments.getArgument(frameArguments, 3);
166-
// the caller can't do, so it must be done here
167-
materializeNode.execute(frame, true, true, callerFrame);
168-
}
169159
if (frameIndex >= 0) {
170160
arguments[frameIndex] = readCallerFrameNode.executeWith(frame, 0);
171161
}
@@ -261,16 +251,8 @@ private void processAsyncActions(VirtualFrame frame, Node location) {
261251
PArguments.setArgument(args, 2, location);
262252
PArguments.setArgument(args, 3, frame);
263253

264-
// TODO: frames: workaround because we can't use an invoke node here; this
265-
// should eventually be done properly
266-
RootNode rootNode = callTarget.getRootNode();
267-
if (rootNode instanceof PRootNode && ((PRootNode) rootNode).needsCallerFrame()) {
268-
Reference currentFrameInfo = PArguments.getCurrentFrameInfo(frame);
269-
currentFrameInfo.setCallNode(location);
270-
PArguments.setCallerFrameInfo(args, currentFrameInfo);
271-
}
272254
try {
273-
callTarget.call(args);
255+
GenericInvokeNode.getUncached().execute(frame, callTarget, args);
274256
} catch (RuntimeException e) {
275257
// we cannot raise the exception here (well, we could, but CPython
276258
// doesn't), so we do what they do and just print it

0 commit comments

Comments
 (0)