changeset 649:b5b4c98b072b

Merge
author sundar
date Fri, 18 Oct 2013 18:26:13 +0530
parents 676cd7bf5e09 66d27c77b455
children 612886fe324d
files
diffstat 18 files changed, 515 insertions(+), 56 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk/nashorn/internal/objects/Global.java	Thu Oct 17 16:19:45 2013 -0700
+++ b/src/jdk/nashorn/internal/objects/Global.java	Fri Oct 18 18:26:13 2013 +0530
@@ -1665,9 +1665,9 @@
         final ScriptObject stringPrototype = getStringPrototype();
         stringPrototype.addOwnProperty("length", Attribute.NON_ENUMERABLE_CONSTANT, 0.0);
 
-        // add Array.prototype.length
+        // set isArray flag on Array.prototype
         final ScriptObject arrayPrototype = getArrayPrototype();
-        arrayPrototype.addOwnProperty("length", Attribute.NOT_ENUMERABLE|Attribute.NOT_CONFIGURABLE, 0.0);
+        arrayPrototype.setIsArray();
 
         this.DEFAULT_DATE = new NativeDate(Double.NaN, this);
 
--- a/src/jdk/nashorn/internal/objects/NativeArray.java	Thu Oct 17 16:19:45 2013 -0700
+++ b/src/jdk/nashorn/internal/objects/NativeArray.java	Fri Oct 18 18:26:13 2013 +0530
@@ -372,9 +372,7 @@
      */
     @Function(attributes = Attribute.NOT_ENUMERABLE, where = Where.CONSTRUCTOR)
     public static Object isArray(final Object self, final Object arg) {
-        return isArray(arg) || (arg == Global.instance().getArrayPrototype())
-                || (arg instanceof NativeRegExpExecResult)
-                || (arg instanceof JSObject && ((JSObject)arg).isArray());
+        return isArray(arg) || (arg instanceof JSObject && ((JSObject)arg).isArray());
     }
 
     /**
@@ -403,6 +401,26 @@
         }
     }
 
+    /**
+     * Prototype length getter
+     * @param self self reference
+     * @return the length of the object
+     */
+    @Getter(name = "length", where = Where.PROTOTYPE, attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_CONFIGURABLE)
+    public static Object getProtoLength(final Object self) {
+        return length(self);  // Same as instance getter but we can't make nasgen use the same method for prototype
+    }
+
+    /**
+     * Prototype length setter
+     * @param self   self reference
+     * @param length new length property
+     */
+    @Setter(name = "length", where = Where.PROTOTYPE, attributes = Attribute.NOT_ENUMERABLE | Attribute.NOT_CONFIGURABLE)
+    public static void setProtoLength(final Object self, final Object length) {
+        length(self, length);  // Same as instance setter but we can't make nasgen use the same method for prototype
+    }
+
     static long validLength(final Object length, final boolean reject) {
         final double doubleLength = JSType.toNumber(length);
         if (!Double.isNaN(doubleLength) && JSType.isRepresentableAsLong(doubleLength)) {
@@ -1007,19 +1025,42 @@
         final long actualStart = relativeStart < 0 ? Math.max(len + relativeStart, 0) : Math.min(relativeStart, len);
         final long actualDeleteCount = Math.min(Math.max(JSType.toLong(deleteCount), 0), len - actualStart);
 
-        final NativeArray array = new NativeArray(actualDeleteCount);
+        NativeArray returnValue;
 
-        for (long k = 0; k < actualDeleteCount; k++) {
-            final long from = actualStart + k;
+        if (actualStart <= Integer.MAX_VALUE && actualDeleteCount <= Integer.MAX_VALUE && bulkable(sobj)) {
+            try {
+                returnValue =  new NativeArray(sobj.getArray().fastSplice((int)actualStart, (int)actualDeleteCount, items.length));
+
+                // Since this is a dense bulkable array we can use faster defineOwnProperty to copy new elements
+                int k = (int) actualStart;
+                for (int i = 0; i < items.length; i++, k++) {
+                    sobj.defineOwnProperty(k, items[i]);
+                }
+            } catch (UnsupportedOperationException uoe) {
+                returnValue = slowSplice(sobj, actualStart, actualDeleteCount, items, len);
+            }
+        } else {
+            returnValue = slowSplice(sobj, actualStart, actualDeleteCount, items, len);
+        }
+
+        return returnValue;
+    }
+
+    private static NativeArray slowSplice(final ScriptObject sobj, final long start, final long deleteCount, final Object[] items, final long len) {
+
+        final NativeArray array = new NativeArray(deleteCount);
+
+        for (long k = 0; k < deleteCount; k++) {
+            final long from = start + k;
 
             if (sobj.has(from)) {
                 array.defineOwnProperty(ArrayIndex.getArrayIndex(k), sobj.get(from));
             }
         }
 
-        if (items.length < actualDeleteCount) {
-            for (long k = actualStart; k < (len - actualDeleteCount); k++) {
-                final long from = k + actualDeleteCount;
+        if (items.length < deleteCount) {
+            for (long k = start; k < (len - deleteCount); k++) {
+                final long from = k + deleteCount;
                 final long to   = k + items.length;
 
                 if (sobj.has(from)) {
@@ -1029,12 +1070,12 @@
                 }
             }
 
-            for (long k = len; k > (len - actualDeleteCount + items.length); k--) {
+            for (long k = len; k > (len - deleteCount + items.length); k--) {
                 sobj.delete(k - 1, true);
             }
-        } else if (items.length > actualDeleteCount) {
-            for (long k = len - actualDeleteCount; k > actualStart; k--) {
-                final long from = k + actualDeleteCount - 1;
+        } else if (items.length > deleteCount) {
+            for (long k = len - deleteCount; k > start; k--) {
+                final long from = k + deleteCount - 1;
                 final long to   = k + items.length - 1;
 
                 if (sobj.has(from)) {
@@ -1046,12 +1087,12 @@
             }
         }
 
-        long k = actualStart;
+        long k = start;
         for (int i = 0; i < items.length; i++, k++) {
             sobj.set(k, items[i], true);
         }
 
-        final long newLength = len - actualDeleteCount + items.length;
+        final long newLength = len - deleteCount + items.length;
         sobj.set("length", newLength, true);
 
         return array;
--- a/src/jdk/nashorn/internal/objects/NativeJSAdapter.java	Thu Oct 17 16:19:45 2013 -0700
+++ b/src/jdk/nashorn/internal/objects/NativeJSAdapter.java	Fri Oct 18 18:26:13 2013 +0530
@@ -629,7 +629,8 @@
                     // to name. Probably not a big deal, but if we can ever make it leaner, it'd be nice.
                     return new GuardedInvocation(MH.dropArguments(MH.constant(Object.class,
                             func.makeBoundFunction(this, new Object[] { name })), 0, Object.class),
-                            adaptee.getMap().getProtoGetSwitchPoint(adaptee.getProto(), __call__), testJSAdaptor(adaptee, null, null, null));
+                            adaptee.getMap().getProtoGetSwitchPoint(adaptee.getProto(), __call__),
+                            testJSAdaptor(adaptee, null, null, null));
                 }
             }
             throw typeError("no.such.function", desc.getNameToken(2), ScriptRuntime.safeToString(this));
--- a/src/jdk/nashorn/internal/parser/Lexer.java	Thu Oct 17 16:19:45 2013 -0700
+++ b/src/jdk/nashorn/internal/parser/Lexer.java	Fri Oct 18 18:26:13 2013 +0530
@@ -47,7 +47,6 @@
 import jdk.nashorn.internal.runtime.ECMAErrors;
 import jdk.nashorn.internal.runtime.ErrorManager;
 import jdk.nashorn.internal.runtime.JSErrorType;
-import jdk.nashorn.internal.runtime.JSType;
 import jdk.nashorn.internal.runtime.ParserException;
 import jdk.nashorn.internal.runtime.Source;
 import jdk.nashorn.internal.runtime.options.Options;
@@ -1054,16 +1053,6 @@
     }
 
     /**
-     * Convert string to number.
-     *
-     * @param valueString String to convert.
-     * @return Converted number.
-     */
-    private static Number valueOf(final String valueString) throws NumberFormatException {
-        return JSType.narrowestIntegerRepresentation(Double.valueOf(valueString));
-    }
-
-    /**
      * Scan a number.
      */
     protected void scanNumber() {
@@ -1623,7 +1612,7 @@
         case HEXADECIMAL:
             return Lexer.valueOf(source.getString(start + 2, len - 2), 16); // number
         case FLOATING:
-            return Lexer.valueOf(source.getString(start, len)); // number
+            return Double.valueOf(source.getString(start, len)); // number
         case STRING:
             return source.getString(start, len); // String
         case ESCSTRING:
--- a/src/jdk/nashorn/internal/runtime/JSType.java	Thu Oct 17 16:19:45 2013 -0700
+++ b/src/jdk/nashorn/internal/runtime/JSType.java	Fri Oct 18 18:26:13 2013 +0530
@@ -210,26 +210,6 @@
     }
 
     /**
-     * Get the smallest integer representation of a number. Returns an Integer
-     * for something that is int representable, and Long for something that
-     * is long representable. If the number needs to be a double, this is an
-     * identity function
-     *
-     * @param number number to check
-     *
-     * @return Number instanceof the narrowest possible integer representation for number
-     */
-    public static Number narrowestIntegerRepresentation(final double number) {
-        if (isRepresentableAsInt(number)) {
-            return (int)number;
-        } else if (isRepresentableAsLong(number)) {
-            return (long)number;
-        } else {
-            return number;
-        }
-    }
-
-    /**
      * Check whether an object is primitive
      *
      * @param obj an object
--- a/src/jdk/nashorn/internal/runtime/ScriptObject.java	Thu Oct 17 16:19:45 2013 -0700
+++ b/src/jdk/nashorn/internal/runtime/ScriptObject.java	Fri Oct 18 18:26:13 2013 +0530
@@ -594,7 +594,7 @@
      * @param index key for property
      * @param value value to define
      */
-    protected final void defineOwnProperty(final int index, final Object value) {
+    public final void defineOwnProperty(final int index, final Object value) {
         assert isValidArrayIndex(index) : "invalid array index";
         final long longIndex = ArrayIndex.toLongIndex(index);
         if (longIndex >= getArray().length()) {
--- a/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java	Thu Oct 17 16:19:45 2013 -0700
+++ b/src/jdk/nashorn/internal/runtime/arrays/ArrayData.java	Fri Oct 18 18:26:13 2013 +0530
@@ -461,7 +461,23 @@
      */
     public abstract ArrayData slice(long from, long to);
 
-    private static Class<?> widestType(final Object... items) {
+    /**
+     * Fast splice operation. This just modifies the array according to the number of
+     * elements added and deleted but does not insert the added elements. Throws
+     * {@code UnsupportedOperationException} if fast splice operation is not supported
+     * for this class or arguments.
+     *
+     * @param start start index of splice operation
+     * @param removed number of removed elements
+     * @param added number of added elements
+     * @throws UnsupportedOperationException if fast splice is not supported for the class or arguments.
+     */
+    public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
+        throw new UnsupportedOperationException();
+    }
+
+
+    static Class<?> widestType(final Object... items) {
         assert items.length > 0;
 
         Class<?> widest = Integer.class;
--- a/src/jdk/nashorn/internal/runtime/arrays/IntArrayData.java	Thu Oct 17 16:19:45 2013 -0700
+++ b/src/jdk/nashorn/internal/runtime/arrays/IntArrayData.java	Fri Oct 18 18:26:13 2013 +0530
@@ -269,4 +269,32 @@
 
         return new IntArrayData(Arrays.copyOfRange(array, (int)from, (int)to), (int)newLength);
     }
+
+    @Override
+    public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
+        final long oldLength = length();
+        final long newLength = oldLength - removed + added;
+        if (newLength > SparseArrayData.MAX_DENSE_LENGTH && newLength > array.length) {
+            throw new UnsupportedOperationException();
+        }
+        final ArrayData returnValue = (removed == 0) ?
+                EMPTY_ARRAY : new IntArrayData(Arrays.copyOfRange(array, start, start + removed), removed);
+
+        if (newLength != oldLength) {
+            final int[] newArray;
+
+            if (newLength > array.length) {
+                newArray = new int[ArrayData.nextSize((int)newLength)];
+                System.arraycopy(array, 0, newArray, 0, start);
+            } else {
+                newArray = array;
+            }
+
+            System.arraycopy(array, start + removed, newArray, start + added, (int)(oldLength - start - removed));
+            array = newArray;
+            setLength(newLength);
+        }
+
+        return returnValue;
+    }
 }
--- a/src/jdk/nashorn/internal/runtime/arrays/LongArrayData.java	Thu Oct 17 16:19:45 2013 -0700
+++ b/src/jdk/nashorn/internal/runtime/arrays/LongArrayData.java	Fri Oct 18 18:26:13 2013 +0530
@@ -92,7 +92,7 @@
 
     @Override
     public ArrayData convert(final Class<?> type) {
-        if (type == Long.class) {
+        if (type == Integer.class || type == Long.class) {
             return this;
         }
         final int length = (int) length();
@@ -238,4 +238,32 @@
         final long newLength = to - start;
         return new LongArrayData(Arrays.copyOfRange(array, (int)from, (int)to), (int)newLength);
     }
+
+    @Override
+    public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
+        final long oldLength = length();
+        final long newLength = oldLength - removed + added;
+        if (newLength > SparseArrayData.MAX_DENSE_LENGTH && newLength > array.length) {
+            throw new UnsupportedOperationException();
+        }
+        final ArrayData returnValue = (removed == 0) ?
+                EMPTY_ARRAY : new LongArrayData(Arrays.copyOfRange(array, start, start + removed), removed);
+
+        if (newLength != oldLength) {
+            final long[] newArray;
+
+            if (newLength > array.length) {
+                newArray = new long[ArrayData.nextSize((int)newLength)];
+                System.arraycopy(array, 0, newArray, 0, start);
+            } else {
+                newArray = array;
+            }
+
+            System.arraycopy(array, start + removed, newArray, start + added, (int)(oldLength - start - removed));
+            array = newArray;
+            setLength(newLength);
+        }
+
+        return returnValue;
+    }
 }
--- a/src/jdk/nashorn/internal/runtime/arrays/NumberArrayData.java	Thu Oct 17 16:19:45 2013 -0700
+++ b/src/jdk/nashorn/internal/runtime/arrays/NumberArrayData.java	Fri Oct 18 18:26:13 2013 +0530
@@ -218,4 +218,32 @@
         final long newLength = to - start;
         return new NumberArrayData(Arrays.copyOfRange(array, (int)from, (int)to), (int)newLength);
     }
+
+    @Override
+    public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
+        final long oldLength = length();
+        final long newLength = oldLength - removed + added;
+        if (newLength > SparseArrayData.MAX_DENSE_LENGTH && newLength > array.length) {
+            throw new UnsupportedOperationException();
+        }
+        final ArrayData returnValue = (removed == 0) ?
+                EMPTY_ARRAY : new NumberArrayData(Arrays.copyOfRange(array, start, start + removed), removed);
+
+        if (newLength != oldLength) {
+            final double[] newArray;
+
+            if (newLength > array.length) {
+                newArray = new double[ArrayData.nextSize((int)newLength)];
+                System.arraycopy(array, 0, newArray, 0, start);
+            } else {
+                newArray = array;
+            }
+
+            System.arraycopy(array, start + removed, newArray, start + added, (int)(oldLength - start - removed));
+            array = newArray;
+            setLength(newLength);
+        }
+
+        return returnValue;
+    }
 }
--- a/src/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java	Thu Oct 17 16:19:45 2013 -0700
+++ b/src/jdk/nashorn/internal/runtime/arrays/ObjectArrayData.java	Fri Oct 18 18:26:13 2013 +0530
@@ -206,4 +206,32 @@
         final long newLength = to - start;
         return new ObjectArrayData(Arrays.copyOfRange(array, (int)from, (int)to), (int)newLength);
     }
