Commit ef97aa7c authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

Revert "[Test] Update tests to work with lazy feedback allocation."

This reverts commit 289b2576.

Reason for revert: Fails gc-stress: https://ci.chromium.org/p/v8/builders/ci/V8%20Mac64%20GC%20Stress/7143

Original change's description:
> [Test] Update tests to work with lazy feedback allocation.
> 
> This adds either %EnsureFeedbackVectorForFunction or
> %PrepareFunctionForOptimization to allocate feedback vectors when testing
> optimization, allocation sites, IC transitions etc.,
> 
> Bug: v8:8394
> Change-Id: I6ad1b6d460e4abda693b326cddb87754e080a0a1
> Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1593303
> Commit-Queue: Mythri Alle <mythria@chromium.org>
> Auto-Submit: Mythri Alle <mythria@chromium.org>
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#61212}

TBR=rmcilroy@chromium.org,mythria@chromium.org

Change-Id: I2a78bfd3ee6102c1d2062957970f425308050d3d
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: v8:8394
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1594565Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61213}
parent 289b2576
......@@ -784,9 +784,7 @@ TEST(InvocationCount) {
CompileRun(
"function bar() {};"
"%EnsureFeedbackVectorForFunction(bar);"
"function foo() { return bar(); };"
"%EnsureFeedbackVectorForFunction(foo);"
"foo();");
Handle<JSFunction> foo = Handle<JSFunction>::cast(GetGlobalProperty("foo"));
CHECK_EQ(1, foo->feedback_vector()->invocation_count());
......
......@@ -37,7 +37,6 @@ function ChangeSmiConstantAndOsr() {
}
return j;
}
%PrepareFunctionForOptimization(ChangeSmiConstantAndOsr);
var r1 = ChangeSmiConstantAndOsr();
if (changed) {
assertEquals("result", r1);
......@@ -55,7 +54,6 @@ function ChangeFloatConstantAndOsr() {
}
return j;
}
%PrepareFunctionForOptimization(ChangeFloatConstantAndOsr);
var r2 = ChangeFloatConstantAndOsr();
if (changed) {
assertEquals("result", r2);
......@@ -74,7 +72,6 @@ function ChangeFloatVarAndOsr() {
}
return j;
}
%PrepareFunctionForOptimization(ChangeFloatVarAndOsr);
var r3 = ChangeFloatVarAndOsr();
if (changed) {
assertEquals("result0.1", r3);
......@@ -108,7 +105,6 @@ function ChangeIntVarAndOsr() {
}
return j;
}
%PrepareFunctionForOptimization(ChangeIntVarAndOsr);
var r4 = ChangeIntVarAndOsr();
if (changed) {
......
......@@ -7,13 +7,9 @@ var Debug = debug.Debug;
Debug.setListener(() => undefined);
function f() {
const myObj = {};
const myObj = {};
for (let i = 0; i < 10; i++) {
%OptimizeOsr();
%ScheduleBreak();
}
for (let i = 0; i < 10; i++) {
%OptimizeOsr();
%ScheduleBreak();
}
%PrepareFunctionForOptimization(f);
f()
......@@ -9,7 +9,6 @@ Debug.setListener(function() {});
function f() {
for (var i = 0; i < 100; i++) %OptimizeOsr();
}
%PrepareFunctionForOptimization(f);
Debug.setBreakPoint(f, 0, 0);
f();
......
......@@ -23,7 +23,6 @@ function wrapper1() {
}
f1();
}
%PrepareFunctionForOptimization(wrapper1);
function f2() {
counter++;
......
......@@ -67,7 +67,6 @@ function assertKind(expected, obj, name_opt) {
function bar0(t) {
return new t();
}
%PrepareFunctionForOptimization(bar0);
a = bar0(Array);
a[0] = 3.5;
b = bar0(Array);
......@@ -78,8 +77,7 @@ function assertKind(expected, obj, name_opt) {
assertOptimized(bar0);
// bar0 should deopt
b = bar0(Object);
assertUnoptimized(bar0);
%PrepareFunctionForOptimization(bar0);
assertUnoptimized(bar0)
// When it's re-optimized, we should call through the full stub
bar0(Array);
%OptimizeFunctionOnNextCall(bar0);
......@@ -101,7 +99,6 @@ function assertKind(expected, obj, name_opt) {
function bar() {
return new Array();
}
%PrepareFunctionForOptimization(bar);
a = bar();
bar();
%OptimizeFunctionOnNextCall(bar);
......@@ -118,7 +115,6 @@ function assertKind(expected, obj, name_opt) {
// map for Array in that context will be used.
(function() {
function bar() { return new Array(); }
%PrepareFunctionForOptimization(bar);
bar();
bar();
%OptimizeFunctionOnNextCall(bar);
......@@ -138,7 +134,6 @@ function assertKind(expected, obj, name_opt) {
// should deal with arguments that create holey arrays.
(function() {
function bar(len) { return new Array(len); }
%PrepareFunctionForOptimization(bar);
bar(0);
bar(0);
%OptimizeFunctionOnNextCall(bar);
......@@ -158,7 +153,6 @@ function assertKind(expected, obj, name_opt) {
// Test: Make sure that crankshaft continues with feedback for large arrays.
(function() {
function bar(len) { return new Array(len); }
%PrepareFunctionForOptimization(bar);
var size = 100001;
// Perform a gc, because we are allocating a very large array and if a gc
// happens during the allocation we could lose our memento.
......
......@@ -79,7 +79,6 @@ function array_literal_test() {
assertEquals(2, f0[1]);
assertEquals(1, f0[0]);
}
%PrepareFunctionForOptimization(array_literal_test);
%PrepareFunctionForOptimization(array_literal_test);
for (var i = 0; i < 3; i++) {
......@@ -110,7 +109,6 @@ function test_large_literal() {
[0, 1, 2, 3, 4, 5, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5,
new Object(), new Object(), new Object(), new Object()]);
}
%PrepareFunctionForOptimization(test_large_literal);
%PrepareFunctionForOptimization(test_large_literal);
for (var i = 0; i < 3; i++) {
......@@ -126,7 +124,6 @@ function deopt_array(use_literal) {
return new Array();
}
}
%PrepareFunctionForOptimization(deopt_array);
%PrepareFunctionForOptimization(deopt_array);
deopt_array(false);
......@@ -145,7 +142,6 @@ assertOptimized(deopt_array);
function deopt_array_literal_all_smis(a) {
return [0, 1, a];
}
%PrepareFunctionForOptimization(deopt_array_literal_all_smis);
%PrepareFunctionForOptimization(deopt_array_literal_all_smis);
deopt_array_literal_all_smis(2);
......@@ -172,7 +168,6 @@ assertEquals(.5, array[2]);
function deopt_array_literal_all_doubles(a) {
return [0.5, 1, a];
}
%PrepareFunctionForOptimization(deopt_array_literal_all_doubles);
%PrepareFunctionForOptimization(deopt_array_literal_all_doubles);
deopt_array_literal_all_doubles(.5);
......
......@@ -17,7 +17,6 @@ function makeArray() {
return a;
}
%PrepareFunctionForOptimization(doShift);
doShift(makeArray());
doShift(makeArray());
%OptimizeFunctionOnNextCall(doShift);
......
......@@ -197,7 +197,6 @@ assertEquals(0.5, array_store_1([], 0, 0.5));
a[b] = c;
}
%PrepareFunctionForOptimization(grow_store);
a = new Array(1);
grow_store(a,1,1);
grow_store(a,2,1);
......@@ -217,7 +216,6 @@ assertEquals(0.5, array_store_1([], 0, 0.5));
function f(o, k, v) {
o[k] = v;
}
%PrepareFunctionForOptimization(f);
a = [3.5];
f(a, 1, "hi"); // DOUBLE packed array -> tagged packed grow
......@@ -240,7 +238,6 @@ assertEquals(0.5, array_store_1([], 0, 0.5));
function f(o, k, v) {
o[k] = v;
}
%PrepareFunctionForOptimization(f);
a = [3.5];
f(a, 0, "hi"); // DOUBLE packed array -> tagged packed grow
......
......@@ -21,7 +21,6 @@
}
%PrepareFunctionForOptimization(slice0);
%PrepareFunctionForOptimization(slice);
assertEquals(arr, slice());
assertFalse(arr === slice());
......@@ -30,6 +29,7 @@
%OptimizeFunctionOnNextCall(slice0);
assertEquals(slice(), slice0());
%PrepareFunctionForOptimization(slice);
%OptimizeFunctionOnNextCall(slice);
assertEquals(slice(), slice0());
......@@ -415,7 +415,6 @@
function test() {
%PrepareFunctionForOptimization(slice0);
%PrepareFunctionForOptimization(slice);
assertEquals(arr, slice());
assertFalse(arr === slice());
......@@ -424,6 +423,7 @@
%OptimizeFunctionOnNextCall(slice0);
assertEquals(slice(), slice0());
%PrepareFunctionForOptimization(slice);
%OptimizeFunctionOnNextCall(slice);
assertEquals(slice(), slice0());
......@@ -455,13 +455,13 @@
}
function test() {
%PrepareFunctionForOptimization(slice0);
%PrepareFunctionForOptimization(slice);
assertEquals(arr, slice());
assertFalse(arr === slice());
assertEquals(slice(), slice0());
assertEquals(slice0(), slice());
%PrepareFunctionForOptimization(slice0);
%PrepareFunctionForOptimization(slice);
%OptimizeFunctionOnNextCall(slice0);
assertEquals(slice(), slice0());
%OptimizeFunctionOnNextCall(slice);
......
......@@ -38,7 +38,6 @@ function f() {
arr[500] = 20;
arr[10] = arr[50];
}
%EnsureFeedbackVectorForFunction(f);
function g() {
f();
......
......@@ -32,7 +32,6 @@
(function() {
// Produce a SpeculativeNumberEqual with Number feedback.
function bar(x, y) { return x === y; }
%EnsureFeedbackVectorForFunction(bar);
bar(0.1, 0.5);
bar(-0, 100);
......@@ -84,7 +83,6 @@
(function() {
// Produce a SpeculativeNumberLessThan with Number feedback.
function bar(x, y) { return x < y; }
%EnsureFeedbackVectorForFunction(bar);
bar(0.1, 0.5);
bar(-0, 100);
......@@ -136,7 +134,6 @@
(function() {
// Produce a SpeculativeNumberLessThanOrEqual with Number feedback.
function bar(x, y) { return x <= y; }
%EnsureFeedbackVectorForFunction(bar);
bar(0.1, 0.5);
bar(-0, 100);
......
......@@ -269,7 +269,6 @@ function osr_inner(t, limit) {
}
return r;
}
%PrepareFunctionForOptimization(osr_inner);
function osr_outer(t, osr_after) {
var r = 1;
......@@ -282,7 +281,6 @@ function osr_outer(t, osr_after) {
}
return r;
}
%PrepareFunctionForOptimization(osr_outer);
function osr_outer_and_deopt(t, osr_after) {
var r = 1;
......@@ -292,7 +290,6 @@ function osr_outer_and_deopt(t, osr_after) {
}
return r;
}
%PrepareFunctionForOptimization(osr_outer_and_deopt);
function test_osr() {
with ({}) {} // Disable optimizations of this function.
......
......@@ -38,7 +38,6 @@ function f1() {
}
return sum;
}
%PrepareFunctionForOptimization(f1);
function f2() {
var sum = 0;
......@@ -51,7 +50,6 @@ function f2() {
}
return sum;
}
%PrepareFunctionForOptimization(f2);
function f3() {
var sum = 0;
......@@ -64,7 +62,6 @@ function f3() {
}
return sum;
}
%PrepareFunctionForOptimization(f3);
function test1() {
var j = 11;
......
......@@ -14,7 +14,6 @@ function fastaRandom(n, table) {
n--;
}
}
%PrepareFunctionForOptimization(fastaRandom);
print("---BEGIN 1");
assertEquals(undefined, fastaRandom(6, null));
......
......@@ -41,5 +41,4 @@ function f(x, b, c) {
return a + 4;
}
%PrepareFunctionForOptimization(f);
assertEquals(55, f(5, "122", "1221"));
......@@ -24,7 +24,6 @@ function foo() {
result.push(out);
return result;
}
%PrepareFunctionForOptimization(foo);
function check() {
......
......@@ -28,7 +28,6 @@ function test(expected, func, depth) {
for (var depth = 1; depth < 4; depth++) {
var body = nest(orig, name, depth);
func = eval("(" + body + ")");
%PrepareFunctionForOptimization(func);
assertEquals(expected, func());
assertEquals(expected, func());
......@@ -48,7 +47,6 @@ function foo() {
}
return result;
}
%PrepareFunctionForOptimization(foo);
test(45, foo);
......@@ -60,7 +58,6 @@ function bar() {
}
return sum;
}
%PrepareFunctionForOptimization(bar);
test(45, bar);
......@@ -74,7 +71,6 @@ function bon() {
return sum;
}
}
%PrepareFunctionForOptimization(bon);
test(45, bon);
......@@ -91,7 +87,6 @@ function row() {
}
return 11;
}
%PrepareFunctionForOptimization(row);
test(7, row);
......@@ -103,7 +98,6 @@ function nub() {
}
return i;
}
%PrepareFunctionForOptimization(nub);
test(2, nub);
......@@ -118,6 +112,5 @@ function kub() {
}
return result;
}
%PrepareFunctionForOptimization(kub);
test(1, kub);
......@@ -24,7 +24,6 @@ function bar() {
}
return result;
}
%PrepareFunctionForOptimization(bar);
test(4005, bar);
......@@ -36,7 +35,6 @@ function baz() {
}
return sum;
}
%PrepareFunctionForOptimization(baz);
test(2, baz);
......@@ -48,7 +46,6 @@ function qux() {
}
return result;
}
%PrepareFunctionForOptimization(qux);
test(1, qux);
......@@ -63,7 +60,6 @@ function nux() {
}
return result;
}
%PrepareFunctionForOptimization(nux);
test(1, nux);
......@@ -82,6 +78,5 @@ function blo() {
}
return result;
}
%PrepareFunctionForOptimization(blo);
test(4005, blo());
......@@ -18,7 +18,6 @@ function foo(t) {
}
return 5;
}
%PrepareFunctionForOptimization(foo);
test(5, foo, {x:20});
......@@ -32,6 +31,5 @@ function bar(t) {
}
return sum;
}
%PrepareFunctionForOptimization(bar);
test(62, bar, {x:20,y:11});
......@@ -11,7 +11,6 @@ function thrower() {
if (x == 5) %OptimizeOsr(1);
if (x == 10) throw "terminate";
}
%PrepareFunctionForOptimization(thrower);
%NeverOptimizeFunction(thrower); // Don't want to inline the thrower.
%NeverOptimizeFunction(test); // Don't want to inline the func into test.
......@@ -26,22 +25,18 @@ function test(func) {
function n1() {
while (true) thrower();
}
%PrepareFunctionForOptimization(n1);
function n2() {
while (true) while (true) thrower();
}
%PrepareFunctionForOptimization(n2);
function n3() {
while (true) while (true) while (true) thrower();
}
%PrepareFunctionForOptimization(n3);
function n4() {
while (true) while (true) while (true) while (true) thrower();
}
%PrepareFunctionForOptimization(n4);
function b1(a) {
while (true) {
......@@ -49,7 +44,6 @@ function b1(a) {
if (a) break
}
}
%PrepareFunctionForOptimization(b1);
function b2(a) {
......@@ -60,7 +54,6 @@ function b2(a) {
}
}
}
%PrepareFunctionForOptimization(b2);
function b3(a) {
......@@ -74,7 +67,6 @@ function b3(a) {
}
}
}
%PrepareFunctionForOptimization(b3);
test(n1);
......
......@@ -17,7 +17,6 @@ function foo() {
}
return sum;
}
%PrepareFunctionForOptimization(foo);
assertEquals(30, foo());
assertEquals(30, foo());
......@@ -37,7 +36,6 @@ function bar(a) {
}
return sum;
}
%PrepareFunctionForOptimization(bar);
assertEquals(1, bar(1));
assertEquals(1, bar(1));
......
......@@ -11,7 +11,6 @@ function mod() {
}
return {blah: i};
}
%PrepareFunctionForOptimization(f0);
function f1(a) {
for (var i = 0; i < 3; i = i + 1 | 0) {
......@@ -19,7 +18,6 @@ function mod() {
}
return {blah: i};
}
%PrepareFunctionForOptimization(f1);
function f2(a,b) {
for (var i = 0; i < 3; i = i + 1 | 0) {
......@@ -27,7 +25,6 @@ function mod() {
}
return {blah: i};
}
%PrepareFunctionForOptimization(f2);
function f3(a,b,c) {
for (var i = 0; i < 3; i = i + 1 | 0) {
......@@ -35,7 +32,6 @@ function mod() {
}
return {blah: i};
}
%PrepareFunctionForOptimization(f3);
function f4(a,b,c,d) {
for (var i = 0; i < 3; i = i + 1 | 0) {
......@@ -43,7 +39,6 @@ function mod() {
}
return {blah: i};
}
%PrepareFunctionForOptimization(f4);
function bar() {
assertEquals(3, f0().blah);
......
......@@ -11,7 +11,6 @@ function mod() {
}
return {blah: i};
}
%PrepareFunctionForOptimization(f0);
function f1(a) {
for (var i = 0; i < 3; i = i + 1 | 0) {
......@@ -19,7 +18,6 @@ function mod() {
}
return {blah: i};
}
%PrepareFunctionForOptimization(f1);
function f2(a,b) {
for (var i = 0; i < 3; i = i + 1 | 0) {
......@@ -27,7 +25,6 @@ function mod() {
}
return {blah: i};
}
%PrepareFunctionForOptimization(f2);
function f3(a,b,c) {
for (var i = 0; i < 3; i = i + 1 | 0) {
......@@ -35,7 +32,6 @@ function mod() {
}
return {blah: i};
}
%PrepareFunctionForOptimization(f3);
function f4(a,b,c,d) {
for (var i = 0; i < 3; i = i + 1 | 0) {
......@@ -43,7 +39,6 @@ function mod() {
}
return {blah: i};
}
%PrepareFunctionForOptimization(f4);
function bar() {
assertEquals(3, f0().blah);
......
......@@ -22,12 +22,10 @@ function gen(w) { // defeat compiler cache.
"} f" + num;
return eval(src);
}
%PrepareFunctionForOptimization(gen);
function check(x,a,b,c) {
for (var i = 0; i < 3; i++) {
var f = gen(i);
%PrepareFunctionForOptimization(f);
assertEquals(x, f(a, b, c));
}
}
......
......@@ -26,7 +26,6 @@ function gen(w) { // defeat compiler cache.
function check(x,a,b,c) {
for (var i = 0; i < 3; i++) {
var f = gen(i);
%PrepareFunctionForOptimization(f);
assertEquals(x, f(a, b, c));
}
}
......
......@@ -44,7 +44,6 @@ function bar(goal) {
}
return sum;
}
%PrepareFunctionForOptimization(bar);
for (var i = 0; i < 13; i++) {
%DeoptimizeFunction(bar);
......
......@@ -59,6 +59,5 @@ function gen(i) {
for (var i = 1; i < 10; i++) {
var f = gen(i);
%PrepareFunctionForOptimization(f);
assertEquals(1979, f());
}
......@@ -40,7 +40,6 @@ function f() {
}
return sum;
}
%PrepareFunctionForOptimization(f);
assertEquals(1450, f());
......
......@@ -19,7 +19,7 @@ function f() {
return sum;
}
%PrepareFunctionForOptimization(f);
assertEquals(15000, f());
assertEquals(15000, f());
assertEquals(15000, f());
......@@ -16,6 +16,5 @@ function f(x) {
}
return sum;
}
%PrepareFunctionForOptimization(f);
assertEquals(50, f(5));
......@@ -13,7 +13,6 @@ function foo(a) {
}
return r;
}
%PrepareFunctionForOptimization(foo);
function bar(a) {
for (var i = 0; i < 10; i++) {
......@@ -22,7 +21,6 @@ function bar(a) {
}
return r;
}
%PrepareFunctionForOptimization(bar);
function baz(a) {
for (var i = 0; i < 10; i++) {
......@@ -30,7 +28,6 @@ function baz(a) {
}
return /\0/;
}
%PrepareFunctionForOptimization(baz);
function qux(a) {
for (var i = 0; i < 10; i++) {
......@@ -42,7 +39,6 @@ function qux(a) {
}
return r;
}
%PrepareFunctionForOptimization(qux);
function test(f) {
// Test the reference equality of regex's created in OSR'd function.
......
......@@ -15,7 +15,6 @@ function f() {
}
return sum;
}
%PrepareFunctionForOptimization(f);
for (var i = 0; i < 2; i++) {
......
......@@ -19,7 +19,6 @@ function SingleLoop() {
}
}
}
%PrepareFunctionForOptimization(SingleLoop);
// These function could also fail if the exception handlers are not updated at
......@@ -39,7 +38,6 @@ function EmptyBody() {
a++;
}
}
%PrepareFunctionForOptimization(EmptyBody);
function NestedLoops() {
for (var a = 0; a < 2; a++) {
......@@ -54,7 +52,6 @@ function NestedLoops() {
}
}
}
%PrepareFunctionForOptimization(NestedLoops);
SingleLoop();
......
......@@ -20,6 +20,5 @@ function f(x) {
}
return sum;
}
%PrepareFunctionForOptimization(f);
assertEquals(500, f(5));
......@@ -35,7 +35,6 @@ function foo() {
}
return result;
}
%PrepareFunctionForOptimization(foo);
test(1, foo);
......@@ -55,6 +54,5 @@ function smo() {
}
return result;
}
%PrepareFunctionForOptimization(smo);
test(11, smo);
......@@ -18,7 +18,6 @@
}
}
%PrepareFunctionForOptimization(g);
g();
})();
......@@ -34,6 +33,5 @@
}
}
%PrepareFunctionForOptimization(g);
g();
})();
......@@ -16,5 +16,4 @@ function f() {
return sum;
}
%PrepareFunctionForOptimization(f);
f();
......@@ -13,5 +13,4 @@ function f() {
return x;
}
%PrepareFunctionForOptimization(f);
assertEquals(0, f());
......@@ -6,14 +6,12 @@
(function() {
"use asm";
var f = function() {
return function() {
for (var i = 0; i < 10; i++) {
if (i == 5) {
%OptimizeOsr();
}
}
with (Object());
};
%PrepareFunctionForOptimization(f);
return f;
}
})()();
......@@ -12,5 +12,4 @@ function f() {
}
}
%PrepareFunctionForOptimization(f);
f();
......@@ -13,5 +13,4 @@ function foo() {
}
}
%PrepareFunctionForOptimization(foo);
foo();
......@@ -12,5 +12,4 @@ function f(get, ...a) {
}
return get();
}
%PrepareFunctionForOptimization(f);
assertThrows(f);
......@@ -11,7 +11,6 @@ function foo(o) {
}
}
%PrepareFunctionForOptimization(foo);
foo([1]);
foo([1]);
%OptimizeFunctionOnNextCall(foo);
......
......@@ -13,7 +13,6 @@ function OSRInsideTry(x) {
}
return x + 2;
}
%PrepareFunctionForOptimization(OSRInsideTry);
assertEquals(24, OSRInsideTry(23));
......@@ -26,7 +25,6 @@ function OSRInsideCatch(x) {
}
return x + 2;
}
%PrepareFunctionForOptimization(OSRInsideCatch);
assertEquals(24, OSRInsideCatch(23));
......@@ -39,7 +37,6 @@ function OSRInsideFinally_Return(x) {
}
return x + 2;
}
%PrepareFunctionForOptimization(OSRInsideFinally_Return);
assertEquals(24, OSRInsideFinally_Return(23));
......@@ -51,5 +48,4 @@ function OSRInsideFinally_ReThrow(x) {
}
return x + 2;
}
%PrepareFunctionForOptimization(OSRInsideFinally_ReThrow);
assertThrows("OSRInsideFinally_ReThrow(new Error)", Error);
......@@ -44,7 +44,6 @@ if (!%IsConcurrentRecompilationSupported()) {
function f1(a, i) {
return a[i] + 0.5;
}
%PrepareFunctionForOptimization(f1);
%PrepareFunctionForOptimization(f1);
var arr = [0.0,,2.5];
......
......@@ -99,7 +99,6 @@ function TestLoadFromConstantFieldOfAPrototype(the_value, other_value) {
// Ensure O.prototype is in fast mode by loading from its field.
function warmup() { return new O().v; }
%EnsureFeedbackVectorForFunction(warmup);
warmup(); warmup(); warmup();
assertTrue(%HasFastProperties(O.prototype));
......
......@@ -14,7 +14,6 @@ function foo(i, deopt = false) {
foo(i - 1, deopt);
}
}
%PrepareFunctionForOptimization(foo);
assertEquals(0, %GetDeoptCount(foo));
......
......@@ -14,7 +14,6 @@ function foo(i, deopt = false) {
foo(i - 1, deopt);
}
}
%PrepareFunctionForOptimization(foo);
%PrepareFunctionForOptimization(foo);
assertEquals(0, %GetDeoptCount(foo));
......
......@@ -18,7 +18,6 @@ function foo(i, deopt = false, deoptobj = null) {
assertEquals(0, %GetDeoptCount(foo));
%PrepareFunctionForOptimization(foo);
foo(10);
foo(10);
%OptimizeFunctionOnNextCall(foo);
......
......@@ -75,7 +75,6 @@ function test(a, b, c, d, e, v) {
assertEquals(24, d);
assertEquals(37.5, e);
}
%PrepareFunctionForOptimization(test);
test(10.0, 20.0, 30.0, 40.0, 50.0, 1.5);
......
......@@ -6,7 +6,6 @@
function f(x, y) { return x + y; }
%PrepareFunctionForOptimization(f);
assertEquals(1, f(0, 1));
assertEquals(5, f(2, 3));
%OptimizeFunctionOnNextCall(f);
......
......@@ -30,7 +30,7 @@
function div(g) {
return (g/-1) ^ 1
}
%PrepareFunctionForOptimization(div);
var kMinInt = 1 << 31;
var expected_MinInt = div(kMinInt);
var expected_minus_zero = div(0);
......@@ -42,7 +42,6 @@ function mul(g) {
return (g * -1) ^ 1
}
%PrepareFunctionForOptimization(mul);
expected_MinInt = mul(kMinInt);
expected_minus_zero = mul(0);
%OptimizeFunctionOnNextCall(mul);
......
......@@ -45,7 +45,6 @@ function test_wrapper() {
} while (--count > 0);
}
%PrepareFunctionForOptimization(testDoubleConversion4);
testDoubleConversion4(new Array(5));
testDoubleConversion4(new Array(5)); // Call twice to make sure that second
// store is a transition and not
......@@ -72,7 +71,6 @@ function test_wrapper() {
} while (--count > 0);
}
%PrepareFunctionForOptimization(testExactMapHoisting);
testExactMapHoisting(new Array(5));
testExactMapHoisting(new Array(5)); // Call twice to make sure that second
// store is a transition and not
......@@ -104,7 +102,6 @@ function test_wrapper() {
} while (--count > 0);
}
%PrepareFunctionForOptimization(testExactMapHoisting2);
testExactMapHoisting2(new Array(5));
testExactMapHoisting2(new Array(5)); // Call twice to make sure that second
// store is a transition and not
......@@ -132,7 +129,6 @@ function test_wrapper() {
} while (--count > 0);
}
%PrepareFunctionForOptimization(testExactMapHoisting3);
var add_transition = new Array(5);
add_transition.foo = 0;
add_transition[0] = new Object(); // For FAST_ELEMENT transition to be created
......@@ -159,7 +155,6 @@ function test_wrapper() {
}
/*
%PrepareFunctionForOptimization(testDominatingTransitionHoisting1);
testDominatingTransitionHoisting1(new Array(5));
testDominatingTransitionHoisting1(new Array(5)); // Call twice to make sure
// that second store is a
......@@ -185,7 +180,6 @@ function test_wrapper() {
} while (--count > 3);
}
%PrepareFunctionForOptimization(testHoistingWithSideEffect);
testHoistingWithSideEffect(new Array(5));
testHoistingWithSideEffect(new Array(5)); // Call twice to make sure that
// second store is a transition and
......@@ -209,7 +203,6 @@ function test_wrapper() {
} while (--count > 3);
}
%PrepareFunctionForOptimization(testStraightLineDupeElinination);
testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),0,0,0,0,.5);
testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),0,0,0,.5,0);
testStraightLineDupeElinination(new Array(0, 0, 0, 0, 0),0,0,.5,0,0);
......
......@@ -30,7 +30,6 @@
assertUnoptimized(foo);
assertTrue(%HasDictionaryElements(a));
%PrepareFunctionForOptimization(foo);
var b = [];
foo(b, 1);
foo(b, 2);
......
......@@ -15,7 +15,6 @@
function readA(x) {
return x.a;
}
%PrepareFunctionForOptimization(readA);
var a = new A();
assertUnoptimized(readA);
readA(a); readA(a); readA(a);
......@@ -27,7 +26,6 @@
b.b = o;
assertEquals(readA(b), o);
assertUnoptimized(readA);
%PrepareFunctionForOptimization(readA);
%OptimizeFunctionOnNextCall(readA);
assertEquals(readA(a), o);
assertOptimized(readA);
......@@ -39,7 +37,6 @@
return x.a;
}
assertUnoptimized(readAFromB);
%PrepareFunctionForOptimization(readAFromB);
readAFromB(b); readAFromB(b); readAFromB(b);
%OptimizeFunctionOnNextCall(readAFromB);
assertEquals(readAFromB(b), o);
......@@ -52,8 +49,6 @@
c.a = [1];
assertUnoptimized(readA);
assertUnoptimized(readAFromB);
%PrepareFunctionForOptimization(readA);
%PrepareFunctionForOptimization(readAFromB);
assertEquals(readA(a), o);
assertEquals(readA(b), o);
assertEquals(readA(c), [1]);
......@@ -82,9 +77,7 @@
A.prototype = {y: 20};
function B(o) { return o.a.y; }
function C() { this.a = new A(); }
%EnsureFeedbackVectorForFunction(C);
%PrepareFunctionForOptimization(B);
B(new C());
B(new C());
%OptimizeFunctionOnNextCall(B);
......@@ -95,7 +88,6 @@
assertEquals(10, B(c));
assertUnoptimized(B);
%PrepareFunctionForOptimization(B);
var c = new C();
%OptimizeFunctionOnNextCall(B);
assertEquals(20, B(c));
......@@ -124,7 +116,6 @@
var f2 = new Foo({x: 2});
var f3 = new Foo({x: 3});
function readX(f) { return f.x.x; }
%PrepareFunctionForOptimization(readX);
assertEquals(readX(f1), 1);
assertEquals(readX(f2), 2);
assertUnoptimized(readX);
......@@ -132,7 +123,6 @@
assertEquals(readX(f3), 3);
assertOptimized(readX);
function writeX(f, x) { f.x = x; }
%PrepareFunctionForOptimization(writeX);
writeX(f1, {x: 11});
writeX(f2, {x: 22});
assertUnoptimized(writeX);
......@@ -156,7 +146,6 @@
var f2 = new Narf(2);
var f3 = new Narf(3);
function baz(f, y) { f.y = y; }
%PrepareFunctionForOptimization(baz);
baz(f1, {b: 9});
baz(f2, {b: 9});
baz(f2, {b: 9});
......@@ -172,7 +161,6 @@
function readA(o) { return o.x.a; }
var f = new Foo({a:1});
var b = new Bar({a:2});
%PrepareFunctionForOptimization(readA);
assertEquals(readA(f), 1);
assertEquals(readA(b), 2);
assertEquals(readA(f), 1);
......
......@@ -9,5 +9,4 @@ function f() {
if (i == 5) %OptimizeOsr();
}
}
%EnsureFeedbackVectorForFunction(f);
f();
......@@ -11,7 +11,6 @@
}
return 23;
}
%PrepareFunctionForOptimization(gen1);
var g = gen1();
assertEquals({ value:23, done:true }, g.next());
})();
......@@ -24,7 +23,6 @@
}
return 23;
}
%PrepareFunctionForOptimization(gen2);
var g = gen2();
assertEquals({ value:0, done:false }, g.next());
assertEquals({ value:1, done:false }, g.next());
......@@ -40,7 +38,6 @@
}
return 23;
}
%PrepareFunctionForOptimization(gen3);
var g = gen3();
assertEquals({ value:0, done:false }, g.next());
assertEquals({ value:1, done:false }, g.next());
......@@ -60,7 +57,6 @@
}
return 23;
}
%PrepareFunctionForOptimization(gen4);
var g = gen4();
assertEquals({ value:0, done:false }, g.next());
assertEquals({ value:1, done:false }, g.next());
......
......@@ -10,10 +10,6 @@ function f(b) {
}
}
f(0);
assertThrows(() => {f(1)}, ReferenceError);
%PrepareFunctionForOptimization(f);
f(0);
f(0);
%OptimizeFunctionOnNextCall(f);
......
......@@ -15,13 +15,7 @@ class B extends A {
}
}
}
// No feedback case
test = new B(0);
assertThrows(() => {new B(1)}, ReferenceError);
// Ensure Feedback
%PrepareFunctionForOptimization(B);
%EnsureFeedbackVectorForFunction(A);
test = new B(0);
test = new B(0);
assertThrows(() => {new B(1)}, ReferenceError);
......
......@@ -15,10 +15,6 @@ class B extends A {
}
}
test = new B(1);
assertThrows(() => {new B(0)}, ReferenceError);
%PrepareFunctionForOptimization(B);
test = new B(1);
test = new B(1);
%OptimizeFunctionOnNextCall(B);
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --opt --interrupt-budget=100 --budget-for-feedback-vector-allocation=10 --allow-natives-syntax
// Flags: --opt --interrupt-budget=100 --allow-natives-syntax
function f() {
let s = 0;
......
......@@ -11,7 +11,6 @@
function foo(a, i) { return a[i]; }
%PrepareFunctionForOptimization(foo);
var a = ['one', , 'three'];
foo(a, 0);
foo(a, 0);
......
......@@ -36,7 +36,6 @@ function get(obj, key) {
return obj[key];
}
%PrepareFunctionForOptimization(get);
get(o, "foo");
get(o, "foo");
get(o, "foo");
......
......@@ -37,7 +37,6 @@ function get(obj, key) {
return obj[key];
}
%PrepareFunctionForOptimization(get);
assertEquals("bar", get(o, s));
get(o, s);
get(o, s);
......
......@@ -34,7 +34,6 @@ function test_div_no_deopt_minus_zero() {
assertTrue(0 === (Math.floor((zero_in_array[0] | 0) / -1) | 0));
}
%PrepareFunctionForOptimization(test_div_no_deopt_minus_zero);
test_div_no_deopt_minus_zero();
test_div_no_deopt_minus_zero();
%OptimizeFunctionOnNextCall(test_div_no_deopt_minus_zero);
......
......@@ -29,7 +29,6 @@
function o1() {
}
%PrepareFunctionForOptimization(o1);
o1(); o1();
%OptimizeFunctionOnNextCall(o1);
......@@ -46,8 +45,6 @@ function u1() {
function u2() {
u1();
}
%PrepareFunctionForOptimization(u1);
%PrepareFunctionForOptimization(u2);
u1(); u1();
u2(); u2();
......
......@@ -220,11 +220,9 @@ assertDoesNotThrow(function() { objControl.splice(0, 0, 100, 101, 102); });
// Verify that crankshaft still does the right thing.
obj = [1, 2, 3];
push_call = function(a) { a.push(1000); return a; };
%PrepareFunctionForOptimization(push_call);
push_call = function(a) { a.push(1000); return a; }
// Include a call site that doesn't have a custom built-in.
var shift_call = function(a) { a.shift(1000); return a; };
%PrepareFunctionForOptimization(shift_call);
var shift_call = function(a) { a.shift(1000); return a; }
for (var i = 0; i < 3; i++) {
push_call(obj);
shift_call(obj);
......
......@@ -20,8 +20,7 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
a.abc = 25;
}
return v;
};
%EnsureFeedbackVectorForFunction(callback);
}
a.map(callback);
};
%PrepareFunctionForOptimization(eagerDeoptInCalled);
......@@ -42,8 +41,7 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
result += v;
a.length = (i == 13 && deopt) ? 25 : 27;
return v;
};
%EnsureFeedbackVectorForFunction(callback);
}
a.map(callback);
};
%PrepareFunctionForOptimization(eagerDeoptInCalled);
......@@ -67,8 +65,7 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
a_noescape.length = 25;
}
return v;
};
%EnsureFeedbackVectorForFunction(callback);
}
a_noescape.map(callback);
};
%PrepareFunctionForOptimization(eagerDeoptInCalled);
......@@ -96,7 +93,6 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
gc(); gc();
return v;
};
%EnsureFeedbackVectorForFunction(callback);
%NeverOptimizeFunction(callback);
b.map(callback);
};
......@@ -121,7 +117,6 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
}
return 2 * v;
};
%EnsureFeedbackVectorForFunction(callback);
%NeverOptimizeFunction(callback);
return b.map(callback);
};
......@@ -142,8 +137,7 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
%DeoptimizeNow();
}
return v;
};
%EnsureFeedbackVectorForFunction(callback);
}
b.map(callback);
};
%PrepareFunctionForOptimization(lazyDeopt);
......@@ -167,7 +161,6 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
}
return v;
};
%EnsureFeedbackVectorForFunction(callback);
%NeverOptimizeFunction(callback);
b.map(callback);
};
......@@ -193,8 +186,7 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
gc();
}
return v;
};
%EnsureFeedbackVectorForFunction(callback);
}
c.map(callback);
};
%PrepareFunctionForOptimization(lazyDeopt);
......@@ -219,8 +211,7 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
throw("a");
}
return v;
};
%EnsureFeedbackVectorForFunction(callback);
}
try {
c.map(callback);
} catch (e) {
......@@ -250,7 +241,6 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
}
return v;
};
%EnsureFeedbackVectorForFunction(callback);
%NeverOptimizeFunction(callback);
try {
c.map(callback);
......@@ -280,7 +270,6 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
}
return 2 * v;
};
%EnsureFeedbackVectorForFunction(callback);
%NeverOptimizeFunction(callback);
var result = 0;
try {
......@@ -314,7 +303,6 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
}
return v;
};
%EnsureFeedbackVectorForFunction(callback);
var o = [1,2,3];
b.map(callback);
};
......@@ -338,7 +326,6 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
}
return v;
};
%EnsureFeedbackVectorForFunction(callback);
%NeverOptimizeFunction(callback);
var o = [1,2,3];
b.map(callback);
......@@ -365,7 +352,6 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
}
return v;
};
%EnsureFeedbackVectorForFunction(callback);
var o = [1,2,3];
b.map(callback);
};
......@@ -389,7 +375,6 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
}
return v;
};
%EnsureFeedbackVectorForFunction(callback);
a.map(callback);
};
%PrepareFunctionForOptimization(lazyDeopt);
......@@ -423,8 +408,7 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
// array.
return v;
}
};
%EnsureFeedbackVectorForFunction(callback);
}
return c.map(callback);
};
%PrepareFunctionForOptimization(to_double);
......@@ -455,8 +439,7 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
// Later, to PACKED_ELEMENTS.
return v + 'hello';
}
};
%EnsureFeedbackVectorForFunction(callback);
}
return c.map(callback);
};
%PrepareFunctionForOptimization(to_fast);
......@@ -477,7 +460,6 @@ var c = [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25];
function double_results() {
// TurboFan recognizes the result is a double.
var callback = v => v + 0.5;
%EnsureFeedbackVectorForFunction(callback);
return a.map(callback);
}
%PrepareFunctionForOptimization(double_results);
......
......@@ -43,8 +43,6 @@ function f(x) {
g();
}
%PrepareFunctionForOptimization(f);
%PrepareFunctionForOptimization(g);
f();
f();
%OptimizeFunctionOnNextCall(f);
......
......@@ -34,7 +34,6 @@
for (var i = 0; osr && i < 2; i++) %OptimizeOsr();
return result;
}
%PrepareFunctionForOptimization(f);
assertEquals("result", f(true, 3, false));
assertEquals("result", f(true, 3, false));
......@@ -59,7 +58,6 @@
function f() {
return g(void(h() + ""));
};
%PrepareFunctionForOptimization(f);
f();
%OptimizeFunctionOnNextCall(f);
......
......@@ -35,7 +35,6 @@ function f(deopt, osr) {
return result;
}
%PrepareFunctionForOptimization(f);
assertEquals("result", f(3, false));
assertEquals("result", f(3, false));
%OptimizeFunctionOnNextCall(f);
......
......@@ -31,25 +31,21 @@
// should be able to construct a receiver from all optimized stack frames.
function A() { }
%EnsureFeedbackVectorForFunction(A);
A.prototype.f = function() { }
function B() { }
%EnsureFeedbackVectorForFunction(B);
var o = new A();
// This function throws if o does not have an f property, and should not be
// inlined.
function g() { try { return o.f(); } finally { }}
%EnsureFeedbackVectorForFunction(g);
// This function should be optimized via OSR.
function h() {
for (var i = 0; i < 10; i++) %OptimizeOsr();
g();
}
%PrepareFunctionForOptimization(h);
h();
o = new B();
......
......@@ -31,5 +31,4 @@ function foo () {
};
}
%PrepareFunctionForOptimization(foo);
foo();
......@@ -31,7 +31,6 @@ function mul(x, y) {
return (x * y) | 0;
}
%PrepareFunctionForOptimization(mul);
mul(0, 0);
mul(0, 0);
%OptimizeFunctionOnNextCall(mul);
......@@ -42,7 +41,6 @@ function div(x, y) {
return (x / y) | 0;
}
%PrepareFunctionForOptimization(div);
div(4, 2);
div(4, 2);
%OptimizeFunctionOnNextCall(div);
......
......@@ -35,10 +35,8 @@ function simple_two_args(always_zero, always_undefined) {
var always_five = always_undefined || 5;
return always_zero * always_five * .5;
}
%EnsureFeedbackVectorForFunction(simple_two_args);
%PrepareFunctionForOptimization(simple);
simple();
simple();
%OptimizeFunctionOnNextCall(simple);
......
......@@ -33,7 +33,6 @@ function f() {
assertEquals(-1.0, Math.round(-0.5000000000000001));
}
%PrepareFunctionForOptimization(f);
f();
f();
%OptimizeFunctionOnNextCall(f);
......
......@@ -55,7 +55,6 @@ function callConstantFunctionOnPrototype(obj) {
obj.holderMethod();
}
%PrepareFunctionForOptimization(callConstantFunctionOnPrototype);
callConstantFunctionOnPrototype(receiver);
callConstantFunctionOnPrototype(receiver);
%OptimizeFunctionOnNextCall(callConstantFunctionOnPrototype);
......
......@@ -25,7 +25,7 @@
// (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 --allow-natives-syntax --opt
// Flags: --use-osr --allow-natives-syntax --ignition-osr --opt
// Flags: --no-always-opt
// Can't OSR with always-opt or in Lite mode.
......@@ -50,7 +50,6 @@ function f() {
} while (false);
}
%PrepareFunctionForOptimization(f);
f();
function g() {
......@@ -86,5 +85,4 @@ function g() {
} while (false);
}
%PrepareFunctionForOptimization(g);
g();
......@@ -14,7 +14,6 @@ function Cb(a, trigger) {
}
return g;
}
%PrepareFunctionForOptimization(Cb);
var s1 = "long string to make cons string 1";
var s2 = "long string to make cons string 2";
......
......@@ -33,7 +33,7 @@ if (isNeverOptimizeLiteMode()) {
x = 42;
return f.arguments[0];
}
%EnsureFeedbackVectorForFunction(f);
f(0);
%OptimizeFunctionOnNextCall(f);
assertEquals(42, f(0));
......
......@@ -27,10 +27,6 @@
// Flags: --allow-natives-syntax
function f() {
for (var i = 0; i < 10; i++) { if (i == 5) %OptimizeOsr(); }
var xl = 4096;
var z = i % xl;
}
%PrepareFunctionForOptimization(f);
f();
for (var i = 0; i < 10; i++) { if (i == 5) %OptimizeOsr(); }
var xl = 4096;
var z = i % xl;
......@@ -10,7 +10,6 @@ function foo(a) {
}
}
%PrepareFunctionForOptimization(foo);
foo([1,2,3]);
foo([2,3,4]);
%OptimizeFunctionOnNextCall(foo);
......
......@@ -18,7 +18,6 @@ function foo() {
}
}
%PrepareFunctionForOptimization(foo);
foo();
foo();
%OptimizeFunctionOnNextCall(foo);
......
......@@ -10,7 +10,6 @@ function foo(obj) {
counter += obj;
return counter;
}
%PrepareFunctionForOptimization(foo);
function bar() {
var a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
......
......@@ -43,7 +43,6 @@ Array.prototype.f = function() {
var o1 = {m: 1};
var o2 = {a: 0, m:1};
%PrepareFunctionForOptimization(callsFReceiver);
var r1 = callsFReceiver(o1);
callsFReceiver(o1);
%OptimizeFunctionOnNextCall(callsFReceiver);
......@@ -57,7 +56,6 @@ assertEquals(1, r1);
assertTrue(r1 === r2);
assertTrue(r2 === r3);
%OptimizeFunctionOnNextCall(callsFReceiver);
r1 = callsFReceiver(o1);
callsFReceiver(o1);
%OptimizeFunctionOnNextCall(callsFReceiver);
......
......@@ -23,7 +23,6 @@ function literals_sharing_test(warmup, optimize) {
// propagated to the next closure.
assertTrue(%HasDoubleElements(a));
};
%EnsureFeedbackVectorForFunction(closure);
if (optimize) %OptimizeFunctionOnNextCall(closure);
closure();
}
......
......@@ -9,7 +9,6 @@ function bar(a) {
return x == undefined;
}
%PrepareFunctionForOptimization(bar);
// Make the keyed load be polymorphic on holey smi and holey fast.
bar([, 2, 3]);
bar([, 'two', 'three']);
......
......@@ -11,7 +11,6 @@
return 23;
} while(false)
}
%PrepareFunctionForOptimization(f);
assertEquals(23, f());
assertEquals(23, f());
})();
......@@ -25,7 +24,6 @@
} while(false)
return 999;
}
%PrepareFunctionForOptimization(g);
var gen = g();
assertEquals({ value:23, done:false }, gen.next());
assertEquals({ value:42, done:false }, gen.next());
......
......@@ -20,7 +20,6 @@ function f(osr_and_recurse) {
}
return 65;
}
%PrepareFunctionForOptimization(f);
assertEquals(65, f(false));
assertEquals(65, f(false));
assertEquals(42, f(true));
......@@ -15,7 +15,6 @@ var f = (function() {
}
}
})();
%PrepareFunctionForOptimization(f);
g = (function() { f((Array), counter()); });
g();
......@@ -8,7 +8,6 @@ function get(a, i) {
return a[i];
}
%PrepareFunctionForOptimization(get);
get([1,,3], 0);
get([1,,3], 2);
%OptimizeFunctionOnNextCall(get);
......
......@@ -8,7 +8,6 @@ function get(a, i) {
return a[i];
}
%PrepareFunctionForOptimization(get);
get([1,,3], 0);
get([1,,3], 2);
%OptimizeFunctionOnNextCall(get);
......
......@@ -7,7 +7,6 @@
function foo(x) {
return Symbol.iterator == x;
}
%PrepareFunctionForOptimization(foo);
function main() {
foo(Symbol());
......
......@@ -8,7 +8,6 @@ var o = {};
function foo(s) { return o[s]; }
%PrepareFunctionForOptimization(foo);
var s = 'c' + 'c';
foo(s);
foo(s);
......
......@@ -7,7 +7,6 @@
(function() {
function foo(o) { o["x"] = 1; }
%PrepareFunctionForOptimization(foo);
assertThrows(() => foo(undefined));
assertThrows(() => foo(undefined));
%OptimizeFunctionOnNextCall(foo);
......@@ -18,7 +17,6 @@
(function() {
function foo(o) { o["x"] = 1; }
%PrepareFunctionForOptimization(foo);
assertThrows(() => foo(null));
assertThrows(() => foo(null));
%OptimizeFunctionOnNextCall(foo);
......@@ -29,7 +27,6 @@
(function() {
function foo(o) { return o["x"]; }
%PrepareFunctionForOptimization(foo);
assertThrows(() => foo(undefined));
assertThrows(() => foo(undefined));
%OptimizeFunctionOnNextCall(foo);
......@@ -40,7 +37,6 @@
(function() {
function foo(o) { return o["x"]; }
%PrepareFunctionForOptimization(foo);
assertThrows(() => foo(null));
assertThrows(() => foo(null));
%OptimizeFunctionOnNextCall(foo);
......@@ -51,7 +47,6 @@
(function() {
function foo(o) { o.x = 1; }
%PrepareFunctionForOptimization(foo);
assertThrows(() => foo(undefined));
assertThrows(() => foo(undefined));
%OptimizeFunctionOnNextCall(foo);
......@@ -62,7 +57,6 @@
(function() {
function foo(o) { o.x = 1; }
%PrepareFunctionForOptimization(foo);
assertThrows(() => foo(null));
assertThrows(() => foo(null));
%OptimizeFunctionOnNextCall(foo);
......@@ -73,7 +67,6 @@
(function() {
function foo(o) { return o.x; }
%PrepareFunctionForOptimization(foo);
assertThrows(() => foo(undefined));
assertThrows(() => foo(undefined));
%OptimizeFunctionOnNextCall(foo);
......@@ -84,7 +77,6 @@
(function() {
function foo(o) { return o.x; }
%PrepareFunctionForOptimization(foo);
assertThrows(() => foo(null));
assertThrows(() => foo(null));
%OptimizeFunctionOnNextCall(foo);
......
......@@ -6,7 +6,6 @@
function foo(o) { return o.x; }
%PrepareFunctionForOptimization(foo);
assertEquals(undefined, foo({}));
assertEquals(undefined, foo(1));
assertEquals(undefined, foo({}));
......
......@@ -8,7 +8,6 @@ function foo(s) {
return s[5];
}
%PrepareFunctionForOptimization(foo);
assertEquals("f", foo("abcdef"));
assertEquals(undefined, foo("a"));
%OptimizeFunctionOnNextCall(foo);
......@@ -20,7 +19,6 @@ assertOptimized(foo);
String.prototype[5] = "5";
assertEquals("f", foo("abcdef"));
%PrepareFunctionForOptimization(foo);
assertEquals("5", foo("a"));
%OptimizeFunctionOnNextCall(foo);
assertEquals("f", foo("abcdef"));
......
......@@ -8,7 +8,6 @@ function foo(s) {
return s[5];
}
%PrepareFunctionForOptimization(foo);
assertEquals("f", foo("abcdef"));
assertEquals(undefined, foo("a"));
%OptimizeFunctionOnNextCall(foo);
......@@ -24,7 +23,6 @@ String.prototype.__proto__ = new Proxy(String.prototype.__proto__, {
});
assertEquals("f", foo("abcdef"));
%PrepareFunctionForOptimization(foo);
assertEquals("5", foo("a"));
%OptimizeFunctionOnNextCall(foo);
assertEquals("f", foo("abcdef"));
......
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