|
51 | 51 | import java.util.function.Supplier;
|
52 | 52 |
|
53 | 53 | 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; |
56 | 54 | import com.oracle.graal.python.builtins.objects.function.PArguments;
|
57 | 55 | import com.oracle.graal.python.builtins.objects.function.Signature;
|
58 | 56 | import com.oracle.graal.python.nodes.PRootNode;
|
59 | 57 | import com.oracle.graal.python.nodes.call.CallNode;
|
| 58 | +import com.oracle.graal.python.nodes.call.GenericInvokeNode; |
60 | 59 | import com.oracle.graal.python.nodes.frame.MaterializeFrameNode;
|
61 | 60 | import com.oracle.graal.python.nodes.frame.MaterializeFrameNodeGen;
|
62 | 61 | import com.oracle.graal.python.nodes.frame.ReadCallerFrameNode;
|
|
68 | 67 | import com.oracle.truffle.api.frame.VirtualFrame;
|
69 | 68 | import com.oracle.truffle.api.nodes.Node;
|
70 | 69 | import com.oracle.truffle.api.nodes.Node.Child;
|
71 |
| -import com.oracle.truffle.api.nodes.RootNode; |
72 | 70 | import com.oracle.truffle.api.profiles.BranchProfile;
|
73 | 71 |
|
74 | 72 | /**
|
@@ -158,14 +156,6 @@ public Object execute(VirtualFrame frame) {
|
158 | 156 | int frameIndex = (int) PArguments.getArgument(frameArguments, 1);
|
159 | 157 | Object[] arguments = Arrays.copyOfRange(frameArguments, PArguments.USER_ARGUMENTS_OFFSET + ASYNC_ARGS, frameArguments.length);
|
160 | 158 |
|
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 |
| - } |
169 | 159 | if (frameIndex >= 0) {
|
170 | 160 | arguments[frameIndex] = readCallerFrameNode.executeWith(frame, 0);
|
171 | 161 | }
|
@@ -261,16 +251,8 @@ private void processAsyncActions(VirtualFrame frame, Node location) {
|
261 | 251 | PArguments.setArgument(args, 2, location);
|
262 | 252 | PArguments.setArgument(args, 3, frame);
|
263 | 253 |
|
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 |
| - } |
272 | 254 | try {
|
273 |
| - callTarget.call(args); |
| 255 | + GenericInvokeNode.getUncached().execute(frame, callTarget, args); |
274 | 256 | } catch (RuntimeException e) {
|
275 | 257 | // we cannot raise the exception here (well, we could, but CPython
|
276 | 258 | // doesn't), so we do what they do and just print it
|
|
0 commit comments