+
+    @Override
+    public ArrayData fastSplice(final int start, final int removed, final int added) throws UnsupportedOperationException {
+        final long oldLength = length();
+        final long newLength = oldLength - removed + added;
+        if (newLength > SparseArrayData.MAX_DENSE_LENGTH && newLength > array.length) {
+            throw new UnsupportedOperationException();
+        }
+        final ArrayData returnValue = (removed == 0) ?
+                EMPTY_ARRAY : new ObjectArrayData(Arrays.copyOfRange(array, start, start + removed), removed);
+
+        if (newLength != oldLength) {
+            final Object[] newArray;
+
+            if (newLength > array.length) {
+                newArray = new Object[ArrayData.nextSize((int)newLength)];
+                System.arraycopy(array, 0, newArray, 0, start);
+            } else {
+                newArray = array;
+            }
+
+            System.arraycopy(array, start + removed, newArray, start + added, (int)(oldLength - start - removed));
+            array = newArray;
+            setLength(newLength);
+        }
+
+        return returnValue;
+    }
 }
--- a/test/examples/array-micro.js	Thu Oct 17 16:19:45 2013 -0700
+++ b/test/examples/array-micro.js	Fri Oct 18 18:26:13 2013 +0530
@@ -90,6 +90,24 @@
     array[6] = 6;
 });
 
