Commit 24258855 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[cleanup] Add missing %PrepareFunctionForOptimize in mjsunit tests

Bug: v8:8801,v8:8394,v8:9183
Change-Id: I5ceaf731a1b2720f086e6791fe08caaaa55de030
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1662568
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Auto-Submit: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62224}
parent d22884ef
...@@ -116,6 +116,7 @@ ...@@ -116,6 +116,7 @@
args.push(i); args.push(i);
if (i%10 == 0) %OptimizeFunctionOnNextCall(sum1); if (i%10 == 0) %OptimizeFunctionOnNextCall(sum1);
assertEquals(i*(i+1)/2, sum1(...args)); assertEquals(i*(i+1)/2, sum1(...args));
if (i%10 == 0) %PrepareFunctionForOptimization(sum1);
} }
})(); })();
...@@ -136,6 +137,7 @@ ...@@ -136,6 +137,7 @@
args.push(i); args.push(i);
if (i%10 == 0) %OptimizeFunctionOnNextCall(sum2); if (i%10 == 0) %OptimizeFunctionOnNextCall(sum2);
assertEquals(i*(i+1)/2, sum2(...args)); assertEquals(i*(i+1)/2, sum2(...args));
if (i%10 == 0) %PrepareFunctionForOptimization(sum2);
} }
})(); })();
...@@ -156,6 +158,7 @@ ...@@ -156,6 +158,7 @@
args.push(i); args.push(i);
if (i%10 == 0) %OptimizeFunctionOnNextCall(sum3); if (i%10 == 0) %OptimizeFunctionOnNextCall(sum3);
assertEquals(i*(i+1)/2, sum3(...args)); assertEquals(i*(i+1)/2, sum3(...args));
if (i%10 == 0) %PrepareFunctionForOptimization(sum3);
} }
})(); })();
...@@ -176,6 +179,7 @@ ...@@ -176,6 +179,7 @@
args.push(i); args.push(i);
if (i%10 == 0) %OptimizeFunctionOnNextCall(sum4); if (i%10 == 0) %OptimizeFunctionOnNextCall(sum4);
assertEquals(i*(i+1)/2-1, sum4(...args)); assertEquals(i*(i+1)/2-1, sum4(...args));
if (i%10 == 0) %PrepareFunctionForOptimization(sum4);
} }
})(); })();
...@@ -192,5 +196,6 @@ ...@@ -192,5 +196,6 @@
args.push(i); args.push(i);
if (i%10 == 0) %OptimizeFunctionOnNextCall(read); if (i%10 == 0) %OptimizeFunctionOnNextCall(read);
assertEquals(i, read(...args)); assertEquals(i, read(...args));
if (i%10 == 0) %PrepareFunctionForOptimization(read);
} }
})(); })();
...@@ -10,6 +10,7 @@ function f() { ...@@ -10,6 +10,7 @@ function f() {
return non_const_true || (f() = this); return non_const_true || (f() = this);
} }
%PrepareFunctionForOptimization(f);
assertTrue(f()); assertTrue(f());
assertTrue(f()); assertTrue(f());
%OptimizeFunctionOnNextCall(f); %OptimizeFunctionOnNextCall(f);
......
...@@ -15,6 +15,7 @@ function f( ) { ...@@ -15,6 +15,7 @@ function f( ) {
d = 357; d = 357;
return {foo: b}; return {foo: b};
} }
%PrepareFunctionForOptimization(f);
f(); f();
f(); f();
%OptimizeFunctionOnNextCall(f); %OptimizeFunctionOnNextCall(f);
...@@ -27,6 +28,7 @@ function g(obj) { ...@@ -27,6 +28,7 @@ function g(obj) {
return obj.foo.length; return obj.foo.length;
} }
%PrepareFunctionForOptimization(f);
g(dummy); g(dummy);
g(dummy); g(dummy);
%OptimizeFunctionOnNextCall(g); %OptimizeFunctionOnNextCall(g);
......
...@@ -16,6 +16,7 @@ function foo(a) { ...@@ -16,6 +16,7 @@ function foo(a) {
} }
} }
%PrepareFunctionForOptimization(foo);
foo([1,2]); foo([1,2]);
foo([2,3]); foo([2,3]);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionOnNextCall(foo);
......
...@@ -19,5 +19,6 @@ var f = (function(v) { ...@@ -19,5 +19,6 @@ var f = (function(v) {
}; };
})(get_thrower()).fun; })(get_thrower()).fun;
%PrepareFunctionForOptimization(f);
%OptimizeFunctionOnNextCall(f); %OptimizeFunctionOnNextCall(f);
f(); f();
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
// Flags: --allow-natives-syntax // Flags: --allow-natives-syntax
function check(f, result) { function check(f, result) {
%PrepareFunctionForOptimization(f);
%OptimizeFunctionOnNextCall(f); %OptimizeFunctionOnNextCall(f);
assertEquals(result, f()); assertEquals(result, f());
} }
......
...@@ -22,5 +22,6 @@ function run_close_to_stack_limit(f) { ...@@ -22,5 +22,6 @@ function run_close_to_stack_limit(f) {
} }
var boom = module().f; var boom = module().f;
%PrepareFunctionForOptimization(boom);
%OptimizeFunctionOnNextCall(boom) %OptimizeFunctionOnNextCall(boom)
run_close_to_stack_limit(boom); run_close_to_stack_limit(boom);
...@@ -20,6 +20,7 @@ var f2 = (function() { ...@@ -20,6 +20,7 @@ var f2 = (function() {
function f(a) { return a || g(); } function f(a) { return a || g(); }
return f; return f;
})(); })();
%PrepareFunctionForOptimization(f2);
assertTrue(f2(true)); assertTrue(f2(true));
%OptimizeFunctionOnNextCall(f2); %OptimizeFunctionOnNextCall(f2);
assertTrue(f2(true)); assertTrue(f2(true));
...@@ -16,5 +16,6 @@ var boom = (function(stdlib, foreign, heap) { ...@@ -16,5 +16,6 @@ var boom = (function(stdlib, foreign, heap) {
} }
return foo return foo
})(this, 0, new ArrayBuffer(256)); })(this, 0, new ArrayBuffer(256));
%PrepareFunctionForOptimization(boom);
%OptimizeFunctionOnNextCall(boom); %OptimizeFunctionOnNextCall(boom);
boom(0, 0x1000); boom(0, 0x1000);
...@@ -9,10 +9,12 @@ var p = {foo: 1.5} ...@@ -9,10 +9,12 @@ var p = {foo: 1.5}
function g(x) { return x.foo === +x.foo; } function g(x) { return x.foo === +x.foo; }
%PrepareFunctionForOptimization(g);
assertEquals(false, g(o)); assertEquals(false, g(o));
assertEquals(false, g(o)); assertEquals(false, g(o));
%OptimizeFunctionOnNextCall(g); %OptimizeFunctionOnNextCall(g);
assertEquals(false, g(o)); // Still fine here. assertEquals(false, g(o)); // Still fine here.
assertEquals(true, g(p)); assertEquals(true, g(p));
%PrepareFunctionForOptimization(g);
%OptimizeFunctionOnNextCall(g); %OptimizeFunctionOnNextCall(g);
assertEquals(false, g(o)); // Confused by type feedback. assertEquals(false, g(o)); // Confused by type feedback.
...@@ -12,6 +12,7 @@ function f() { ...@@ -12,6 +12,7 @@ function f() {
} }
} }
%PrepareFunctionForOptimization(f);
f(); f();
f(); f();
%OptimizeFunctionOnNextCall(f); %OptimizeFunctionOnNextCall(f);
......
...@@ -11,6 +11,7 @@ class Subclass extends Base { ...@@ -11,6 +11,7 @@ class Subclass extends Base {
super(); super();
} }
} }
%PrepareFunctionForOptimization(Subclass);
new Subclass(); new Subclass();
new Subclass(); new Subclass();
%OptimizeFunctionOnNextCall(Subclass); %OptimizeFunctionOnNextCall(Subclass);
......
...@@ -10,5 +10,6 @@ function f(obj) { ...@@ -10,5 +10,6 @@ function f(obj) {
return key === undefined; return key === undefined;
} }
%PrepareFunctionForOptimization(f);
%OptimizeFunctionOnNextCall(f); %OptimizeFunctionOnNextCall(f);
assertFalse(f({ foo:0 })); assertFalse(f({ foo:0 }));
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
function foo(o) { return %_ToLength(o.length); } function foo(o) { return %_ToLength(o.length); }
%PrepareFunctionForOptimization(foo);
foo(new Array(4)); foo(new Array(4));
foo(new Array(Math.pow(2, 32) - 1)); foo(new Array(Math.pow(2, 32) - 1));
foo({length: 10}); foo({length: 10});
......
...@@ -14,11 +14,13 @@ function Check() { ...@@ -14,11 +14,13 @@ function Check() {
n.xyz = 0x826852f4; n.xyz = 0x826852f4;
} }
%PrepareFunctionForOptimization(Ctor);
Ctor(); Ctor();
Ctor(); Ctor();
%OptimizeFunctionOnNextCall(Ctor); %OptimizeFunctionOnNextCall(Ctor);
Ctor(); Ctor();
%PrepareFunctionForOptimization(Check);
Check(); Check();
Check(); Check();
%OptimizeFunctionOnNextCall(Check); %OptimizeFunctionOnNextCall(Check);
......
...@@ -15,11 +15,13 @@ function Check() { ...@@ -15,11 +15,13 @@ function Check() {
n.xyz = 0x826852f4; n.xyz = 0x826852f4;
} }
%PrepareFunctionForOptimization(Ctor);
Ctor(); Ctor();
Ctor(); Ctor();
%OptimizeFunctionOnNextCall(Ctor); %OptimizeFunctionOnNextCall(Ctor);
Ctor(); Ctor();
%PrepareFunctionForOptimization(Check);
Check(); Check();
Check(); Check();
%OptimizeFunctionOnNextCall(Check); %OptimizeFunctionOnNextCall(Check);
......
...@@ -17,6 +17,7 @@ function h(a) { ...@@ -17,6 +17,7 @@ function h(a) {
function boom() { return g(1) } function boom() { return g(1) }
%PrepareFunctionForOptimization(boom);
assertEquals(1, h(1)); assertEquals(1, h(1));
assertEquals(2, boom()); assertEquals(2, boom());
assertEquals(3, boom()); assertEquals(3, boom());
......
...@@ -23,6 +23,7 @@ function emit_f(size) { ...@@ -23,6 +23,7 @@ function emit_f(size) {
// a single instruction's immediate field (2^12). // a single instruction's immediate field (2^12).
var kLength = 701; var kLength = 701;
emit_f(kLength); emit_f(kLength);
%PrepareFunctionForOptimization(f);
f(1); f(1);
f(1); f(1);
%OptimizeFunctionOnNextCall(f); %OptimizeFunctionOnNextCall(f);
......
...@@ -11,6 +11,7 @@ function foo(a) { ...@@ -11,6 +11,7 @@ function foo(a) {
this.x = 0; this.x = 0;
delete x; delete x;
%PrepareFunctionForOptimization(foo);
foo(); foo();
foo(); foo();
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionOnNextCall(foo);
...@@ -19,6 +20,7 @@ assertEquals(undefined, v); ...@@ -19,6 +20,7 @@ assertEquals(undefined, v);
Object.freeze(this); Object.freeze(this);
%PrepareFunctionForOptimization(foo);
foo(4); foo(4);
foo(5); foo(5);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionOnNextCall(foo);
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
// Flags: --allow-natives-syntax // Flags: --allow-natives-syntax
eval('function f(a) { return [' + new Array(1 << 17) + ',a] }'); eval('function f(a) { return [' + new Array(1 << 17) + ',a] }');
%PrepareFunctionForOptimization(f);
assertEquals(23, f(23)[1 << 17]); assertEquals(23, f(23)[1 << 17]);
assertEquals(42, f(42)[1 << 17]); assertEquals(42, f(42)[1 << 17]);
%OptimizeFunctionOnNextCall(f); %OptimizeFunctionOnNextCall(f);
......
...@@ -8,6 +8,7 @@ function f() { ...@@ -8,6 +8,7 @@ function f() {
for (var i of [NaN].keys()); for (var i of [NaN].keys());
} }
%PrepareFunctionForOptimization(f);
f(); f();
%OptimizeFunctionOnNextCall(f); %OptimizeFunctionOnNextCall(f);
f(); f();
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
// Generate a function {f} containing a large array literal of doubles. // Generate a function {f} containing a large array literal of doubles.
eval("function f() { return [" + String("0.1,").repeat(65535) + "] }"); eval("function f() { return [" + String("0.1,").repeat(65535) + "] }");
%PrepareFunctionForOptimization(f);
// Running the function once will initialize the boilerplate. // Running the function once will initialize the boilerplate.
assertEquals(65535, f().length); assertEquals(65535, f().length);
......
...@@ -14,5 +14,6 @@ function f() { ...@@ -14,5 +14,6 @@ function f() {
return g(-1); return g(-1);
} }
%PrepareFunctionForOptimization(f);
%OptimizeFunctionOnNextCall(f); %OptimizeFunctionOnNextCall(f);
assertEquals(4294967295, f()); assertEquals(4294967295, f());
...@@ -9,6 +9,7 @@ function foo() { ...@@ -9,6 +9,7 @@ function foo() {
%_DeoptimizeNow(); %_DeoptimizeNow();
return a[2]; return a[2];
} }
%PrepareFunctionForOptimization(foo);
assertSame(undefined, foo()); assertSame(undefined, foo());
assertSame(undefined, foo()); assertSame(undefined, foo());
%OptimizeFunctionOnNextCall(foo) %OptimizeFunctionOnNextCall(foo)
......
...@@ -8,6 +8,7 @@ class C {} ...@@ -8,6 +8,7 @@ class C {}
class D extends C { constructor() { super(...unresolved, 75) } } class D extends C { constructor() { super(...unresolved, 75) } }
D.__proto__ = null; D.__proto__ = null;
%PrepareFunctionForOptimization(D);
assertThrows(() => new D(), TypeError); assertThrows(() => new D(), TypeError);
assertThrows(() => new D(), TypeError); assertThrows(() => new D(), TypeError);
%OptimizeFunctionOnNextCall(D); %OptimizeFunctionOnNextCall(D);
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
var obj = {}; var obj = {};
obj.load_boom = smi_arr; obj.load_boom = smi_arr;
%PrepareFunctionForOptimization(do_keyed_load);
do_keyed_load(arrs); do_keyed_load(arrs);
do_keyed_load(arrs); do_keyed_load(arrs);
%OptimizeFunctionOnNextCall(do_keyed_load); %OptimizeFunctionOnNextCall(do_keyed_load);
...@@ -57,6 +58,7 @@ ...@@ -57,6 +58,7 @@
var obj = {}; var obj = {};
obj.store_boom = smi_arr; obj.store_boom = smi_arr;
%PrepareFunctionForOptimization(do_keyed_store);
do_keyed_store(arrs); do_keyed_store(arrs);
do_keyed_store(arrs); do_keyed_store(arrs);
%OptimizeFunctionOnNextCall(do_keyed_store); %OptimizeFunctionOnNextCall(do_keyed_store);
......
...@@ -31,6 +31,7 @@ var observer = new Proxy(A, { ...@@ -31,6 +31,7 @@ var observer = new Proxy(A, {
} }
}); });
%PrepareFunctionForOptimization(B);
Reflect.construct(B, [], observer); Reflect.construct(B, [], observer);
Reflect.construct(B, [], observer); Reflect.construct(B, [], observer);
%OptimizeFunctionOnNextCall(B); %OptimizeFunctionOnNextCall(B);
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
} }
src += 'c) { return a + c })'; src += 'c) { return a + c })';
var f = eval(src); var f = eval(src);
%PrepareFunctionForOptimization(f);
assertEquals(NaN, f(1)); assertEquals(NaN, f(1));
assertEquals(NaN, f(2)); assertEquals(NaN, f(2));
%OptimizeFunctionOnNextCall(f); %OptimizeFunctionOnNextCall(f);
......
...@@ -8,6 +8,7 @@ function __f_1() { ...@@ -8,6 +8,7 @@ function __f_1() {
function __f_2() { function __f_2() {
Array.prototype.__proto__ = { 77e4 : null }; Array.prototype.__proto__ = { 77e4 : null };
} }
%PrepareFunctionForOptimization(__f_2);
__f_2(); __f_2();
%OptimizeFunctionOnNextCall(__f_2); %OptimizeFunctionOnNextCall(__f_2);
__f_2(); __f_2();
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
(function TestGeneratorMaterialization() { (function TestGeneratorMaterialization() {
function* f([x]) { yield x } function* f([x]) { yield x }
// No warm-up of {f} to trigger soft deopt. // No warm-up of {f} to trigger soft deopt.
%PrepareFunctionForOptimization(f);
%OptimizeFunctionOnNextCall(f); %OptimizeFunctionOnNextCall(f);
var gen = f([23]); var gen = f([23]);
assertEquals("[object Generator]", gen.toString()); assertEquals("[object Generator]", gen.toString());
...@@ -22,6 +23,7 @@ ...@@ -22,6 +23,7 @@
return gen; return gen;
} }
function h() { f() } function h() { f() }
%PrepareFunctionForOptimization(h);
// Enough warm-up to make {p} an in-object property. // Enough warm-up to make {p} an in-object property.
for (var i = 0; i < 100; ++i) { g(); h(); } for (var i = 0; i < 100; ++i) { g(); h(); }
%OptimizeFunctionOnNextCall(h); %OptimizeFunctionOnNextCall(h);
......
...@@ -8,6 +8,7 @@ class Base {} ...@@ -8,6 +8,7 @@ class Base {}
class Derived extends Base { class Derived extends Base {
constructor() { super(); } constructor() { super(); }
} }
%PrepareFunctionForOptimization(Derived);
var proxy = new Proxy(Base, { get() {} }); var proxy = new Proxy(Base, { get() {} });
assertDoesNotThrow(() => Reflect.construct(Derived, [])); assertDoesNotThrow(() => Reflect.construct(Derived, []));
assertThrows(() => Reflect.construct(Derived, [], proxy), TypeError); assertThrows(() => Reflect.construct(Derived, [], proxy), TypeError);
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
const A = class A {} const A = class A {}
function test(foo) { function test(foo) {
%PrepareFunctionForOptimization(foo);
assertThrows(foo); assertThrows(foo);
assertThrows(foo); assertThrows(foo);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionOnNextCall(foo);
......
...@@ -11,6 +11,7 @@ function f() { ...@@ -11,6 +11,7 @@ function f() {
%_DeoptimizeNow(); %_DeoptimizeNow();
return o.length; return o.length;
} }
%PrepareFunctionForOptimization(f);
assertEquals(1, f()); assertEquals(1, f());
assertEquals(1, f()); assertEquals(1, f());
%OptimizeFunctionOnNextCall(f); %OptimizeFunctionOnNextCall(f);
......
...@@ -10,6 +10,7 @@ function f() { ...@@ -10,6 +10,7 @@ function f() {
local += 'abcdefghijkl' + (0 + global); local += 'abcdefghijkl' + (0 + global);
global += 'abcdefghijkl'; global += 'abcdefghijkl';
} }
%PrepareFunctionForOptimization(f);
f(); f();
%OptimizeFunctionOnNextCall(f); %OptimizeFunctionOnNextCall(f);
f(); f();
...@@ -26,6 +26,7 @@ function __getRandomProperty(obj, seed) { ...@@ -26,6 +26,7 @@ function __getRandomProperty(obj, seed) {
}; };
return __v_59904.filter(__v_59909); return __v_59904.filter(__v_59909);
}; };
%PrepareFunctionForOptimization(__v_59906);
print(__v_59906()); print(__v_59906());
__v_59904[__getRandomProperty(__v_59904, 366855)] = this, gc(); __v_59904[__getRandomProperty(__v_59904, 366855)] = this, gc();
print(__v_59906()); print(__v_59906());
......
...@@ -19,6 +19,7 @@ class Derived extends Base { ...@@ -19,6 +19,7 @@ class Derived extends Base {
// Feed a bound function as new.target // Feed a bound function as new.target
// to the profiler, so HeapObjectMatcher // to the profiler, so HeapObjectMatcher
// can find it. // can find it.
%PrepareFunctionForOptimization(Derived);
Reflect.construct(Derived, [], Object.bind()); Reflect.construct(Derived, [], Object.bind());
%OptimizeFunctionOnNextCall(Derived); %OptimizeFunctionOnNextCall(Derived);
new Derived(); new Derived();
...@@ -17,6 +17,7 @@ function foo() { ...@@ -17,6 +17,7 @@ function foo() {
try { undefined[0] = bar(); } catch (e) { } try { undefined[0] = bar(); } catch (e) { }
Math.min(bar(), bar(), bar()); Math.min(bar(), bar(), bar());
} }
%PrepareFunctionForOptimization(foo);
foo(); foo();
foo(); foo();
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionOnNextCall(foo);
......
...@@ -18,6 +18,7 @@ bar(0.1); ...@@ -18,6 +18,7 @@ bar(0.1);
return bar(x | -1) == 4294967295; return bar(x | -1) == 4294967295;
} }
%PrepareFunctionForOptimization(foo);
assertFalse(foo(1)); assertFalse(foo(1));
assertFalse(foo(0)); assertFalse(foo(0));
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionOnNextCall(foo);
...@@ -35,6 +36,7 @@ bar(0.1); ...@@ -35,6 +36,7 @@ bar(0.1);
makeFoo(0); // Defeat the function context specialization. makeFoo(0); // Defeat the function context specialization.
const foo = makeFoo(1); const foo = makeFoo(1);
%PrepareFunctionForOptimization(foo);
assertFalse(foo(1)); assertFalse(foo(1));
assertFalse(foo(0)); assertFalse(foo(0));
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionOnNextCall(foo);
......
...@@ -21,6 +21,7 @@ a3.fill(3.3); ...@@ -21,6 +21,7 @@ a3.fill(3.3);
var a4 = [1.1]; var a4 = [1.1];
%PrepareFunctionForOptimization(fun);
for (let i = 0; i < 3; i++) fun(...a4); for (let i = 0; i < 3; i++) fun(...a4);
%OptimizeFunctionOnNextCall(fun); %OptimizeFunctionOnNextCall(fun);
fun(...a4); fun(...a4);
......
...@@ -14,6 +14,7 @@ function opt(){ ...@@ -14,6 +14,7 @@ function opt(){
finally{} finally{}
} }
} }
%PrepareFunctionForOptimization(opt);
opt(); opt();
%OptimizeFunctionOnNextCall(opt); %OptimizeFunctionOnNextCall(opt);
opt(); opt();
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
// Flags: --allow-natives-syntax // Flags: --allow-natives-syntax
function test(func, expect) { function test(func, expect) {
%PrepareFunctionForOptimization(func);
assertTrue(func() == expect); assertTrue(func() == expect);
%OptimizeFunctionOnNextCall(func); %OptimizeFunctionOnNextCall(func);
assertTrue(func() == expect); assertTrue(func() == expect);
...@@ -50,6 +51,7 @@ test(check_v4, true); ...@@ -50,6 +51,7 @@ test(check_v4, true);
function testIn(index, array) { function testIn(index, array) {
return index in array; return index in array;
} }
%PrepareFunctionForOptimization(testIn);
let a = []; let a = [];
a.__proto__ = [0,1,2]; a.__proto__ = [0,1,2];
...@@ -65,6 +67,7 @@ test(check_v4, true); ...@@ -65,6 +67,7 @@ test(check_v4, true);
%ClearFunctionFeedback(testIn); %ClearFunctionFeedback(testIn);
%DeoptimizeFunction(testIn); %DeoptimizeFunction(testIn);
%PrepareFunctionForOptimization(testIn);
// First load will set IC to Load handle with allow hole to undefined conversion false. // First load will set IC to Load handle with allow hole to undefined conversion false.
assertTrue(testIn(0, a)); assertTrue(testIn(0, a));
...@@ -75,6 +78,7 @@ test(check_v4, true); ...@@ -75,6 +78,7 @@ test(check_v4, true);
// Repeat the same testing for access out-of-bounds of the array, but in bounds of it's prototype. // Repeat the same testing for access out-of-bounds of the array, but in bounds of it's prototype.
%ClearFunctionFeedback(testIn); %ClearFunctionFeedback(testIn);
%DeoptimizeFunction(testIn); %DeoptimizeFunction(testIn);
%PrepareFunctionForOptimization(testIn);
assertTrue(testIn(2, a)); assertTrue(testIn(2, a));
assertTrue(testIn(2, a)); assertTrue(testIn(2, a));
...@@ -83,6 +87,7 @@ test(check_v4, true); ...@@ -83,6 +87,7 @@ test(check_v4, true);
%ClearFunctionFeedback(testIn); %ClearFunctionFeedback(testIn);
%DeoptimizeFunction(testIn); %DeoptimizeFunction(testIn);
%PrepareFunctionForOptimization(testIn);
assertTrue(testIn(2, a)); assertTrue(testIn(2, a));
%OptimizeFunctionOnNextCall(testIn); %OptimizeFunctionOnNextCall(testIn);
......
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