8040655: When processing a RewriteException debug object, the return value has already been reset to null. We need to catch this value before that.
authorlagergren
Fri, 18 Apr 2014 21:24:34 +0200
changeset 24742 a9afb384e654
parent 24741 4232289c3235
child 24743 138ee369abd8
8040655: When processing a RewriteException debug object, the return value has already been reset to null. We need to catch this value before that. Reviewed-by: attila, lagergren Contributed-by: matherey.nunez@oracle.com
nashorn/src/jdk/nashorn/internal/objects/NativeArray.java
nashorn/src/jdk/nashorn/internal/objects/NativeDebug.java
nashorn/src/jdk/nashorn/internal/runtime/CompiledFunction.java
nashorn/src/jdk/nashorn/internal/runtime/Context.java
nashorn/src/jdk/nashorn/internal/runtime/DebugLogger.java
nashorn/src/jdk/nashorn/internal/runtime/Property.java
nashorn/src/jdk/nashorn/internal/runtime/RewriteException.java
nashorn/src/jdk/nashorn/internal/runtime/RuntimeEvent.java
nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java
nashorn/src/jdk/nashorn/internal/runtime/events/RecompilationEvent.java
nashorn/src/jdk/nashorn/internal/runtime/events/RuntimeEvent.java
nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterClassLoader.java
nashorn/test/script/basic/arraysIntKey.js
nashorn/test/script/basic/arraysIntKey.js.EXPECTED
nashorn/test/script/basic/arrays_int_key.js
nashorn/test/script/basic/arrays_int_key.js.EXPECTED
nashorn/test/script/basic/relinkIndexGetter.js
nashorn/test/script/basic/relinkIndexGetter.js.EXPECTED
nashorn/test/script/basic/relink_index_getter.js
nashorn/test/script/basic/relink_index_getter.js.EXPECTED
nashorn/test/script/trusted/event_queue.js
nashorn/test/script/trusted/event_queue.js.EXPECTED
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java	Fri Apr 18 20:12:21 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeArray.java	Fri Apr 18 21:24:34 2014 +0200
@@ -712,7 +712,6 @@
         return new NativeArray(list.toArray());
     }
 
-    @SuppressWarnings("null")
     private static void concatToList(final ArrayList<Object> list, final Object obj) {
         final boolean isScriptArray = isArray(obj);
         final boolean isScriptObject = isScriptArray || obj instanceof ScriptObject;
--- a/nashorn/src/jdk/nashorn/internal/objects/NativeDebug.java	Fri Apr 18 20:12:21 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/objects/NativeDebug.java	Fri Apr 18 21:24:34 2014 +0200
@@ -39,9 +39,9 @@
 import jdk.nashorn.internal.runtime.JSType;
 import jdk.nashorn.internal.runtime.PropertyListeners;
 import jdk.nashorn.internal.runtime.PropertyMap;
-import jdk.nashorn.internal.runtime.RuntimeEvent;
 import jdk.nashorn.internal.runtime.ScriptFunction;
 import jdk.nashorn.internal.runtime.ScriptObject;
+import jdk.nashorn.internal.runtime.events.RuntimeEvent;
 import jdk.nashorn.internal.runtime.linker.LinkerCallSite;
 
 /**
--- a/nashorn/src/jdk/nashorn/internal/runtime/CompiledFunction.java	Fri Apr 18 20:12:21 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/CompiledFunction.java	Fri Apr 18 21:24:34 2014 +0200
@@ -41,6 +41,7 @@
 import jdk.nashorn.internal.codegen.types.ArrayType;
 import jdk.nashorn.internal.codegen.types.Type;
 import jdk.nashorn.internal.ir.FunctionNode;
+import jdk.nashorn.internal.runtime.events.RecompilationEvent;
 import jdk.nashorn.internal.runtime.linker.Bootstrap;
 
 /**
@@ -576,7 +577,7 @@
 
         final FunctionNode fn = oldOptimismInfo.recompile(callSiteType, re);
         if (LOG.isEnabled()) {
-            LOG.info(new RuntimeEvent<>(Level.INFO, re), "\tRewriteException ", re.getMessageShort());
+            LOG.info(new RecompilationEvent(Level.INFO, re, re.getReturnValueNonDestructive()), "\tRewriteException ", re.getMessageShort());
         }
 
         // It didn't necessarily recompile, e.g. for an outer invocation of a recursive function if we already
--- a/nashorn/src/jdk/nashorn/internal/runtime/Context.java	Fri Apr 18 20:12:21 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/Context.java	Fri Apr 18 21:24:34 2014 +0200
@@ -64,6 +64,7 @@
 import jdk.nashorn.internal.ir.debug.PrintVisitor;
 import jdk.nashorn.internal.objects.Global;
 import jdk.nashorn.internal.parser.Parser;
+import jdk.nashorn.internal.runtime.events.RuntimeEvent;
 import jdk.nashorn.internal.runtime.options.Options;
 
 /**
--- a/nashorn/src/jdk/nashorn/internal/runtime/DebugLogger.java	Fri Apr 18 20:12:21 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/DebugLogger.java	Fri Apr 18 21:24:34 2014 +0200
@@ -30,7 +30,7 @@
 import java.util.logging.Logger;
 
 import jdk.nashorn.internal.objects.Global;
-import jdk.nashorn.internal.runtime.RuntimeEvent;
+import jdk.nashorn.internal.runtime.events.RuntimeEvent;
 import jdk.nashorn.internal.runtime.options.Options;
 
 /**
--- a/nashorn/src/jdk/nashorn/internal/runtime/Property.java	Fri Apr 18 20:12:21 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/Property.java	Fri Apr 18 21:24:34 2014 +0200
@@ -100,6 +100,7 @@
     /** Property field number or spill slot. */
     private final int slot;
 
+    /** SwitchPoint that is invalidated when property is changed, optional */
     protected SwitchPoint changeCallback;
 
     /**
@@ -173,6 +174,12 @@
         return propFlags;
     }
 
+    /**
+     * Set the change callback for this property, i.e. a SwitchPoint
+     * that will be invalidated when the value of the property is
+     * changed
+     * @param sp SwitchPoint to use for change callback
+     */
     public final void setChangeCallback(final SwitchPoint sp) {
         this.changeCallback = sp;
     }
--- a/nashorn/src/jdk/nashorn/internal/runtime/RewriteException.java	Fri Apr 18 20:12:21 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/RewriteException.java	Fri Apr 18 21:24:34 2014 +0200
@@ -167,7 +167,7 @@
         return getUOE().getReturnValueDestructive();
     }
 