+bench("push", function() {
+    var arr = [1, 2, 3];
+    arr.push(4);
+    arr.push(5);
+    arr.push(6);
+});
+
+bench("pop", function() {
+    var arr = [1, 2, 3];
+    arr.pop();
+    arr.pop();
+    arr.pop();
+});
+
+bench("splice", function() {
+    [1, 2, 3].splice(0, 2, 5, 6, 7);
+});
+
 var all = function(e) { return true; };
 var none = function(e) { return false; };
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8026161.js	Fri Oct 18 18:26:13 2013 +0530
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+/**
+ * JDK-8026161: Don't narrow floating-point literals in the lexer
+ *
+ * @test
+ * @run
+ */
+
+print(new java.awt.Color(1, 1, 1)) // creates Color[r=1,g=1,b=1]
+print(new java.awt.Color(1.0, 1.0, 1.0)) // Color[r=255,g=255,b=255]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8026161.js.EXPECTED	Fri Oct 18 18:26:13 2013 +0530
@@ -0,0 +1,2 @@
+java.awt.Color[r=1,g=1,b=1]
+java.awt.Color[r=255,g=255,b=255]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8026701.js	Fri Oct 18 18:26:13 2013 +0530
@@ -0,0 +1,72 @@
+/*
+ * 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.
+ */
+
+/**
+ * JDK-8026701: Array.prototype.splice is slow on dense arrays
+ *
+ * @test
+ * @run
+ */
+
+function testSplice(arr, e1, e2, e3) {
+    try {
+        print(arr);
+        print(arr.splice(3, 0, e1, e2, e3));
+        print(arr);
+        print(arr.splice(2, 3));
+        print(arr);
+        print(arr.splice(2, 3, arr[2], arr[3], arr[4]));
+        print(arr);
+        print(arr.splice(20, 10));
+        print(arr);
+        print(arr.splice(arr.length, 0, e1, e2, e3));
+        print(arr);
+        print(arr.splice(0, 2, arr[0], arr[1], arr[2], arr[3]));
+        print(arr);
+    } catch (error) {
+        print(error);
+    }
+}
+
+function convert(array, type) {
+    return (typeof Java === "undefined") ? array : Java.from(Java.to(array, type));
+}
+
+// run some splice tests on all dense array implementations
+testSplice([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], -1, -2, -3);
+testSplice(convert([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "long[]"), -1, -2, -3);
+testSplice(convert([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "double[]"), -1, -2, -3);
+testSplice(["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"], -1, -2, -3);
+
+// test array conversion during splice
+testSplice([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], -1, "-2", "-3");
+testSplice([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], -1, -2.5, -3.5);
+testSplice(convert([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "long[]"), -1, "-2", "-3");
+testSplice(convert([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "long[]"), -1, -2.5, -3.5);
+testSplice(convert([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], "double[]"), -1, "-2", "-3");
+
+// test combination with defined elements
+testSplice(Object.defineProperty([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 5, {value: 13}), -1, -2, -3);
+testSplice(Object.defineProperty([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 5, {value: 13, writable: false}), -1, -2, -3);
+testSplice(Object.defineProperty([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 5, {value: 13, configurable: false}), -1, -2, -3);
+testSplice(Object.defineProperty([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 5, {value: 13, writable: false, configurable: false}), -1, -2, -3);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8026701.js.EXPECTED	Fri Oct 18 18:26:13 2013 +0530
@@ -0,0 +1,147 @@
+1,2,3,4,5,6,7,8,9,10
+
+1,2,3,-1,-2,-3,4,5,6,7,8,9,10
+3,-1,-2
+1,2,-3,4,5,6,7,8,9,10
+-3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+1,2
+1,2,-3,4,-3,4,5,13,7,8,9,10,-1,-2,-3
+1,2,3,4,5,13,7,8,9,10
+TypeError: "5" is not a writable property of [object Array]
+1,2,3,4,5,13,7,8,9,10
+
+1,2,3,-1,-2,-3,4,5,13,7,8,9,10
+3,-1,-2
+1,2,-3,4,5,13,7,8,9,10
+-3,4,5
+1,2,-3,4,5,13,7,8,9,10
+
+1,2,-3,4,5,13,7,8,9,10
+
+1,2,-3,4,5,13,7,8,9,10,-1,-2,-3
+1,2
+1,2,-3,4,-3,4,5,13,7,8,9,10,-1,-2,-3
+1,2,3,4,5,13,7,8,9,10
+TypeError: "5" is not a writable property of [object Array]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/script/basic/JDK-8026805.js	Fri Oct 18 18:26:13 2013 +0530
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+/**
+ * JDK-8026805: Array.prototype.length doesn't work as expected
+ *
+ * @test
+ * @run
+ */
+
+if (Array.prototype.length !== 0) {
+    throw new Error("Initial length not 0");
+}
+
+Array.prototype[3] = 1;
+
+if (Array.prototype.length !== 4) {
+    throw new Error("length not updated to 4");
+}
+
+Array.prototype.length = 0;
+
+if (Array.prototype.length !== 0) {
+    throw new Error("length not reset to 0");
+}
+
+if (3 in Array.prototype) {
+    throw new Error("array element not deleted");
+}
--- a/test/src/jdk/nashorn/api/javaaccess/MethodAccessTest.java	Thu Oct 17 16:19:45 2013 -0700
+++ b/test/src/jdk/nashorn/api/javaaccess/MethodAccessTest.java	Fri Oct 18 18:26:13 2013 +0530
@@ -412,7 +412,7 @@
 
     @Test
     public void accessMethodMixedWithEllipsis() throws ScriptException {
-        assertArrayEquals(new Object[] { "Hello", 10, true, -100500, 80 }, (Object[])e.eval("o.methodMixedWithEllipsis('Hello', 10, true, -100500,80.0);"));
+        assertArrayEquals(new Object[] { "Hello", 10, true, -100500, 80d }, (Object[])e.eval("o.methodMixedWithEllipsis('Hello', 10, true, -100500,80.0);"));
         assertArrayEquals(new Object[] { "Nashorn", 15 }, (Object[])e.eval("o.methodMixedWithEllipsis('Nashorn',15);"));
     }
 
@@ -431,8 +431,8 @@
 
     @Test
     public void accessMethodDoubleVSintOverloaded() throws ScriptException {
-        assertEquals("int", e.eval("o.overloadedMethodDoubleVSint(0.0);"));
-        assertEquals("int", e.eval("o.overloadedMethodDoubleVSint(1000.0);"));
+        assertEquals("double", e.eval("o.overloadedMethodDoubleVSint(0.0);"));
+        assertEquals("double", e.eval("o.overloadedMethodDoubleVSint(1000.0);"));
         assertEquals("double", e.eval("o.overloadedMethodDoubleVSint(0.01);"));
         assertEquals("double", e.eval("o.overloadedMethodDoubleVSint(100.02);"));
         assertEquals("int", e.eval("o.overloadedMethodDoubleVSint(0);"));