|
1 | 1 | /* |
2 | | - * Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 | 4 | * |
5 | 5 | * This code is free software; you can redistribute it and/or modify it |
|
22 | 22 | */ |
23 | 23 | package com.oracle.truffle.r.nodes.function; |
24 | 24 |
|
25 | | -import com.oracle.truffle.api.CompilerAsserts; |
26 | 25 | import com.oracle.truffle.api.CompilerDirectives; |
27 | 26 | import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; |
28 | 27 | import com.oracle.truffle.api.dsl.Cached; |
29 | 28 | import com.oracle.truffle.api.dsl.NodeChild; |
30 | 29 | import com.oracle.truffle.api.dsl.Specialization; |
31 | 30 | import com.oracle.truffle.api.frame.VirtualFrame; |
32 | | -import com.oracle.truffle.api.nodes.Node; |
33 | 31 | import com.oracle.truffle.api.nodes.NodeCost; |
34 | 32 | import com.oracle.truffle.api.nodes.NodeInfo; |
35 | 33 | import com.oracle.truffle.api.source.SourceSection; |
@@ -176,20 +174,14 @@ public RBaseNode getErrorContext() { |
176 | 174 | */ |
177 | 175 | private RCallSpecialNode callSpecialParent; |
178 | 176 |
|
179 | | - private final boolean inReplace; |
180 | | - private final int[] ignoredArguments; |
181 | | - |
182 | | - private RCallSpecialNode(SourceSection sourceSection, RNode functionNode, RBuiltinDescriptor expectedFunction, RSyntaxNode[] arguments, ArgumentsSignature signature, RNode special, |
183 | | - boolean inReplace, int[] ignoredArguments) { |
| 177 | + private RCallSpecialNode(SourceSection sourceSection, RNode functionNode, RBuiltinDescriptor expectedFunction, RSyntaxNode[] arguments, ArgumentsSignature signature, RNode special) { |
184 | 178 | this.sourceSection = sourceSection; |
185 | 179 | this.expectedFunction = expectedFunction; |
186 | 180 | this.special = special; |
187 | 181 | this.functionNode = functionNode; |
188 | 182 | this.arguments = arguments; |
189 | 183 | this.signature = signature; |
190 | 184 | this.visible = expectedFunction.getVisibility(); |
191 | | - this.inReplace = inReplace; |
192 | | - this.ignoredArguments = ignoredArguments; |
193 | 185 | } |
194 | 186 |
|
195 | 187 | /** |
@@ -296,7 +288,7 @@ private static RCallSpecialNode tryCreate(SourceSection sourceSection, RNode fun |
296 | 288 | RBuiltinDescriptor expectedFunction = RContext.lookupBuiltinDescriptor(name); |
297 | 289 | RInternalError.guarantee(expectedFunction != null); |
298 | 290 |
|
299 | | - RCallSpecialNode callSpecial = new RCallSpecialNode(sourceSection, functionNode, expectedFunction, arguments, signature, special, inReplace, ignoredArguments); |
| 291 | + RCallSpecialNode callSpecial = new RCallSpecialNode(sourceSection, functionNode, expectedFunction, arguments, signature, special); |
300 | 292 | for (int i = 0; i < arguments.length; i++) { |
301 | 293 | if (!inReplace || !contains(ignoredArguments, i)) { |
302 | 294 | if (arguments[i] instanceof RCallSpecialNode) { |
@@ -348,19 +340,6 @@ public Object execute(VirtualFrame frame, Object function) { |
348 | 340 | } |
349 | 341 | } |
350 | 342 |
|
351 | | - @Override |
352 | | - public Node deepCopy() { |
353 | | - assert !inReplace && callSpecialParent == null && ignoredArguments.length == 0; |
354 | | - CompilerAsserts.neverPartOfCompilation(); |
355 | | - RCallSpecialNode node = (RCallSpecialNode) RContext.getASTBuilder().process(this).asRNode(); |
356 | | - node.functionNode = node.insert(node.functionNode); |
357 | | - node.special = node.insert(node.special); |
358 | | - if (node.visibility != null) { |
359 | | - node.visibility = insert(node.visibility); |
360 | | - } |
361 | | - return node; |
362 | | - } |
363 | | - |
364 | 343 | private RCallNode getRCallNode(RSyntaxNode[] newArguments) { |
365 | 344 | return RCallNode.createCall(sourceSection, functionNode, signature, newArguments); |
366 | 345 | } |
|
0 commit comments