summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/mjsunit')
-rw-r--r--deps/v8/test/mjsunit/allocation-site-info.js272
-rw-r--r--deps/v8/test/mjsunit/array-constructor-feedback.js217
-rw-r--r--deps/v8/test/mjsunit/array-feedback.js216
-rw-r--r--deps/v8/test/mjsunit/array-literal-feedback.js75
-rw-r--r--deps/v8/test/mjsunit/assert-opt-and-deopt.js8
-rw-r--r--deps/v8/test/mjsunit/compiler/inline-arguments.js43
-rw-r--r--deps/v8/test/mjsunit/compiler/osr-big.js45
-rw-r--r--deps/v8/test/mjsunit/compiler/osr-nested.js46
-rw-r--r--deps/v8/test/mjsunit/compiler/osr-one.js40
-rw-r--r--deps/v8/test/mjsunit/compiler/osr-regress-max-locals.js (renamed from deps/v8/test/mjsunit/compiler/regress-max-locals-for-osr.js)0
-rw-r--r--deps/v8/test/mjsunit/compiler/osr-simple.js (renamed from deps/v8/test/mjsunit/compiler/simple-osr.js)0
-rw-r--r--deps/v8/test/mjsunit/compiler/osr-two.js44
-rw-r--r--deps/v8/test/mjsunit/compiler/osr-with-args.js44
-rw-r--r--deps/v8/test/mjsunit/compiler/parallel-proto-change.js22
-rw-r--r--deps/v8/test/mjsunit/date.js4
-rw-r--r--deps/v8/test/mjsunit/debug-breakpoints.js25
-rw-r--r--deps/v8/test/mjsunit/debug-evaluate-locals.js13
-rw-r--r--deps/v8/test/mjsunit/debug-script.js5
-rw-r--r--deps/v8/test/mjsunit/elements-kind.js6
-rw-r--r--deps/v8/test/mjsunit/external-array-no-sse2.js37
-rw-r--r--deps/v8/test/mjsunit/external-array.js37
-rw-r--r--deps/v8/test/mjsunit/function-call.js1
-rw-r--r--deps/v8/test/mjsunit/fuzz-natives-part1.js11
-rw-r--r--deps/v8/test/mjsunit/fuzz-natives-part2.js10
-rw-r--r--deps/v8/test/mjsunit/fuzz-natives-part3.js12
-rw-r--r--deps/v8/test/mjsunit/fuzz-natives-part4.js12
-rw-r--r--deps/v8/test/mjsunit/harmony/collections.js48
-rw-r--r--deps/v8/test/mjsunit/harmony/dataview-accessors.js310
-rw-r--r--deps/v8/test/mjsunit/harmony/generators-iteration.js61
-rw-r--r--deps/v8/test/mjsunit/harmony/generators-runtime.js3
-rw-r--r--deps/v8/test/mjsunit/harmony/iteration-syntax.js5
-rw-r--r--deps/v8/test/mjsunit/harmony/typedarrays.js85
-rw-r--r--deps/v8/test/mjsunit/manual-parallel-recompile.js23
-rw-r--r--deps/v8/test/mjsunit/mjsunit.status7
-rw-r--r--deps/v8/test/mjsunit/opt-elements-kind.js161
-rw-r--r--deps/v8/test/mjsunit/osr-elements-kind.js155
-rw-r--r--deps/v8/test/mjsunit/parallel-initial-prototype-change.js55
-rw-r--r--deps/v8/test/mjsunit/parallel-invalidate-transition-map.js61
-rw-r--r--deps/v8/test/mjsunit/parallel-optimize-disabled.js7
-rw-r--r--deps/v8/test/mjsunit/regress/regress-1383.js2
-rw-r--r--deps/v8/test/mjsunit/regress/regress-2691.js34
-rw-r--r--deps/v8/test/mjsunit/regress/regress-crbug-217858.js13
-rw-r--r--deps/v8/test/mjsunit/regress/regress-crbug-245480.js90
-rw-r--r--deps/v8/test/mjsunit/regress/regress-debug-deopt-while-recompile.js84
-rw-r--r--deps/v8/test/mjsunit/regress/regress-embedded-cons-string.js66
-rw-r--r--deps/v8/test/mjsunit/regress/regress-function-length-strict.js41
-rw-r--r--deps/v8/test/mjsunit/regress/regress-opt-after-debug-deopt.js69
-rw-r--r--deps/v8/test/mjsunit/regress/regress-polymorphic-store.js48
-rw-r--r--deps/v8/test/mjsunit/regress/string-split-monkey-patching.js40
-rw-r--r--deps/v8/test/mjsunit/tools/tickprocessor.js4
50 files changed, 2470 insertions, 247 deletions
diff --git a/deps/v8/test/mjsunit/allocation-site-info.js b/deps/v8/test/mjsunit/allocation-site-info.js
index f533d61738..86c28aac63 100644
--- a/deps/v8/test/mjsunit/allocation-site-info.js
+++ b/deps/v8/test/mjsunit/allocation-site-info.js
@@ -37,7 +37,6 @@
// support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8));
support_smi_only_arrays = true;
-optimize_constructed_arrays = true;
if (support_smi_only_arrays) {
print("Tests include smi-only arrays.");
@@ -45,12 +44,6 @@ if (support_smi_only_arrays) {
print("Tests do NOT include smi-only arrays.");
}
-if (optimize_constructed_arrays) {
- print("Tests include constructed array optimizations.");
-} else {
- print("Tests do NOT include constructed array optimizations.");
-}
-
var elements_kind = {
fast_smi_only : 'fast smi only elements',
fast : 'fast elements',
@@ -96,7 +89,6 @@ function assertNotHoley(obj, name_opt) {
}
if (support_smi_only_arrays) {
-
obj = [];
assertNotHoley(obj);
assertKind(elements_kind.fast_smi_only, obj);
@@ -187,135 +179,151 @@ if (support_smi_only_arrays) {
// sites work again for fast literals
//assertKind(elements_kind.fast, obj);
- if (optimize_constructed_arrays) {
- function newarraycase_smidouble(value) {
- var a = new Array();
- a[0] = value;
- return a;
- }
+ function newarraycase_smidouble(value) {
+ var a = new Array();
+ a[0] = value;
+ return a;
+ }
- // Case: new Array() as allocation site, smi->double
- obj = newarraycase_smidouble(1);
- assertKind(elements_kind.fast_smi_only, obj);
- obj = newarraycase_smidouble(1.5);
- assertKind(elements_kind.fast_double, obj);
- obj = newarraycase_smidouble(2);
- assertKind(elements_kind.fast_double, obj);
+ // Case: new Array() as allocation site, smi->double
+ obj = newarraycase_smidouble(1);
+ assertKind(elements_kind.fast_smi_only, obj);
+ obj = newarraycase_smidouble(1.5);
+ assertKind(elements_kind.fast_double, obj);
+ obj = newarraycase_smidouble(2);
+ assertKind(elements_kind.fast_double, obj);
- function newarraycase_smiobj(value) {
- var a = new Array();
- a[0] = value;
- return a;
- }
+ function newarraycase_smiobj(value) {
+ var a = new Array();
+ a[0] = value;
+ return a;
+ }
- // Case: new Array() as allocation site, smi->fast
- obj = newarraycase_smiobj(1);
- assertKind(elements_kind.fast_smi_only, obj);
- obj = newarraycase_smiobj("gloria");
- assertKind(elements_kind.fast, obj);
- obj = newarraycase_smiobj(2);
- assertKind(elements_kind.fast, obj);
-
- function newarraycase_length_smidouble(value) {
- var a = new Array(3);
- a[0] = value;
- return a;
- }
-
- // Case: new Array(length) as allocation site
- obj = newarraycase_length_smidouble(1);
- assertKind(elements_kind.fast_smi_only, obj);
- obj = newarraycase_length_smidouble(1.5);
- assertKind(elements_kind.fast_double, obj);
- obj = newarraycase_length_smidouble(2);
- assertKind(elements_kind.fast_double, obj);
+ // Case: new Array() as allocation site, smi->fast
+ obj = newarraycase_smiobj(1);
+ assertKind(elements_kind.fast_smi_only, obj);
+ obj = newarraycase_smiobj("gloria");
+ assertKind(elements_kind.fast, obj);
+ obj = newarraycase_smiobj(2);
+ assertKind(elements_kind.fast, obj);
- // Try to continue the transition to fast object, but
- // we will not pretransition from double->fast, because
- // it may hurt performance ("poisoning").
- obj = newarraycase_length_smidouble("coates");
- assertKind(elements_kind.fast, obj);
- obj = newarraycase_length_smidouble(2.5);
- // However, because of optimistic transitions, we will
- // transition to the most general kind of elements kind found,
- // therefore I can't count on this assert yet.
- // assertKind(elements_kind.fast_double, obj);
-
- function newarraycase_length_smiobj(value) {
- var a = new Array(3);
- a[0] = value;
- return a;
- }
-
- // Case: new Array(<length>) as allocation site, smi->fast
- obj = newarraycase_length_smiobj(1);
- assertKind(elements_kind.fast_smi_only, obj);
- obj = newarraycase_length_smiobj("gloria");
- assertKind(elements_kind.fast, obj);
- obj = newarraycase_length_smiobj(2);
- assertKind(elements_kind.fast, obj);
-
- function newarraycase_list_smidouble(value) {
- var a = new Array(1, 2, 3);
- a[0] = value;
- return a;
- }
-
- obj = newarraycase_list_smidouble(1);
- assertKind(elements_kind.fast_smi_only, obj);
- obj = newarraycase_list_smidouble(1.5);
- assertKind(elements_kind.fast_double, obj);
- obj = newarraycase_list_smidouble(2);
- assertKind(elements_kind.fast_double, obj);
+ function newarraycase_length_smidouble(value) {
+ var a = new Array(3);
+ a[0] = value;
+ return a;
+ }
- function newarraycase_list_smiobj(value) {
- var a = new Array(4, 5, 6);
- a[0] = value;
- return a;
- }
+ // Case: new Array(length) as allocation site
+ obj = newarraycase_length_smidouble(1);
+ assertKind(elements_kind.fast_smi_only, obj);
+ obj = newarraycase_length_smidouble(1.5);
+ assertKind(elements_kind.fast_double, obj);
+ obj = newarraycase_length_smidouble(2);
+ assertKind(elements_kind.fast_double, obj);
- obj = newarraycase_list_smiobj(1);
- assertKind(elements_kind.fast_smi_only, obj);
- obj = newarraycase_list_smiobj("coates");
- assertKind(elements_kind.fast, obj);
- obj = newarraycase_list_smiobj(2);
- assertKind(elements_kind.fast, obj);
-
- function newarraycase_onearg(len, value) {
- var a = new Array(len);
- a[0] = value;
- return a;
- }
-
- obj = newarraycase_onearg(5, 3.5);
- assertKind(elements_kind.fast_double, obj);
- obj = newarraycase_onearg(10, 5);
- assertKind(elements_kind.fast_double, obj);
- obj = newarraycase_onearg(0, 5);
- assertKind(elements_kind.fast_double, obj);
- // Now pass a length that forces the dictionary path.
- obj = newarraycase_onearg(100000, 5);
- assertKind(elements_kind.dictionary, obj);
- assertTrue(obj.length == 100000);
-
- // Verify that cross context calls work
- var realmA = Realm.current();
- var realmB = Realm.create();
- assertEquals(0, realmA);
- assertEquals(1, realmB);
-
- function instanceof_check(type) {
- assertTrue(new type() instanceof type);
- assertTrue(new type(5) instanceof type);
- assertTrue(new type(1,2,3) instanceof type);
- }
-
- var realmBArray = Realm.eval(realmB, "Array");
- instanceof_check(Array);
- instanceof_check(realmBArray);
- %OptimizeFunctionOnNextCall(instanceof_check);
- instanceof_check(Array);
- instanceof_check(realmBArray);
- assertTrue(2 != %GetOptimizationStatus(instanceof_check));
+ // Try to continue the transition to fast object, but
+ // we will not pretransition from double->fast, because
+ // it may hurt performance ("poisoning").
+ obj = newarraycase_length_smidouble("coates");
+ assertKind(elements_kind.fast, obj);
+ obj = newarraycase_length_smidouble(2.5);
+ // However, because of optimistic transitions, we will
+ // transition to the most general kind of elements kind found,
+ // therefore I can't count on this assert yet.
+ // assertKind(elements_kind.fast_double, obj);
+
+ function newarraycase_length_smiobj(value) {
+ var a = new Array(3);
+ a[0] = value;
+ return a;
}
+
+ // Case: new Array(<length>) as allocation site, smi->fast
+ obj = newarraycase_length_smiobj(1);
+ assertKind(elements_kind.fast_smi_only, obj);
+ obj = newarraycase_length_smiobj("gloria");
+ assertKind(elements_kind.fast, obj);
+ obj = newarraycase_length_smiobj(2);
+ assertKind(elements_kind.fast, obj);
+
+ function newarraycase_list_smidouble(value) {
+ var a = new Array(1, 2, 3);
+ a[0] = value;
+ return a;
+ }
+
+ obj = newarraycase_list_smidouble(1);
+ assertKind(elements_kind.fast_smi_only, obj);
+ obj = newarraycase_list_smidouble(1.5);
+ assertKind(elements_kind.fast_double, obj);
+ obj = newarraycase_list_smidouble(2);
+ assertKind(elements_kind.fast_double, obj);
+
+ function newarraycase_list_smiobj(value) {
+ var a = new Array(4, 5, 6);
+ a[0] = value;
+ return a;
+ }
+
+ obj = newarraycase_list_smiobj(1);
+ assertKind(elements_kind.fast_smi_only, obj);
+ obj = newarraycase_list_smiobj("coates");
+ assertKind(elements_kind.fast, obj);
+ obj = newarraycase_list_smiobj(2);
+ assertKind(elements_kind.fast, obj);
+
+ function newarraycase_onearg(len, value) {
+ var a = new Array(len);
+ a[0] = value;
+ return a;
+ }
+
+ obj = newarraycase_onearg(5, 3.5);
+ assertKind(elements_kind.fast_double, obj);
+ obj = newarraycase_onearg(10, 5);
+ assertKind(elements_kind.fast_double, obj);
+ obj = newarraycase_onearg(0, 5);
+ assertKind(elements_kind.fast_double, obj);
+ // Now pass a length that forces the dictionary path.
+ obj = newarraycase_onearg(100000, 5);
+ assertKind(elements_kind.dictionary, obj);
+ assertTrue(obj.length == 100000);
+
+ // Verify that cross context calls work
+ var realmA = Realm.current();
+ var realmB = Realm.create();
+ assertEquals(0, realmA);
+ assertEquals(1, realmB);
+
+ function instanceof_check(type) {
+ assertTrue(new type() instanceof type);
+ assertTrue(new type(5) instanceof type);
+ assertTrue(new type(1,2,3) instanceof type);
+ }
+
+ var realmBArray = Realm.eval(realmB, "Array");
+ instanceof_check(Array);
+ instanceof_check(realmBArray);
+ %OptimizeFunctionOnNextCall(instanceof_check);
+
+ // No de-opt will occur because HCallNewArray wasn't selected, on account of
+ // the call site not being monomorphic to Array.
+ instanceof_check(Array);
+ assertTrue(2 != %GetOptimizationStatus(instanceof_check));
+ instanceof_check(realmBArray);
+ assertTrue(2 != %GetOptimizationStatus(instanceof_check));
+
+ // Try to optimize again, but first clear all type feedback, and allow it
+ // to be monomorphic on first call. Only after crankshafting do we introduce
+ // realmBArray. This should deopt the method.
+ %DeoptimizeFunction(instanceof_check);
+ %ClearFunctionTypeFeedback(instanceof_check);
+ instanceof_check(Array);
+ instanceof_check(Array);
+ %OptimizeFunctionOnNextCall(instanceof_check);
+ instanceof_check(Array);
+ assertTrue(2 != %GetOptimizationStatus(instanceof_check));
+
+ instanceof_check(realmBArray);
+ assertTrue(1 != %GetOptimizationStatus(instanceof_check));
}
diff --git a/deps/v8/test/mjsunit/array-constructor-feedback.js b/deps/v8/test/mjsunit/array-constructor-feedback.js
new file mode 100644
index 0000000000..e29e769465
--- /dev/null
+++ b/deps/v8/test/mjsunit/array-constructor-feedback.js
@@ -0,0 +1,217 @@
+// Copyright 2012 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --allow-natives-syntax --smi-only-arrays --expose-gc
+// Flags: --track-allocation-sites --noalways-opt
+
+// Test element kind of objects.
+// Since --smi-only-arrays affects builtins, its default setting at compile
+// time sticks if built with snapshot. If --smi-only-arrays is deactivated
+// by default, only a no-snapshot build actually has smi-only arrays enabled
+// in this test case. Depending on whether smi-only arrays are actually
+// enabled, this test takes the appropriate code path to check smi-only arrays.
+
+// support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8));
+support_smi_only_arrays = true;
+
+if (support_smi_only_arrays) {
+ print("Tests include smi-only arrays.");
+} else {
+ print("Tests do NOT include smi-only arrays.");
+}
+
+var elements_kind = {
+ fast_smi_only : 'fast smi only elements',
+ fast : 'fast elements',
+ fast_double : 'fast double elements',
+ dictionary : 'dictionary elements',
+ external_byte : 'external byte elements',
+ external_unsigned_byte : 'external unsigned byte elements',
+ external_short : 'external short elements',
+ external_unsigned_short : 'external unsigned short elements',
+ external_int : 'external int elements',
+ external_unsigned_int : 'external unsigned int elements',
+ external_float : 'external float elements',
+ external_double : 'external double elements',
+ external_pixel : 'external pixel elements'
+}
+
+function getKind(obj) {
+ if (%HasFastSmiElements(obj)) return elements_kind.fast_smi_only;
+ if (%HasFastObjectElements(obj)) return elements_kind.fast;
+ if (%HasFastDoubleElements(obj)) return elements_kind.fast_double;
+ if (%HasDictionaryElements(obj)) return elements_kind.dictionary;
+}
+
+function isHoley(obj) {
+ if (%HasFastHoleyElements(obj)) return true;
+ return false;
+}
+
+function assertKind(expected, obj, name_opt) {
+ if (!support_smi_only_arrays &&
+ expected == elements_kind.fast_smi_only) {
+ expected = elements_kind.fast;
+ }
+ assertEquals(expected, getKind(obj), name_opt);
+}
+
+if (support_smi_only_arrays) {
+
+ // Test: If a call site goes megamorphic, it loses the ability to
+ // use allocation site feedback.
+ (function() {
+ function bar(t, len) {
+ return new t(len);
+ }
+
+ a = bar(Array, 10);
+ a[0] = 3.5;
+ b = bar(Array, 1);
+ assertKind(elements_kind.fast_double, b);
+ c = bar(Object, 3);
+ b = bar(Array, 10);
+ assertKind(elements_kind.fast_smi_only, b);
+ b[0] = 3.5;
+ c = bar(Array, 10);
+ assertKind(elements_kind.fast_smi_only, c);
+ })();
+
+
+ // Test: ensure that crankshafted array constructor sites are deopted
+ // if another function is used.
+ (function() {
+ function bar0(t) {
+ return new t();
+ }
+ a = bar0(Array);
+ a[0] = 3.5;
+ b = bar0(Array);
+ assertKind(elements_kind.fast_double, b);
+ %OptimizeFunctionOnNextCall(bar0);
+ b = bar0(Array);
+ assertKind(elements_kind.fast_double, b);
+ assertTrue(2 != %GetOptimizationStatus(bar0));
+ // bar0 should deopt
+ b = bar0(Object);
+ assertTrue(1 != %GetOptimizationStatus(bar0));
+ // When it's re-optimized, we should call through the full stub
+ bar0(Array);
+ %OptimizeFunctionOnNextCall(bar0);
+ b = bar0(Array);
+ // We also lost our ability to record kind feedback, as the site
+ // is megamorphic now.
+ assertKind(elements_kind.fast_smi_only, b);
+ assertTrue(2 != %GetOptimizationStatus(bar0));
+ b[0] = 3.5;
+ c = bar0(Array);
+ assertKind(elements_kind.fast_smi_only, c);
+ })();
+
+
+ // Test: Ensure that bailouts from the stub don't deopt a crankshafted
+ // method with a call to that stub.
+ (function() {
+ function bar(len) {
+ return new Array(len);
+ }
+ a = bar(10);
+ a[0] = "a string";
+ a = bar(10);
+ assertKind(elements_kind.fast, a);
+ %OptimizeFunctionOnNextCall(bar);
+ a = bar(10);
+ assertKind(elements_kind.fast, a);
+ assertTrue(2 != %GetOptimizationStatus(bar));
+ // The stub bails out, but the method call should be fine.
+ a = bar(100000);
+ assertTrue(2 != %GetOptimizationStatus(bar));
+ assertKind(elements_kind.dictionary, a);
+
+ // If the argument isn't a smi, it bails out as well
+ a = bar("oops");
+ assertTrue(2 != %GetOptimizationStatus(bar));
+ assertKind(elements_kind.fast, a);
+
+ function barn(one, two, three) {
+ return new Array(one, two, three);
+ }
+
+ barn(1, 2, 3);
+ barn(1, 2, 3);
+ %OptimizeFunctionOnNextCall(barn);
+ barn(1, 2, 3);
+ assertTrue(2 != %GetOptimizationStatus(barn));
+ a = barn(1, "oops", 3);
+ // The stub should bail out but the method should remain optimized.
+ assertKind(elements_kind.fast, a);
+ assertTrue(2 != %GetOptimizationStatus(barn));
+ })();
+
+
+ // Test: When a method with array constructor is crankshafted, the type
+ // feedback for elements kind is baked in. Verify that transitions don't
+ // change it anymore
+ (function() {
+ function bar() {
+ return new Array();
+ }
+ a = bar();
+ bar();
+ %OptimizeFunctionOnNextCall(bar);
+ b = bar();
+ // This only makes sense to test if we allow crankshafting
+ if (4 != %GetOptimizationStatus(bar)) {
+ assertTrue(2 != %GetOptimizationStatus(bar));
+ %DebugPrint(3);
+ b[0] = 3.5;
+ c = bar();
+ assertKind(elements_kind.fast_smi_only, c);
+ assertTrue(2 != %GetOptimizationStatus(bar));
+ }
+ })();
+
+
+ // Test: create arrays in two contexts, verifying that the correct
+ // map for Array in that context will be used.
+ (function() {
+ function bar() { return new Array(); }
+ bar();
+ bar();
+ %OptimizeFunctionOnNextCall(bar);
+ a = bar();
+ assertTrue(a instanceof Array);
+
+ var contextB = Realm.create();
+ Realm.eval(contextB, "function bar2() { return new Array(); };");
+ Realm.eval(contextB, "bar2(); bar2();");
+ Realm.eval(contextB, "%OptimizeFunctionOnNextCall(bar2);");
+ Realm.eval(contextB, "bar2();");
+ assertFalse(Realm.eval(contextB, "bar2();") instanceof Array);
+ assertTrue(Realm.eval(contextB, "bar2() instanceof Array"));
+ })();
+}
diff --git a/deps/v8/test/mjsunit/array-feedback.js b/deps/v8/test/mjsunit/array-feedback.js
new file mode 100644
index 0000000000..d1b3062eb0
--- /dev/null
+++ b/deps/v8/test/mjsunit/array-feedback.js
@@ -0,0 +1,216 @@
+// Copyright 2012 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --allow-natives-syntax --smi-only-arrays --expose-gc
+// Flags: --track-allocation-sites --noalways-opt
+
+// Test element kind of objects.
+// Since --smi-only-arrays affects builtins, its default setting at compile
+// time sticks if built with snapshot. If --smi-only-arrays is deactivated
+// by default, only a no-snapshot build actually has smi-only arrays enabled
+// in this test case. Depending on whether smi-only arrays are actually
+// enabled, this test takes the appropriate code path to check smi-only arrays.
+
+// support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8));
+support_smi_only_arrays = true;
+
+if (support_smi_only_arrays) {
+ print("Tests include smi-only arrays.");
+} else {
+ print("Tests do NOT include smi-only arrays.");
+}
+
+var elements_kind = {
+ fast_smi_only : 'fast smi only elements',
+ fast : 'fast elements',
+ fast_double : 'fast double elements',
+ dictionary : 'dictionary elements',
+ external_byte : 'external byte elements',
+ external_unsigned_byte : 'external unsigned byte elements',
+ external_short : 'external short elements',
+ external_unsigned_short : 'external unsigned short elements',
+ external_int : 'external int elements',
+ external_unsigned_int : 'external unsigned int elements',
+ external_float : 'external float elements',
+ external_double : 'external double elements',
+ external_pixel : 'external pixel elements'
+}
+
+function getKind(obj) {
+ if (%HasFastSmiElements(obj)) return elements_kind.fast_smi_only;
+ if (%HasFastObjectElements(obj)) return elements_kind.fast;
+ if (%HasFastDoubleElements(obj)) return elements_kind.fast_double;
+ if (%HasDictionaryElements(obj)) return elements_kind.dictionary;
+}
+
+function isHoley(obj) {
+ if (%HasFastHoleyElements(obj)) return true;
+ return false;
+}
+
+function assertKind(expected, obj, name_opt) {
+ if (!support_smi_only_arrays &&
+ expected == elements_kind.fast_smi_only) {
+ expected = elements_kind.fast;
+ }
+ assertEquals(expected, getKind(obj), name_opt);
+}
+
+if (support_smi_only_arrays) {
+
+ // Verify that basic elements kind feedback works for non-constructor
+ // array calls (as long as the call is made through an IC, and not
+ // a CallStub).
+ (function (){
+ function create0() {
+ return Array();
+ }
+
+ // Calls through ICs need warm up through uninitialized, then
+ // premonomorphic first.
+ create0();
+ create0();
+ a = create0();
+ assertKind(elements_kind.fast_smi_only, a);
+ a[0] = 3.5;
+ b = create0();
+ assertKind(elements_kind.fast_double, b);
+
+ function create1(arg) {
+ return Array(arg);
+ }
+
+ create1(0);
+ create1(0);
+ a = create1(0);
+ assertFalse(isHoley(a));
+ assertKind(elements_kind.fast_smi_only, a);
+ a[0] = "hello";
+ b = create1(10);
+ assertTrue(isHoley(b));
+ assertKind(elements_kind.fast, b);
+
+ a = create1(100000);
+ assertKind(elements_kind.dictionary, a);
+
+ function create3(arg1, arg2, arg3) {
+ return Array(arg1, arg2, arg3);
+ }
+
+ create3();
+ create3();
+ a = create3(1,2,3);
+ a[0] = 3.5;
+ b = create3(1,2,3);
+ assertKind(elements_kind.fast_double, b);
+ assertFalse(isHoley(b));
+ })();
+
+
+ // Verify that keyed calls work
+ (function (){
+ function create0(name) {
+ return this[name]();
+ }
+
+ name = "Array";
+ create0(name);
+ create0(name);
+ a = create0(name);
+ a[0] = 3.5;
+ b = create0(name);
+ assertKind(elements_kind.fast_double, b);
+ })();
+
+
+ // Verify that the IC can't be spoofed by patching
+ (function (){
+ function create0() {
+ return Array();
+ }
+
+ create0();
+ create0();
+ a = create0();
+ assertKind(elements_kind.fast_smi_only, a);
+ var oldArray = this.Array;
+ this.Array = function() { return ["hi"]; };
+ b = create0();
+ assertEquals(["hi"], b);
+ this.Array = oldArray;
+ })();
+
+ // Verify that calls are still made through an IC after crankshaft,
+ // though the type information is reset.
+ // TODO(mvstanton): instead, consume the type feedback gathered up
+ // until crankshaft time.
+ (function (){
+ function create0() {
+ return Array();
+ }
+
+ create0();
+ create0();
+ a = create0();
+ a[0] = 3.5;
+ %OptimizeFunctionOnNextCall(create0);
+ create0();
+ // This test only makes sense if crankshaft is allowed
+ if (4 != %GetOptimizationStatus(create0)) {
+ create0();
+ b = create0();
+ assertKind(elements_kind.fast_smi_only, b);
+ b[0] = 3.5;
+ c = create0();
+ assertKind(elements_kind.fast_double, c);
+ assertTrue(2 != %GetOptimizationStatus(create0));
+ }
+ })();
+
+
+ // Verify that cross context calls work
+ (function (){
+ var realmA = Realm.current();
+ var realmB = Realm.create();
+ assertEquals(0, realmA);
+ assertEquals(1, realmB);
+
+ function instanceof_check(type) {
+ assertTrue(type() instanceof type);
+ assertTrue(type(5) instanceof type);
+ assertTrue(type(1,2,3) instanceof type);
+ }
+
+ var realmBArray = Realm.eval(realmB, "Array");
+ instanceof_check(Array);
+ instanceof_check(Array);
+ instanceof_check(Array);
+ instanceof_check(realmBArray);
+ instanceof_check(realmBArray);
+ instanceof_check(realmBArray);
+ })();
+}
diff --git a/deps/v8/test/mjsunit/array-literal-feedback.js b/deps/v8/test/mjsunit/array-literal-feedback.js
new file mode 100644
index 0000000000..8cc617e93f
--- /dev/null
+++ b/deps/v8/test/mjsunit/array-literal-feedback.js
@@ -0,0 +1,75 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --allow-natives-syntax --smi-only-arrays --expose-gc
+// Flags: --track-allocation-sites --noalways-opt
+
+// Test element kind of objects.
+// Since --smi-only-arrays affects builtins, its default setting at compile
+// time sticks if built with snapshot. If --smi-only-arrays is deactivated
+// by default, only a no-snapshot build actually has smi-only arrays enabled
+// in this test case. Depending on whether smi-only arrays are actually
+// enabled, this test takes the appropriate code path to check smi-only arrays.
+
+// support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8));
+support_smi_only_arrays = true;
+
+if (support_smi_only_arrays) {
+ print("Tests include smi-only arrays.");
+} else {
+ print("Tests do NOT include smi-only arrays.");
+}
+
+if (support_smi_only_arrays) {
+
+ function get_literal(x) {
+ var literal = [1, 2, x];
+ return literal;
+ }
+
+ get_literal(3);
+ get_literal(3);
+ %OptimizeFunctionOnNextCall(get_literal);
+ a = get_literal(3);
+ assertTrue(2 != %GetOptimizationStatus(get_literal));
+ assertTrue(%HasFastSmiElements(a));
+ a[0] = 3.5;
+
+ // We should have transitioned the boilerplate array to double, and
+ // crankshafted code should de-opt on the unexpected elements kind
+ b = get_literal(3);
+ assertTrue(%HasFastDoubleElements(b));
+ assertEquals([1, 2, 3], b);
+ assertTrue(1 != %GetOptimizationStatus(get_literal));
+
+ // Optimize again
+ get_literal(3);
+ %OptimizeFunctionOnNextCall(get_literal);
+ b = get_literal(3);
+ assertTrue(%HasFastDoubleElements(b));
+ assertTrue(2 != %GetOptimizationStatus(get_literal));
+}
diff --git a/deps/v8/test/mjsunit/assert-opt-and-deopt.js b/deps/v8/test/mjsunit/assert-opt-and-deopt.js
index fa38ae3e56..afba963fc7 100644
--- a/deps/v8/test/mjsunit/assert-opt-and-deopt.js
+++ b/deps/v8/test/mjsunit/assert-opt-and-deopt.js
@@ -25,8 +25,12 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --allow-natives-syntax
-%SetFlags("--noparallel-recompilation");
+// Flags: --allow-natives-syntax --noparallel-recompilation
+
+if (%IsParallelRecompilationSupported()) {
+ print("Parallel recompilation is turned on after all. Skipping this test.");
+ quit();
+}
/**
* This class shows how to use %GetOptimizationCount() and
diff --git a/deps/v8/test/mjsunit/compiler/inline-arguments.js b/deps/v8/test/mjsunit/compiler/inline-arguments.js
index df1bd2214d..75d01b5df3 100644
--- a/deps/v8/test/mjsunit/compiler/inline-arguments.js
+++ b/deps/v8/test/mjsunit/compiler/inline-arguments.js
@@ -266,3 +266,46 @@ test_toarr(toarr2);
}
}
})();
+
+
+// Test materialization of arguments object with values in registers.
+(function () {
+ "use strict";
+ var forceDeopt = { deopt:false };
+ function inner(a,b,c,d,e,f,g,h,i,j) {
+ var args = arguments;
+ forceDeopt.deopt;
+ assertSame(10, args.length);
+ assertSame(a, args[0]);
+ assertSame(b, args[1]);
+ assertSame(c, args[2]);
+ assertSame(d, args[3]);
+ assertSame(e, args[4]);
+ assertSame(f, args[5]);
+ assertSame(g, args[6]);
+ assertSame(h, args[7]);
+ assertSame(i, args[8]);
+ assertSame(j, args[9]);
+ }
+
+ var a = 0.5;
+ var b = 1.7;
+ var c = 123;
+ function outer() {
+ inner(
+ a - 0.3, // double in double register
+ b + 2.3, // integer in double register
+ c + 321, // integer in general register
+ c - 456, // integer in stack slot
+ a + 0.1, a + 0.2, a + 0.3, a + 0.4, a + 0.5,
+ a + 0.6 // double in stack slot
+ );
+ }
+
+ outer();
+ outer();
+ %OptimizeFunctionOnNextCall(outer);
+ outer();
+ delete forceDeopt.deopt;
+ outer();
+})();
diff --git a/deps/v8/test/mjsunit/compiler/osr-big.js b/deps/v8/test/mjsunit/compiler/osr-big.js
new file mode 100644
index 0000000000..ed71744b78
--- /dev/null
+++ b/deps/v8/test/mjsunit/compiler/osr-big.js
@@ -0,0 +1,45 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --use-osr
+
+function f(x) {
+ var sum = 0;
+ var outer = 1000000;
+ var a = 1, b = 2, c = 3, d = 4, e = 5;
+ while (outer > 0) {
+ a = a + 5;
+ b = b + 4;
+ c = c + 3;
+ d = d + 2;
+ e = e + 1;
+ outer--;
+ }
+ return a + b + c + d + e;
+}
+
+assertEquals(15000015, f(5));
diff --git a/deps/v8/test/mjsunit/compiler/osr-nested.js b/deps/v8/test/mjsunit/compiler/osr-nested.js
new file mode 100644
index 0000000000..4bdb0828ca
--- /dev/null
+++ b/deps/v8/test/mjsunit/compiler/osr-nested.js
@@ -0,0 +1,46 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --use-osr
+
+function f() {
+ var sum = 0;
+ for (var i = 0; i < 10; i++) {
+ for (var j = 0; j < 100000; j++) {
+ var x = i + 2;
+ var y = x + 5;
+ var z = y + 3;
+ sum += z;
+ }
+ }
+ return sum;
+}
+
+
+assertEquals(14500000, f());
+assertEquals(14500000, f());
+assertEquals(14500000, f());
diff --git a/deps/v8/test/mjsunit/compiler/osr-one.js b/deps/v8/test/mjsunit/compiler/osr-one.js
new file mode 100644
index 0000000000..2c27192d27
--- /dev/null
+++ b/deps/v8/test/mjsunit/compiler/osr-one.js
@@ -0,0 +1,40 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --use-osr
+
+function f(x) {
+ var sum = 0;
+ var count = 10000000;
+ while (count > 0) {
+ sum += x;
+ count--;
+ }
+ return sum;
+}
+
+assertEquals(50000000, f(5));
diff --git a/deps/v8/test/mjsunit/compiler/regress-max-locals-for-osr.js b/deps/v8/test/mjsunit/compiler/osr-regress-max-locals.js
index cc150edfd7..cc150edfd7 100644
--- a/deps/v8/test/mjsunit/compiler/regress-max-locals-for-osr.js
+++ b/deps/v8/test/mjsunit/compiler/osr-regress-max-locals.js
diff --git a/deps/v8/test/mjsunit/compiler/simple-osr.js b/deps/v8/test/mjsunit/compiler/osr-simple.js
index 8ec1b2b936..8ec1b2b936 100644
--- a/deps/v8/test/mjsunit/compiler/simple-osr.js
+++ b/deps/v8/test/mjsunit/compiler/osr-simple.js
diff --git a/deps/v8/test/mjsunit/compiler/osr-two.js b/deps/v8/test/mjsunit/compiler/osr-two.js
new file mode 100644
index 0000000000..8ac4c2cc12
--- /dev/null
+++ b/deps/v8/test/mjsunit/compiler/osr-two.js
@@ -0,0 +1,44 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --use-osr
+
+function f(x) {
+ var sum = 0;
+ var outer = 100;
+ while (outer > 0) {
+ var inner = 100000;
+ while (inner > 0) {
+ sum += x;
+ inner--;
+ }
+ outer--;
+ }
+ return sum;
+}
+
+assertEquals(50000000, f(5));
diff --git a/deps/v8/test/mjsunit/compiler/osr-with-args.js b/deps/v8/test/mjsunit/compiler/osr-with-args.js
new file mode 100644
index 0000000000..44fa1cb2cf
--- /dev/null
+++ b/deps/v8/test/mjsunit/compiler/osr-with-args.js
@@ -0,0 +1,44 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --use-osr
+
+function f() {
+ var sum = 0;
+ for (var i = 0; i < 1000000; i++) {
+ var t = arguments[0] + 2;
+ var x = arguments[1] + 2;
+ var y = t + x + 5;
+ var z = y + 3;
+ sum += z;
+ }
+ return sum;
+}
+
+for (var i = 0; i < 4; i++) {
+ assertEquals(17000000, f(2, 3));
+}
diff --git a/deps/v8/test/mjsunit/compiler/parallel-proto-change.js b/deps/v8/test/mjsunit/compiler/parallel-proto-change.js
index 74e6d86a10..2392a37c95 100644
--- a/deps/v8/test/mjsunit/compiler/parallel-proto-change.js
+++ b/deps/v8/test/mjsunit/compiler/parallel-proto-change.js
@@ -25,7 +25,17 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --allow-natives-syntax --parallel-recompilation
+// Flags: --allow-natives-syntax
+// Flags: --parallel-recompilation --parallel-recompilation-delay=50
+
+if (!%IsParallelRecompilationSupported()) {
+ print("Parallel recompilation is disabled. Skipping this test.");
+ quit();
+}
+
+function assertUnoptimized(fun) {
+ assertTrue(%GetOptimizationStatus(fun) != 1);
+}
function f(foo) { return foo.bar(); }
@@ -36,10 +46,10 @@ assertEquals(1, f(o));
assertEquals(1, f(o));
%OptimizeFunctionOnNextCall(f, "parallel");
-assertEquals(1, f(o));
-// Change the prototype chain during optimization.
+assertEquals(1, f(o)); // Trigger optimization.
+assertUnoptimized(f); // Optimization not yet done.
+// Change the prototype chain during optimization to trigger map invalidation.
o.__proto__.__proto__ = { bar: function() { return 2; } };
-
-%WaitUntilOptimized(f);
-
+%CompleteOptimization(f); // Conclude optimization with...
+assertUnoptimized(f); // ... bailing out due to map dependency.
assertEquals(2, f(o));
diff --git a/deps/v8/test/mjsunit/date.js b/deps/v8/test/mjsunit/date.js
index 5aaa3bb94e..a1b7871d60 100644
--- a/deps/v8/test/mjsunit/date.js
+++ b/deps/v8/test/mjsunit/date.js
@@ -150,7 +150,7 @@ assertTrue(isNaN(l.getUTCMilliseconds()));
// date without the timezone information.
function testToLocaleTimeString() {
var d = new Date();
- var s = d.toLocaleTimeString();
+ var s = d.toLocaleTimeString("en-GB");
assertEquals(8, s.length);
}
@@ -340,4 +340,4 @@ date.getYear();
%OptimizeFunctionOnNextCall(Date.prototype.getYear);
assertThrows(function() { Date.prototype.getYear.call(""); }, TypeError);
opt_status = %GetOptimizationStatus(Date.prototype.getYear);
-assertTrue(%GetOptimizationStatus(Date.prototype.getTime) != 1); \ No newline at end of file
+assertTrue(%GetOptimizationStatus(Date.prototype.getTime) != 1);
diff --git a/deps/v8/test/mjsunit/debug-breakpoints.js b/deps/v8/test/mjsunit/debug-breakpoints.js
index 13020343b0..148acfc9ef 100644
--- a/deps/v8/test/mjsunit/debug-breakpoints.js
+++ b/deps/v8/test/mjsunit/debug-breakpoints.js
@@ -29,7 +29,7 @@
// Get the Debug object exposed from the debug context global object.
Debug = debug.Debug
-function f() {a=1;b=2};
+function f() {a=1;b=2}
function g() {
a=1;
b=2;
@@ -121,13 +121,13 @@ assertTrue(Debug.showBreakPoints(g).indexOf("[B0]") < 0);
// Tests for setting break points by script id and position.
-function setBreakpointByPosition(f, position)
+function setBreakpointByPosition(f, position, opt_position_alignment)
{
var break_point = Debug.setBreakPointByScriptIdAndPosition(
Debug.findScript(f).id,
position + Debug.sourcePosition(f),
"",
- true);
+ true, opt_position_alignment);
return break_point.number();
}
@@ -204,3 +204,22 @@ Debug.clearBreakPoint(bp3);
//b=2;
//}
assertTrue(Debug.showBreakPoints(g).indexOf("[B0]") < 0);
+
+// Tests for setting break points without statement aligment.
+// (This may be sensitive to compiler break position map generation).
+function h() {a=f(f2(1,2),f3())+f3();b=f3();}
+var scenario = [
+ [5, "{a[B0]=f"],
+ [6, "{a=[B0]f("],
+ [7, "{a=f([B0]f2("],
+ [16, "f2(1,2),[B0]f3()"],
+ [22, "+[B0]f3()"]
+];
+for(var i = 0; i < scenario.length; i++) {
+ bp1 = setBreakpointByPosition(h, scenario[i][0],
+ Debug.BreakPositionAlignment.BreakPosition);
+ assertTrue(Debug.showBreakPoints(h, undefined,
+ Debug.BreakPositionAlignment.BreakPosition).indexOf(scenario[i][1]) > 0);
+ Debug.clearBreakPoint(bp1);
+}
+
diff --git a/deps/v8/test/mjsunit/debug-evaluate-locals.js b/deps/v8/test/mjsunit/debug-evaluate-locals.js
index a68162d9bd..e6326e18e0 100644
--- a/deps/v8/test/mjsunit/debug-evaluate-locals.js
+++ b/deps/v8/test/mjsunit/debug-evaluate-locals.js
@@ -38,6 +38,7 @@ function h() {
var b = 2;
var eval = 5; // Overriding eval should not break anything.
debugger; // Breakpoint.
+ return a;
}
function checkFrame0(frame) {
@@ -60,7 +61,7 @@ function checkFrame0(frame) {
function g() {
var a = 3;
eval("var b = 4;");
- h();
+ return h() + a;
}
function checkFrame1(frame) {
@@ -83,7 +84,7 @@ function f() {
var a = 5;
var b = 0;
with ({b:6}) {
- g();
+ return g();
}
}
@@ -125,6 +126,10 @@ function listener(event, exec_state, event_data, data) {
assertEquals(6, exec_state.frame(2).evaluate('b').value());
assertEquals("function",
typeof exec_state.frame(2).evaluate('eval').value());
+ assertEquals("foo",
+ exec_state.frame(0).evaluate('a = "foo"').value());
+ assertEquals("bar",
+ exec_state.frame(1).evaluate('a = "bar"').value());
// Indicate that all was processed.
listenerComplete = true;
}
@@ -137,7 +142,9 @@ function listener(event, exec_state, event_data, data) {
// Add the debug event listener.
Debug.setListener(listener);
-f();
+var f_result = f();
+
+assertEquals('foobar', f_result);
// Make sure that the debug event listener was invoked.
assertFalse(exception, "exception in listener")
diff --git a/deps/v8/test/mjsunit/debug-script.js b/deps/v8/test/mjsunit/debug-script.js
index afaa369042..c456e6bf57 100644
--- a/deps/v8/test/mjsunit/debug-script.js
+++ b/deps/v8/test/mjsunit/debug-script.js
@@ -61,9 +61,8 @@ for (i = 0; i < scripts.length; i++) {
// This has to be updated if the number of native scripts change.
assertEquals(16, named_native_count);
-// If no snapshot is used, only the 'gc' extension is loaded.
-// If snapshot is used, all extensions are cached in the snapshot.
-assertTrue(extension_count == 1 || extension_count == 5);
+// Only the 'gc' and (depending on flags) the 'i18n' extensions are loaded.
+assertTrue(extension_count == 1 || extension_count == 2);
// This script and mjsunit.js has been loaded. If using d8, d8 loads
// a normal script during startup too.
assertTrue(normal_count == 2 || normal_count == 3);
diff --git a/deps/v8/test/mjsunit/elements-kind.js b/deps/v8/test/mjsunit/elements-kind.js
index 0e8e209ef7..247aa89747 100644
--- a/deps/v8/test/mjsunit/elements-kind.js
+++ b/deps/v8/test/mjsunit/elements-kind.js
@@ -171,18 +171,21 @@ monomorphic(smi_only);
if (support_smi_only_arrays) {
function construct_smis() {
+ try {} catch (e) {} // TODO(titzer): DisableOptimization
var a = [0, 0, 0];
a[0] = 0; // Send the COW array map to the steak house.
assertKind(elements_kind.fast_smi_only, a);
return a;
}
function construct_doubles() {
+ try {} catch (e) {} // TODO(titzer): DisableOptimization
var a = construct_smis();
a[0] = 1.5;
assertKind(elements_kind.fast_double, a);
return a;
}
function construct_objects() {
+ try {} catch (e) {} // TODO(titzer): DisableOptimization
var a = construct_smis();
a[0] = "one";
assertKind(elements_kind.fast, a);
@@ -191,6 +194,7 @@ if (support_smi_only_arrays) {
// Test crankshafted transition SMI->DOUBLE.
function convert_to_double(array) {
+ try {} catch (e) {} // TODO(titzer): DisableOptimization
array[1] = 2.5;
assertKind(elements_kind.fast_double, array);
assertEquals(2.5, array[1]);
@@ -202,6 +206,7 @@ if (support_smi_only_arrays) {
convert_to_double(smis);
// Test crankshafted transitions SMI->FAST and DOUBLE->FAST.
function convert_to_fast(array) {
+ try {} catch (e) {} // TODO(titzer): DisableOptimization
array[1] = "two";
assertKind(elements_kind.fast, array);
assertEquals("two", array[1]);
@@ -218,6 +223,7 @@ if (support_smi_only_arrays) {
// Test transition chain SMI->DOUBLE->FAST (crankshafted function will
// transition to FAST directly).
function convert_mixed(array, value, kind) {
+ try {} catch (e) {} // TODO(titzer): DisableOptimization
array[1] = value;
assertKind(kind, array);
assertEquals(value, array[1]);
diff --git a/deps/v8/test/mjsunit/external-array-no-sse2.js b/deps/v8/test/mjsunit/external-array-no-sse2.js
index c9d56217c8..cffcab8610 100644
--- a/deps/v8/test/mjsunit/external-array-no-sse2.js
+++ b/deps/v8/test/mjsunit/external-array-no-sse2.js
@@ -520,30 +520,15 @@ assertSame(a.buffer, aa.buffer);
assertThrows(function(){ a.subarray.call({}, 0) });
assertThrows(function(){ a.subarray.call([], 0) });
-// Call constructors directly as functions, and through .call and .apply
-
-b = ArrayBuffer(100)
-a = Int8Array(b, 5, 77)
-assertInstance(b, ArrayBuffer)
-assertInstance(a, Int8Array)
-assertSame(b, a.buffer)
-assertEquals(5, a.byteOffset)
-assertEquals(77, a.byteLength)
-b = ArrayBuffer.call(null, 10)
-a = Uint16Array.call(null, b, 2, 4)
-assertInstance(b, ArrayBuffer)
-assertInstance(a, Uint16Array)
-assertSame(b, a.buffer)
-assertEquals(2, a.byteOffset)
-assertEquals(8, a.byteLength)
-b = ArrayBuffer.apply(null, [1000])
-a = Float32Array.apply(null, [b, 128, 1])
-assertInstance(b, ArrayBuffer)
-assertInstance(a, Float32Array)
-assertSame(b, a.buffer)
-assertEquals(128, a.byteOffset)
-assertEquals(4, a.byteLength)
+// Try to call constructors directly as functions, and through .call
+// and .apply. Should fail.
+assertThrows(function() { ArrayBuffer(100); }, TypeError);
+assertThrows(function() { Int8Array(b, 5, 77); }, TypeError);
+assertThrows(function() { ArrayBuffer.call(null, 10); }, TypeError);
+assertThrows(function() { Uint16Array.call(null, b, 2, 4); }, TypeError);
+assertThrows(function() { ArrayBuffer.apply(null, [1000]); }, TypeError);
+assertThrows(function() { Float32Array.apply(null, [b, 128, 1]); }, TypeError);
// Test array.set in different combinations.
@@ -632,15 +617,15 @@ var b0 = a0.buffer
var b1 = b0.slice(0)
assertEquals(b0.byteLength, b1.byteLength)
-assertArrayPrefix([1, 2, 3, 4, 5, 6], Int8Array(b1))
+assertArrayPrefix([1, 2, 3, 4, 5, 6], new Int8Array(b1))
var b2 = b0.slice(3)
assertEquals(b0.byteLength - 3, b2.byteLength)
-assertArrayPrefix([4, 5, 6], Int8Array(b2))
+assertArrayPrefix([4, 5, 6], new Int8Array(b2))
var b3 = b0.slice(2, 4)
assertEquals(2, b3.byteLength)
-assertArrayPrefix([3, 4], Int8Array(b3))
+assertArrayPrefix([3, 4], new Int8Array(b3))
function goo(a, i) {
return a[i];
diff --git a/deps/v8/test/mjsunit/external-array.js b/deps/v8/test/mjsunit/external-array.js
index bfdab8abff..deb3c8659d 100644
--- a/deps/v8/test/mjsunit/external-array.js
+++ b/deps/v8/test/mjsunit/external-array.js
@@ -519,30 +519,15 @@ assertSame(a.buffer, aa.buffer);
assertThrows(function(){ a.subarray.call({}, 0) });
assertThrows(function(){ a.subarray.call([], 0) });
-// Call constructors directly as functions, and through .call and .apply
-
-b = ArrayBuffer(100)
-a = Int8Array(b, 5, 77)
-assertInstance(b, ArrayBuffer)
-assertInstance(a, Int8Array)
-assertSame(b, a.buffer)
-assertEquals(5, a.byteOffset)
-assertEquals(77, a.byteLength)
-b = ArrayBuffer.call(null, 10)
-a = Uint16Array.call(null, b, 2, 4)
-assertInstance(b, ArrayBuffer)
-assertInstance(a, Uint16Array)
-assertSame(b, a.buffer)
-assertEquals(2, a.byteOffset)
-assertEquals(8, a.byteLength)
-b = ArrayBuffer.apply(null, [1000])
-a = Float32Array.apply(null, [b, 128, 1])
-assertInstance(b, ArrayBuffer)
-assertInstance(a, Float32Array)
-assertSame(b, a.buffer)
-assertEquals(128, a.byteOffset)
-assertEquals(4, a.byteLength)
+// Try to call constructors directly as functions, and through .call
+// and .apply. Should fail.
+assertThrows(function() { ArrayBuffer(100); }, TypeError);
+assertThrows(function() { Int8Array(b, 5, 77); }, TypeError);
+assertThrows(function() { ArrayBuffer.call(null, 10); }, TypeError);
+assertThrows(function() { Uint16Array.call(null, b, 2, 4); }, TypeError);
+assertThrows(function() { ArrayBuffer.apply(null, [1000]); }, TypeError);
+assertThrows(function() { Float32Array.apply(null, [b, 128, 1]); }, TypeError);
// Test array.set in different combinations.
@@ -631,15 +616,15 @@ var b0 = a0.buffer
var b1 = b0.slice(0)
assertEquals(b0.byteLength, b1.byteLength)
-assertArrayPrefix([1, 2, 3, 4, 5, 6], Int8Array(b1))
+assertArrayPrefix([1, 2, 3, 4, 5, 6], new Int8Array(b1))
var b2 = b0.slice(3)
assertEquals(b0.byteLength - 3, b2.byteLength)
-assertArrayPrefix([4, 5, 6], Int8Array(b2))
+assertArrayPrefix([4, 5, 6], new Int8Array(b2))
var b3 = b0.slice(2, 4)
assertEquals(2, b3.byteLength)
-assertArrayPrefix([3, 4], Int8Array(b3))
+assertArrayPrefix([3, 4], new Int8Array(b3))
function goo(a, i) {
return a[i];
diff --git a/deps/v8/test/mjsunit/function-call.js b/deps/v8/test/mjsunit/function-call.js
index 92792ac827..38be10c48b 100644
--- a/deps/v8/test/mjsunit/function-call.js
+++ b/deps/v8/test/mjsunit/function-call.js
@@ -151,6 +151,7 @@ var reducing_functions =
function checkExpectedMessage(e) {
assertTrue(e.message.indexOf("called on null or undefined") >= 0 ||
+ e.message.indexOf("invoked on undefined or null value") >= 0 ||
e.message.indexOf("Cannot convert null to object") >= 0);
}
diff --git a/deps/v8/test/mjsunit/fuzz-natives-part1.js b/deps/v8/test/mjsunit/fuzz-natives-part1.js
index d5e1aeea5f..8ca523cc6f 100644
--- a/deps/v8/test/mjsunit/fuzz-natives-part1.js
+++ b/deps/v8/test/mjsunit/fuzz-natives-part1.js
@@ -163,6 +163,8 @@ var knownProblems = {
"ResolvePossiblyDirectEval": true,
"Log": true,
"DeclareGlobals": true,
+ "ArrayConstructor": true,
+ "InternalArrayConstructor": true,
"PromoteScheduledException": true,
"DeleteHandleScopeExtensions": true,
@@ -205,11 +207,18 @@ var knownProblems = {
// Only applicable to generators.
"_GeneratorNext": true,
"_GeneratorThrow": true,
+
+ // Only applicable to DataViews.
+ "DataViewGetBuffer": true,
+ "DataViewGetByteLength": true,
+ "DataViewGetByteOffset": true
};
var currentlyUncallable = {
// We need to find a way to test this without breaking the system.
- "SystemBreak": true
+ "SystemBreak": true,
+ // Inserts an int3/stop instruction when run with --always-opt.
+ "_DebugBreakInOptimizedCode": true
};
function testNatives() {
diff --git a/deps/v8/test/mjsunit/fuzz-natives-part2.js b/deps/v8/test/mjsunit/fuzz-natives-part2.js
index 699a341783..ec84f35ada 100644
--- a/deps/v8/test/mjsunit/fuzz-natives-part2.js
+++ b/deps/v8/test/mjsunit/fuzz-natives-part2.js
@@ -153,6 +153,7 @@ var knownProblems = {
"ParallelRecompile": true,
"InstallRecompiledCode": true,
"NotifyDeoptimized": true,
+ "NotifyStubFailure": true,
"NotifyOSR": true,
"CreateObjectLiteralBoilerplate": true,
"CloneLiteralBoilerplate": true,
@@ -206,11 +207,18 @@ var knownProblems = {
// Only applicable to generators.
"_GeneratorNext": true,
"_GeneratorThrow": true,
+
+ // Only applicable to DataViews.
+ "DataViewGetBuffer": true,
+ "DataViewGetByteLength": true,
+ "DataViewGetByteOffset": true
};
var currentlyUncallable = {
// We need to find a way to test this without breaking the system.
- "SystemBreak": true
+ "SystemBreak": true,
+ // Inserts an int3/stop instruction when run with --always-opt.
+ "_DebugBreakInOptimizedCode": true
};
function testNatives() {
diff --git a/deps/v8/test/mjsunit/fuzz-natives-part3.js b/deps/v8/test/mjsunit/fuzz-natives-part3.js
index 973963597f..928fb4634f 100644
--- a/deps/v8/test/mjsunit/fuzz-natives-part3.js
+++ b/deps/v8/test/mjsunit/fuzz-natives-part3.js
@@ -153,6 +153,7 @@ var knownProblems = {
"ParallelRecompile": true,
"InstallRecompiledCode": true,
"NotifyDeoptimized": true,
+ "NotifyStubFailure": true,
"NotifyOSR": true,
"CreateObjectLiteralBoilerplate": true,
"CloneLiteralBoilerplate": true,
@@ -162,6 +163,8 @@ var knownProblems = {
"ResolvePossiblyDirectEval": true,
"Log": true,
"DeclareGlobals": true,
+ "ArrayConstructor": true,
+ "InternalArrayConstructor": true,
"PromoteScheduledException": true,
"DeleteHandleScopeExtensions": true,
@@ -204,11 +207,18 @@ var knownProblems = {
// Only applicable to generators.
"_GeneratorNext": true,
"_GeneratorThrow": true,
+
+ // Only applicable to DataViews.
+ "DataViewGetBuffer": true,
+ "DataViewGetByteLength": true,
+ "DataViewGetByteOffset": true
};
var currentlyUncallable = {
// We need to find a way to test this without breaking the system.
- "SystemBreak": true
+ "SystemBreak": true,
+ // Inserts an int3/stop instruction when run with --always-opt.
+ "_DebugBreakInOptimizedCode": true
};
function testNatives() {
diff --git a/deps/v8/test/mjsunit/fuzz-natives-part4.js b/deps/v8/test/mjsunit/fuzz-natives-part4.js
index 595af7d629..d47db3467e 100644
--- a/deps/v8/test/mjsunit/fuzz-natives-part4.js
+++ b/deps/v8/test/mjsunit/fuzz-natives-part4.js
@@ -153,6 +153,7 @@ var knownProblems = {
"ParallelRecompile": true,
"InstallRecompiledCode": true,
"NotifyDeoptimized": true,
+ "NotifyStubFailure": true,
"NotifyOSR": true,
"CreateObjectLiteralBoilerplate": true,
"CloneLiteralBoilerplate": true,
@@ -162,6 +163,8 @@ var knownProblems = {
"ResolvePossiblyDirectEval": true,
"Log": true,
"DeclareGlobals": true,
+ "ArrayConstructor": true,
+ "InternalArrayConstructor": true,
"PromoteScheduledException": true,
"DeleteHandleScopeExtensions": true,
@@ -204,11 +207,18 @@ var knownProblems = {
// Only applicable to generators.
"_GeneratorNext": true,
"_GeneratorThrow": true,
+
+ // Only applicable to DataViews.
+ "DataViewGetBuffer": true,
+ "DataViewGetByteLength": true,
+ "DataViewGetByteOffset": true
};
var currentlyUncallable = {
// We need to find a way to test this without breaking the system.
- "SystemBreak": true
+ "SystemBreak": true,
+ // Inserts an int3/stop instruction when run with --always-opt.
+ "_DebugBreakInOptimizedCode": true
};
function testNatives() {
diff --git a/deps/v8/test/mjsunit/harmony/collections.js b/deps/v8/test/mjsunit/harmony/collections.js
index d60c59c907..cf18745ae8 100644
--- a/deps/v8/test/mjsunit/harmony/collections.js
+++ b/deps/v8/test/mjsunit/harmony/collections.js
@@ -377,17 +377,39 @@ for (var i = 9; i >= 0; i--) {
assertEquals(i, m.size);
}
-// Test clear
-var a = new Set();
-s.add(42);
-assertTrue(s.has(42));
-s.clear();
-assertFalse(s.has(42));
-assertEquals(0, s.size);
-var m = new Map();
-m.set(42, true);
-assertTrue(m.has(42));
-m.clear();
-assertFalse(m.has(42));
-assertEquals(0, m.size);
+// Test Set clear
+(function() {
+ var s = new Set();
+ s.add(42);
+ assertTrue(s.has(42));
+ assertEquals(1, s.size);
+ s.clear();
+ assertFalse(s.has(42));
+ assertEquals(0, s.size);
+})();
+
+
+// Test Map clear
+(function() {
+ var m = new Map();
+ m.set(42, true);
+ assertTrue(m.has(42));
+ assertEquals(1, m.size);
+ m.clear();
+ assertFalse(m.has(42));
+ assertEquals(0, m.size);
+})();
+
+
+// Test WeakMap clear
+(function() {
+ var k = new Object();
+ var w = new WeakMap();
+ w.set(k, 23);
+ assertTrue(w.has(k));
+ assertEquals(23, w.get(k));
+ w.clear();
+ assertFalse(w.has(k));
+ assertEquals(undefined, w.get(k));
+})();
diff --git a/deps/v8/test/mjsunit/harmony/dataview-accessors.js b/deps/v8/test/mjsunit/harmony/dataview-accessors.js
new file mode 100644
index 0000000000..9dd8fe35e0
--- /dev/null
+++ b/deps/v8/test/mjsunit/harmony/dataview-accessors.js
@@ -0,0 +1,310 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// These tests are adapted from Khronos DataView tests
+
+var intArray1 =
+ [0, 1, 2, 3, 100, 101, 102, 103, 128, 129, 130, 131, 252, 253, 254, 255];
+var intArray2 =
+ [31, 32, 33, 0, 1, 2, 3, 100, 101, 102, 103, 128, 129, 130, 131, 252,
+ 253, 254, 255];
+var initialArray =
+ [204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
+ 204, 204, 204];
+
+var arayBuffer = null;
+var view = null;
+var viewStart = 0;
+var viewLength = 0;
+
+function getElementSize(func) {
+ switch (func) {
+ case "Int8":
+ case "Uint8":
+ return 1;
+ case "Int16":
+ case "Uint16":
+ return 2;
+ case "Int32":
+ case "Uint32":
+ case "Float32":
+ return 4;
+ case "Float64":
+ return 8;
+ default:
+ assertUnreachable(func);
+ }
+}
+
+function checkGet(func, index, expected, littleEndian) {
+ function doGet() {
+ return view["get" + func](index, littleEndian);
+ }
+ if (index >=0 && index + getElementSize(func) - 1 < view.byteLength)
+ assertSame(expected, doGet());
+ else
+ assertThrows(doGet, RangeError);
+}
+
+function checkSet(func, index, value, littleEndian) {
+ function doSet() {
+ view["set" + func](index, value, littleEndian);
+ }
+ if (index >= 0 &&
+ index + getElementSize(func) - 1 < view.byteLength) {
+ assertSame(undefined, doSet());
+ checkGet(func, index, value, littleEndian);
+ } else {
+ assertThrows(doSet, RangeError);
+ }
+}
+
+function test(isTestingGet, func, index, value, littleEndian) {
+ if (isTestingGet)
+ checkGet(func, index, value, littleEndian);
+ else
+ checkSet(func, index, value, littleEndian);
+}
+
+function createDataView(
+ array, frontPaddingNum, littleEndian, start, length) {
+ if (!littleEndian)
+ array.reverse();
+ var paddingArray = new Array(frontPaddingNum);
+ arrayBuffer = (new Uint8Array(paddingArray.concat(array))).buffer;
+ view = new DataView(arrayBuffer, viewStart, viewLength);
+ if (!littleEndian)
+ array.reverse(); // restore the array.
+}
+
+function runIntegerTestCases(isTestingGet, array, start, length) {
+ createDataView(array, 0, true, start, length);
+
+ test(isTestingGet, "Int8", 0, 0);
+ test(isTestingGet, "Int8", 8, -128);
+ test(isTestingGet, "Int8", 15, -1);
+
+ test(isTestingGet, "Uint8", 0, 0);
+ test(isTestingGet, "Uint8", 8, 128);
+ test(isTestingGet, "Uint8", 15, 255);
+
+ // Little endian.
+ test(isTestingGet, "Int16", 0, 256, true);
+ test(isTestingGet, "Int16", 5, 26213, true);
+ test(isTestingGet, "Int16", 9, -32127, true);
+ test(isTestingGet, "Int16", 14, -2, true);
+
+ // Big endian.
+ test(isTestingGet, "Int16", 0, 1);
+ test(isTestingGet, "Int16", 5, 25958);
+ test(isTestingGet, "Int16", 9, -32382);
+ test(isTestingGet, "Int16", 14, -257);
+
+ // Little endian.
+ test(isTestingGet, "Uint16", 0, 256, true);
+ test(isTestingGet, "Uint16", 5, 26213, true);
+ test(isTestingGet, "Uint16", 9, 33409, true);
+ test(isTestingGet, "Uint16", 14, 65534, true);
+
+ // Big endian.
+ test(isTestingGet, "Uint16", 0, 1);
+ test(isTestingGet, "Uint16", 5, 25958);
+ test(isTestingGet, "Uint16", 9, 33154);
+ test(isTestingGet, "Uint16", 14, 65279);
+
+ // Little endian.
+ test(isTestingGet, "Int32", 0, 50462976, true);
+ test(isTestingGet, "Int32", 3, 1717920771, true);
+ test(isTestingGet, "Int32", 6, -2122291354, true);
+ test(isTestingGet, "Int32", 9, -58490239, true);
+ test(isTestingGet, "Int32", 12,-66052, true);
+
+ // Big endian.
+ test(isTestingGet, "Int32", 0, 66051);
+ test(isTestingGet, "Int32", 3, 56911206);
+ test(isTestingGet, "Int32", 6, 1718059137);
+ test(isTestingGet, "Int32", 9, -2122152964);
+ test(isTestingGet, "Int32", 12, -50462977);
+
+ // Little endian.
+ test(isTestingGet, "Uint32", 0, 50462976, true);
+ test(isTestingGet, "Uint32", 3, 1717920771, true);
+ test(isTestingGet, "Uint32", 6, 2172675942, true);
+ test(isTestingGet, "Uint32", 9, 4236477057, true);
+ test(isTestingGet, "Uint32", 12,4294901244, true);
+
+ // Big endian.
+ test(isTestingGet, "Uint32", 0, 66051);
+ test(isTestingGet, "Uint32", 3, 56911206);
+ test(isTestingGet, "Uint32", 6, 1718059137);
+ test(isTestingGet, "Uint32", 9, 2172814332);
+ test(isTestingGet, "Uint32", 12, 4244504319);
+}
+
+function testFloat(isTestingGet, func, array, start, expected) {
+ // Little endian.
+ createDataView(array, 0, true, start);
+ test(isTestingGet, func, 0, expected, true);
+ createDataView(array, 3, true, start);
+ test(isTestingGet, func, 3, expected, true);
+ createDataView(array, 7, true, start);
+ test(isTestingGet, func, 7, expected, true);
+ createDataView(array, 10, true, start);
+ test(isTestingGet, func, 10, expected, true);
+
+ // Big endian.
+ createDataView(array, 0, false);
+ test(isTestingGet, func, 0, expected, false);
+ createDataView(array, 3, false);
+ test(isTestingGet, func, 3, expected, false);
+ createDataView(array, 7, false);
+ test(isTestingGet, func, 7, expected, false);
+ createDataView(array, 10, false);
+ test(isTestingGet, func, 10, expected, false);
+}
+
+function runFloatTestCases(isTestingGet, start) {
+ testFloat(isTestingGet, "Float32",
+ isTestingGet ? [0, 0, 32, 65] : initialArray, start, 10);
+
+ testFloat(isTestingGet, "Float32",
+ isTestingGet ? [164, 112, 157, 63] : initialArray,
+ start, 1.2300000190734863);
+ testFloat(isTestingGet, "Float32",
+ isTestingGet ? [95, 53, 50, 199] : initialArray,
+ start, -45621.37109375);
+ testFloat(isTestingGet, "Float32",
+ isTestingGet ? [255, 255, 255, 127] : initialArray,
+ start, NaN);
+ testFloat(isTestingGet, "Float32",
+ isTestingGet ? [255, 255, 255, 255] : initialArray,
+ start, -NaN);
+
+ testFloat(isTestingGet, "Float64",
+ isTestingGet ? [0, 0, 0, 0, 0, 0, 36, 64] : initialArray,
+ start, 10);
+ testFloat(isTestingGet, "Float64",
+ isTestingGet ? [174, 71, 225, 122, 20, 174, 243, 63] : initialArray,
+ start, 1.23);
+ testFloat(isTestingGet, "Float64",
+ isTestingGet ? [181, 55, 248, 30, 242, 179, 87, 193] : initialArray,
+ start, -6213576.4839);
+ testFloat(isTestingGet, "Float64",
+ isTestingGet ? [255, 255, 255, 255, 255, 255, 255, 127] : initialArray,
+ start, NaN);
+ testFloat(isTestingGet, "Float64",
+ isTestingGet ? [255, 255, 255, 255, 255, 255, 255, 255] : initialArray,
+ start, -NaN);
+}
+
+function runNegativeIndexTests(isTestingGet) {
+ createDataView(intArray1, 0, true, 0, 16);
+
+ test(isTestingGet, "Int8", -1, 0);
+ test(isTestingGet, "Int8", -2, 0);
+
+ test(isTestingGet, "Uint8", -1, 0);
+ test(isTestingGet, "Uint8", -2, 0);
+
+ test(isTestingGet, "Int16", -1, 1);
+ test(isTestingGet, "Int16", -2, 1);
+ test(isTestingGet, "Int16", -3, 1);
+
+ test(isTestingGet, "Uint16", -1, 1);
+ test(isTestingGet, "Uint16", -2, 1);
+ test(isTestingGet, "Uint16", -3, 1);
+
+ test(isTestingGet, "Int32", -1, 66051);
+ test(isTestingGet, "Int32", -3, 66051);
+ test(isTestingGet, "Int32", -5, 66051);
+
+ test(isTestingGet, "Uint32", -1, 66051);
+ test(isTestingGet, "Uint32", -3, 66051);
+ test(isTestingGet, "Uint32", -5, 66051);
+
+ createDataView([0, 0, 0, 0, 0, 0, 0, 0], 0, true, 0, 8);
+
+ test(isTestingGet, "Float32", -1, 0);
+ test(isTestingGet, "Float32", -3, 0);
+ test(isTestingGet, "Float32", -5, 0);
+
+ test(isTestingGet, "Float64", -1, 0);
+ test(isTestingGet, "Float64", -5, 0);
+ test(isTestingGet, "Float64", -9, 0);
+}
+
+
+function TestGetters() {
+ runIntegerTestCases(true, intArray1, 0, 16);
+ runFloatTestCases(true, 0);
+
+ runIntegerTestCases(true, intArray2, 3, 2);
+ runFloatTestCases(true, 3);
+
+ runNegativeIndexTests(true);
+}
+
+function TestSetters() {
+ runIntegerTestCases(false, initialArray, 0, 16);
+ runFloatTestCases(false);
+
+ runIntegerTestCases(false, initialArray, 3, 2);
+ runFloatTestCases(false, 7);
+
+ runNegativeIndexTests(false);
+
+}
+
+TestGetters();
+TestSetters();
+
+function TestGeneralAccessors() {
+ var a = new DataView(new ArrayBuffer(256));
+ function CheckAccessor(name) {
+ var f = a[name];
+ f.call(a, 0, 0); // should not throw
+ assertThrows(function() { f.call({}, 0, 0); }, TypeError);
+ }
+ CheckAccessor("getUint8");
+ CheckAccessor("setUint8");
+ CheckAccessor("getInt8");
+ CheckAccessor("setInt8");
+ CheckAccessor("getUint16");
+ CheckAccessor("setUint16");
+ CheckAccessor("getInt16");
+ CheckAccessor("setInt16");
+ CheckAccessor("getUint32");
+ CheckAccessor("setUint32");
+ CheckAccessor("getInt32");
+ CheckAccessor("setInt32");
+ CheckAccessor("getFloat32");
+ CheckAccessor("setFloat32");
+ CheckAccessor("getFloat64");
+ CheckAccessor("setFloat64");
+}
+
+TestGeneralAccessors();
diff --git a/deps/v8/test/mjsunit/harmony/generators-iteration.js b/deps/v8/test/mjsunit/harmony/generators-iteration.js
index 01facd085c..7fad97e944 100644
--- a/deps/v8/test/mjsunit/harmony/generators-iteration.js
+++ b/deps/v8/test/mjsunit/harmony/generators-iteration.js
@@ -324,6 +324,67 @@ TestGenerator(
"foo",
[2, "1foo3", 5, "4foo6", "foofoo"]);
+// Generator function instances.
+TestGenerator(GeneratorFunction(),
+ [undefined],
+ "foo",
+ [undefined]);
+
+TestGenerator(new GeneratorFunction(),
+ [undefined],
+ "foo",
+ [undefined]);
+
+TestGenerator(GeneratorFunction('yield 1;'),
+ [1, undefined],
+ "foo",
+ [1, undefined]);
+
+TestGenerator(
+ function() { return GeneratorFunction('x', 'y', 'yield x + y;')(1, 2) },
+ [3, undefined],
+ "foo",
+ [3, undefined]);
+
+// Access to this with formal arguments.
+TestGenerator(
+ function () {
+ return ({ x: 42, g: function* (a) { yield this.x } }).g(0);
+ },
+ [42, undefined],
+ "foo",
+ [42, undefined]);
+
+// Test that yield* re-yields received results without re-boxing.
+function TestDelegatingYield() {
+ function results(results) {
+ var i = 0;
+ function next() {
+ return results[i++];
+ }
+ return { next: next }
+ }
+ function* yield_results(expected) {
+ return yield* results(expected);
+ }
+ function collect_results(iter) {
+ var ret = [];
+ var result;
+ do {
+ result = iter.next();
+ ret.push(result);
+ } while (!result.done);
+ return ret;
+ }
+ // We have to put a full result for the end, because the return will re-box.
+ var expected = [{value: 1}, 13, "foo", {value: 34, done: true}];
+
+ // Sanity check.
+ assertEquals(expected, collect_results(results(expected)));
+ assertEquals(expected, collect_results(yield_results(expected)));
+}
+TestDelegatingYield();
+
function TestTryCatch(instantiate) {
function* g() { yield 1; try { yield 2; } catch (e) { yield e; } yield 3; }
function Sentinel() {}
diff --git a/deps/v8/test/mjsunit/harmony/generators-runtime.js b/deps/v8/test/mjsunit/harmony/generators-runtime.js
index 7667deb7f6..aef063b6c8 100644
--- a/deps/v8/test/mjsunit/harmony/generators-runtime.js
+++ b/deps/v8/test/mjsunit/harmony/generators-runtime.js
@@ -110,6 +110,9 @@ function TestGeneratorFunction() {
// Not all functions are generators.
assertTrue(f instanceof Function); // Sanity check.
assertTrue(!(f instanceof GeneratorFunction));
+
+ assertTrue((new GeneratorFunction()) instanceof GeneratorFunction);
+ assertTrue(GeneratorFunction() instanceof GeneratorFunction);
}
TestGeneratorFunction();
diff --git a/deps/v8/test/mjsunit/harmony/iteration-syntax.js b/deps/v8/test/mjsunit/harmony/iteration-syntax.js
index 21149c04bc..3bda78ed4e 100644
--- a/deps/v8/test/mjsunit/harmony/iteration-syntax.js
+++ b/deps/v8/test/mjsunit/harmony/iteration-syntax.js
@@ -54,6 +54,11 @@ assertThrows("function f() { for (var of of) { } }", SyntaxError);
assertThrows("function f() { for (let of y) { } }", SyntaxError);
assertThrows("function f() { for (let of of) { } }", SyntaxError);
+assertThrows("function f() { for (x = 3 of y) { } }", SyntaxError);
+assertThrows("function f() { for (var x = 3 of y) { } }", SyntaxError);
+assertThrows("function f() { for (let x = 3 of y) { } }", SyntaxError);
+
+
// Alack, this appears to be valid.
function f() { for (of of y) { } }
function f() { for (let of of y) { } }
diff --git a/deps/v8/test/mjsunit/harmony/typedarrays.js b/deps/v8/test/mjsunit/harmony/typedarrays.js
index c5c19e161f..e1b0e653d6 100644
--- a/deps/v8/test/mjsunit/harmony/typedarrays.js
+++ b/deps/v8/test/mjsunit/harmony/typedarrays.js
@@ -25,8 +25,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --harmony-typed-arrays
-
// ArrayBuffer
function TestByteLength(param, expectedByteLength) {
@@ -37,14 +35,15 @@ function TestByteLength(param, expectedByteLength) {
function TestArrayBufferCreation() {
TestByteLength(1, 1);
TestByteLength(256, 256);
- TestByteLength(-10, 0);
TestByteLength(2.567, 2);
- TestByteLength(-2.567, 0);
TestByteLength("abc", 0);
TestByteLength(0, 0);
+ assertThrows(function() { new ArrayBuffer(-10); }, RangeError);
+ assertThrows(function() { new ArrayBuffer(-2.567); }, RangeError);
+
/* TODO[dslomov]: Reenable the test
assertThrows(function() {
var ab1 = new ArrayBuffer(0xFFFFFFFFFFFF)
@@ -91,6 +90,7 @@ function TestArrayBufferSlice() {
TestSlice(0, 0, 1, 20);
TestSlice(100, 100, 0, 100);
TestSlice(100, 100, 0, 1000);
+
TestSlice(0, 100, 5, 1);
TestSlice(1, 100, -11, -10);
@@ -101,7 +101,7 @@ function TestArrayBufferSlice() {
TestSlice(10, 100, 90, "100");
TestSlice(10, 100, "90", "100");
- TestSlice(0, 100, 90, "abc");
+ TestSlice(0, 100, 90, "abc");
TestSlice(10, 100, "abc", 10);
TestSlice(10, 100, 0.96, 10.96);
@@ -109,7 +109,6 @@ function TestArrayBufferSlice() {
TestSlice(10, 100, 0.01, 10.01);
TestSlice(10, 100, 0.01, 10.96);
-
TestSlice(10, 100, 90);
TestSlice(10, 100, -10);
}
@@ -457,6 +456,74 @@ function TestTypedArraySet() {
TestTypedArraySet();
+// DataView
+function TestDataViewConstructor() {
+ var ab = new ArrayBuffer(256);
+
+ var d1 = new DataView(ab, 1, 255);
+ assertSame(ab, d1.buffer);
+ assertSame(1, d1.byteOffset);
+ assertSame(255, d1.byteLength);
+
+ var d2 = new DataView(ab, 2);
+ assertSame(ab, d2.buffer);
+ assertSame(2, d2.byteOffset);
+ assertSame(254, d2.byteLength);
+
+ var d3 = new DataView(ab);
+ assertSame(ab, d3.buffer);
+ assertSame(0, d3.byteOffset);
+ assertSame(256, d3.byteLength);
+
+ var d3a = new DataView(ab, 1, 0);
+ assertSame(ab, d3a.buffer);
+ assertSame(1, d3a.byteOffset);
+ assertSame(0, d3a.byteLength);
+
+ var d3b = new DataView(ab, 256, 0);
+ assertSame(ab, d3b.buffer);
+ assertSame(256, d3b.byteOffset);
+ assertSame(0, d3b.byteLength);
+
+ var d3c = new DataView(ab, 256);
+ assertSame(ab, d3c.buffer);
+ assertSame(256, d3c.byteOffset);
+ assertSame(0, d3c.byteLength);
+
+ var d4 = new DataView(ab, 1, 3.1415926);
+ assertSame(ab, d4.buffer);
+ assertSame(1, d4.byteOffset);
+ assertSame(3, d4.byteLength);
+
+
+ // error cases
+ assertThrows(function() { new DataView(ab, -1); }, RangeError);
+ assertThrows(function() { new DataView(ab, 1, -1); }, RangeError);
+ assertThrows(function() { new DataView(); }, TypeError);
+ assertThrows(function() { new DataView([]); }, TypeError);
+ assertThrows(function() { new DataView(ab, 257); }, RangeError);
+ assertThrows(function() { new DataView(ab, 1, 1024); }, RangeError);
+}
+
+TestDataViewConstructor();
+
+function TestDataViewPropertyTypeChecks() {
+ var a = new DataView(new ArrayBuffer(10));
+ function CheckProperty(name) {
+ var d = Object.getOwnPropertyDescriptor(DataView.prototype, name);
+ var o = {}
+ assertThrows(function() {d.get.call(o);}, TypeError);
+ d.get.call(a); // shouldn't throw
+ }
+
+ CheckProperty("buffer");
+ CheckProperty("byteOffset");
+ CheckProperty("byteLength");
+}
+
+
+TestDataViewPropertyTypeChecks();
+
// General tests for properties
// Test property attribute [[Enumerable]]
@@ -475,6 +542,7 @@ TestEnumerable(ArrayBuffer, new ArrayBuffer());
for(i = 0; i < typedArrayConstructors.lenght; i++) {
TestEnumerable(typedArrayConstructors[i]);
}
+TestEnumerable(DataView, new DataView(new ArrayBuffer()));
// Test arbitrary properties on ArrayBuffer
function TestArbitrary(m) {
@@ -491,8 +559,9 @@ TestArbitrary(new ArrayBuffer(256));
for(i = 0; i < typedArrayConstructors.lenght; i++) {
TestArbitary(new typedArrayConstructors[i](10));
}
-
+TestArbitrary(new DataView(new ArrayBuffer(256)));
// Test direct constructor call
-assertTrue(ArrayBuffer() instanceof ArrayBuffer);
+assertThrows(function() { ArrayBuffer(); }, TypeError);
+assertThrows(function() { DataView(new ArrayBuffer()); }, TypeError);
diff --git a/deps/v8/test/mjsunit/manual-parallel-recompile.js b/deps/v8/test/mjsunit/manual-parallel-recompile.js
index 8d660e047c..b502fb19ad 100644
--- a/deps/v8/test/mjsunit/manual-parallel-recompile.js
+++ b/deps/v8/test/mjsunit/manual-parallel-recompile.js
@@ -25,12 +25,22 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --allow-natives-syntax --expose-gc --parallel-recompilation
+// Flags: --allow-natives-syntax --expose-gc
+// Flags: --parallel-recompilation --parallel-recompilation-delay=50
+
+if (!%IsParallelRecompilationSupported()) {
+ print("Parallel recompilation is disabled. Skipping this test.");
+ quit();
+}
function assertUnoptimized(fun) {
assertTrue(%GetOptimizationStatus(fun) != 1);
}
+function assertOptimized(fun) {
+ assertTrue(%GetOptimizationStatus(fun) != 2);
+}
+
function f(x) {
var xx = x * x;
var xxstr = xx.toString();
@@ -53,10 +63,13 @@ assertUnoptimized(g);
%OptimizeFunctionOnNextCall(f, "parallel");
%OptimizeFunctionOnNextCall(g, "parallel");
-f(g(2));
+f(g(2)); // Trigger optimization.
-assertUnoptimized(f);
+assertUnoptimized(f); // Not yet optimized.
assertUnoptimized(g);
-%WaitUntilOptimized(f);
-%WaitUntilOptimized(g);
+%CompleteOptimization(f); // Wait till optimized code is installed.
+%CompleteOptimization(g);
+
+assertOptimized(f); // Optimized now.
+assertOptimized(g);
diff --git a/deps/v8/test/mjsunit/mjsunit.status b/deps/v8/test/mjsunit/mjsunit.status
index 8d6274bf2a..7e8d5b9584 100644
--- a/deps/v8/test/mjsunit/mjsunit.status
+++ b/deps/v8/test/mjsunit/mjsunit.status
@@ -47,10 +47,6 @@ regress/regress-crbug-160010: SKIP
stack-traces-gc: PASS || FAIL
##############################################################################
-# TODO(wingo): Re-enable when GC bug from r15060 is solved.
-harmony/generators-iteration: SKIP
-
-##############################################################################
# Too slow in debug mode with --stress-opt mode.
compiler/regress-stacktrace-methods: PASS, SKIP if $mode == debug
compiler/regress-funcaller: PASS, SKIP if $mode == debug
@@ -208,6 +204,9 @@ debug-liveedit-stack-padding: SKIP
debug-liveedit-restart-frame: SKIP
debug-liveedit-double-call: SKIP
+# Currently always deopt on minus zero
+math-floor-of-div-minus-zero: SKIP
+
##############################################################################
# Native Client uses the ARM simulator so will behave similarly to arm
# on mjsunit tests.
diff --git a/deps/v8/test/mjsunit/opt-elements-kind.js b/deps/v8/test/mjsunit/opt-elements-kind.js
new file mode 100644
index 0000000000..3df1d9ba2b
--- /dev/null
+++ b/deps/v8/test/mjsunit/opt-elements-kind.js
@@ -0,0 +1,161 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --allow-natives-syntax --smi-only-arrays --expose-gc
+// Flags: --notrack_allocation_sites
+
+// Limit the number of stress runs to reduce polymorphism it defeats some of the
+// assumptions made about how elements transitions work because transition stubs
+// end up going generic.
+// Flags: --stress-runs=2
+
+// Test element kind of objects.
+// Since --smi-only-arrays affects builtins, its default setting at compile
+// time sticks if built with snapshot. If --smi-only-arrays is deactivated
+// by default, only a no-snapshot build actually has smi-only arrays enabled
+// in this test case. Depending on whether smi-only arrays are actually
+// enabled, this test takes the appropriate code path to check smi-only arrays.
+
+support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8));
+
+if (support_smi_only_arrays) {
+ print("Tests include smi-only arrays.");
+} else {
+ print("Tests do NOT include smi-only arrays.");
+}
+
+var elements_kind = {
+ fast_smi_only : 'fast smi only elements',
+ fast : 'fast elements',
+ fast_double : 'fast double elements',
+ dictionary : 'dictionary elements',
+ external_byte : 'external byte elements',
+ external_unsigned_byte : 'external unsigned byte elements',
+ external_short : 'external short elements',
+ external_unsigned_short : 'external unsigned short elements',
+ external_int : 'external int elements',
+ external_unsigned_int : 'external unsigned int elements',
+ external_float : 'external float elements',
+ external_double : 'external double elements',
+ external_pixel : 'external pixel elements'
+}
+
+function getKind(obj) {
+ if (%HasFastSmiElements(obj)) return elements_kind.fast_smi_only;
+ if (%HasFastObjectElements(obj)) return elements_kind.fast;
+ if (%HasFastDoubleElements(obj)) return elements_kind.fast_double;
+ if (%HasDictionaryElements(obj)) return elements_kind.dictionary;
+ // Every external kind is also an external array.
+ assertTrue(%HasExternalArrayElements(obj));
+ if (%HasExternalByteElements(obj)) {
+ return elements_kind.external_byte;
+ }
+ if (%HasExternalUnsignedByteElements(obj)) {
+ return elements_kind.external_unsigned_byte;
+ }
+ if (%HasExternalShortElements(obj)) {
+ return elements_kind.external_short;
+ }
+ if (%HasExternalUnsignedShortElements(obj)) {
+ return elements_kind.external_unsigned_short;
+ }
+ if (%HasExternalIntElements(obj)) {
+ return elements_kind.external_int;
+ }
+ if (%HasExternalUnsignedIntElements(obj)) {
+ return elements_kind.external_unsigned_int;
+ }
+ if (%HasExternalFloatElements(obj)) {
+ return elements_kind.external_float;
+ }
+ if (%HasExternalDoubleElements(obj)) {
+ return elements_kind.external_double;
+ }
+ if (%HasExternalPixelElements(obj)) {
+ return elements_kind.external_pixel;
+ }
+}
+
+function assertKind(expected, obj, name_opt) {
+ if (!support_smi_only_arrays &&
+ expected == elements_kind.fast_smi_only) {
+ expected = elements_kind.fast;
+ }
+ assertEquals(expected, getKind(obj), name_opt);
+}
+
+function construct_smis() {
+ try {} catch (e) {} // TODO(titzer): DisableOptimization
+ var a = [0, 0, 0];
+ a[0] = 0; // Send the COW array map to the steak house.
+ assertKind(elements_kind.fast_smi_only, a);
+ return a;
+}
+
+function construct_doubles() {
+ try {} catch (e) {} // TODO(titzer): DisableOptimization
+ var a = construct_smis();
+ a[0] = 1.5;
+ assertKind(elements_kind.fast_double, a);
+ return a;
+}
+
+function convert_mixed(array, value, kind) {
+ try {} catch (e) {} // TODO(titzer): DisableOptimization
+ array[1] = value;
+ assertKind(kind, array);
+ assertEquals(value, array[1]);
+}
+
+function test1() {
+ if (!support_smi_only_arrays) return;
+
+ // Test transition chain SMI->DOUBLE->FAST (crankshafted function will
+ // transition to FAST directly).
+ var smis = construct_smis();
+ convert_mixed(smis, 1.5, elements_kind.fast_double);
+
+ var doubles = construct_doubles();
+ convert_mixed(doubles, "three", elements_kind.fast);
+
+ convert_mixed(construct_smis(), "three", elements_kind.fast);
+ convert_mixed(construct_doubles(), "three", elements_kind.fast);
+
+ smis = construct_smis();
+ doubles = construct_doubles();
+ convert_mixed(smis, 1, elements_kind.fast);
+ convert_mixed(doubles, 1, elements_kind.fast);
+ assertTrue(%HaveSameMap(smis, doubles));
+}
+
+test1();
+gc(); // clear IC state
+test1();
+gc(); // clear IC state
+%OptimizeFunctionOnNextCall(test1);
+test1();
+gc(); // clear IC state
diff --git a/deps/v8/test/mjsunit/osr-elements-kind.js b/deps/v8/test/mjsunit/osr-elements-kind.js
new file mode 100644
index 0000000000..9b0f506b48
--- /dev/null
+++ b/deps/v8/test/mjsunit/osr-elements-kind.js
@@ -0,0 +1,155 @@
+// Copyright 2012 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --allow-natives-syntax --smi-only-arrays --expose-gc
+// Flags: --notrack_allocation_sites
+
+// Limit the number of stress runs to reduce polymorphism it defeats some of the
+// assumptions made about how elements transitions work because transition stubs
+// end up going generic.
+// Flags: --stress-runs=2
+
+// Test element kind of objects.
+// Since --smi-only-arrays affects builtins, its default setting at compile
+// time sticks if built with snapshot. If --smi-only-arrays is deactivated
+// by default, only a no-snapshot build actually has smi-only arrays enabled
+// in this test case. Depending on whether smi-only arrays are actually
+// enabled, this test takes the appropriate code path to check smi-only arrays.
+
+support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8));
+
+if (support_smi_only_arrays) {
+ print("Tests include smi-only arrays.");
+} else {
+ print("Tests do NOT include smi-only arrays.");
+}
+
+var elements_kind = {
+ fast_smi_only : 'fast smi only elements',
+ fast : 'fast elements',
+ fast_double : 'fast double elements',
+ dictionary : 'dictionary elements',
+ external_byte : 'external byte elements',
+ external_unsigned_byte : 'external unsigned byte elements',
+ external_short : 'external short elements',
+ external_unsigned_short : 'external unsigned short elements',
+ external_int : 'external int elements',
+ external_unsigned_int : 'external unsigned int elements',
+ external_float : 'external float elements',
+ external_double : 'external double elements',
+ external_pixel : 'external pixel elements'
+}
+
+function getKind(obj) {
+ if (%HasFastSmiElements(obj)) return elements_kind.fast_smi_only;
+ if (%HasFastObjectElements(obj)) return elements_kind.fast;
+ if (%HasFastDoubleElements(obj)) return elements_kind.fast_double;
+ if (%HasDictionaryElements(obj)) return elements_kind.dictionary;
+ // Every external kind is also an external array.
+ assertTrue(%HasExternalArrayElements(obj));
+ if (%HasExternalByteElements(obj)) {
+ return elements_kind.external_byte;
+ }
+ if (%HasExternalUnsignedByteElements(obj)) {
+ return elements_kind.external_unsigned_byte;
+ }
+ if (%HasExternalShortElements(obj)) {
+ return elements_kind.external_short;
+ }
+ if (%HasExternalUnsignedShortElements(obj)) {
+ return elements_kind.external_unsigned_short;
+ }
+ if (%HasExternalIntElements(obj)) {
+ return elements_kind.external_int;
+ }
+ if (%HasExternalUnsignedIntElements(obj)) {
+ return elements_kind.external_unsigned_int;
+ }
+ if (%HasExternalFloatElements(obj)) {
+ return elements_kind.external_float;
+ }
+ if (%HasExternalDoubleElements(obj)) {
+ return elements_kind.external_double;
+ }
+ if (%HasExternalPixelElements(obj)) {
+ return elements_kind.external_pixel;
+ }
+}
+
+function assertKind(expected, obj, name_opt) {
+ if (!support_smi_only_arrays &&
+ expected == elements_kind.fast_smi_only) {
+ expected = elements_kind.fast;
+ }
+ assertEquals(expected, getKind(obj), name_opt);
+}
+
+// long-running loop forces OSR.
+for (var i = 0; i < 1000000; i++) { }
+
+if (support_smi_only_arrays) {
+ function construct_smis() {
+ try {} catch (e) {} // TODO(titzer): DisableOptimization
+ var a = [0, 0, 0];
+ a[0] = 0; // Send the COW array map to the steak house.
+ assertKind(elements_kind.fast_smi_only, a);
+ return a;
+ }
+ function construct_doubles() {
+ try {} catch (e) {} // TODO(titzer): DisableOptimization
+ var a = construct_smis();
+ a[0] = 1.5;
+ assertKind(elements_kind.fast_double, a);
+ return a;
+ }
+
+ // Test transition chain SMI->DOUBLE->FAST (crankshafted function will
+ // transition to FAST directly).
+ function convert_mixed(array, value, kind) {
+ try {} catch (e) {} // TODO(titzer): DisableOptimization
+ array[1] = value;
+ assertKind(kind, array);
+ assertEquals(value, array[1]);
+ }
+ smis = construct_smis();
+ convert_mixed(smis, 1.5, elements_kind.fast_double);
+
+ doubles = construct_doubles();
+ convert_mixed(doubles, "three", elements_kind.fast);
+
+ convert_mixed(construct_smis(), "three", elements_kind.fast);
+ convert_mixed(construct_doubles(), "three", elements_kind.fast);
+
+ smis = construct_smis();
+ doubles = construct_doubles();
+ convert_mixed(smis, 1, elements_kind.fast);
+ convert_mixed(doubles, 1, elements_kind.fast);
+ assertTrue(%HaveSameMap(smis, doubles));
+}
+
+// Throw away type information in the ICs for next stress run.
+gc();
diff --git a/deps/v8/test/mjsunit/parallel-initial-prototype-change.js b/deps/v8/test/mjsunit/parallel-initial-prototype-change.js
new file mode 100644
index 0000000000..9f698bae63
--- /dev/null
+++ b/deps/v8/test/mjsunit/parallel-initial-prototype-change.js
@@ -0,0 +1,55 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --allow-natives-syntax
+// Flags: --parallel-recompilation --parallel-recompilation-delay=50
+
+if (!%IsParallelRecompilationSupported()) {
+ print("Parallel recompilation is disabled. Skipping this test.");
+ quit();
+}
+
+function assertUnoptimized(fun) {
+ assertTrue(%GetOptimizationStatus(fun) != 1);
+}
+
+function f1(a, i) {
+ return a[i] + 0.5;
+}
+
+var arr = [0.0,,2.5];
+assertEquals(0.5, f1(arr, 0));
+assertEquals(0.5, f1(arr, 0));
+
+// Optimized code of f1 depends on initial object and array maps.
+%OptimizeFunctionOnNextCall(f1, "parallel");
+assertEquals(0.5, f1(arr, 0));
+assertUnoptimized(f1); // Not yet optimized.
+Object.prototype[1] = 1.5; // Invalidate current initial object map.
+assertEquals(2, f1(arr, 1));
+%CompleteOptimization(f1); // Conclude optimization with...
+assertUnoptimized(f1); // ... bailing out due to map dependency.
diff --git a/deps/v8/test/mjsunit/parallel-invalidate-transition-map.js b/deps/v8/test/mjsunit/parallel-invalidate-transition-map.js
new file mode 100644
index 0000000000..2a2276f1e2
--- /dev/null
+++ b/deps/v8/test/mjsunit/parallel-invalidate-transition-map.js
@@ -0,0 +1,61 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --track-fields --track-double-fields --allow-natives-syntax
+// Flags: --parallel-recompilation --parallel-recompilation-delay=50
+
+if (!%IsParallelRecompilationSupported()) {
+ print("Parallel recompilation is disabled. Skipping this test.");
+ quit();
+}
+
+function assertUnoptimized(fun) {
+ assertTrue(%GetOptimizationStatus(fun) != 1);
+}
+
+function new_object() {
+ var o = {};
+ o.a = 1;
+ o.b = 2;
+ return o;
+}
+
+function add_field(obj) {
+ obj.c = 3;
+}
+
+add_field(new_object());
+add_field(new_object());
+%OptimizeFunctionOnNextCall(add_field, "parallel");
+
+var o = new_object();
+add_field(o); // Trigger optimization.
+assertUnoptimized(add_field); // Not yet optimized.
+o.c = 2.2; // Invalidate transition map.
+%CompleteOptimization(add_field); // Conclude optimization with...
+assertUnoptimized(add_field); // ... bailing out due to map dependency.
+
diff --git a/deps/v8/test/mjsunit/parallel-optimize-disabled.js b/deps/v8/test/mjsunit/parallel-optimize-disabled.js
index 86b375c53a..b56303e08f 100644
--- a/deps/v8/test/mjsunit/parallel-optimize-disabled.js
+++ b/deps/v8/test/mjsunit/parallel-optimize-disabled.js
@@ -28,6 +28,11 @@
// Flags: --nodead-code-elimination --parallel-recompilation
// Flags: --allow-natives-syntax
+if (!%IsParallelRecompilationSupported()) {
+ print("Parallel recompilation is disabled. Skipping this test.");
+ quit();
+}
+
function g() { // g() cannot be optimized.
const x = 1;
x++;
@@ -43,4 +48,4 @@ f();
%OptimizeFunctionOnNextCall(g, "parallel");
f(0); // g() is disabled for optimization on inlining attempt.
// Attempt to optimize g() should not run into any assertion.
-%WaitUntilOptimized(g);
+%CompleteOptimization(g);
diff --git a/deps/v8/test/mjsunit/regress/regress-1383.js b/deps/v8/test/mjsunit/regress/regress-1383.js
index 4b08f5a6b5..387c8b4004 100644
--- a/deps/v8/test/mjsunit/regress/regress-1383.js
+++ b/deps/v8/test/mjsunit/regress/regress-1383.js
@@ -33,7 +33,7 @@ x="";
function foo(){
"use strict";
var wxemsx=(4);
- var wxemsx_0=Float32Array(wxemsx);
+ var wxemsx_0=new Float32Array(wxemsx);
wxemsx_0[0]={};
}
diff --git a/deps/v8/test/mjsunit/regress/regress-2691.js b/deps/v8/test/mjsunit/regress/regress-2691.js
new file mode 100644
index 0000000000..e17be10814
--- /dev/null
+++ b/deps/v8/test/mjsunit/regress/regress-2691.js
@@ -0,0 +1,34 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --harmony-generators
+
+// Check that yield* on non-objects raises a TypeError.
+
+assertThrows('(function*() { yield* 10 })().next()', TypeError);
+assertThrows('(function*() { yield* {} })().next()', TypeError);
+assertThrows('(function*() { yield* undefined })().next()', TypeError);
diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-217858.js b/deps/v8/test/mjsunit/regress/regress-crbug-217858.js
index 8563e07eee..e61cb9f6d2 100644
--- a/deps/v8/test/mjsunit/regress/regress-crbug-217858.js
+++ b/deps/v8/test/mjsunit/regress/regress-crbug-217858.js
@@ -25,16 +25,13 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --allow-natives-syntax
+// Flags: --noanalyze_environment_liveness
var r = /r/;
-var a = "";
function f() {
- %OptimizeFunctionOnNextCall(f, "osr");
- for (var i = 0; i < 1000000; i++) {
- a += i.toString();
- r[r] = function() {};
- }
+ r[r] = function() {};
}
-f();
+for (var i = 0; i < 300000; i++) {
+ f();
+}
diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-245480.js b/deps/v8/test/mjsunit/regress/regress-crbug-245480.js
new file mode 100644
index 0000000000..4769486403
--- /dev/null
+++ b/deps/v8/test/mjsunit/regress/regress-crbug-245480.js
@@ -0,0 +1,90 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --allow-natives-syntax --smi-only-arrays --expose-gc
+// Flags: --track-allocation-sites --noalways-opt
+
+// Test element kind of objects.
+// Since --smi-only-arrays affects builtins, its default setting at compile
+// time sticks if built with snapshot. If --smi-only-arrays is deactivated
+// by default, only a no-snapshot build actually has smi-only arrays enabled
+// in this test case. Depending on whether smi-only arrays are actually
+// enabled, this test takes the appropriate code path to check smi-only arrays.
+
+// support_smi_only_arrays = %HasFastSmiElements(new Array(1,2,3,4,5,6,7,8));
+support_smi_only_arrays = true;
+
+if (support_smi_only_arrays) {
+ print("Tests include smi-only arrays.");
+} else {
+ print("Tests do NOT include smi-only arrays.");
+}
+
+function isHoley(obj) {
+ if (%HasFastHoleyElements(obj)) return true;
+ return false;
+}
+
+function assertHoley(obj, name_opt) {
+ assertEquals(true, isHoley(obj), name_opt);
+}
+
+function assertNotHoley(obj, name_opt) {
+ assertEquals(false, isHoley(obj), name_opt);
+}
+
+if (support_smi_only_arrays) {
+ function create_array(arg) {
+ return new Array(arg);
+ }
+
+ obj = create_array(0);
+ assertNotHoley(obj);
+ create_array(0);
+ %OptimizeFunctionOnNextCall(create_array);
+ obj = create_array(10);
+ assertHoley(obj);
+}
+
+// The code below would assert in debug or crash in release
+function f(length) {
+ return new Array(length)
+}
+
+f(0);
+f(0);
+%OptimizeFunctionOnNextCall(f);
+var a = f(10);
+
+function g(a) {
+ return a[0];
+}
+
+var b = [0];
+g(b);
+g(b);
+assertEquals(undefined, g(a)); \ No newline at end of file
diff --git a/deps/v8/test/mjsunit/regress/regress-debug-deopt-while-recompile.js b/deps/v8/test/mjsunit/regress/regress-debug-deopt-while-recompile.js
new file mode 100644
index 0000000000..3a66235684
--- /dev/null
+++ b/deps/v8/test/mjsunit/regress/regress-debug-deopt-while-recompile.js
@@ -0,0 +1,84 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-debug-as debug --allow-natives-syntax
+
+Debug = debug.Debug;
+
+function listener(event, exec_state, event_data, data) {
+ if (event != Debug.DebugEvent.Break) return;
+ try {
+ assertEquals("foo", exec_state.frame(0).evaluate("bar").value());
+ } catch (e) {
+ exception = e;
+ };
+ listened++;
+};
+
+var exception = null;
+var listened = 0;
+
+var f = function() {
+ var bar = "foo";
+ var baz = bar; // Break point should be here.
+ return bar;
+}
+
+var g = function() {
+ var bar = "foo";
+ var baz = bar; // Break point should be here.
+ return bar;
+}
+
+f();
+f();
+g();
+g();
+
+// Mark with builtin.
+%OptimizeFunctionOnNextCall(f);
+if (%IsParallelRecompilationSupported()) {
+ %OptimizeFunctionOnNextCall(g, "parallel");
+}
+
+// Activate debugger.
+Debug.setListener(listener);
+
+ // Set break point.
+Debug.setBreakPoint(f, 2, 0);
+Debug.setBreakPoint(g, 2, 0);
+
+// Trigger break point.
+f();
+g();
+
+// Assert that break point is set at expected location.
+assertTrue(Debug.showBreakPoints(f).indexOf("[B0]var baz = bar;") > 0);
+assertTrue(Debug.showBreakPoints(g).indexOf("[B0]var baz = bar;") > 0);
+
+assertEquals(2, listened);
+assertNull(exception);
diff --git a/deps/v8/test/mjsunit/regress/regress-embedded-cons-string.js b/deps/v8/test/mjsunit/regress/regress-embedded-cons-string.js
new file mode 100644
index 0000000000..afb3835688
--- /dev/null
+++ b/deps/v8/test/mjsunit/regress/regress-embedded-cons-string.js
@@ -0,0 +1,66 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --fold-constants --nodead-code-elimination
+// Flags: --expose-gc --allow-natives-syntax
+// Flags: --parallel-recompilation --parallel-recompilation-delay=300
+
+if (!%IsParallelRecompilationSupported()) {
+ print("Parallel recompilation is disabled. Skipping this test.");
+ quit();
+}
+
+function assertUnoptimized(fun) {
+ assertTrue(%GetOptimizationStatus(fun) != 1);
+}
+
+function test(fun) {
+ fun();
+ fun();
+ %OptimizeFunctionOnNextCall(fun, "parallel");
+ fun(); // Trigger optimization in the background.
+ gc(); // Tenure cons string.
+ assertUnoptimized(fun); // Compilation not complete yet.
+ %CompleteOptimization(fun); // Compilation embeds tenured cons string.
+ gc(); // Visit embedded cons string during mark compact.
+}
+
+function f() {
+ return "abcdefghijklmn" + "123456789";
+}
+
+function g() {
+ return "abcdefghijklmn\u2603" + "123456789";
+}
+
+function h() {
+ return "abcdefghijklmn\u2603" + "123456789\u2604";
+}
+
+test(f);
+test(g);
+test(h);
diff --git a/deps/v8/test/mjsunit/regress/regress-function-length-strict.js b/deps/v8/test/mjsunit/regress/regress-function-length-strict.js
new file mode 100644
index 0000000000..700f34a67a
--- /dev/null
+++ b/deps/v8/test/mjsunit/regress/regress-function-length-strict.js
@@ -0,0 +1,41 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test that the length property of a function is read-only in strict mode.
+
+"use strict";
+
+function foo(a, b, c) {
+ return b;
+}
+
+var desc = Object.getOwnPropertyDescriptor(foo, 'length');
+assertEquals(3, desc.value);
+assertFalse(desc.writable);
+assertFalse(desc.enumerable);
+assertFalse(desc.configurable);
+assertThrows(function() { foo.length = 2; }, TypeError);
diff --git a/deps/v8/test/mjsunit/regress/regress-opt-after-debug-deopt.js b/deps/v8/test/mjsunit/regress/regress-opt-after-debug-deopt.js
new file mode 100644
index 0000000000..be12cc56fd
--- /dev/null
+++ b/deps/v8/test/mjsunit/regress/regress-opt-after-debug-deopt.js
@@ -0,0 +1,69 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --expose-debug-as debug --allow-natives-syntax
+// Flags: --parallel-recompilation --parallel-recompilation-delay=300
+
+if (!%IsParallelRecompilationSupported()) {
+ print("Parallel recompilation is disabled. Skipping this test.");
+ quit();
+}
+
+Debug = debug.Debug;
+
+function listener(event, exec_state, event_data, data) {
+ if (event != Debug.DebugEvent.Break) return;
+ try {
+ assertEquals("foo", exec_state.frame(0).evaluate("a").value());
+ } catch (e) {
+ exception = e;
+ };
+ listened++;
+};
+
+var exception = null;
+var listened = 0;
+
+var f = function() {
+ var a = "foo";
+ var b = a.substring("1");
+ [a, b].sort();
+ return a;
+}
+
+f();
+f();
+%OptimizeFunctionOnNextCall(f, "parallel"); // Mark with builtin.
+f(); // Kick off parallel recompilation.
+
+Debug.setListener(listener); // Activate debugger.
+Debug.setBreakPoint(f, 2, 0); // Force deopt.
+%CompleteOptimization(f); // Install optimized code.
+
+f(); // Trigger break point.
+assertEquals(1, listened);
+assertNull(exception);
diff --git a/deps/v8/test/mjsunit/regress/regress-polymorphic-store.js b/deps/v8/test/mjsunit/regress/regress-polymorphic-store.js
new file mode 100644
index 0000000000..4723a7f434
--- /dev/null
+++ b/deps/v8/test/mjsunit/regress/regress-polymorphic-store.js
@@ -0,0 +1,48 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Flags: --allow-natives-syntax
+
+var o1 = {};
+o1.f1 = function() { return 10; };
+o1.x = 5;
+o1.y = 2;
+var o2 = {};
+o2.x = 5;
+o2.y = 5;
+
+function store(o, v) {
+ o.y = v;
+}
+
+store(o2, 0);
+store(o1, 0);
+store(o2, 0);
+%OptimizeFunctionOnNextCall(store);
+store(o1, 10);
+assertEquals(5, o1.x);
+assertEquals(10, o1.y);
diff --git a/deps/v8/test/mjsunit/regress/string-split-monkey-patching.js b/deps/v8/test/mjsunit/regress/string-split-monkey-patching.js
new file mode 100644
index 0000000000..ea5c8679cb
--- /dev/null
+++ b/deps/v8/test/mjsunit/regress/string-split-monkey-patching.js
@@ -0,0 +1,40 @@
+// Copyright 2013 the V8 project authors. All rights reserved.
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are
+// met:
+//
+// * Redistributions of source code must retain the above copyright
+// notice, this list of conditions and the following disclaimer.
+// * Redistributions in binary form must reproduce the above
+// copyright notice, this list of conditions and the following
+// disclaimer in the documentation and/or other materials provided
+// with the distribution.
+// * Neither the name of Google Inc. nor the names of its
+// contributors may be used to endorse or promote products derived
+// from this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+// Test that String.prototype.split with an regexp does not call the
+// monkey-patchable Array.prototype.push or PutValue.
+
+Array.prototype.push = assertUnreachable;
+
+Object.defineProperty(Array.prototype, "0", {
+ get: assertUnreachable,
+ set: assertUnreachable });
+
+"-".split(/-/);
+"I-must-not-use-push!".split(/-/);
+"Oh-no!".split(/(-)/);
+"a".split(/(a)|(b)/);
diff --git a/deps/v8/test/mjsunit/tools/tickprocessor.js b/deps/v8/test/mjsunit/tools/tickprocessor.js
index 00e8f6e73e..626929de16 100644
--- a/deps/v8/test/mjsunit/tools/tickprocessor.js
+++ b/deps/v8/test/mjsunit/tools/tickprocessor.js
@@ -25,6 +25,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+// This test case is not compatible with optimization stress because the
+// generated profile will look vastly different when more is optimized.
+// Flags: --nostress-opt --noalways-opt
+
// Load implementations from <project root>/tools.
// Files: tools/splaytree.js tools/codemap.js tools/csvparser.js
// Files: tools/consarray.js tools/profile.js tools/profile_view.js