Commit d22884ef authored by Mythri A's avatar Mythri A Committed by Commit Bot

[cleanup] Add %PrepareFunctionForOptimize in mjsunit tests

Bug: v8:8801, v8:8394, v8:9183
Change-Id: Ie2858af4863511d5f67b662ac6f6f79512f55e7e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1662307
Commit-Queue: Mythri Alle <mythria@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62223}
parent 7d4b5893
......@@ -198,7 +198,6 @@ function TestAllScenarios(f) {
if (strict === 0)
Assign(o, i);
else
AssignStrict(o, i);
assertEquals(i, o.a);
}
......
......@@ -26,6 +26,7 @@ function f() {
}
}
%PrepareFunctionForOptimization(f);
f();
f();
%OptimizeFunctionOnNextCall(f);
......
......@@ -18,8 +18,8 @@ function f2(h, h_eval) {
// site.
o.x = h_eval;
};
%PrepareFunctionForOptimization(f2);
function f3(h) {
%PrepareFunctionForOptimization(f2);
f2(h, h());
%OptimizeFunctionOnNextCall(f2);
f2(h, h());
......
......@@ -5,6 +5,7 @@
// Flags: --allow-natives-syntax
function optimize(crankshaft_test) {
%PrepareFunctionForOptimization(crankshaft_test);
crankshaft_test();
crankshaft_test();
%OptimizeFunctionOnNextCall(crankshaft_test);
......
......@@ -21,6 +21,7 @@ function f(o, value) {
var obj = {o: a1};
%PrepareFunctionForOptimization(f);
f(obj, a1);
f(obj, a1);
%OptimizeFunctionOnNextCall(f);
......
......@@ -40,6 +40,7 @@ function f(o, a) {
return v;
}
%PrepareFunctionForOptimization(f);
f({y:1.4}, [1]);
f({y:1.6}, [1]);
%OptimizeFunctionOnNextCall(f);
......@@ -59,6 +60,7 @@ function f2(o) {
var o1 = { x: 1.5 };
var o2 = { y: 1, x: 1 };
%PrepareFunctionForOptimization(f2);
f2(o1);
f2(o1);
f2(o2);
......
......@@ -12,6 +12,7 @@ function g() { global = this; }
Object.defineProperty(Number.prototype, "prop", { get: g });
function f(s) { s.prop; }
%PrepareFunctionForOptimization(f);
f(1);
f(1);
%OptimizeFunctionOnNextCall(f);
......
......@@ -45,6 +45,7 @@ function g() {
}
var fun = g();
%PrepareFunctionForOptimization(fun);
fun(false, c);
fun(false, c);
fun(false, c);
......
......@@ -20,6 +20,7 @@ function mod1() {
}
var f = mod1();
%PrepareFunctionForOptimization(f);
assertThrows(f);
%OptimizeFunctionOnNextCall(f);
assertThrows(f);
......@@ -36,6 +37,7 @@ function bug2() {
}
}
%PrepareFunctionForOptimization(bug2);
assertThrows(bug2);
%OptimizeFunctionOnNextCall(bug2);
assertThrows(bug2);
......@@ -28,6 +28,7 @@
// Flags: --allow-natives-syntax
function test(fun, expectation) {
%PrepareFunctionForOptimization(fun);
assertEquals(1, fun(1));
%OptimizeFunctionOnNextCall(fun);
assertEquals(expectation, fun(0));
......
......@@ -7,8 +7,8 @@
function load(o) {
return o.x;
};
%PrepareFunctionForOptimization(load);
for (var x = 0; x < 1000; ++x) {
%PrepareFunctionForOptimization(load);
load({x});
load({x});
%OptimizeFunctionOnNextCall(load);
......@@ -23,8 +23,8 @@ assertOptimized(load);
function store(o) {
o.x = -1;
};
%PrepareFunctionForOptimization(store);
for (var x = 0; x < 1000; ++x) {
%PrepareFunctionForOptimization(store);
store({x});
store({x});
%OptimizeFunctionOnNextCall(store);
......
......@@ -17,6 +17,7 @@ function foo(a) {
}
const a = [1, 2, 3];
%PrepareFunctionForOptimization(foo);
assertTrue(foo(a));
assertTrue(foo(a));
%OptimizeFunctionOnNextCall(foo);
......
......@@ -15,6 +15,7 @@ var foo = (function () {
}
})();
%PrepareFunctionForOptimization(foo);
foo(1);
foo(1);
%OptimizeFunctionOnNextCall(foo);
......
......@@ -936,6 +936,7 @@ function __f_30(x) {
return 0;
}
try {
%PrepareFunctionForOptimization(__f_30);
assertEquals(0, __f_30(0));
assertEquals(0, __f_30(0));
%OptimizeFunctionOnNextCall(__f_30);
......@@ -956,6 +957,7 @@ function __f_33() {
__f_32({});
}
try {
%PrepareFunctionForOptimization(__f_33);
__f_33();
__f_33();
__f_33();
......
......@@ -472,6 +472,7 @@ function __f_30(x) {
return 0;
}
try {
%PrepareFunctionForOptimization(__f_30);
assertEquals(0, __f_30(0));
assertEquals(0, __f_30(0));
%OptimizeFunctionOnNextCall(__f_30);
......@@ -492,6 +493,7 @@ function __f_33() {
__f_32({});
}
try {
%PrepareFunctionForOptimization(__f_33);
__f_33();
__f_33();
__f_33();
......
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