8193295: Remove no longer used COMMALEFT
authorattila
Sun, 11 Feb 2018 12:41:56 +0100
changeset 48844 09e128cfff3e
parent 48843 21efc1774302
child 48845 b3a833c9c6e9
8193295: Remove no longer used COMMALEFT Reviewed-by: hannesw, mhaupt
src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java
src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/WeighNodes.java
src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BinaryNode.java
src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/visitor/NodeOperatorVisitor.java
src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/TokenType.java
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java	Sat Feb 10 09:23:41 2018 -0800
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/CodeGenerator.java	Sun Feb 11 12:41:56 2018 +0100
@@ -1077,12 +1077,6 @@
             }
 
             @Override
-            public boolean enterCOMMALEFT(final BinaryNode binaryNode) {
-                loadCOMMALEFT(binaryNode, resultBounds);
-                return false;
-            }
-
-            @Override
             public boolean enterCOMMARIGHT(final BinaryNode binaryNode) {
                 loadCOMMARIGHT(binaryNode, resultBounds);
                 return false;
@@ -4247,11 +4241,6 @@
         loadMaybeDiscard(binaryNode, binaryNode.rhs(), resultBounds);
     }
 
-    private void loadCOMMALEFT(final BinaryNode binaryNode, final TypeBounds resultBounds) {
-        loadMaybeDiscard(binaryNode, binaryNode.lhs(), resultBounds);
-        loadAndDiscard(binaryNode.rhs());
-    }
-
     private void loadDIV(final BinaryNode binaryNode, final TypeBounds resultBounds) {
         new BinaryArith() {
             @Override
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/WeighNodes.java	Sat Feb 10 09:23:41 2018 -0800
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/WeighNodes.java	Sun Feb 11 12:41:56 2018 +0100
@@ -455,11 +455,6 @@
     }
 
     @Override
-    public Node leaveCOMMALEFT(final BinaryNode binaryNode) {
-        return binaryNodeWeight(binaryNode);
-    }
-
-    @Override
     public Node leaveCOMMARIGHT(final BinaryNode binaryNode) {
         return binaryNodeWeight(binaryNode);
     }
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BinaryNode.java	Sat Feb 10 09:23:41 2018 -0800
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/BinaryNode.java	Sun Feb 11 12:41:56 2018 +0100
@@ -250,9 +250,6 @@
         case INSTANCEOF: {
             return Type.BOOLEAN;
         }
-        case COMMALEFT: {
-            return lhs.getType();
-        }
         case COMMARIGHT: {
             return rhs.getType();
         }
@@ -378,8 +375,6 @@
     @Override
     public boolean isAlwaysFalse() {
         switch (tokenType()) {
-        case COMMALEFT:
-            return lhs.isAlwaysFalse();
         case COMMARIGHT:
             return rhs.isAlwaysFalse();
         default:
@@ -390,8 +385,6 @@
     @Override
     public boolean isAlwaysTrue() {
         switch (tokenType()) {
-        case COMMALEFT:
-            return lhs.isAlwaysTrue();
         case COMMARIGHT:
             return rhs.isAlwaysTrue();
         default:
@@ -419,9 +412,6 @@
         sb.append(' ');
 
         switch (tokenType) {
-        case COMMALEFT:
-            sb.append(",<");
-            break;
         case COMMARIGHT:
             sb.append(",>");
             break;
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/visitor/NodeOperatorVisitor.java	Sat Feb 10 09:23:41 2018 -0800
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/ir/visitor/NodeOperatorVisitor.java	Sun Feb 11 12:41:56 2018 +0100
@@ -143,8 +143,6 @@
             return enterBIT_XOR(binaryNode);
         case COMMARIGHT:
             return enterCOMMARIGHT(binaryNode);
-        case COMMALEFT:
-            return enterCOMMALEFT(binaryNode);
         case DIV:
             return enterDIV(binaryNode);
         case EQ:
@@ -227,8 +225,6 @@
             return leaveBIT_XOR(binaryNode);
         case COMMARIGHT:
             return leaveCOMMARIGHT(binaryNode);
-        case COMMALEFT:
-            return leaveCOMMALEFT(binaryNode);
         case DIV:
             return leaveDIV(binaryNode);
         case EQ:
@@ -815,28 +811,6 @@
     }
 
     /**
-     * Binary enter - callback for entering comma left operator
-     * (a, b) where the result is a
-     *
-     * @param  binaryNode the node
-     * @return true if traversal should continue and node children be traversed, false otherwise
-     */
-    public boolean enterCOMMALEFT(final BinaryNode binaryNode) {
-        return enterDefault(binaryNode);
-    }
-
-    /**
-     * Binary leave - callback for leaving a comma left operator
-     * (a, b) where the result is a
-     *
-     * @param  binaryNode the node
-     * @return processed node, which will replace the original one, or the original node
-     */
-    public Node leaveCOMMALEFT(final BinaryNode binaryNode) {
-        return leaveDefault(binaryNode);
-    }
-
-    /**
      * Binary enter - callback for entering comma right operator
      * (a, b) where the result is b
      *
--- a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/TokenType.java	Sat Feb 10 09:23:41 2018 -0800
+++ b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/parser/TokenType.java	Sun Feb 11 12:41:56 2018 +0100
@@ -191,7 +191,6 @@
     TEMPLATE_MIDDLE(LITERAL,  null),
     TEMPLATE_TAIL  (LITERAL,  null),
 
-    COMMALEFT      (IR,       null),
     DECPOSTFIX     (IR,       null),
     INCPOSTFIX     (IR,       null),
     SPREAD_ARGUMENT(IR,       null),