Skip to content
Snippets Groups Projects
Commit 00895296 authored by Lukas Stadler's avatar Lukas Stadler
Browse files

[GR-2738] Remove unnecessary ReadArgumentNode.

parents 93c49d55 90a8d480
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,7 @@ import com.oracle.truffle.r.nodes.function.PromiseHelperNode;
import com.oracle.truffle.r.nodes.function.opt.EagerEvalHelper;
import com.oracle.truffle.r.nodes.function.opt.OptConstantPromiseNode;
import com.oracle.truffle.r.nodes.function.opt.OptVariablePromiseBaseNode;
import com.oracle.truffle.r.runtime.RArguments;
import com.oracle.truffle.r.runtime.RInternalError;
import com.oracle.truffle.r.runtime.data.REmpty;
import com.oracle.truffle.r.runtime.data.RMissing;
......@@ -56,8 +57,6 @@ import com.oracle.truffle.r.runtime.nodes.RNode;
*/
public final class AccessArgumentNode extends RNode {
@Child private ReadArgumentNode readArgNode;
@Child private PromiseHelperNode promiseHelper;
/**
......@@ -65,10 +64,6 @@ public final class AccessArgumentNode extends RNode {
*/
private final int index;
public ReadArgumentNode getReadArgNode() {
return readArgNode;
}
/**
* Used to cache {@link RPromise} evaluations.
*/
......@@ -84,7 +79,6 @@ public final class AccessArgumentNode extends RNode {
private AccessArgumentNode(int index) {
this.index = index;
this.readArgNode = new ReadArgumentNode(index);
}
public static AccessArgumentNode create(int index) {
......@@ -100,7 +94,7 @@ public final class AccessArgumentNode extends RNode {
@Override
public Object execute(VirtualFrame frame) {
return doArgument(frame, readArgNode.execute(frame));
return doArgument(frame, RArguments.getArgument(frame, index));
}
@Override
......
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.truffle.r.nodes.access;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.r.runtime.RArguments;
import com.oracle.truffle.r.runtime.nodes.RNode;
class ReadArgumentNode extends RNode {
private final int index;
protected ReadArgumentNode(int index) {
this.index = index;
}
/**
* for WrapperNode subclass.
*/
protected ReadArgumentNode() {
index = 0;
}
@Override
public Object execute(VirtualFrame frame) {
return RArguments.getArgument(frame, index);
}
public int getIndex() {
return index;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment