Skip to content

Commit

Permalink
Remove defunct NotNode from AST and consumers.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Feb 7, 2014
1 parent ccefa24 commit 135fa0d
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 143 deletions.
93 changes: 0 additions & 93 deletions core/src/main/java/org/jruby/ast/NotNode.java

This file was deleted.

Expand Up @@ -97,7 +97,6 @@
import org.jruby.ast.NextNode;
import org.jruby.ast.NilNode;
import org.jruby.ast.Node;
import org.jruby.ast.NotNode;
import org.jruby.ast.NthRefNode;
import org.jruby.ast.OpAsgnAndNode;
import org.jruby.ast.OpAsgnNode;
Expand Down Expand Up @@ -486,11 +485,6 @@ public Object visitNilNode(NilNode iVisited) {
return defaultVisit(iVisited);
}

@Override
public Object visitNotNode(NotNode iVisited) {
return defaultVisit(iVisited);
}

@Override
public Object visitNthRefNode(NthRefNode iVisited) {
return defaultVisit(iVisited);
Expand Down
2 changes: 0 additions & 2 deletions core/src/main/java/org/jruby/ast/visitor/NodeVisitor.java
Expand Up @@ -99,7 +99,6 @@
import org.jruby.ast.NewlineNode;
import org.jruby.ast.NextNode;
import org.jruby.ast.NilNode;
import org.jruby.ast.NotNode;
import org.jruby.ast.NthRefNode;
import org.jruby.ast.OpAsgnAndNode;
import org.jruby.ast.OpAsgnNode;
Expand Down Expand Up @@ -215,7 +214,6 @@ public interface NodeVisitor {
public Object visitNewlineNode(NewlineNode iVisited);
public Object visitNextNode(NextNode iVisited);
public Object visitNilNode(NilNode iVisited);
public Object visitNotNode(NotNode iVisited);
public Object visitNthRefNode(NthRefNode iVisited);
public Object visitOpElementAsgnNode(OpElementAsgnNode iVisited);
public Object visitOpAsgnNode(OpAsgnNode iVisited);
Expand Down
13 changes: 0 additions & 13 deletions core/src/main/java/org/jruby/compiler/ASTCompiler.java
Expand Up @@ -257,9 +257,6 @@ public void compile(Node node, BodyCompiler context, boolean expr) {
case NILNODE:
compileNil(node, context, expr);
break;
case NOTNODE:
compileNot(node, context, expr);
break;
case OPASGNANDNODE:
compileOpAsgnAnd(node, context, expr);
break;
Expand Down Expand Up @@ -3106,16 +3103,6 @@ public void compileNil(Node node, BodyCompiler context, boolean expr) {
}
}

public void compileNot(Node node, BodyCompiler context, boolean expr) {
NotNode notNode = (NotNode) node;

compile(notNode.getConditionNode(), context, true);

context.negateCurrentValue();
// TODO: don't require pop
if (!expr) context.consumeCurrentValue();
}

public void compileOpAsgnAnd(Node node, BodyCompiler context, boolean expr) {
final BinaryOperatorNode andNode = (BinaryOperatorNode) node;

Expand Down
3 changes: 0 additions & 3 deletions core/src/main/java/org/jruby/compiler/ASTInspector.java
Expand Up @@ -585,9 +585,6 @@ public void inspect(Node node) {
break;
case NILNODE:
break;
case NOTNODE:
inspect(((NotNode)node).getConditionNode());
break;
case NTHREFNODE:
break;
case OPASGNANDNODE:
Expand Down
16 changes: 0 additions & 16 deletions core/src/main/java/org/jruby/ir/IRBuilder.java
Expand Up @@ -380,7 +380,6 @@ private Operand buildOperand(Node node, IRScope s) throws NotCompilableException
case NEXTNODE: return buildNext((NextNode) node, s);
case NTHREFNODE: return buildNthRef((NthRefNode) node, s);
case NILNODE: return buildNil(node, s);
case NOTNODE: return buildNot((NotNode) node, s);
case OPASGNANDNODE: return buildOpAsgnAnd((OpAsgnAndNode) node, s);
case OPASGNNODE: return buildOpAsgn((OpAsgnNode) node, s);
case OPASGNORNODE: return buildOpAsgnOr((OpAsgnOrNode) node, s);
Expand Down Expand Up @@ -1358,15 +1357,6 @@ public Operand buildVersionSpecificGetDefinitionIR(Node node, IRScope s) {
addInstr(s, new LabelInstr(doneLabel));
return tmpVar;
}
case NOTNODE: {
Operand v = buildGetDefinitionBase(((NotNode)node).getConditionNode(), s);
Label doneLabel = s.getNewLabel();
Variable tmpVar = getValueInTemporaryVariable(s, v);
addInstr(s, BEQInstr.create(tmpVar, manager.getNil(), doneLabel));
addInstr(s, new CopyInstr(tmpVar, new StringLiteral("method")));
addInstr(s, new LabelInstr(doneLabel));
return tmpVar;
}
case NTHREFNODE: {
// SSS FIXME: Is there a reason to do this all with low-level IR?
// Can't this all be folded into a Java method that would be part
Expand Down Expand Up @@ -2836,12 +2826,6 @@ public Operand buildNil(Node node, IRScope s) {
return manager.getNil();
}

public Operand buildNot(NotNode node, IRScope s) {
Variable ret = s.getNewTemporaryVariable();
addInstr(s, new NotInstr(ret, build(node.getConditionNode(), s)));
return ret;
}

public Operand buildOpAsgn(OpAsgnNode opAsgnNode, IRScope s) {
Label l;
Variable readerValue = s.getNewTemporaryVariable();
Expand Down
10 changes: 0 additions & 10 deletions core/src/main/java/org/jruby/truffle/translator/Translator.java
Expand Up @@ -86,7 +86,6 @@ public class Translator implements org.jruby.ast.visitor.NodeVisitor {
nodeDefinedNames.put(org.jruby.ast.HashNode.class, "expression");
nodeDefinedNames.put(org.jruby.ast.SymbolNode.class, "expression");
nodeDefinedNames.put(org.jruby.ast.DotNode.class, "expression");
nodeDefinedNames.put(org.jruby.ast.NotNode.class, "expression");
nodeDefinedNames.put(org.jruby.ast.AndNode.class, "expression");
nodeDefinedNames.put(org.jruby.ast.OrNode.class, "expression");
nodeDefinedNames.put(org.jruby.ast.LocalVarNode.class, "local-variable");
Expand Down Expand Up @@ -1526,15 +1525,6 @@ public Object visitNilNode(org.jruby.ast.NilNode node) {
return new NilNode(context, translate(node.getPosition()));
}

@Override
public Object visitNotNode(org.jruby.ast.NotNode node) {
final SourceSection sourceSection = translate(node.getPosition());

final BooleanCastNode booleanCastNode = BooleanCastNodeFactory.create(context, sourceSection, (RubyNode) node.getConditionNode().accept(this));

return new NotNode(context, sourceSection, booleanCastNode);
}

@Override
public Object visitNthRefNode(org.jruby.ast.NthRefNode node) {
final SourceSection sourceSection = translate(node.getPosition());
Expand Down

0 comments on commit 135fa0d

Please sign in to comment.