Commit 31a3cfbc authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[Test] Add PrepareForOptimization to mjsunit/compiler

BUG=v8:8801

Change-Id: I9d9d9824c6c9ad0176bbfd3723da1b578b17c256
Reviewed-on: https://chromium-review.googlesource.com/c/1495555
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60001}
parent f507e222
......@@ -11,6 +11,7 @@
function foo() { return a == b; }
%PrepareFunctionForOptimization(foo);
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -24,6 +25,7 @@
function foo() { return a == b; }
%PrepareFunctionForOptimization(foo);
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -37,6 +39,7 @@
function foo() { return a == b; }
%PrepareFunctionForOptimization(foo);
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -50,6 +53,7 @@
function foo() { return a == b; }
%PrepareFunctionForOptimization(foo);
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -63,6 +67,7 @@
function foo() { return a == b; }
%PrepareFunctionForOptimization(foo);
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -76,6 +81,7 @@
function foo(a) { return a == b; }
%PrepareFunctionForOptimization(foo);
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(b));
......@@ -96,6 +102,7 @@
function foo(a) { return a == b; }
%PrepareFunctionForOptimization(foo);
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(b));
......@@ -116,6 +123,7 @@
function foo(a) { return a == b; }
%PrepareFunctionForOptimization(foo);
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(b));
......@@ -136,6 +144,7 @@
function foo(a) { return a == b; }
%PrepareFunctionForOptimization(foo);
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(b));
......@@ -159,6 +168,7 @@
function foo(a) { return a == b; }
%PrepareFunctionForOptimization(foo);
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(b));
......
......@@ -11,6 +11,7 @@
function foo() { return a == b; }
%PrepareFunctionForOptimization(foo);
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -24,6 +25,7 @@
function foo() { return a != b; }
%PrepareFunctionForOptimization(foo);
assertTrue(foo());
assertTrue(foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -38,6 +40,7 @@
function foo(a) { return a == b; }
// Warmup
%PrepareFunctionForOptimization(foo);
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(b));
......@@ -52,6 +55,7 @@
assertUnoptimized(foo);
// Make sure TurboFan learns the new feedback
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertFalse(foo("a"));
assertOptimized(foo);
......@@ -65,6 +69,7 @@
function foo(a) { return a != b; }
// Warmup
%PrepareFunctionForOptimization(foo);
assertFalse(foo(b));
assertTrue(foo(a));
assertFalse(foo(b));
......@@ -78,6 +83,7 @@
assertUnoptimized(foo);
// Make sure TurboFan learns the new feedback
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo("a"));
assertOptimized(foo);
......@@ -91,6 +97,7 @@
function foo(a, b) { return a == b; }
// Warmup
%PrepareFunctionForOptimization(foo);
assertTrue(foo(b, b));
assertFalse(foo(a, b));
assertTrue(foo(a, a));
......@@ -104,6 +111,7 @@
assertUnoptimized(foo);
// Make sure TurboFan learns the new feedback
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertFalse(foo("a", b));
assertOptimized(foo);
......@@ -116,6 +124,7 @@
function foo(a, b) { return a != b; }
%PrepareFunctionForOptimization(foo);
assertFalse(foo(b, b));
assertTrue(foo(a, b));
assertFalse(foo(a, a));
......@@ -129,6 +138,7 @@
assertUnoptimized(foo);
// Make sure TurboFan learns the new feedback
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo("a", b));
assertOptimized(foo);
......
......@@ -13,6 +13,7 @@ const undetectable = %GetUndetectable();
function foo() { return a == b; }
%PrepareFunctionForOptimization(foo);
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -26,6 +27,7 @@ const undetectable = %GetUndetectable();
function foo() { return a == b; }
%PrepareFunctionForOptimization(foo);
assertTrue(foo());
assertTrue(foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -39,6 +41,7 @@ const undetectable = %GetUndetectable();
function foo() { return a == b; }
%PrepareFunctionForOptimization(foo);
assertTrue(foo());
assertTrue(foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -52,6 +55,7 @@ const undetectable = %GetUndetectable();
function foo() { return a == b; }
%PrepareFunctionForOptimization(foo);
assertTrue(foo());
assertTrue(foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -65,6 +69,7 @@ const undetectable = %GetUndetectable();
function foo() { return a == b; }
%PrepareFunctionForOptimization(foo);
assertTrue(foo());
assertTrue(foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -78,6 +83,7 @@ const undetectable = %GetUndetectable();
function foo(a) { return a == b; }
%PrepareFunctionForOptimization(foo);
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(b));
......@@ -98,6 +104,7 @@ const undetectable = %GetUndetectable();
function foo(a, b) { return a == b; }
%PrepareFunctionForOptimization(foo);
assertTrue(foo(b, b));
assertFalse(foo(a, b));
assertTrue(foo(a, a));
......
......@@ -15,6 +15,7 @@ function foo(o) {
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(7, foo(o));
assertEquals(7, foo(o));
%OptimizeFunctionOnNextCall(foo);
......
......@@ -15,6 +15,7 @@ function foo(o) {
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(7, foo(o));
assertEquals(7, foo(o));
%OptimizeFunctionOnNextCall(foo);
......
......@@ -36,6 +36,7 @@
function test() {
return new huge();
}
%PrepareFunctionForOptimization(test);
test();
test();
%OptimizeFunctionOnNextCall(test);
......
......@@ -37,6 +37,7 @@ function test_helper(construct, a, b) {
function test(construct) {
%DeoptimizeFunction(test);
%PrepareFunctionForOptimization(test_helper);
test_helper(construct, 0, 0);
test_helper(construct, 0, 0);
%OptimizeFunctionOnNextCall(test_helper);
......
......@@ -10,10 +10,12 @@
function g() { return arguments; }
function f() { return g(1, 2, 3); }
%PrepareFunctionForOptimization(f);
assertEquals(g(1, 2, 3), f());
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(f);
assertEquals(g(1, 2, 3), f());
%PrepareFunctionForOptimization(g);
%OptimizeFunctionOnNextCall(g);
assertEquals(g(1, 2, 3), f());
})();
......@@ -25,10 +27,12 @@
function g() { return arguments; }
function f() { return g(1, 2, 3); }
%PrepareFunctionForOptimization(f);
assertEquals(g(1, 2, 3), f());
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(f);
assertEquals(g(1, 2, 3), f());
%PrepareFunctionForOptimization(g);
%OptimizeFunctionOnNextCall(g);
assertEquals(g(1, 2, 3), f());
})();
......@@ -40,10 +44,12 @@
function g() { return eval("arguments"); }
function f() { return g(1, 2, 3); }
%PrepareFunctionForOptimization(f);
assertEquals(g(1, 2, 3), f());
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(f);
assertEquals(g(1, 2, 3), f());
%PrepareFunctionForOptimization(g);
%OptimizeFunctionOnNextCall(g);
assertEquals(g(1, 2, 3), f());
})();
......@@ -56,10 +62,13 @@
function g() { return eval("arguments"); }
function f() { return g(1, 2, 3); }
%PrepareFunctionForOptimization(f);
assertEquals(g(1, 2, 3), f());
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(f);
assertEquals(g(1, 2, 3), f());
%PrepareFunctionForOptimization(g);
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(g);
assertEquals(g(1, 2, 3), f());
})();
......@@ -72,10 +81,13 @@
function g() { return h(); }
function f() { return g(1, 2, 3); }
%PrepareFunctionForOptimization(f);
assertEquals(g(1, 2, 3), f());
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(f);
assertEquals(g(1, 2, 3), f());
%PrepareFunctionForOptimization(g);
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(g);
assertEquals(g(1, 2, 3), f());
})();
......@@ -84,10 +96,13 @@
function g() { return h(); }
function f() { "use strict"; return g(1, 2, 3); }
%PrepareFunctionForOptimization(f);
assertEquals(g(1, 2, 3), f());
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(f);
assertEquals(g(1, 2, 3), f());
%PrepareFunctionForOptimization(g);
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(g);
assertEquals(g(1, 2, 3), f());
})();
......@@ -96,10 +111,13 @@
function g() { return h(); }
function f() { return g(1, 2, 3); }
%PrepareFunctionForOptimization(f);
assertEquals(g(1, 2, 3), f());
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(f);
assertEquals(g(1, 2, 3), f());
%PrepareFunctionForOptimization(g);
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(g);
assertEquals(g(1, 2, 3), f());
})();
......@@ -108,10 +126,13 @@
function g() { return h(); }
function f() { "use strict"; return g(1, 2, 3); }
%PrepareFunctionForOptimization(f);
assertEquals(g(1, 2, 3), f());
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(f);
assertEquals(g(1, 2, 3), f());
%PrepareFunctionForOptimization(g);
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(g);
assertEquals(g(1, 2, 3), f());
})();
......@@ -123,10 +144,13 @@
function g() { return h(); }
function f() { return g(1, 2, 3); }
%PrepareFunctionForOptimization(f);
assertEquals(g(1, 2, 3), f());
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(f);
assertEquals(g(1, 2, 3), f());
%PrepareFunctionForOptimization(g);
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(g);
assertEquals(g(1, 2, 3), f());
})();
......@@ -135,10 +159,13 @@
function g() { return h(); }
function f() { "use strict"; return g(1, 2, 3); }
%PrepareFunctionForOptimization(f);
assertEquals(g(1, 2, 3), f());
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(f);
assertEquals(g(1, 2, 3), f());
%PrepareFunctionForOptimization(g);
assertEquals(g(1, 2, 3), f());
%OptimizeFunctionOnNextCall(g);
assertEquals(g(1, 2, 3), f());
})();
......@@ -15,6 +15,7 @@
return ArrayBuffer.isView({x}.x);
}
%PrepareFunctionForOptimization(foo);
assertFalse(foo(Symbol()));
assertFalse(foo("some string"));
assertFalse(foo(new Object()));
......@@ -41,6 +42,7 @@
return ArrayBuffer.isView(x);
}
%PrepareFunctionForOptimization(foo);
assertFalse(foo(1));
assertFalse(foo(1.1));
assertFalse(foo(Symbol()));
......
......@@ -8,6 +8,7 @@
(() => {
function foo(x) { return Array(!!x); }
%PrepareFunctionForOptimization(foo);
assertEquals([true], foo(true));
assertEquals([false], foo(false));
%OptimizeFunctionOnNextCall(foo);
......@@ -19,6 +20,7 @@
(() => {
function foo(x) { return new Array(!!x); }
%PrepareFunctionForOptimization(foo);
assertEquals([true], foo(true));
assertEquals([false], foo(false));
%OptimizeFunctionOnNextCall(foo);
......@@ -30,6 +32,7 @@
(() => {
function foo(x) { return Array("" + x); }
%PrepareFunctionForOptimization(foo);
assertEquals(["a"], foo("a"));
assertEquals(["b"], foo("b"));
%OptimizeFunctionOnNextCall(foo);
......@@ -41,6 +44,7 @@
(() => {
function foo(x) { return new Array("" + x); }
%PrepareFunctionForOptimization(foo);
assertEquals(["a"], foo("a"));
assertEquals(["b"], foo("b"));
%OptimizeFunctionOnNextCall(foo);
......@@ -52,6 +56,7 @@
(() => {
function foo() { return Array(2); }
%PrepareFunctionForOptimization(foo);
assertEquals(2, foo().length);
assertEquals(2, foo().length);
%OptimizeFunctionOnNextCall(foo);
......@@ -62,6 +67,7 @@
(() => {
function foo() { return new Array(2); }
%PrepareFunctionForOptimization(foo);
assertEquals(2, foo().length);
assertEquals(2, foo().length);
%OptimizeFunctionOnNextCall(foo);
......@@ -72,6 +78,7 @@
(() => {
function foo(x, y, z) { return Array(x, y, z); }
%PrepareFunctionForOptimization(foo);
assertEquals([1, 2, 3], foo(1, 2, 3));
assertEquals([1, 2, 3], foo(1, 2, 3));
%OptimizeFunctionOnNextCall(foo);
......@@ -82,6 +89,7 @@
(() => {
function foo(x, y, z) { return new Array(x, y, z); }
%PrepareFunctionForOptimization(foo);
assertEquals([1, 2, 3], foo(1, 2, 3));
assertEquals([1, 2, 3], foo(1, 2, 3));
%OptimizeFunctionOnNextCall(foo);
......@@ -92,6 +100,7 @@
(() => {
function foo(x) { try { return new Array(x) } catch (e) { return e } }
%PrepareFunctionForOptimization(foo);
assertEquals([], foo(0));
assertEquals([], foo(0));
%OptimizeFunctionOnNextCall(foo);
......
......@@ -10,6 +10,7 @@
return a.every(x => x === o.x);
}
%PrepareFunctionForOptimization(foo);
assertTrue(foo([3, 3, 3], {x:3}));
assertFalse(foo([3, 3, 2], {x:3}));
%OptimizeFunctionOnNextCall(foo);
......
......@@ -10,6 +10,7 @@
return a.find(x => x === o.x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(3, foo([1, 2, 3], {x:3}));
assertEquals(undefined, foo([0, 1, 2], {x:3}));
%OptimizeFunctionOnNextCall(foo);
......
......@@ -10,6 +10,7 @@
return a.findIndex(x => x === o.x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(2, foo([1, 2, 3], {x:3}));
assertEquals(-1, foo([0, 1, 2], {x:3}));
%OptimizeFunctionOnNextCall(foo);
......
......@@ -11,6 +11,7 @@
return Array.isArray([]);
}
%PrepareFunctionForOptimization(foo);
assertTrue(foo());
assertTrue(foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -24,6 +25,7 @@
return Array.isArray(new Proxy([], {}));
}
%PrepareFunctionForOptimization(foo);
assertTrue(foo());
assertTrue(foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -37,6 +39,7 @@
return Array.isArray({});
}
%PrepareFunctionForOptimization(foo);
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -50,6 +53,7 @@
return Array.isArray(new Proxy({}, {}));
}
%PrepareFunctionForOptimization(foo);
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -63,6 +67,7 @@
return Array.isArray(x);
}
%PrepareFunctionForOptimization(foo);
assertFalse(foo({}));
assertFalse(foo(new Proxy({}, {})));
assertTrue(foo([]));
......@@ -97,6 +102,7 @@
}
}
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo([]), TypeError);
assertInstanceof(foo({}), TypeError);
%OptimizeFunctionOnNextCall(foo);
......
......@@ -38,11 +38,15 @@ function Test(a0, a2, a5) {
var a0 = [];
var a2 = [1,2];
var a5 = [1,2,3,4,5];
%PrepareFunctionForOptimization(ArrayLength);
for (var i = 0; i < 5; i++) Test(a0, a2, a5);
%OptimizeFunctionOnNextCall(ArrayLength);
Test(a0, a2, a5);
%PrepareFunctionForOptimization(Test);
%OptimizeFunctionOnNextCall(Test);
Test(a0, a2, a5);
assertEquals("undefined", typeof(ArrayLength(0)));
%PrepareFunctionForOptimization(Test);
for (var i = 0; i < 5; i++) Test(a0, a2, a5);
%OptimizeFunctionOnNextCall(Test);
Test(a0, a2, a5);
......
......@@ -20,6 +20,7 @@ function runTest(f, message, mkICTraining, deoptArg) {
let t2 = t();
let t3 = t();
%PrepareFunctionForOptimization(f);
for (let a of t1) {
f(a.arr, () => a.el);
}
......@@ -45,6 +46,7 @@ function runTest(f, message, mkICTraining, deoptArg) {
message_optimized = message + " should have been unoptimized"
f(a1.arr, () => a1.el);
assertUnoptimized(f, undefined, message_unoptimized);
%PrepareFunctionForOptimization(f);
%OptimizeFunctionOnNextCall(f);
// No speculation should protect against further deopts.
f(a2.arr, () => a2.el);
......
......@@ -10,6 +10,7 @@
return a.push();
}
%PrepareFunctionForOptimization(push0);
assertEquals(0, push0([]));
assertEquals(1, push0([1]));
%OptimizeFunctionOnNextCall(push0);
......@@ -19,6 +20,7 @@
return a.push(1);
}
%PrepareFunctionForOptimization(push1);
assertEquals(1, push1([]));
assertEquals(2, push1([1]));
%OptimizeFunctionOnNextCall(push1);
......@@ -28,6 +30,7 @@
return a.push(1, 2);
}
%PrepareFunctionForOptimization(push2);
assertEquals(2, push2([]));
assertEquals(3, push2([1]));
%OptimizeFunctionOnNextCall(push2);
......@@ -37,6 +40,7 @@
return a.push(1, 2, 3);
}
%PrepareFunctionForOptimization(push3);
assertEquals(3, push3([]));
assertEquals(4, push3([1]));
%OptimizeFunctionOnNextCall(push3);
......@@ -49,6 +53,7 @@
return a.push();
}
%PrepareFunctionForOptimization(push0);
assertEquals(1, push0(new Array(1)));
assertEquals(2, push0(new Array(2)));
%OptimizeFunctionOnNextCall(push0);
......@@ -58,6 +63,7 @@
return a.push(1);
}
%PrepareFunctionForOptimization(push1);
assertEquals(2, push1(new Array(1)));
assertEquals(3, push1(new Array(2)));
%OptimizeFunctionOnNextCall(push1);
......@@ -67,6 +73,7 @@
return a.push(1, 2);
}
%PrepareFunctionForOptimization(push2);
assertEquals(3, push2(new Array(1)));
assertEquals(4, push2(new Array(2)));
%OptimizeFunctionOnNextCall(push2);
......@@ -76,6 +83,7 @@
return a.push(1, 2, 3);
}
%PrepareFunctionForOptimization(push3);
assertEquals(4, push3(new Array(1)));
assertEquals(5, push3(new Array(2)));
%OptimizeFunctionOnNextCall(push3);
......@@ -88,6 +96,7 @@
return a.push();
}
%PrepareFunctionForOptimization(push0);
assertEquals(1, push0([1.1]));
assertEquals(2, push0([1.1, 2.2]));
%OptimizeFunctionOnNextCall(push0);
......@@ -97,6 +106,7 @@
return a.push(1.1);
}
%PrepareFunctionForOptimization(push1);
assertEquals(2, push1([1.1]));
assertEquals(3, push1([1.1, 2.2]));
%OptimizeFunctionOnNextCall(push1);
......@@ -106,6 +116,7 @@
return a.push(1.1, 2.2);
}
%PrepareFunctionForOptimization(push2);
assertEquals(3, push2([1.1]));
assertEquals(4, push2([1.1, 2.2]));
%OptimizeFunctionOnNextCall(push2);
......@@ -115,6 +126,7 @@
return a.push(1.1, 2.2, 3.3);
}
%PrepareFunctionForOptimization(push3);
assertEquals(4, push3([1.1]));
assertEquals(5, push3([1.1, 2.2]));
%OptimizeFunctionOnNextCall(push3);
......@@ -127,6 +139,7 @@
return a.push();
}
%PrepareFunctionForOptimization(push0);
assertEquals(2, push0([, 1.1]));
assertEquals(3, push0([, 1.1, 2.2]));
%OptimizeFunctionOnNextCall(push0);
......@@ -136,6 +149,7 @@
return a.push(1.1);
}
%PrepareFunctionForOptimization(push1);
assertEquals(3, push1([, 1.1]));
assertEquals(4, push1([, 1.1, 2.2]));
%OptimizeFunctionOnNextCall(push1);
......@@ -145,6 +159,7 @@
return a.push(1.1, 2.2);
}
%PrepareFunctionForOptimization(push2);
assertEquals(4, push2([, 1.1]));
assertEquals(5, push2([, 1.1, 2.2]));
%OptimizeFunctionOnNextCall(push2);
......@@ -154,6 +169,7 @@
return a.push(1.1, 2.2, 3.3);
}
%PrepareFunctionForOptimization(push3);
assertEquals(5, push3([, 1.1]));
assertEquals(6, push3([, 1.1, 2.2]));
%OptimizeFunctionOnNextCall(push3);
......@@ -166,6 +182,7 @@
return a.push();
}
%PrepareFunctionForOptimization(push0);
assertEquals(1, push0(['1']));
assertEquals(2, push0(['1', '2']));
%OptimizeFunctionOnNextCall(push0);
......@@ -175,6 +192,7 @@
return a.push('1');
}
%PrepareFunctionForOptimization(push1);
assertEquals(2, push1(['1']));
assertEquals(3, push1(['1', '2']));
%OptimizeFunctionOnNextCall(push1);
......@@ -184,6 +202,7 @@
return a.push('1', '2');
}
%PrepareFunctionForOptimization(push2);
assertEquals(3, push2(['1']));
assertEquals(4, push2(['1', '2']));
%OptimizeFunctionOnNextCall(push2);
......@@ -193,6 +212,7 @@
return a.push('1', '2', '3');
}
%PrepareFunctionForOptimization(push3);
assertEquals(4, push3(['1']));
assertEquals(5, push3(['1', '2']));
%OptimizeFunctionOnNextCall(push3);
......@@ -205,6 +225,7 @@
return a.push();
}
%PrepareFunctionForOptimization(push0);
assertEquals(2, push0([, '1']));
assertEquals(3, push0([, '1', '2']));
%OptimizeFunctionOnNextCall(push0);
......@@ -214,6 +235,7 @@
return a.push('1');
}
%PrepareFunctionForOptimization(push1);
assertEquals(3, push1([, '1']));
assertEquals(4, push1([, '1', '2']));
%OptimizeFunctionOnNextCall(push1);
......@@ -223,6 +245,7 @@
return a.push('1', '2');
}
%PrepareFunctionForOptimization(push2);
assertEquals(4, push2([, '1']));
assertEquals(5, push2([, '1', '2']));
%OptimizeFunctionOnNextCall(push2);
......@@ -232,6 +255,7 @@
return a.push('1', '2', '3');
}
%PrepareFunctionForOptimization(push3);
assertEquals(5, push3([, '1']));
assertEquals(6, push3([, '1', '2']));
%OptimizeFunctionOnNextCall(push3);
......
......@@ -8,6 +8,7 @@
(function() {
const a = [];
const foo = (x, y) => a.push(x, y);
%PrepareFunctionForOptimization(foo);
foo(1, 2);
foo(3, 4);
%OptimizeFunctionOnNextCall(foo);
......@@ -17,6 +18,7 @@
(function() {
const a = [];
const foo = (x, y) => a.push(x, y);
%PrepareFunctionForOptimization(foo);
foo(1, 2);
foo(3, 4);
%OptimizeFunctionOnNextCall(foo);
......@@ -28,6 +30,7 @@
(function() {
const a = [];
const foo = (x, y) => a.push(x, y);
%PrepareFunctionForOptimization(foo);
foo(1, 2);
foo(3, 4);
%OptimizeFunctionOnNextCall(foo);
......@@ -37,6 +40,7 @@
(function() {
const a = [];
const foo = (x, y) => a.push(x, y);
%PrepareFunctionForOptimization(foo);
foo(1, 2);
foo(3, 4);
%OptimizeFunctionOnNextCall(foo);
......@@ -48,6 +52,7 @@
(function() {
const a = [0.5];
const foo = (x, y) => a.push(x, y);
%PrepareFunctionForOptimization(foo);
foo(1, 2);
foo(3, 4);
%OptimizeFunctionOnNextCall(foo);
......@@ -57,6 +62,7 @@
(function() {
const a = [0.5];
const foo = (x, y) => a.push(x, y);
%PrepareFunctionForOptimization(foo);
foo(1, 2);
foo(3, 4);
%OptimizeFunctionOnNextCall(foo);
......
......@@ -9,6 +9,7 @@
const a = [];
const bar = x => { a.push(x); return x; };
const foo = x => a.push(bar(x), bar(x));
%PrepareFunctionForOptimization(foo);
foo(1);
foo(2);
%OptimizeFunctionOnNextCall(foo);
......@@ -22,6 +23,7 @@
const a = [];
const bar = x => { a.push(y); return x; }
const foo = x => a.push(bar(x), bar(x));
%PrepareFunctionForOptimization(foo);
foo(1);
y = 2;
foo(2);
......@@ -38,6 +40,7 @@
const a = [0.5];
const bar = x => { a.push(y); return x; }
const foo = x => a.push(bar(x), bar(x));
%PrepareFunctionForOptimization(foo);
foo(1);
y = 2;
foo(2);
......
......@@ -20,12 +20,16 @@
return arr.slice(0);
}
%PrepareFunctionForOptimization(slice0);
assertEquals(arr, slice());
assertFalse(arr === slice());
assertEquals(slice(), slice0());
assertEquals(slice0(), slice());
%OptimizeFunctionOnNextCall(slice0);
assertEquals(slice(), slice0());
%PrepareFunctionForOptimization(slice);
%OptimizeFunctionOnNextCall(slice);
assertEquals(slice(), slice0());
......@@ -41,6 +45,8 @@
return arr.slice();
}
%PrepareFunctionForOptimization(slice);
assertEquals(arr, slice());
assertEquals(slice(), arr);
......@@ -60,6 +66,8 @@
return arr.slice();
}
%PrepareFunctionForOptimization(slice);
assertEquals(arr, slice());
assertEquals(slice(), arr);
......@@ -71,6 +79,7 @@
arr.push(7.2);
slice();
%PrepareFunctionForOptimization(slice);
%OptimizeFunctionOnNextCall(slice);
// Trigger opt again
slice();
......@@ -92,6 +101,8 @@
class MyArray extends Array {};
array.constructor = MyArray;
%PrepareFunctionForOptimization(slice);
slice(); slice();
%OptimizeFunctionOnNextCall(slice);
......@@ -106,6 +117,8 @@
return array.slice();
}
%PrepareFunctionForOptimization(slice);
slice(); slice();
%OptimizeFunctionOnNextCall(slice);
......@@ -128,6 +141,8 @@
return arr.slice();
}
%PrepareFunctionForOptimization(slice);
slice(); slice();
arr.foo = 6.2;
......@@ -155,6 +170,8 @@
return arr.slice();
}
%PrepareFunctionForOptimization(slice);
slice(iarr); slice(darr);
slice(iarr); slice(darr);
......@@ -182,6 +199,8 @@
return array.slice();
}
%PrepareFunctionForOptimization(slice);
assertEquals(slice(),array);
slice();
......@@ -205,6 +224,8 @@
return x.slice();
}
%PrepareFunctionForOptimization(slice);
slice(); slice();
%OptimizeFunctionOnNextCall(slice);
......@@ -221,6 +242,8 @@
return array.slice();
}
%PrepareFunctionForOptimization(slice);
assertEquals(slice(),array);
slice();
......@@ -238,6 +261,8 @@
return array.slice();
}
%PrepareFunctionForOptimization(slice);
assertEquals(slice(),array);
slice();
......@@ -259,6 +284,8 @@
return arr.slice();
}
%PrepareFunctionForOptimization(slice);
// make array's map is_prototype_map()
var x = {__proto__ : array};
......@@ -284,6 +311,8 @@
return array.slice();
}
%PrepareFunctionForOptimization(slice);
assertEquals(slice(),array);
slice();
......@@ -305,6 +334,8 @@
return array.slice();
}
%PrepareFunctionForOptimization(slice);
assertEquals(slice(),array);
slice();
......@@ -328,6 +359,8 @@
return array.slice();
}
%PrepareFunctionForOptimization(slice);
assertEquals(slice(),array);
slice();
......@@ -348,6 +381,8 @@
return array.slice();
}
%PrepareFunctionForOptimization(slice);
assertEquals(slice(),array);
slice();
......
......@@ -10,6 +10,7 @@
return a.some(x => x === o.x);
}
%PrepareFunctionForOptimization(foo);
assertTrue(foo([1, 2, 3], {x:3}));
assertFalse(foo([0, 1, 2], {x:3}));
%OptimizeFunctionOnNextCall(foo);
......
......@@ -12,6 +12,8 @@ function f() {
let y;
%PrepareFunctionForOptimization(f);
y = f();
assertFalse(y instanceof Foo);
assertInstanceof(y, Array);
......
......@@ -10,6 +10,7 @@
function foo() { return new A; }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(0, foo().length);
assertInstanceof(foo(), A);
......@@ -26,6 +27,7 @@
function foo() { return new A(L); }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(L, foo().length);
assertInstanceof(foo(), A);
......@@ -42,6 +44,7 @@
function foo() { return new A(L); }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(L, foo().length);
assertInstanceof(foo(), A);
......@@ -57,6 +60,7 @@
function foo() { return new A(true); }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(1, foo().length);
assertEquals(true, foo()[0]);
......@@ -75,6 +79,7 @@
function foo() { return new A(""); }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(1, foo().length);
assertEquals("", foo()[0]);
......@@ -94,6 +99,7 @@
function foo() { return new A(O); }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(1, foo().length);
assertSame(O, foo()[0]);
......@@ -112,6 +118,7 @@
function foo() { return new A(1, 2, 3); }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(3, foo().length);
assertEquals(1, foo()[0]);
......@@ -131,6 +138,7 @@
function foo() { return new A(1.1, 2.2, 3.3); }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(3, foo().length);
assertEquals(1.1, foo()[0]);
......@@ -150,6 +158,7 @@
function foo() { return new A("a", "b", "c", "d"); }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(4, foo().length);
assertEquals("a", foo()[0]);
......@@ -176,6 +185,7 @@
function foo() { return new A; }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(0, foo().length);
assertEquals(1, foo().bar);
......@@ -200,6 +210,7 @@
function foo() { return new A(L); }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(L, foo().length);
assertEquals(1, foo().bar);
......@@ -224,6 +235,7 @@
function foo() { return new A(L); }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(L, foo().length);
assertEquals(1, foo().bar);
......@@ -247,6 +259,7 @@
function foo() { return new A(true); }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(1, foo().length);
assertEquals(true, foo()[0]);
......@@ -273,6 +286,7 @@
function foo() { return new A(""); }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(1, foo().length);
assertEquals("", foo()[0]);
......@@ -300,6 +314,7 @@
function foo() { return new A(O); }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(1, foo().length);
assertSame(O, foo()[0]);
......@@ -326,6 +341,7 @@
function foo() { return new A(1, 2, 3); }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(3, foo().length);
assertEquals(1, foo()[0]);
......@@ -352,6 +368,7 @@
function foo() { return new A(1.1, 2.2, 3.3); }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(3, foo().length);
assertEquals(1.1, foo()[0]);
......@@ -378,6 +395,7 @@
function foo() { return new A("a", "b", "c", "d"); }
%PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), A);
assertEquals(4, foo().length);
assertEquals("a", foo()[0]);
......
......@@ -42,6 +42,8 @@ assertEquals(2.1, o.x);
// Test deopt with count operation on named property.
function assign2(p) { p.x += 1 }
%PrepareFunctionForOptimization(assign2);
o.x = "42";
assign2(o);
assertEquals("421", o.x);
......@@ -60,6 +62,8 @@ assertEquals(max_smi + 10, o.x);
// Test deopt with count operation on keyed property.
function assign3(a, b) { a[b] += 1; }
%PrepareFunctionForOptimization(assign3);
o = ["42"];
assign3(o, 0);
assertEquals("421", o[0]);
......@@ -83,12 +87,14 @@ o[0] = 0;
for(var i = 0; i < 5; i++) {
assign3(o, 0);
}
%PrepareFunctionForOptimization(assign3);
%OptimizeFunctionOnNextCall(assign3);
assign3(o, 0);
assign3(o, 1);
// Test bailout with count operation in a value context.
function assign5(x,y) { return (x += 1) + y; }
%PrepareFunctionForOptimization(assign5);
for (var i = 0; i < 5; ++i) assertEquals(4, assign5(2, 1));
%OptimizeFunctionOnNextCall(assign5);
assertEquals(4, assign5(2, 1));
......@@ -97,6 +103,7 @@ assertEquals(4.1, assign5(2, 1.1));
assertEquals(4.1, assign5(2.1, 1));
function assign7(o,y) { return (o.x += 1) + y; }
%PrepareFunctionForOptimization(assign7);
o = {x:0};
for (var i = 0; i < 5; ++i) {
o.x = 42;
......@@ -112,6 +119,7 @@ o.x = 42.1;
assertEquals(44.1, assign7(o, 1));
function assign9(o,y) { return (o[0] += 1) + y; }
%PrepareFunctionForOptimization(assign9);
q = [0];
for (var i = 0; i < 5; ++i) {
q[0] = 42;
......@@ -128,6 +136,7 @@ assertEquals(44.1, assign9(q, 1));
// Test deopt because of a failed map check on the load.
function assign10(p) { return p.x += 1 }
%PrepareFunctionForOptimization(assign10);
var g1 = {x:0};
var g2 = {y:0, x:42};
for (var i = 0; i < 5; ++i) {
......@@ -148,6 +157,7 @@ assertEquals(43, g2.x);
o = {x:0};
var g3 = { valueOf: function() { o.y = "bar"; return 42; }};
function assign11(p) { return p.x += 1; }
%PrepareFunctionForOptimization(assign11);
for (var i = 0; i < 5; i++) {
o.x = "a";
......@@ -165,6 +175,7 @@ assertEquals("bar", o.y);
o = [0];
var g4 = { valueOf: function() { o.y = "bar"; return 42; }};
function assign12(p) { return p[0] += 1; }
%PrepareFunctionForOptimization(assign12);
for (var i = 0; i < 5; i++) {
o[0] = "a";
......
......@@ -7,6 +7,7 @@
function test1(s) {
return s.toString;
}
%PrepareFunctionForOptimization(test1);
assertSame(test1(false), Boolean.prototype.toString);
assertSame(test1(true), Boolean.prototype.toString);
%OptimizeFunctionOnNextCall(test1);
......@@ -16,6 +17,7 @@ assertSame(test1(true), Boolean.prototype.toString);
function test2(s) {
return s.valueOf;
}
%PrepareFunctionForOptimization(test2);
assertSame(test2(false), Boolean.prototype.valueOf);
assertSame(test2(true), Boolean.prototype.valueOf);
%OptimizeFunctionOnNextCall(test2);
......@@ -26,6 +28,7 @@ Boolean.prototype.foo = 42;
function test3(s) {
return s["foo"];
}
%PrepareFunctionForOptimization(test3);
assertEquals(test3(false), 42);
assertEquals(test3(true), 42);
%OptimizeFunctionOnNextCall(test3);
......@@ -36,6 +39,7 @@ Boolean.prototype.bar = function bar() { "use strict"; return this; }
function test4(s) {
return s.bar();
}
%PrepareFunctionForOptimization(test4);
assertEquals(test4(false), false);
assertEquals(test4(true), true);
%OptimizeFunctionOnNextCall(test4);
......
......@@ -12,5 +12,6 @@ var foo = (function() {
var baz = (function (s) { return foo(s) });
%PrepareFunctionForOptimization(baz);
%OptimizeFunctionOnNextCall(baz);
assertEquals(42 + 12, baz(12));
......@@ -38,6 +38,8 @@ function x(z) {
return z.f();
}
%PrepareFunctionForOptimization(x);
x(a);
x(b);
x(a);
......
......@@ -33,6 +33,8 @@ function test_empty() {
return { value: o.value };
}
%PrepareFunctionForOptimization(foo);
function Base() {
this.v_ = 5;
}
......@@ -63,6 +65,8 @@ function test_narrow1() {
return { value: o.value };
}
%PrepareFunctionForOptimization(foo);
function Base() {
this.v_ = 5;
}
......@@ -97,6 +101,8 @@ function test_narrow2() {
return { value: o.value(flag) };
}
%PrepareFunctionForOptimization(foo);
function Base() {
this.v_ = 5;
}
......
......@@ -62,6 +62,8 @@ function F4(a, b) {
%NeverOptimizeFunction(test);
function test(f, a, b) {
%PrepareFunctionForOptimization(f);
f(a, a);
f(a, b);
f(b, a);
......
......@@ -47,6 +47,7 @@ function add_field(obj) {
obj.c = 0;
obj.c = 3;
}
%PrepareFunctionForOptimization(add_field);
var obj1 = new_object();
var obj2 = new_object();
add_field(obj1);
......
......@@ -36,6 +36,8 @@ if (!%IsConcurrentRecompilationSupported()) {
function f(foo) { return foo.bar(); }
%PrepareFunctionForOptimization(f);
var o = {};
o.__proto__ = { __proto__: { bar: function() { return 1; } } };
......
......@@ -9,6 +9,7 @@
(function() {
const a = [1, 2, 3];
const foo = () => a[0];
%PrepareFunctionForOptimization(foo);
assertEquals(1, foo());
assertEquals(1, foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -24,6 +25,7 @@
(function() {
const a = [1, 2, 3];
const foo = () => a[0];
%PrepareFunctionForOptimization(foo);
assertEquals(1, foo());
assertEquals(1, foo());
%OptimizeFunctionOnNextCall(foo);
......
......@@ -7,6 +7,7 @@
// Check that constant-folding of ToString operations works properly for NaN.
(function() {
const foo = () => `${NaN}`;
%PrepareFunctionForOptimization(foo);
assertEquals("NaN", foo());
assertEquals("NaN", foo());
%OptimizeFunctionOnNextCall(foo);
......@@ -16,6 +17,7 @@
// Check that constant-folding of ToString operations works properly for 0/-0.
(function() {
const foo = x => `${x ? 0 : -0}`;
%PrepareFunctionForOptimization(foo);
assertEquals("0", foo(true));
assertEquals("0", foo(false));
assertEquals("0", foo(true));
......
......@@ -77,17 +77,22 @@ function testConstructorInlining(){
}
assertEquals(a, new Derived(true, 5, a));
%PrepareFunctionForOptimization(Derived);
%OptimizeFunctionOnNextCall(Derived);
assertEquals(b, new DerivedDeoptCreate(true, a, b));
%PrepareFunctionForOptimization(Derived);
%OptimizeFunctionOnNextCall(Derived);
assertEquals(a, new DerivedDeoptCreate(true, a, undefined));
%PrepareFunctionForOptimization(Derived);
%OptimizeFunctionOnNextCall(Derived);
assertEquals(5, new DerivedDeoptCreate(false, 5, 7).x);
%PrepareFunctionForOptimization(Derived);
%OptimizeFunctionOnNextCall(Derived);
assertEquals(7, new DerivedDeoptCreate(false, 5, 7).y);
}
testConstructorInlining();
%PrepareFunctionForOptimization(testConstructorInlining);
%OptimizeFunctionOnNextCall(testConstructorInlining);
testConstructorInlining();
......@@ -95,6 +100,7 @@ var last = undefined;
for(var i = 0; deopt_at < 0; ++i) {
deopt_at = i;
counter = 0;
%PrepareFunctionForOptimization(testConstructorInlining);
%OptimizeFunctionOnNextCall(testConstructorInlining);
testConstructorInlining();
if (last !== undefined) {
......
......@@ -17,6 +17,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => y + x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(1, foo(0));
assertEquals(2, foo(object1));
assertThrows(() => foo(thrower));
......@@ -36,6 +37,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => y - x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(1, foo(0));
assertEquals(0, foo(object1));
assertThrows(() => foo(thrower));
......@@ -55,6 +57,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => y * x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(1, foo(1));
assertEquals(1, foo(object1));
assertThrows(() => foo(thrower));
......@@ -74,6 +77,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => y / x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(1, foo(1));
assertEquals(1, foo(object1));
assertThrows(() => foo(thrower));
......@@ -93,6 +97,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => y % x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(0, foo(1));
assertEquals(0, foo(object1));
assertThrows(() => foo(thrower));
......@@ -112,6 +117,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => y ** x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(1, foo(1));
assertEquals(1, foo(object1));
assertThrows(() => foo(thrower));
......@@ -131,6 +137,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => y | x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(1, foo(1));
assertEquals(1, foo(object1));
assertThrows(() => foo(thrower));
......@@ -150,6 +157,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => y & x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(1, foo(1));
assertEquals(1, foo(object1));
assertThrows(() => foo(thrower));
......@@ -169,6 +177,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => y ^ x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(0, foo(1));
assertEquals(0, foo(object1));
assertThrows(() => foo(thrower));
......@@ -188,6 +197,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => y << x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(2, foo(1));
assertEquals(2, foo(object1));
assertThrows(() => foo(thrower));
......@@ -207,6 +217,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => y >> x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(0, foo(1));
assertEquals(0, foo(object1));
assertThrows(() => foo(thrower));
......@@ -226,6 +237,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => y >>> x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(0, foo(1));
assertEquals(0, foo(object1));
assertThrows(() => foo(thrower));
......@@ -245,6 +257,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => y == x);
}
%PrepareFunctionForOptimization(foo);
assertFalse(foo(0));
assertTrue(foo(object1));
assertThrows(() => foo(thrower));
......@@ -264,6 +277,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => y < x);
}
%PrepareFunctionForOptimization(foo);
assertFalse(foo(0));
assertFalse(foo(object1));
assertThrows(() => foo(thrower));
......@@ -283,6 +297,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => x > y);
}
%PrepareFunctionForOptimization(foo);
assertFalse(foo(0));
assertFalse(foo(object1));
assertThrows(() => foo(thrower));
......@@ -302,6 +317,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => y <= x);
}
%PrepareFunctionForOptimization(foo);
assertFalse(foo(0));
assertTrue(foo(object1));
assertThrows(() => foo(thrower));
......@@ -321,6 +337,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(y => x >= y);
}
%PrepareFunctionForOptimization(foo);
assertFalse(foo(0));
assertTrue(foo(object1));
assertThrows(() => foo(thrower));
......@@ -340,6 +357,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(o => o instanceof c);
}
%PrepareFunctionForOptimization(foo);
assertTrue(foo(Object));
assertFalse(foo(Array));
assertThrows(() => foo({[Symbol.hasInstance]() { throw new Error(); }}));
......@@ -359,6 +377,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(() => ~x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(0, foo(-1));
assertEquals(~1, foo(object1));
assertThrows(() => foo(thrower));
......@@ -378,6 +397,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(() => -x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(1, foo(-1));
assertEquals(-1, foo(object1));
assertThrows(() => foo(thrower));
......@@ -397,6 +417,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(() => ++x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(1, foo(0));
assertEquals(2, foo(object1));
assertThrows(() => foo(thrower));
......@@ -416,6 +437,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(() => --x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(1, foo(2));
assertEquals(0, foo(object1));
assertThrows(() => foo(thrower));
......@@ -436,6 +458,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(() => arguments)[0];
}
%PrepareFunctionForOptimization(foo);
assertEquals(0, foo(0, 1));
assertEquals(1, foo(1, 2));
assertEquals(undefined, foo());
......@@ -455,6 +478,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
return bar(() => args)[0];
}
%PrepareFunctionForOptimization(foo);
assertEquals(0, foo(0, 1));
assertEquals(1, foo(1, 2));
assertEquals(undefined, foo());
......@@ -491,6 +515,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
});
}
%PrepareFunctionForOptimization(foo);
assertEquals('Some value', foo('Another value'));
assertEquals('Another value', actualValue);
assertEquals('Another value', foo('Some value'));
......@@ -516,6 +541,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
});
}
%PrepareFunctionForOptimization(foo);
assertEquals('abc', foo({a: 1, b: 2, c: 3}));
assertEquals('ab', foo(Object.create({a: 1, b: 2})));
%OptimizeFunctionOnNextCall(foo);
......@@ -542,6 +568,7 @@ const thrower = {[Symbol.toPrimitive]() { throw new Error(); }};
});
}
%PrepareFunctionForOptimization(foo);
assertEquals(6, foo(1, 2, 3));
assertEquals("abc", foo("a", "b", "c"));
%OptimizeFunctionOnNextCall(foo);
......
......@@ -42,6 +42,8 @@ assertEquals(2.1, o.x);
// Test deopt with count operation on named property.
function inc2(p) { p.x++ }
%PrepareFunctionForOptimization(inc2);
o.x = "42";
inc2(o);
assertEquals(43, o.x);
......@@ -60,6 +62,8 @@ assertEquals(max_smi + 10, o.x);
// Test deopt with count operation on keyed property.
function inc3(a, b) { a[b]++; }
%PrepareFunctionForOptimization(inc3);
o = ["42"];
inc3(o, 0);
assertEquals(43, o[0]);
......@@ -83,18 +87,21 @@ o[0] = 0;
for(var i = 0; i < 5; i++) {
inc3(o, 0);
}
%PrepareFunctionForOptimization(inc3);
%OptimizeFunctionOnNextCall(inc3);
inc3(o, 0);
inc3(o, 1);
// Test bailout with count operation in a value context.
function inc4(x,y) { return (x++) + y; }
%PrepareFunctionForOptimization(inc4);
for (var i = 0; i < 5; ++i) assertEquals(3, inc4(2, 1));
%OptimizeFunctionOnNextCall(inc4);
inc4(2, 1);
assertEquals(3.1, inc4(2, 1.1));
function inc5(x,y) { return (++x) + y; }
%PrepareFunctionForOptimization(inc5);
for (var i = 0; i < 5; ++i) assertEquals(4, inc5(2, 1));
%OptimizeFunctionOnNextCall(inc5);
assertEquals(4, inc5(2, 1));
......@@ -102,6 +109,7 @@ assertEquals(4.1, inc5(2, 1.1));
assertEquals(4.1, inc5(2.1, 1));
function inc6(o,y) { return (o.x++) + y; }
%PrepareFunctionForOptimization(inc6);
o = {x:0};
for (var i = 0; i < 5; ++i) {
o.x = 42;
......@@ -116,6 +124,7 @@ o.x = 42.1;
assertEquals(43.1, inc6(o, 1));
function inc7(o,y) { return (++o.x) + y; }
%PrepareFunctionForOptimization(inc7);
o = {x:0};
for (var i = 0; i < 5; ++i) {
o.x = 42;
......@@ -130,6 +139,7 @@ o.x = 42.1;
assertEquals(44.1, inc7(o, 1));
function inc8(o,y) { return (o[0]++) + y; }
%PrepareFunctionForOptimization(inc8);
var q = [0];
for (var i = 0; i < 5; ++i) {
q[0] = 42;
......@@ -144,6 +154,7 @@ q[0] = 42.1;
assertEquals(43.1, inc8(q, 1));
function inc9(o,y) { return (++o[0]) + y; }
%PrepareFunctionForOptimization(inc9);
q = [0];
for (var i = 0; i < 5; ++i) {
q[0] = 42;
......@@ -159,6 +170,7 @@ assertEquals(44.1, inc9(q, 1));
// Test deopt because of a failed map check.
function inc10(p) { return p.x++ }
%PrepareFunctionForOptimization(inc10);
var g1 = {x:0};
var g2 = {y:0, x:42}
for (var i = 0; i < 5; ++i) {
......
......@@ -16,6 +16,7 @@
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(42, foo(0));
assertEquals(24, foo(1));
assertEquals(43, foo(0));
......@@ -37,6 +38,7 @@
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(42, foo(0));
assertEquals(24, foo(1));
assertEquals(43, foo(0));
......@@ -58,6 +60,7 @@
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(42, foo(0));
assertEquals(24, foo(2));
assertEquals(43, foo(0));
......@@ -79,6 +82,7 @@
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(42, foo(0));
assertEquals(24, foo(2));
assertEquals(43, foo(0));
......@@ -100,6 +104,7 @@
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(42, foo(0));
assertEquals(24, foo(4));
assertEquals(43, foo(0));
......@@ -121,6 +126,7 @@
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(42, foo(0));
assertEquals(24, foo(4));
assertEquals(43, foo(0));
......@@ -142,6 +148,7 @@
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(42, foo(0));
assertEquals(24, foo(4));
assertEquals(43, foo(0));
......@@ -163,6 +170,7 @@
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(42, foo(0));
assertEquals(24, foo(8));
assertEquals(43, foo(0));
......
......@@ -16,6 +16,7 @@ function readUint8(offset) {
}
function warmupRead(f) {
%PrepareFunctionForOptimization(f);
f(0);
f(1);
%OptimizeFunctionOnNextCall(f);
......@@ -40,6 +41,7 @@ function writeUint8(offset, value) {
}
function warmupWrite(f) {
%PrepareFunctionForOptimization(f);
f(0, 0);
f(0, 1);
%OptimizeFunctionOnNextCall(f);
......
......@@ -54,6 +54,7 @@ function readFloat64(offset, little_endian) {
}
function warmup(f) {
%PrepareFunctionForOptimization(f);
f(0);
f(1);
%OptimizeFunctionOnNextCall(f);
......
......@@ -16,6 +16,7 @@
return dv.getInt8(0);
}
%PrepareFunctionForOptimization(foo);
assertEquals(0, foo(dv));
assertEquals(0, foo(dv));
%OptimizeFunctionOnNextCall(foo);
......@@ -24,6 +25,7 @@
%ArrayBufferDetach(ab);
assertThrows(() => foo(dv), TypeError);
assertUnoptimized(foo);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(() => foo(dv), TypeError);
assertOptimized(foo);
......@@ -38,6 +40,7 @@
return dv.getUint8(0);
}
%PrepareFunctionForOptimization(foo);
assertEquals(0, foo(dv));
assertEquals(0, foo(dv));
%OptimizeFunctionOnNextCall(foo);
......@@ -46,6 +49,7 @@
%ArrayBufferDetach(ab);
assertThrows(() => foo(dv), TypeError);
assertUnoptimized(foo);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(() => foo(dv), TypeError);
assertOptimized(foo);
......@@ -60,6 +64,7 @@
return dv.getInt16(0, true);
}
%PrepareFunctionForOptimization(foo);
assertEquals(0, foo(dv));
assertEquals(0, foo(dv));
%OptimizeFunctionOnNextCall(foo);
......@@ -68,6 +73,7 @@
%ArrayBufferDetach(ab);
assertThrows(() => foo(dv), TypeError);
assertUnoptimized(foo);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(() => foo(dv), TypeError);
assertOptimized(foo);
......@@ -82,6 +88,7 @@
return dv.getUint16(0, true);
}
%PrepareFunctionForOptimization(foo);
assertEquals(0, foo(dv));
assertEquals(0, foo(dv));
%OptimizeFunctionOnNextCall(foo);
......@@ -90,6 +97,7 @@
%ArrayBufferDetach(ab);
assertThrows(() => foo(dv), TypeError);
assertUnoptimized(foo);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(() => foo(dv), TypeError);
assertOptimized(foo);
......@@ -104,6 +112,7 @@
return dv.getInt32(0, true);
}
%PrepareFunctionForOptimization(foo);
assertEquals(0, foo(dv));
assertEquals(0, foo(dv));
%OptimizeFunctionOnNextCall(foo);
......@@ -112,6 +121,7 @@
%ArrayBufferDetach(ab);
assertThrows(() => foo(dv), TypeError);
assertUnoptimized(foo);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(() => foo(dv), TypeError);
assertOptimized(foo);
......@@ -126,6 +136,7 @@
return dv.getUint32(0, true);
}
%PrepareFunctionForOptimization(foo);
assertEquals(0, foo(dv));
assertEquals(0, foo(dv));
%OptimizeFunctionOnNextCall(foo);
......@@ -134,6 +145,7 @@
%ArrayBufferDetach(ab);
assertThrows(() => foo(dv), TypeError);
assertUnoptimized(foo);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(() => foo(dv), TypeError);
assertOptimized(foo);
......@@ -148,6 +160,7 @@
return dv.getFloat32(0, true);
}
%PrepareFunctionForOptimization(foo);
assertEquals(0, foo(dv));
assertEquals(0, foo(dv));
%OptimizeFunctionOnNextCall(foo);
......@@ -156,6 +169,7 @@
%ArrayBufferDetach(ab);
assertThrows(() => foo(dv), TypeError);
assertUnoptimized(foo);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(() => foo(dv), TypeError);
assertOptimized(foo);
......@@ -170,6 +184,7 @@
return dv.getFloat64(0, true);
}
%PrepareFunctionForOptimization(foo);
assertEquals(0, foo(dv));
assertEquals(0, foo(dv));
%OptimizeFunctionOnNextCall(foo);
......@@ -178,6 +193,7 @@
%ArrayBufferDetach(ab);
assertThrows(() => foo(dv), TypeError);
assertUnoptimized(foo);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(() => foo(dv), TypeError);
assertOptimized(foo);
......@@ -192,6 +208,7 @@
return dv.setInt8(0, x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(undefined, foo(dv, 1));
assertEquals(1, dv.getInt8(0));
assertEquals(undefined, foo(dv, 2));
......@@ -202,6 +219,7 @@
%ArrayBufferDetach(ab);
assertThrows(() => foo(dv, 4), TypeError);
assertUnoptimized(foo);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(() => foo(dv, 5), TypeError);
assertOptimized(foo);
......@@ -216,6 +234,7 @@
return dv.setUint8(0, x);
}
%PrepareFunctionForOptimization(foo);
assertEquals(undefined, foo(dv, 1));
assertEquals(1, dv.getUint8(0));
assertEquals(undefined, foo(dv, 2));
......@@ -226,6 +245,7 @@
%ArrayBufferDetach(ab);
assertThrows(() => foo(dv, 4), TypeError);
assertUnoptimized(foo);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(() => foo(dv, 5), TypeError);
assertOptimized(foo);
......@@ -240,6 +260,7 @@
return dv.setInt16(0, x, true);
}
%PrepareFunctionForOptimization(foo);
assertEquals(undefined, foo(dv, 1));
assertEquals(1, dv.getInt16(0, true));
assertEquals(undefined, foo(dv, 2));
......@@ -250,6 +271,7 @@
%ArrayBufferDetach(ab);
assertThrows(() => foo(dv, 4), TypeError);
assertUnoptimized(foo);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(() => foo(dv, 5), TypeError);
assertOptimized(foo);
......@@ -264,6 +286,7 @@
return dv.setUint16(0, x, true);
}
%PrepareFunctionForOptimization(foo);
assertEquals(undefined, foo(dv, 1));
assertEquals(1, dv.getUint16(0, true));
assertEquals(undefined, foo(dv, 2));
......@@ -274,6 +297,7 @@
%ArrayBufferDetach(ab);
assertThrows(() => foo(dv, 4), TypeError);
assertUnoptimized(foo);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(() => foo(dv, 5), TypeError);
assertOptimized(foo);
......@@ -288,6 +312,7 @@
return dv.setInt32(0, x, true);
}
%PrepareFunctionForOptimization(foo);
assertEquals(undefined, foo(dv, 1));
assertEquals(1, dv.getInt32(0, true));
assertEquals(undefined, foo(dv, 2));
......@@ -298,6 +323,7 @@
%ArrayBufferDetach(ab);
assertThrows(() => foo(dv, 4), TypeError);
assertUnoptimized(foo);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(() => foo(dv, 5), TypeError);
assertOptimized(foo);
......@@ -312,6 +338,7 @@
return dv.setUint32(0, x, true);
}
%PrepareFunctionForOptimization(foo);
assertEquals(undefined, foo(dv, 1));
assertEquals(1, dv.getUint32(0, true));
assertEquals(undefined, foo(dv, 2));
......@@ -322,6 +349,7 @@
%ArrayBufferDetach(ab);
assertThrows(() => foo(dv, 4), TypeError);
assertUnoptimized(foo);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(() => foo(dv, 5), TypeError);
assertOptimized(foo);
......@@ -336,6 +364,7 @@
return dv.setFloat32(0, x, true);
}
%PrepareFunctionForOptimization(foo);
assertEquals(undefined, foo(dv, 1));
assertEquals(1, dv.getFloat32(0, true));
assertEquals(undefined, foo(dv, 2));
......@@ -346,6 +375,7 @@
%ArrayBufferDetach(ab);
assertThrows(() => foo(dv, 4), TypeError);
assertUnoptimized(foo);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(() => foo(dv, 5), TypeError);
assertOptimized(foo);
......@@ -360,6 +390,7 @@
return dv.setFloat64(0, x, true);
}
%PrepareFunctionForOptimization(foo);
assertEquals(undefined, foo(dv, 1));
assertEquals(1, dv.getFloat64(0, true));
assertEquals(undefined, foo(dv, 2));
......@@ -370,6 +401,7 @@
%ArrayBufferDetach(ab);
assertThrows(() => foo(dv, 4), TypeError);
assertUnoptimized(foo);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(() => foo(dv, 5), TypeError);
assertOptimized(foo);
......
......@@ -16,6 +16,7 @@
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(42, foo(dv, 0));
assertEquals(24, foo(dv, 1));
assertEquals(43, foo(dv, 0));
......@@ -37,6 +38,7 @@
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(42, foo(dv, 0));
assertEquals(24, foo(dv, 1));
assertEquals(43, foo(dv, 0));
......@@ -58,6 +60,7 @@
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(42, foo(dv, 0));
assertEquals(24, foo(dv, 2));
assertEquals(43, foo(dv, 0));
......@@ -79,6 +82,7 @@
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(42, foo(dv, 0));
assertEquals(24, foo(dv, 2));
assertEquals(43, foo(dv, 0));
......@@ -100,6 +104,7 @@
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(42, foo(dv, 0));
assertEquals(24, foo(dv, 4));
assertEquals(43, foo(dv, 0));
......@@ -121,6 +126,7 @@
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(42, foo(dv, 0));
assertEquals(24, foo(dv, 4));
assertEquals(43, foo(dv, 0));
......@@ -142,6 +148,7 @@
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(42, foo(dv, 0));
assertEquals(24, foo(dv, 4));
assertEquals(43, foo(dv, 0));
......@@ -163,6 +170,7 @@
return x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(42, foo(dv, 0));
assertEquals(24, foo(dv, 8));
assertEquals(43, foo(dv, 0));
......
......@@ -44,6 +44,7 @@ function writeFloat64(offset, value, little_endian) {
}
function warmup(f) {
%PrepareFunctionForOptimization(f);
f(0, 0);
f(0, 1);
%OptimizeFunctionOnNextCall(f);
......
......@@ -57,16 +57,19 @@ function dead3(a, b) {
return a;
}
%PrepareFunctionForOptimization(dead1);
assertTrue(dead1(33, 32) == 33);
assertTrue(dead1(33, 32) == 33);
%OptimizeFunctionOnNextCall(dead1);
assertTrue(dead1(33, 32) == 33);
%PrepareFunctionForOptimization(dead2);
assertTrue(dead2(34, 11) == 34);
assertTrue(dead2(34, 11) == 34);
%OptimizeFunctionOnNextCall(dead2);
assertTrue(dead2(34, 11) == 34);
%PrepareFunctionForOptimization(dead3);
assertTrue(dead3(35, 12) == 35);
assertTrue(dead3(35, 12) == 35);
%OptimizeFunctionOnNextCall(dead3);
......
......@@ -83,6 +83,7 @@ var params_loops = [loop6, loop7, loop8];
for (var i = 0; i < no_params_loops.length; i++) {
var f = no_params_loops[i];
%PrepareFunctionForOptimization(f);
f();
f();
f();
......@@ -92,6 +93,7 @@ for (var i = 0; i < no_params_loops.length; i++) {
for (var i = 0; i < params_loops.length; i++) {
var f = params_loops[i];
%PrepareFunctionForOptimization(f);
f(3);
f(7);
f(11);
......
......@@ -80,6 +80,7 @@ var loops = [loop1, loop2, loop3, loop4, loop5, loop6, loop7, loop8];
for (var i = 0; i < loops.length; i++) {
var f = loops[i];
%PrepareFunctionForOptimization(f);
f();
f();
%OptimizeFunctionOnNextCall(f);
......
......@@ -68,9 +68,14 @@ function run() {
assertEquals("1", dead3("true", 0));
}
%PrepareFunctionForOptimization(dead1);
run();
run();
%OptimizeFunctionOnNextCall(dead1);
run();
%PrepareFunctionForOptimization(dead2);
%OptimizeFunctionOnNextCall(dead2);
run();
%PrepareFunctionForOptimization(dead3);
%OptimizeFunctionOnNextCall(dead3);
run();
......@@ -21,6 +21,7 @@ function foo(o) {
return o.x++;
}
%PrepareFunctionForOptimization(foo);
assertEquals(1, foo(o));
assertEquals(2, foo(o));
%OptimizeFunctionOnNextCall(foo);
......
......@@ -21,6 +21,7 @@ function foo(o) {
return ++o.x;
}
%PrepareFunctionForOptimization(foo);
assertEquals(2, foo(o));
assertEquals(3, foo(o));
%OptimizeFunctionOnNextCall(foo);
......
......@@ -22,6 +22,7 @@ function foo(o) {
return o[x]++;
}
%PrepareFunctionForOptimization(foo);
assertEquals(1, foo(o));
assertEquals(2, foo(o));
%OptimizeFunctionOnNextCall(foo);
......
......@@ -22,6 +22,7 @@ function foo(o) {
return ++o[x];
}
%PrepareFunctionForOptimization(foo);
assertEquals(2, foo(o));
assertEquals(3, foo(o));
%OptimizeFunctionOnNextCall(foo);
......
......@@ -17,6 +17,7 @@ function test() {
assertEquals(1, o.q = 1);
}
%PrepareFunctionForOptimization(test);
test();
test();
%OptimizeFunctionOnNextCall(test);
......
......@@ -18,6 +18,7 @@ function test() {
assertEquals(1, o[q] = 1);
}
%PrepareFunctionForOptimization(test);
test();
test();
%OptimizeFunctionOnNextCall(test);
......
......@@ -21,6 +21,7 @@ function foo(o, x) {
return bar(1, (o[x], 2), 3);
}
%PrepareFunctionForOptimization(foo);
assertEquals(4, foo(o, "v"));
assertEquals(4, foo(o, "v"));
assertEquals(4, foo(o, "x"));
......
......@@ -35,6 +35,7 @@ function f(a,b,c) {
return 42;
}
%PrepareFunctionForOptimization(g);
var object = { };
object.f = f;
for (var i = 0; i < 5; i++) {
......
......@@ -13,10 +13,12 @@
function g() {
[1,2,3].forEach(f);
}
%PrepareFunctionForOptimization(g);
g();
g();
%OptimizeFunctionOnNextCall(g);
g();
%PrepareFunctionForOptimization(g);
%OptimizeFunctionOnNextCall(g);
g();
assertOptimized(g);
......@@ -31,10 +33,12 @@
function g() {
[1,2,3].find(f);
}
%PrepareFunctionForOptimization(g);
g();
g();
%OptimizeFunctionOnNextCall(g);
g();
%PrepareFunctionForOptimization(g);
%OptimizeFunctionOnNextCall(g);
g();
assertOptimized(g);
......@@ -48,10 +52,12 @@
function g() {
[1,2,3].map(f);
}
%PrepareFunctionForOptimization(g);
g();
g();
%OptimizeFunctionOnNextCall(g);
g();
%PrepareFunctionForOptimization(g);
%OptimizeFunctionOnNextCall(g);
g();
assertOptimized(g);
......@@ -65,10 +71,12 @@
function g() {
[1,2,3].filter(f);
}
%PrepareFunctionForOptimization(g);
g();
g();
%OptimizeFunctionOnNextCall(g);
g();
%PrepareFunctionForOptimization(g);
%OptimizeFunctionOnNextCall(g);
g();
assertOptimized(g);
......@@ -84,10 +92,12 @@
function g() {
[1,2,3].forEach(f);
}
%PrepareFunctionForOptimization(g);
g();
g();
%OptimizeFunctionOnNextCall(g);
g();
%PrepareFunctionForOptimization(g);
%OptimizeFunctionOnNextCall(g);
g();
assertOptimized(g);
......@@ -102,10 +112,12 @@
function g() {
[1,2,3].find(f);
}
%PrepareFunctionForOptimization(g);
g();
g();
%OptimizeFunctionOnNextCall(g);
g();
%PrepareFunctionForOptimization(g);
%OptimizeFunctionOnNextCall(g);
g();
assertOptimized(g);
......@@ -119,10 +131,12 @@
function g() {
[1,2,3].map(f);
}
%PrepareFunctionForOptimization(g);
g();
g();
%OptimizeFunctionOnNextCall(g);
g();
%PrepareFunctionForOptimization(g);
%OptimizeFunctionOnNextCall(g);
g();
assertOptimized(g);
......@@ -136,11 +150,13 @@
function g() {
[1,2,3].filter(f);
}
%PrepareFunctionForOptimization(g);
g();
g();
%OptimizeFunctionOnNextCall(g);
g();
g();
%PrepareFunctionForOptimization(g);
%OptimizeFunctionOnNextCall(g);
g();
g();
......
......@@ -13,6 +13,7 @@
return array[Symbol.iterator]().next();
}
%PrepareFunctionForOptimization(next);
assertEquals(next().value, undefined);
assertEquals(next().value, undefined);
......
......@@ -15,6 +15,7 @@
return array.every(v => v > 0);
}
%PrepareFunctionForOptimization(every);
every(); every();
%OptimizeFunctionOnNextCall(every);
......
......@@ -15,6 +15,7 @@
return array.filter(v => v > 0);
}
%PrepareFunctionForOptimization(filter);
filter(); filter();
%OptimizeFunctionOnNextCall(filter);
......
......@@ -15,6 +15,7 @@
return array.find(v => v > 0);
}
%PrepareFunctionForOptimization(find);
find(); find();
%OptimizeFunctionOnNextCall(find);
......
......@@ -15,6 +15,7 @@
return array.findIndex(v => v > 0);
}
%PrepareFunctionForOptimization(findIndex);
findIndex(); findIndex();
%OptimizeFunctionOnNextCall(findIndex);
......
......@@ -15,6 +15,7 @@
function forEach() {
array.forEach(increment);
}
%PrepareFunctionForOptimization(forEach);
forEach(); forEach();
%OptimizeFunctionOnNextCall(forEach);
......
......@@ -16,6 +16,7 @@
return arr.includes(val);
}
%PrepareFunctionForOptimization(includes);
assertTrue(includes(iarr, 0)); assertTrue(includes(darr, 0));
assertTrue(includes(iarr, 2)); assertTrue(includes(darr, 2));
......@@ -33,6 +34,7 @@
return arr.includes(val);
}
%PrepareFunctionForOptimization(includes);
assertTrue(includes(iarr, 0));
assertTrue(includes(iarr, 2));
......@@ -55,6 +57,7 @@
iarr.__proto__ = [2];
// get feedback
%PrepareFunctionForOptimization(includes);
assertFalse(includes(iarr, 0));
assertTrue(includes(iarr, 2));
......@@ -72,6 +75,7 @@
return arr.includes(val);
}
%PrepareFunctionForOptimization(includes);
assertFalse(includes(iarr, 2));
assertTrue(includes(iarr, 3));
......@@ -92,6 +96,7 @@
return array.includes(val);
}
%PrepareFunctionForOptimization(includes);
includes(6); includes(6);
%OptimizeFunctionOnNextCall(includes);
......
......@@ -16,6 +16,7 @@
return arr.indexOf(val);
}
%PrepareFunctionForOptimization(indexOf);
assertEquals(0, indexOf(iarr, 0));
assertEquals(0, indexOf(darr, 0));
assertEquals(2, indexOf(iarr, 2));
......@@ -36,6 +37,7 @@
return arr.indexOf(val);
}
%PrepareFunctionForOptimization(indexOf);
assertEquals(0, indexOf(iarr, 0));
assertEquals(2, indexOf(iarr, 2));
......@@ -55,6 +57,7 @@
return arr.indexOf(val);
}
%PrepareFunctionForOptimization(indexOf);
iarr.__proto__ = [2];
assertEquals(-1, indexOf(iarr, 0));
assertEquals(0, indexOf(iarr, 2));
......@@ -73,6 +76,7 @@
return arr.indexOf(val);
}
%PrepareFunctionForOptimization(indexOf);
assertEquals(-1, indexOf(iarr, 2));
assertEquals(1, indexOf(iarr, 3));
......@@ -93,6 +97,7 @@
return array.indexOf(val);
}
%PrepareFunctionForOptimization(indexOf);
indexOf(6); indexOf(6);
%OptimizeFunctionOnNextCall(indexOf);
......
......@@ -15,6 +15,7 @@
return array.lastIndexOf(val);
}
%PrepareFunctionForOptimization(lastIndexOf);
lastIndexOf(6); lastIndexOf(6);
%OptimizeFunctionOnNextCall(lastIndexOf);
......
......@@ -15,6 +15,7 @@
return array.map(x => x + 1);
}
%PrepareFunctionForOptimization(map);
map(); map();
%OptimizeFunctionOnNextCall(map);
......
......@@ -15,6 +15,8 @@
return array.pop();
}
%PrepareFunctionForOptimization(pop);
assertEquals(pop(), undefined);
assertEquals(pop(), undefined);
......
......@@ -16,6 +16,7 @@
array.reduce(accumulate);
}
%PrepareFunctionForOptimization(reduce);
reduce(); reduce();
%OptimizeFunctionOnNextCall(reduce);
......
......@@ -15,6 +15,7 @@
return array.slice();
}
%PrepareFunctionForOptimization(slice);
slice(); slice();
%OptimizeFunctionOnNextCall(slice);
......
......@@ -15,6 +15,7 @@
return array.some(v => v > 0);
}
%PrepareFunctionForOptimization(some);
some(); some();
%OptimizeFunctionOnNextCall(some);
......
......@@ -15,6 +15,8 @@ function foo(a, b) {
return passed;
}
%PrepareFunctionForOptimization(foo);
assertTrue(foo(3, 4));
assertTrue(foo(3, 4));
assertFalse(foo(3.1, 4));
......
......@@ -20,6 +20,8 @@ function foo(expected, x) {
return passed;
}
%PrepareFunctionForOptimization(foo);
assertTrue(foo([0,1], [0,1]));
assertTrue(foo([0,2], [0,2]));
assertFalse(foo([0,2.25], [0,2.75]));
......
......@@ -12,6 +12,7 @@
}
return g();
}
%PrepareFunctionForOptimization(f);
assertEquals(24, f(23));
assertEquals(43, f(42));
%OptimizeFunctionOnNextCall(f);
......@@ -26,6 +27,7 @@
}
return g();
}
%PrepareFunctionForOptimization(f);
assertEquals(24, f(23));
assertEquals(43, f(42));
%OptimizeFunctionOnNextCall(f);
......@@ -40,6 +42,7 @@
}
return new g();
}
%PrepareFunctionForOptimization(f);
assertEquals({ val: 24 }, f(23));
assertEquals({ val: 43 }, f(42));
%OptimizeFunctionOnNextCall(f);
......
......@@ -43,5 +43,6 @@ function f() {
return eval("200");
}
%PrepareFunctionForOptimization(f);
%OptimizeFunctionOnNextCall(f);
assertEquals(100, f());
......@@ -19,9 +19,12 @@ function h(o) {
return o.x;
}
%PrepareFunctionForOptimization(g);
g({x : 1});
g({x : 2});
%OptimizeFunctionOnNextCall(g);
%OptimizeFunctionOnNextCall(h);
g({x : 3});
%PrepareFunctionForOptimization(h);
%OptimizeFunctionOnNextCall(h);
g({x : 4});
g({y : 1, x : 3});
......@@ -22,6 +22,7 @@ function g(b) {
} // It should trigger an eager deoptimization when b=true.
}
%PrepareFunctionForOptimization(f);
f(false); f(false);
%OptimizeFunctionOnNextCall(f);
f(false);
......
......@@ -12,6 +12,7 @@ function useObject(obj) {
return obj.f;
}
%PrepareFunctionForOptimization(useObject);
var o = {f: 1, g: 2}
assertEquals(useObject(o), 2);
assertEquals(useObject(o), 4);
......
......@@ -17,6 +17,7 @@ function deopt() {
}
%NeverOptimizeFunction(deopt);
%PrepareFunctionForOptimization(opt_me);
opt_me();
opt_me();
%OptimizeFunctionOnNextCall(opt_me);
......
......@@ -44,6 +44,7 @@ Array.prototype.f = function() {
return g([].f.call({}), deopt + 1, called);
}
%PrepareFunctionForOptimization(f);
called = f(0, called);
called = f(0, called);
%OptimizeFunctionOnNextCall(f);
......@@ -65,6 +66,7 @@ Array.prototype.f = function() {
return [].pop.call(a1) + b.value;
}
%PrepareFunctionForOptimization(f);
assertEquals(7, f(obj));
assertEquals(6, f(obj));
%OptimizeFunctionOnNextCall(f);
......@@ -84,6 +86,7 @@ Array.prototype.f = function() {
return [].shift.call(a2) + b.value;
}
%PrepareFunctionForOptimization(f);
assertEquals(4, f(obj));
assertEquals(5, f(obj));
%OptimizeFunctionOnNextCall(f);
......@@ -102,6 +105,7 @@ Array.prototype.f = function() {
return [].push.call(a3, b.value);
}
%PrepareFunctionForOptimization(f);
assertEquals(5, f(obj));
assertEquals(6, f(obj));
%OptimizeFunctionOnNextCall(f);
......@@ -121,6 +125,7 @@ Array.prototype.f = function() {
return [].indexOf.call(a4, b.value);
}
%PrepareFunctionForOptimization(f);
f(obj);
f(obj);
%OptimizeFunctionOnNextCall(f);
......@@ -141,6 +146,7 @@ Array.prototype.f = function() {
return [].lastIndexOf.call(a5, b.value);
}
%PrepareFunctionForOptimization(f);
f(obj);
f(obj);
%OptimizeFunctionOnNextCall(f);
......
......@@ -21,6 +21,7 @@ function setAndUseObject() {
return obj.f;
}
%PrepareFunctionForOptimization(setAndUseObject);
assertEquals(setAndUseObject(), 2);
assertEquals(setAndUseObject(), 4);
%OptimizeFunctionOnNextCall(setAndUseObject);
......
......@@ -17,6 +17,7 @@ function f() {
return o.x;
}
%PrepareFunctionForOptimization(f);
f(); f();
%OptimizeFunctionOnNextCall(f);
b = true;
......
......@@ -19,6 +19,7 @@ function foo(a) {
}
var o = 1;
%PrepareFunctionForOptimization(foo);
assertEquals(foo(o), 2);
assertEquals(foo(o), 2);
%OptimizeFunctionOnNextCall(foo);
......
......@@ -23,11 +23,19 @@ function b() {
%DeoptimizeFunction(a);
}
%PrepareFunctionForOptimization(f);
f(); f();
%OptimizeFunctionOnNextCall(f);
f();
%PrepareFunctionForOptimization(a);
a(); a();
%OptimizeFunctionOnNextCall(a);
a();
for(var i = 0; i < 5; i++) {
%PrepareFunctionForOptimization(f);
%OptimizeFunctionOnNextCall(f);
%OptimizeFunctionOnNextCall(a);
f();
%PrepareFunctionForOptimization(a);
%OptimizeFunctionOnNextCall(a);
a();
}
......@@ -36,6 +36,7 @@ function f(a) {
// accumulator holding an unboxed double which needs materialized.
global = Math.sqrt(a);
}
%PrepareFunctionForOptimization(f);
%OptimizeFunctionOnNextCall(f);
f(0.25);
assertEquals(0.5, global);
......@@ -8,5 +8,6 @@ function f() {
%DeoptimizeNow();
}
%PrepareFunctionForOptimization(f);
%OptimizeFunctionOnNextCall(f);
f();
......@@ -7,6 +7,7 @@
(function() {
function foo(x, y) { return x << y; }
%PrepareFunctionForOptimization(foo);
foo(1.1, 0.1);
foo(0.1, 1.1);
foo(true, false);
......@@ -32,6 +33,7 @@
(function() {
function foo(x, y) { return x >> y; }
%PrepareFunctionForOptimization(foo);
foo(1.1, 0.1);
foo(0.1, 1.1);
foo(true, false);
......@@ -57,6 +59,7 @@
(function() {
function foo(x, y) { return x >>> y; }
%PrepareFunctionForOptimization(foo);
foo(1.1, 0.1);
foo(0.1, 1.1);
foo(true, false);
......@@ -82,6 +85,7 @@
(function() {
function foo(x, y) { return x ^ y; }
%PrepareFunctionForOptimization(foo);
foo(1.1, 0.1);
foo(0.1, 1.1);
foo(true, false);
......@@ -107,6 +111,7 @@
(function() {
function foo(x, y) { return x | y; }
%PrepareFunctionForOptimization(foo);
foo(1.1, 0.1);
foo(0.1, 1.1);
foo(true, false);
......@@ -132,6 +137,7 @@
(function() {
function foo(x, y) { return x & y; }
%PrepareFunctionForOptimization(foo);
foo(1.1, 0.1);
foo(0.1, 1.1);
foo(true, false);
......
......@@ -10,6 +10,7 @@ function f(o) {
return o.x;
}
%PrepareFunctionForOptimization(f);
assertEquals(f({x : 2}), 2);
assertEquals(f({x : 2}), 2);
%OptimizeFunctionOnNextCall(f);
......
......@@ -14,6 +14,7 @@ function g() {
%DeoptimizeFunction(f);
}
%PrepareFunctionForOptimization(f);
f(); f();
%OptimizeFunctionOnNextCall(f);
f();
......@@ -22,6 +22,7 @@ function f() {
}
}
%PrepareFunctionForOptimization(f);
assertEquals(f(), 43);
assertEquals(f(), 43);
%OptimizeFunctionOnNextCall(f);
......
......@@ -17,5 +17,6 @@ function f() {
return o.x;
}
%PrepareFunctionForOptimization(f);
%OptimizeFunctionOnNextCall(f);
f();
......@@ -9,10 +9,12 @@ var s = "12345";
(function() {
function foo() { return s[5]; }
%PrepareFunctionForOptimization(foo);
foo();
foo();
%OptimizeFunctionOnNextCall(foo);
foo();
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
foo();
assertOptimized(foo);
......@@ -21,10 +23,12 @@ var s = "12345";
(function() {
function foo(i) { return s[i]; }
%PrepareFunctionForOptimization(foo);
foo(0);
foo(1);
%OptimizeFunctionOnNextCall(foo);
foo(5);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
foo(5);
assertOptimized(foo);
......@@ -33,10 +37,12 @@ var s = "12345";
(function() {
function foo(s) { return s[5]; }
%PrepareFunctionForOptimization(foo);
foo(s);
foo(s);
%OptimizeFunctionOnNextCall(foo);
foo(s);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
foo(s);
assertOptimized(foo);
......@@ -45,10 +51,12 @@ var s = "12345";
(function() {
function foo(s, i) { return s[i]; }
%PrepareFunctionForOptimization(foo);
foo(s, 0);
foo(s, 1);
%OptimizeFunctionOnNextCall(foo);
foo(s, 5);
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
foo(s, 5);
assertOptimized(foo);
......
......@@ -25,6 +25,7 @@ var o = { toString : function() {
return "1";
} };
%PrepareFunctionForOptimization(f);
counter = 0;
assertEquals(1, f(deopt, o));
assertEquals(2, counter);
......@@ -34,6 +35,7 @@ counter = 0;
assertEquals(-1, f(o, deopt));
assertEquals(2, counter);
%PrepareFunctionForOptimization(f);
%OptimizeFunctionOnNextCall(f);
counter = 0;
assertEquals(0, f(deopt, deopt));
......
......@@ -29,14 +29,16 @@ function deopt(f) {
};
}
%PrepareFunctionForOptimization(f);
assertEquals(false, f(deopt(f)));
assertEquals(1, counter);
assertEquals(true, g(deopt(g)));
assertEquals(2, counter);
%OptimizeFunctionOnNextCall(f);
assertEquals(false, f(deopt(f)));
assertEquals(2, counter);
%PrepareFunctionForOptimization(g);
assertEquals(true, g(deopt(g)));
assertEquals(3, counter);
%OptimizeFunctionOnNextCall(g);
......
......@@ -25,6 +25,7 @@ var o = { toString : function() {
return "1";
} };
%PrepareFunctionForOptimization(f);
counter = 0;
assertEquals(4, f(deopt, o));
assertEquals(2, counter);
......@@ -34,6 +35,7 @@ counter = 0;
assertEquals(4, f(o, deopt));
assertEquals(2, counter);
%PrepareFunctionForOptimization(f);
%OptimizeFunctionOnNextCall(f);
counter = 0;
assertEquals(8, f(deopt, deopt));
......
......@@ -17,6 +17,7 @@ function h() {
%DeoptimizeFunction(f);
}
%PrepareFunctionForOptimization(f);
f(); f();
%OptimizeFunctionOnNextCall(f);
f();
......@@ -13,6 +13,7 @@ function g() {
%DeoptimizeFunction(f);
}
%PrepareFunctionForOptimization(f);
f(); f();
%OptimizeFunctionOnNextCall(f);
f();
......@@ -38,10 +38,14 @@ function f() {
}
shouldDeopt = false;
%PrepareFunctionForOptimization(dummy_opt);
f();
f();
%OptimizeFunctionOnNextCall(f);
%OptimizeFunctionOnNextCall(dummy_opt);
f();
%PrepareFunctionForOptimization(f);
f();
%OptimizeFunctionOnNextCall(f);
shouldDeopt = true;
assertEquals(2, f());
......@@ -107,6 +107,7 @@ function TestDivisionLike(ref, construct, values, divisor) {
var OptFun = new Function("dividend", construct(divisor));
// Warm up type feedback.
%PrepareFunctionForOptimization(OptFun);
OptFun(7);
OptFun(11);
%OptimizeFunctionOnNextCall(OptFun);
......
......@@ -6,5 +6,6 @@
function bar(a) { a[0](true); }
function foo(a) { return bar(1); }
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
assertThrows(function() {bar([foo])}, TypeError);
......@@ -11,6 +11,7 @@ function foo(a) {
b = a[i];
}
}
%PrepareFunctionForOptimization(foo);
foo(a);
foo(a);
%OptimizeFunctionOnNextCall(foo);
......
......@@ -12,6 +12,7 @@ function f() {
return g(1, (%_DeoptimizeNow(), 2), 3);
}
%PrepareFunctionForOptimization(f);
f();
f();
%OptimizeFunctionOnNextCall(f);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment