diff --git a/test/mjsunit/regress/regress-1560.js b/test/mjsunit/regress/regress-1560.js index ff7075bb5e..98bbef1f44 100644 --- a/test/mjsunit/regress/regress-1560.js +++ b/test/mjsunit/regress/regress-1560.js @@ -53,7 +53,7 @@ function test(factories, w) { %PrepareFunctionForOptimization(w); factories.forEach(function(f) { w(f(), 0); }); factories.forEach(function(f) { w(f(), 0); }); - %OptimizeFunctionOnNextCall(w); + %OptimizeFunctionOnNextCall(w); factories.forEach(function(f) { w(f(), 0); }); } diff --git a/test/mjsunit/regress/regress-1582.js b/test/mjsunit/regress/regress-1582.js index 819ec2c0db..ca3f7b4c47 100644 --- a/test/mjsunit/regress/regress-1582.js +++ b/test/mjsunit/regress/regress-1582.js @@ -41,6 +41,7 @@ function f(restIsArray, rest) { } %PrepareFunctionForOptimization(f); +%PrepareFunctionForOptimization(f); f(false, 'b', 'c'); f(false, 'b', 'c'); f(false, 'b', 'c'); diff --git a/test/mjsunit/regress/regress-2193.js b/test/mjsunit/regress/regress-2193.js index 00e6924b27..068476b1b0 100644 --- a/test/mjsunit/regress/regress-2193.js +++ b/test/mjsunit/regress/regress-2193.js @@ -48,6 +48,7 @@ var expected = [1,2,3,3,4,5,6,7,8,9,bozo]; // Make sure we generate optimized code for the first closure after // warming it up properly so that the literals boilerplate is generated // and the optimized code uses CreateArrayLiteralShallow runtime call. +%PrepareFunctionForOptimization(closure1); assertEquals(0, closure1(false)); assertEquals(expected, closure1(true)); %OptimizeFunctionOnNextCall(closure1); @@ -55,6 +56,7 @@ assertEquals(expected, closure1(true)); // Optimize the second closure, which should reuse the optimized code // from the first closure with the same literal boilerplates. +%PrepareFunctionForOptimization(closure2); assertEquals(0, closure2(false)); %OptimizeFunctionOnNextCall(closure2); assertEquals(expected, closure2(true)); diff --git a/test/mjsunit/regress/regress-2315.js b/test/mjsunit/regress/regress-2315.js index b1bc8a9d35..2ae4b4cb67 100644 --- a/test/mjsunit/regress/regress-2315.js +++ b/test/mjsunit/regress/regress-2315.js @@ -32,6 +32,7 @@ var foo = (function() { })(); %PrepareFunctionForOptimization(foo); +%PrepareFunctionForOptimization(foo); foo(); foo(); %OptimizeFunctionOnNextCall(foo); diff --git a/test/mjsunit/regress/regress-2612.js b/test/mjsunit/regress/regress-2612.js index 8b6ba460ec..7603901498 100644 --- a/test/mjsunit/regress/regress-2612.js +++ b/test/mjsunit/regress/regress-2612.js @@ -70,6 +70,7 @@ source += "x=1; return _0;" var f = new Function(source); %PrepareFunctionForOptimization(f); +%PrepareFunctionForOptimization(f); f(); %OptimizeFunctionOnNextCall(f); f(); diff --git a/test/mjsunit/regress/regress-264203.js b/test/mjsunit/regress/regress-264203.js index dccc3fa91c..0b066d4744 100644 --- a/test/mjsunit/regress/regress-264203.js +++ b/test/mjsunit/regress/regress-264203.js @@ -38,6 +38,7 @@ function foo(x) { } %PrepareFunctionForOptimization(foo); +%PrepareFunctionForOptimization(foo); foo(0); foo(0); %OptimizeFunctionOnNextCall(foo); diff --git a/test/mjsunit/regress/regress-2671-1.js b/test/mjsunit/regress/regress-2671-1.js index 25cb4890bc..d288738775 100644 --- a/test/mjsunit/regress/regress-2671-1.js +++ b/test/mjsunit/regress/regress-2671-1.js @@ -38,6 +38,7 @@ function f() { } %PrepareFunctionForOptimization(f); +%PrepareFunctionForOptimization(f); f(); f(); f(); diff --git a/test/mjsunit/regress/regress-2671.js b/test/mjsunit/regress/regress-2671.js index 350125855b..6bdff7d5ba 100644 --- a/test/mjsunit/regress/regress-2671.js +++ b/test/mjsunit/regress/regress-2671.js @@ -38,6 +38,7 @@ function f() { } %PrepareFunctionForOptimization(f); +%PrepareFunctionForOptimization(f); f(); f(); f(); diff --git a/test/mjsunit/regress/regress-2843.js b/test/mjsunit/regress/regress-2843.js index acf90a22c9..f71161c788 100644 --- a/test/mjsunit/regress/regress-2843.js +++ b/test/mjsunit/regress/regress-2843.js @@ -39,6 +39,7 @@ function foo(x, fun) { } %PrepareFunctionForOptimization(foo); +%PrepareFunctionForOptimization(foo); assertThrows("foo(1, bailout)"); assertThrows("foo(1, bailout)"); %OptimizeFunctionOnNextCall(foo); diff --git a/test/mjsunit/regress/regress-3176.js b/test/mjsunit/regress/regress-3176.js index a564943789..3a1bfde1cf 100644 --- a/test/mjsunit/regress/regress-3176.js +++ b/test/mjsunit/regress/regress-3176.js @@ -20,10 +20,12 @@ function foo(a) { var a = new Int32Array(10); +%PrepareFunctionForOptimization(foo); foo(a); foo(a); %OptimizeFunctionOnNextCall(foo); foo(a); +%PrepareFunctionForOptimization(foo); %OptimizeFunctionOnNextCall(foo); foo(a); assertOptimized(foo); diff --git a/test/mjsunit/regress/regress-3183.js b/test/mjsunit/regress/regress-3183.js index a942dc48a2..290508226c 100644 --- a/test/mjsunit/regress/regress-3183.js +++ b/test/mjsunit/regress/regress-3183.js @@ -44,6 +44,7 @@ function baz(f, deopt) { return foo("x", deopt, f); } %PrepareFunctionForOptimization(baz); + %PrepareFunctionForOptimization(baz); baz(f1, 0); baz(f2, 0); %OptimizeFunctionOnNextCall(baz); @@ -68,6 +69,7 @@ function baz(deopt) { return foo("x", deopt); } %PrepareFunctionForOptimization(baz); + %PrepareFunctionForOptimization(baz); baz(0); baz(0); %OptimizeFunctionOnNextCall(baz); @@ -92,6 +94,7 @@ function baz(deopt) { return foo(0, deopt); } %PrepareFunctionForOptimization(baz); + %PrepareFunctionForOptimization(baz); baz(0); baz(0); %OptimizeFunctionOnNextCall(baz); diff --git a/test/mjsunit/regress/regress-320532.js b/test/mjsunit/regress/regress-320532.js index 7522c839a1..1b4990a440 100644 --- a/test/mjsunit/regress/regress-320532.js +++ b/test/mjsunit/regress/regress-320532.js @@ -39,5 +39,6 @@ function foo(len) { return new Array(len); } %PrepareFunctionForOptimization(foo); foo(0); foo(0); +%PrepareFunctionForOptimization(bar); %OptimizeFunctionOnNextCall(bar); foo(0); diff --git a/test/mjsunit/regress/regress-3218915.js b/test/mjsunit/regress/regress-3218915.js index d76fe979d6..2850092afa 100644 --- a/test/mjsunit/regress/regress-3218915.js +++ b/test/mjsunit/regress/regress-3218915.js @@ -39,6 +39,7 @@ function withCommaExpressionInConditional(x) { } %PrepareFunctionForOptimization(withCommaExpressionInConditional); +%PrepareFunctionForOptimization(withCommaExpressionInConditional); for (var i = 0; i < 5; i++) { withCommaExpressionInConditional(i); } diff --git a/test/mjsunit/regress/regress-410912.js b/test/mjsunit/regress/regress-410912.js index b22b32d809..761b009098 100644 --- a/test/mjsunit/regress/regress-410912.js +++ b/test/mjsunit/regress/regress-410912.js @@ -40,6 +40,7 @@ function __f_0(__v_1,__v_0,i) { } %PrepareFunctionForOptimization(__f_0); try { + %PrepareFunctionForOptimization(__f_0); __f_0(__v_1,__v_0,0); __f_0(__v_1,__v_0,0); %OptimizeFunctionOnNextCall(__f_0); @@ -85,6 +86,7 @@ function __f_7(o) { return o.__f_4(); } try { + %PrepareFunctionForOptimization(__f_7); for (var __v_7 = 0; __v_7 < 5; __v_7++) __f_7(__v_5); %OptimizeFunctionOnNextCall(__f_7); __f_7(__v_5); @@ -112,6 +114,7 @@ gc(); var __v_8; } catch(e) { print("Caught: " + e); } function __f_9(n) { return __v_9.charAt(n); } +%PrepareFunctionForOptimization(__f_9); try { for (var __v_7 = 0; __v_7 < 5; __v_7++) { __v_8 = __f_9(0); diff --git a/test/mjsunit/regress/regress-451958.js b/test/mjsunit/regress/regress-451958.js index 33695f2b3e..41cd23bae2 100644 --- a/test/mjsunit/regress/regress-451958.js +++ b/test/mjsunit/regress/regress-451958.js @@ -15,6 +15,7 @@ function foo(a) { for (i = 0; i < 1; i++) ; } } +%PrepareFunctionForOptimization(foo); %OptimizeFunctionOnNextCall(foo); foo(); @@ -27,5 +28,6 @@ var __v_45; for (__v_45 = 128; __v_45 < 256; __v_45++) { } } +%PrepareFunctionForOptimization(bar); %OptimizeFunctionOnNextCall(bar); assertThrows(bar); diff --git a/test/mjsunit/regress/regress-4715.js b/test/mjsunit/regress/regress-4715.js index 33041208e7..aeacf8214a 100644 --- a/test/mjsunit/regress/regress-4715.js +++ b/test/mjsunit/regress/regress-4715.js @@ -36,6 +36,7 @@ function foo(object) { } return key; } +%PrepareFunctionForOptimization(foo); // Collect type feedback for slow-mode for-in. foo(training); diff --git a/test/mjsunit/regress/regress-4788-1.js b/test/mjsunit/regress/regress-4788-1.js index 347ab5e592..9258f7ba77 100644 --- a/test/mjsunit/regress/regress-4788-1.js +++ b/test/mjsunit/regress/regress-4788-1.js @@ -12,6 +12,8 @@ var f = (function() { return foo; })(); +%PrepareFunctionForOptimization(f); + function deopt(f) { return { toString : function() { diff --git a/test/mjsunit/regress/regress-4970.js b/test/mjsunit/regress/regress-4970.js index da0033b34f..b34b53910d 100644 --- a/test/mjsunit/regress/regress-4970.js +++ b/test/mjsunit/regress/regress-4970.js @@ -10,6 +10,7 @@ function g() { f(); } +%PrepareFunctionForOptimization(g); assertThrows(g, SyntaxError); %OptimizeFunctionOnNextCall(g); assertThrows(g, SyntaxError); diff --git a/test/mjsunit/regress/regress-4971.js b/test/mjsunit/regress/regress-4971.js index 041f6c2a57..7866a5fb02 100644 --- a/test/mjsunit/regress/regress-4971.js +++ b/test/mjsunit/regress/regress-4971.js @@ -12,8 +12,9 @@ Object.defineProperty(C.prototype, "boom", { get: function() { if (should_deoptimize_caller) %DeoptimizeFunction(D.prototype.f); return this.m - }}) + }}); + %PrepareFunctionForOptimization(D.prototype.f); assertEquals(23, new D().f()); assertEquals(23, new D().f()); %OptimizeFunctionOnNextCall(D.prototype.f); @@ -30,8 +31,9 @@ Object.defineProperty(C.prototype, "boom", { get: function() { if (should_deoptimize_caller) %DeoptimizeFunction(D.prototype.f); return this.m - }}) + }}); + %PrepareFunctionForOptimization(D.prototype.f); assertEquals(23, new D().f("boom")); assertEquals(23, new D().f("boom")); %OptimizeFunctionOnNextCall(D.prototype.f); diff --git a/test/mjsunit/regress/regress-5205.js b/test/mjsunit/regress/regress-5205.js index 0d88f45053..547a1d9d2c 100644 --- a/test/mjsunit/regress/regress-5205.js +++ b/test/mjsunit/regress/regress-5205.js @@ -9,6 +9,7 @@ if (o == 'warmup') { return g() } with (o) { return x } } + %PrepareFunctionForOptimization(f); function g() { // Only a marker function serving as weak embedded object. } diff --git a/test/mjsunit/regress/regress-5262.js b/test/mjsunit/regress/regress-5262.js index d980ba8e91..05fc0e513b 100644 --- a/test/mjsunit/regress/regress-5262.js +++ b/test/mjsunit/regress/regress-5262.js @@ -12,6 +12,7 @@ function f(osr_and_recurse) { for (var i = 0; i < 3; ++i) { if (i == 1) %OptimizeOsr(); } + %PrepareFunctionForOptimization(f); %OptimizeFunctionOnNextCall(f); f(false); // Trigger tier-up due to recursive call. boom(this); // Causes a deopt due to below dependency. diff --git a/test/mjsunit/regress/regress-5404.js b/test/mjsunit/regress/regress-5404.js index eddd1837a8..104aed0a21 100644 --- a/test/mjsunit/regress/regress-5404.js +++ b/test/mjsunit/regress/regress-5404.js @@ -8,6 +8,7 @@ function foo(a, b) { return a + "0123456789012"; } +%PrepareFunctionForOptimization(foo); foo("a"); foo("a"); %OptimizeFunctionOnNextCall(foo); @@ -16,6 +17,7 @@ foo("a"); var a = "a".repeat(%StringMaxLength()); assertThrows(function() { foo(a); }, RangeError); +%PrepareFunctionForOptimization(foo); %OptimizeFunctionOnNextCall(foo); assertThrows(function() { foo(a); }, RangeError); assertOptimized(foo); diff --git a/test/mjsunit/regress/regress-5636-1.js b/test/mjsunit/regress/regress-5636-1.js index 06db63331c..4be9eb5579 100644 --- a/test/mjsunit/regress/regress-5636-1.js +++ b/test/mjsunit/regress/regress-5636-1.js @@ -9,10 +9,10 @@ function f(n) { function g() { return x; }; - %PrepareFunctionForOptimization(g); for (var i = 0; i < n; ++i) { var x = i; a[i] = g; + %PrepareFunctionForOptimization(g); %OptimizeFunctionOnNextCall(g); g(); } diff --git a/test/mjsunit/regress/regress-5636-2.js b/test/mjsunit/regress/regress-5636-2.js index 2a366890f0..a03dc06ca6 100644 --- a/test/mjsunit/regress/regress-5636-2.js +++ b/test/mjsunit/regress/regress-5636-2.js @@ -10,10 +10,10 @@ function f(n) { function g() { return x; }; - %PrepareFunctionForOptimization(g); for (var i = 0; i < n; ++i) { var x = i; a[i] = g; + %PrepareFunctionForOptimization(g); %OptimizeFunctionOnNextCall(g); g(); }