-    private Object getReturnValueNonDestructive() {
+    Object getReturnValueNonDestructive() {
         return getUOE().getReturnValueNonDestructive();
     }
 
--- a/nashorn/src/jdk/nashorn/internal/runtime/RuntimeEvent.java	Fri Apr 18 20:12:21 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.nashorn.internal.runtime;
-
-import java.util.logging.Level;
-
-import jdk.nashorn.internal.objects.NativeDebug;
-import jdk.nashorn.internal.runtime.options.Options;
-
-/**
- * Class for representing a runtime event, giving less global dependencies than logger.
- * Every {@link NativeDebug} object keeps a queue of RuntimeEvents that can be explored
- * through the debug API.
- *
- * @param <T> class of the value this event wraps
- */
-public class RuntimeEvent<T> {
-    /** Queue size for the runtime event buffer */
-    public static final int RUNTIME_EVENT_QUEUE_SIZE = Options.getIntProperty("nashorn.runtime.event.queue.size", 1024);
-
-    private final Level level;
-    private final T value;
-
-    /**
-     * Constructor
-     * @param level  log level for runtime event to create
-     * @param object object to wrap
-     */
-    public RuntimeEvent(final Level level, final T object) {
-        this.level = level;
-        this.value = object;
-    }
-
-    /**
-     * Return the value wrapped in this runtime event
-     * @return value
-     */
-    public T getValue() {
-        return value;
-    }
-
-    @Override
-    public String toString() {
-        final StringBuilder sb = new StringBuilder();
-
-        sb.append('[').
-            append(level).
-            append("] ").
-            append(value == null ? "null" : getValueClass().getSimpleName()).
-            append(" value=").
-            append(value);
-
-        return sb.toString();
-    }
-
-    /**
-     * Descriptor for this runtime event, must be overridden and
-     * implemented, e.g. "RewriteException"
-     * @return event name
-     */
-    public final Class<?> getValueClass() {
-        return value.getClass();
-    }
-}
--- a/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java	Fri Apr 18 20:12:21 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/ScriptObject.java	Fri Apr 18 21:24:34 2014 +0200
@@ -2246,7 +2246,6 @@
      * @param request the link request
      * @return GuardedInvocation to be invoked at call site.
      */
-    @SuppressWarnings("null")
     public GuardedInvocation noSuchProperty(final CallSiteDescriptor desc, final LinkRequest request) {
         final String       name        = desc.getNameToken(CallSiteDescriptor.NAME_OPERAND);
         final FindProperty find        = findProperty(NO_SUCH_PROPERTY_NAME, true);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/runtime/events/RecompilationEvent.java	Fri Apr 18 21:24:34 2014 +0200
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.runtime.events;
+
+import java.util.logging.Level;
+
+import jdk.nashorn.internal.runtime.RecompilableScriptFunctionData;
+import jdk.nashorn.internal.runtime.RewriteException;
+
+/**
+ * Subclass of runtime event for {@link RewriteException}. In order not
+ * to leak memory, RewriteExceptions get their return value destroyed
+ * and nulled out during recompilation. If we are running with event
+ * logging enabled, we need to retain the returnValue, hence the extra
+ * field
+ */
+public final class RecompilationEvent extends RuntimeEvent<RewriteException> {
+
+    private final Object returnValue;
+
+    /**
+     * Constructor
+     *
+     * @param level            logging level
+     * @param rewriteException rewriteException wrapped by this RuntimEvent
+     * @param returnValue      rewriteException return value - as we don't want to make
+     *     {@link RewriteException#getReturnValueNonDestructive()} public, we pass it as
+     *     an extra parameter, rather than querying the getter from another package.
+     */
+    public RecompilationEvent(final Level level, final RewriteException rewriteException, final Object returnValue) {
+        super(level, rewriteException);
+        assert RecompilableScriptFunctionData.getLogger().isEnabled() :
+            "Unit test/instrumentation purpose only: RecompilationEvent instances should not be created without '--log=recompile', or we will leak memory in the general case";
+        this.returnValue = returnValue;
+    }
+
+    /**
+     * Get the preserved return value for the RewriteException
+     * @return return value
+     */
+    public Object getReturnValue() {
+        return returnValue;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/src/jdk/nashorn/internal/runtime/events/RuntimeEvent.java	Fri Apr 18 21:24:34 2014 +0200
@@ -0,0 +1,88 @@
+/*
+ * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+package jdk.nashorn.internal.runtime.events;
+
+import java.util.logging.Level;
+
+import jdk.nashorn.internal.objects.NativeDebug;
+import jdk.nashorn.internal.runtime.options.Options;
+
+/**
+ * Class for representing a runtime event, giving less global dependencies than logger.
+ * Every {@link NativeDebug} object keeps a queue of RuntimeEvents that can be explored
+ * through the debug API.
+ *
+ * @param <T> class of the value this event wraps
+ */
+public class RuntimeEvent<T> {
+    /** Queue size for the runtime event buffer */
+    public static final int RUNTIME_EVENT_QUEUE_SIZE = Options.getIntProperty("nashorn.runtime.event.queue.size", 1024);
+
+    private final Level level;
+    private final T value;
+
+    /**
+     * Constructor
+     *
+     * @param level  log level for runtime event to create
+     * @param object object to wrap
+     */
+    public RuntimeEvent(final Level level, final T object) {
+        this.level = level;
+        this.value = object;
+    }
+
+    /**
+     * Return the value wrapped in this runtime event
+     * @return value
+     */
+    public final T getValue() {
+        return value;
+    }
+
+    @Override
+    public String toString() {
+        final StringBuilder sb = new StringBuilder();
+
+        sb.append('[').
+            append(level).
+            append("] ").
+            append(value == null ? "null" : getValueClass().getSimpleName()).
+            append(" value=").
+            append(value);
+
+        return sb.toString();
+    }
+
+    /**
+     * Descriptor for this runtime event, must be overridden and
+     * implemented, e.g. "RewriteException"
+     * @return event name
+     */
+    public final Class<?> getValueClass() {
+        return value.getClass();
+    }
+}
--- a/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterClassLoader.java	Fri Apr 18 20:12:21 2014 +0200
+++ b/nashorn/src/jdk/nashorn/internal/runtime/linker/JavaAdapterClassLoader.java	Fri Apr 18 21:24:34 2014 +0200
@@ -39,14 +39,13 @@
  * "class loader", it does not, in fact, extend {@code ClassLoader}, but rather uses them internally. Instances of this
  * class are normally created by {@link JavaAdapterBytecodeGenerator}.
  */
-@SuppressWarnings("javadoc")
 final class JavaAdapterClassLoader {
     private static final AccessControlContext CREATE_LOADER_ACC_CTXT = ClassAndLoader.createPermAccCtxt("createClassLoader");
 
     private final String className;
     private final byte[] classBytes;
 
-    JavaAdapterClassLoader(String className, byte[] classBytes) {
+    JavaAdapterClassLoader(final String className, final byte[] classBytes) {
         this.className = className.replace('/', '.');
         this.classBytes = classBytes;
     }
--- a/nashorn/test/script/basic/arraysIntKey.js	Fri Apr 18 20:12:21 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- * 
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- * 
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- * 
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * Checks that we override array entries with defineProperty.
- *
- * @test
- * @run
- */
- 
-var o = [0];
-Object.defineProperty(o, "0", { get: function() { return "zero"; }, set: function(v) { print(v); }, configurable: true });
-
-print(o[0]);
-o[0] = "one";
--- a/nashorn/test/script/basic/arraysIntKey.js.EXPECTED	Fri Apr 18 20:12:21 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-zero
-one
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/arrays_int_key.js	Fri Apr 18 21:24:34 2014 +0200
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * Checks that we override array entries with defineProperty.
+ *
+ * @test
+ * @run
+ */
+ 
+var o = [0];
+Object.defineProperty(o, "0", { get: function() { return "zero"; }, set: function(v) { print(v); }, configurable: true });
+
+print(o[0]);
+o[0] = "one";
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/arrays_int_key.js.EXPECTED	Fri Apr 18 21:24:34 2014 +0200
@@ -0,0 +1,2 @@
+zero
+one
--- a/nashorn/test/script/basic/relinkIndexGetter.js	Fri Apr 18 20:12:21 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- * 
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- * 
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- * 
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- * 
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-/**
- * relinkIndexGetter: after call site was linked for array, make sure it
- * gets correctly relinked for boolean.
- *
- * @test
- * @run
- */
-
-var x = [[], false]
-for(var i in x) { print(x[i][0]) }
--- a/nashorn/test/script/basic/relinkIndexGetter.js.EXPECTED	Fri Apr 18 20:12:21 2014 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,2 +0,0 @@
-undefined
-undefined
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/relink_index_getter.js	Fri Apr 18 21:24:34 2014 +0200
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ * 
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ * 
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ * 
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ * 
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+
+/**
+ * relink_index_getter: after call site was linked for array, make sure it
+ * gets correctly relinked for boolean.
+ *
+ * @test
+ * @run
+ */
+
+var x = [[], false]
+for(var i in x) { print(x[i][0]) }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nashorn/test/script/basic/relink_index_getter.js.EXPECTED	Fri Apr 18 21:24:34 2014 +0200
@@ -0,0 +1,2 @@
+undefined
+undefined
--- a/nashorn/test/script/trusted/event_queue.js	Fri Apr 18 20:12:21 2014 +0200
+++ b/nashorn/test/script/trusted/event_queue.js	Fri Apr 18 21:24:34 2014 +0200
@@ -35,7 +35,7 @@
 print();
 
 var forName       = java.lang.Class["forName(String)"];
-var RuntimeEvent  = forName("jdk.nashorn.internal.runtime.RuntimeEvent").static;
+var RuntimeEvent  = forName("jdk.nashorn.internal.runtime.events.RuntimeEvent").static;
 var getValue      = RuntimeEvent.class.getMethod("getValue"); 
 var getValueClass = RuntimeEvent.class.getMethod("getValueClass"); 
 
--- a/nashorn/test/script/trusted/event_queue.js.EXPECTED	Fri Apr 18 20:12:21 2014 +0200
+++ b/nashorn/test/script/trusted/event_queue.js.EXPECTED	Fri Apr 18 21:24:34 2014 +0200
@@ -1,6 +1,6 @@
 [object Debug]
 
-[JavaClass jdk.nashorn.internal.runtime.RuntimeEvent]
+[JavaClass jdk.nashorn.internal.runtime.events.RuntimeEvent]
 [JavaClass jdk.nashorn.internal.runtime.RewriteException]
 
 4.840000000000001
@@ -10,24 +10,24 @@
 events = true
 events.length = 2
 event #0
-	event class=class jdk.nashorn.internal.runtime.RuntimeEvent
+	event class=class jdk.nashorn.internal.runtime.events.RecompilationEvent
 	valueClass in event=class jdk.nashorn.internal.runtime.RewriteException
 	class of value=class jdk.nashorn.internal.runtime.RewriteException
 	return type=double
 event #1
-	event class=class jdk.nashorn.internal.runtime.RuntimeEvent
+	event class=class jdk.nashorn.internal.runtime.events.RecompilationEvent
 	valueClass in event=class jdk.nashorn.internal.runtime.RewriteException
 	class of value=class jdk.nashorn.internal.runtime.RewriteException
 	return type=double
 
-in loop last class = class jdk.nashorn.internal.runtime.RuntimeEvent
+in loop last class = class jdk.nashorn.internal.runtime.events.RecompilationEvent
 in loop last value class = class jdk.nashorn.internal.runtime.RewriteException
 in loop rex class = class jdk.nashorn.internal.runtime.RewriteException
 in loop rex return type = double
 
 true
 
-last class = class jdk.nashorn.internal.runtime.RuntimeEvent
+last class = class jdk.nashorn.internal.runtime.events.RecompilationEvent
 last value class = class jdk.nashorn.internal.runtime.RewriteException
 rex class = class jdk.nashorn.internal.runtime.RewriteException
 rex return type = object