8015673: Type for :e symbol is wrong

Fri, 31 May 2013 12:58:02 +0200

author
attila
date
Fri, 31 May 2013 12:58:02 +0200
changeset 313
11b81fa7125a
parent 312
cab639125b98
child 314
b4e6cc05ce09

8015673: Type for :e symbol is wrong
Reviewed-by: jlaskey, lagergren

src/jdk/nashorn/internal/codegen/Attr.java file | annotate | diff | comparison | revisions
src/jdk/nashorn/internal/codegen/CompilerConstants.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/jdk/nashorn/internal/codegen/Attr.java	Fri May 31 12:57:44 2013 +0200
     1.2 +++ b/src/jdk/nashorn/internal/codegen/Attr.java	Fri May 31 12:58:02 2013 +0200
     1.3 @@ -84,13 +84,12 @@
     1.4  import jdk.nashorn.internal.ir.UnaryNode;
     1.5  import jdk.nashorn.internal.ir.VarNode;
     1.6  import jdk.nashorn.internal.ir.WithNode;
     1.7 +import jdk.nashorn.internal.ir.visitor.NodeOperatorVisitor;
     1.8  import jdk.nashorn.internal.ir.visitor.NodeVisitor;
     1.9 -import jdk.nashorn.internal.ir.visitor.NodeOperatorVisitor;
    1.10  import jdk.nashorn.internal.parser.TokenType;
    1.11  import jdk.nashorn.internal.runtime.Context;
    1.12  import jdk.nashorn.internal.runtime.Debug;
    1.13  import jdk.nashorn.internal.runtime.DebugLogger;
    1.14 -import jdk.nashorn.internal.runtime.ECMAException;
    1.15  import jdk.nashorn.internal.runtime.JSType;
    1.16  import jdk.nashorn.internal.runtime.Property;
    1.17  import jdk.nashorn.internal.runtime.PropertyMap;
    1.18 @@ -1323,7 +1322,7 @@
    1.19      @Override
    1.20      public Node leaveForNode(final ForNode forNode) {
    1.21          if (forNode.isForIn()) {
    1.22 -            forNode.setIterator(newInternal(lc.getCurrentFunction().uniqueName(ITERATOR_PREFIX.symbolName()), Type.OBJECT)); //NASHORN-73
    1.23 +            forNode.setIterator(newInternal(lc.getCurrentFunction().uniqueName(ITERATOR_PREFIX.symbolName()), Type.typeFor(ITERATOR_PREFIX.type()))); //NASHORN-73
    1.24              /*
    1.25               * Iterators return objects, so we need to widen the scope of the
    1.26               * init variable if it, for example, has been assigned double type
    1.27 @@ -1500,7 +1499,7 @@
    1.28      }
    1.29  
    1.30      private Symbol exceptionSymbol() {
    1.31 -        return newInternal(lc.getCurrentFunction().uniqueName(EXCEPTION_PREFIX.symbolName()), Type.typeFor(ECMAException.class));
    1.32 +        return newInternal(lc.getCurrentFunction().uniqueName(EXCEPTION_PREFIX.symbolName()), Type.typeFor(EXCEPTION_PREFIX.type()));
    1.33      }
    1.34  
    1.35      /**
     2.1 --- a/src/jdk/nashorn/internal/codegen/CompilerConstants.java	Fri May 31 12:57:44 2013 +0200
     2.2 +++ b/src/jdk/nashorn/internal/codegen/CompilerConstants.java	Fri May 31 12:58:02 2013 +0200
     2.3 @@ -29,6 +29,7 @@
     2.4  
     2.5  import java.lang.invoke.MethodHandle;
     2.6  import java.lang.invoke.MethodHandles;
     2.7 +import java.util.Iterator;
     2.8  import jdk.nashorn.internal.codegen.types.Type;
     2.9  import jdk.nashorn.internal.runtime.ScriptFunction;
    2.10  import jdk.nashorn.internal.runtime.ScriptObject;
    2.11 @@ -105,13 +106,13 @@
    2.12      ARGUMENTS("arguments", Object.class, 2),
    2.13  
    2.14      /** prefix for iterators for for (x in ...) */
    2.15 -    ITERATOR_PREFIX(":i"),
    2.16 +    ITERATOR_PREFIX(":i", Iterator.class),
    2.17  
    2.18      /** prefix for tag variable used for switch evaluation */
    2.19      SWITCH_TAG_PREFIX(":s"),
    2.20  
    2.21      /** prefix for all exceptions */
    2.22 -    EXCEPTION_PREFIX(":e"),
    2.23 +    EXCEPTION_PREFIX(":e", Throwable.class),
    2.24  
    2.25      /** prefix for quick slots generated in Store */
    2.26      QUICK_PREFIX(":q"),

mercurial