# HG changeset patch
# User lagergren
# Date 1376671913 -7200
# Node ID 9476460521b30601257e5f1f22b9a6c0b574ca27
# Parent 8264a018be6f9796807c37bfffa91c9bced740b2
8023017: SUB missing for widest op == number for BinaryNode
Reviewed-by: sundar, jlaskey
diff -r 8264a018be6f -r 9476460521b3 nashorn/src/jdk/nashorn/internal/codegen/ObjectClassGenerator.java
--- a/nashorn/src/jdk/nashorn/internal/codegen/ObjectClassGenerator.java Fri Aug 16 13:42:44 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/ObjectClassGenerator.java Fri Aug 16 18:51:53 2013 +0200
@@ -317,7 +317,8 @@
final String className = getClassName(fieldCount);
final String superName = className(ScriptObject.class);
final ClassEmitter classEmitter = newClassEmitter(className, superName);
- final List initFields = addFields(classEmitter, fieldCount);
+
+ addFields(classEmitter, fieldCount);
final MethodEmitter init = newInitMethod(classEmitter);
init.returnVoid();
diff -r 8264a018be6f -r 9476460521b3 nashorn/src/jdk/nashorn/internal/codegen/ObjectCreator.java
--- a/nashorn/src/jdk/nashorn/internal/codegen/ObjectCreator.java Fri Aug 16 13:42:44 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/codegen/ObjectCreator.java Fri Aug 16 18:51:53 2013 +0200
@@ -45,9 +45,11 @@
/** Code generator */
protected final CodeGenerator codegen;
- private final boolean isScope;
- private final boolean hasArguments;
- protected PropertyMap propertyMap;
+ /** Property map */
+ protected PropertyMap propertyMap;
+
+ private final boolean isScope;
+ private final boolean hasArguments;
/**
* Constructor
diff -r 8264a018be6f -r 9476460521b3 nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java
--- a/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java Fri Aug 16 13:42:44 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/BinaryNode.java Fri Aug 16 18:51:53 2013 +0200
@@ -99,6 +99,7 @@
case DIV:
case MOD:
case MUL:
+ case SUB:
case ASSIGN_DIV:
case ASSIGN_MOD:
case ASSIGN_MUL:
diff -r 8264a018be6f -r 9476460521b3 nashorn/src/jdk/nashorn/internal/ir/BreakableNode.java
--- a/nashorn/src/jdk/nashorn/internal/ir/BreakableNode.java Fri Aug 16 13:42:44 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/BreakableNode.java Fri Aug 16 18:51:53 2013 +0200
@@ -33,6 +33,14 @@
* a {@code break} statement
*/
public interface BreakableNode extends LexicalContextNode {
+ /**
+ * Ensure that any labels in this breakable node are unique so
+ * that new jumps won't go to old parts of the tree. Used for
+ * example for cloning finally blocks
+ *
+ * @param lc the lexical context
+ * @return node after labels have been made unique
+ */
public abstract Node ensureUniqueLabels(final LexicalContext lc);
/**
diff -r 8264a018be6f -r 9476460521b3 nashorn/src/jdk/nashorn/internal/ir/IdentNode.java
--- a/nashorn/src/jdk/nashorn/internal/ir/IdentNode.java Fri Aug 16 13:42:44 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/IdentNode.java Fri Aug 16 18:51:53 2013 +0200
@@ -161,13 +161,13 @@
* converting to object, for example if the symbol is used as the left hand side of an
* assignment such as in the code below.
+ * }
*
* @return true if can have callsite type
*/
diff -r 8264a018be6f -r 9476460521b3 nashorn/src/jdk/nashorn/internal/ir/LexicalContextNode.java
--- a/nashorn/src/jdk/nashorn/internal/ir/LexicalContextNode.java Fri Aug 16 13:42:44 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/ir/LexicalContextNode.java Fri Aug 16 18:51:53 2013 +0200
@@ -44,8 +44,14 @@
Node accept(final LexicalContext lc, final NodeVisitor extends LexicalContext> visitor);
// Would be a default method on Java 8
+ /**
+ * Helper class for accept for items of this lexical context, delegates to the
+ * subclass accept and makes sure that the node is on the context before accepting
+ * and gets popped after accepting (and that the stack is consistent in that the
+ * node has been replaced with the possible new node resulting in visitation)
+ */
static class Acceptor {
- static Node accept(LexicalContextNode node, final NodeVisitor extends LexicalContext> visitor) {
+ static Node accept(final LexicalContextNode node, final NodeVisitor extends LexicalContext> visitor) {
final LexicalContext lc = visitor.getLexicalContext();
lc.push(node);
final LexicalContextNode newNode = (LexicalContextNode)node.accept(lc, visitor);
diff -r 8264a018be6f -r 9476460521b3 nashorn/src/jdk/nashorn/internal/objects/NativeArguments.java
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeArguments.java Fri Aug 16 13:42:44 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeArguments.java Fri Aug 16 18:51:53 2013 +0200
@@ -266,9 +266,8 @@
final ScriptObject proto = global.getObjectPrototype();
if (isStrict) {
return new NativeStrictArguments(arguments, numParams, proto, global.getStrictArgumentsMap());
- } else {
- return new NativeArguments(arguments, callee, numParams, proto, global.getArgumentsMap());
}
+ return new NativeArguments(arguments, callee, numParams, proto, global.getArgumentsMap());
}
/**
diff -r 8264a018be6f -r 9476460521b3 nashorn/src/jdk/nashorn/internal/objects/NativeArray.java
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java Fri Aug 16 13:42:44 2013 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java Fri Aug 16 18:51:53 2013 +0200
@@ -638,9 +638,9 @@
if (isScriptArray || obj instanceof Iterable || (obj != null && obj.getClass().isArray())) {
final Iterator