Skip to content

Commit

Permalink
Removing useless methods (#9590)
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslavTulach authored Apr 3, 2024
1 parent a83c75f commit dcccad9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,13 @@
import com.oracle.truffle.api.library.ExportMessage;
import com.oracle.truffle.api.nodes.NodeInfo;
import com.oracle.truffle.api.nodes.RootNode;
import com.oracle.truffle.api.nodes.UnexpectedResultException;
import com.oracle.truffle.api.source.SourceSection;
import java.util.UUID;
import org.enso.interpreter.runtime.builtin.Builtins;
import org.enso.interpreter.runtime.callable.function.Function;
import org.enso.interpreter.runtime.data.atom.AtomConstructor;
import org.enso.interpreter.runtime.scope.DebugLocalScope;
import org.enso.interpreter.runtime.tag.AvoidIdInstrumentationTag;
import org.enso.interpreter.runtime.tag.IdentifiedTag;
import org.enso.interpreter.runtime.tag.Patchable;
import org.enso.interpreter.runtime.type.TypesGen;

/**
* A base class for all Enso expressions.
Expand Down Expand Up @@ -110,43 +106,6 @@ public void setId(UUID id) {
this.id = id;
}

/**
* Executes the current node, returning the result as a {@code long}.
*
* @param frame the stack frame for execution
* @return the {@code long} value obtained by executing the node
* @throws UnexpectedResultException if the result cannot be represented as a value of the return
* type
*/
public long executeLong(VirtualFrame frame) throws UnexpectedResultException {
return TypesGen.expectLong(executeGeneric(frame));
}

/**
* Executes the current node, returning the result as an {@link AtomConstructor}.
*
* @param frame the stack frame for execution
* @return the Atom constructor obtained by executing the node
* @throws UnexpectedResultException if the result cannot be represented as a value of the return
* type
*/
public AtomConstructor executeAtomConstructor(VirtualFrame frame)
throws UnexpectedResultException {
return TypesGen.expectAtomConstructor(executeGeneric(frame));
}

/**
* Executes the current node, returning the result as a {@link Function}.
*
* @param frame the stack frame for execution
* @return the function obtained by executing the node
* @throws UnexpectedResultException if the result cannot be represented as a value of the return
* type
*/
public Function executeFunction(VirtualFrame frame) throws UnexpectedResultException {
return TypesGen.expectFunction(executeGeneric(frame));
}

/**
* Executes the current node and returns a result.
*
Expand All @@ -155,15 +114,6 @@ public Function executeFunction(VirtualFrame frame) throws UnexpectedResultExcep
*/
public abstract Object executeGeneric(VirtualFrame frame);

/**
* Executes the current node without returning a result.
*
* @param frame the stack frame for execution
*/
public void executeVoid(VirtualFrame frame) {
executeGeneric(frame);
}

/**
* Marks this node as instrumentable by Truffle Instrumentation APIs.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static BlockNode buildSilent(ExpressionNode[] expressions, ExpressionNode
@ExplodeLoop
public Object executeGeneric(VirtualFrame frame) {
for (ExpressionNode statement : statements) {
statement.executeVoid(frame);
statement.executeGeneric(frame);
}
return returnExpr.executeGeneric(frame);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,6 @@ public static CreateFunctionNode build(RootCallTarget callTarget, ArgumentDefini
return new CreateFunctionNode(callTarget, args);
}

/**
* Generates the provided function definition in the given stack {@code frame}.
*
* @param frame the stack frame for execution
* @return the function defined by this node
*/
@Override
public Function executeFunction(VirtualFrame frame) {
MaterializedFrame scope = frame.materialize();
return new Function(callTarget, scope, this.schema);
}

/**
* Executes the current node.
*
Expand All @@ -59,7 +47,8 @@ public Function executeFunction(VirtualFrame frame) {
*/
@Override
public Object executeGeneric(VirtualFrame frame) {
return executeFunction(frame);
MaterializedFrame scope = frame.materialize();
return new Function(callTarget, scope, this.schema);
}

/**
Expand Down

0 comments on commit dcccad9

Please sign in to comment.