Commit 490c4199 authored by Thibaud Michaud's avatar Thibaud Michaud Committed by Commit Bot

[cleanup] Add PrepareFunctionForOptimization

R=mythria@chromium.org

Bug: v8:9183
Change-Id: I3913ce4bb69895994a0e397f0f96c83813668ea4
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1660480Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Thibaud Michaud <thibaudm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62183}
parent bd0b0ce8
......@@ -114,6 +114,7 @@ function strict_return_receiver() {
function g() {
return strict_return_receiver();
}
%PrepareFunctionForOptimization(g);
for (var i = 0; i < 5; i++) {
assertEquals(void 0, g());
......@@ -129,6 +130,7 @@ function g2() {
o.f = strict_return_receiver;
return o.f();
}
%PrepareFunctionForOptimization(g2);
for (var i = 0; i < 5; i++) {
assertTrue(typeof g2() == "object");
......
......@@ -41,6 +41,7 @@ function strictToBeInlined(n) {
function nonstrictCallStrict(n) {
strictToBeInlined(n);
}
%PrepareFunctionForOptimization(nonstrictCallStrict);
(function testInlineStrictInNonStrict() {
for (var i = 0; i <= MAX; i ++) {
......
......@@ -212,6 +212,7 @@ for (var lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
function f() {
return 'abc'.indexOf('a');
}
%PrepareFunctionForOptimization(f);
assertEquals(0, f());
assertEquals(0, f());
assertEquals(0, f());
......@@ -221,6 +222,7 @@ for (var lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
function f2() {
return 'abc'.indexOf('a', 1);
}
%PrepareFunctionForOptimization(f2);
assertEquals(-1, f2());
assertEquals(-1, f2());
assertEquals(-1, f2());
......@@ -230,6 +232,7 @@ for (var lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
function f3() {
return 'abc'.indexOf('a');
}
%PrepareFunctionForOptimization(f3);
assertEquals(0, f3());
assertEquals(0, f3());
assertEquals(0, f3());
......@@ -239,6 +242,7 @@ for (var lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
function f4() {
return 'abcbc'.indexOf('bc', 2);
}
%PrepareFunctionForOptimization(f4);
assertEquals(3, f4());
assertEquals(3, f4());
assertEquals(3, f4());
......@@ -248,6 +252,7 @@ for (var lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
function f5() {
return 'abcbc'.indexOf('b', -1);
}
%PrepareFunctionForOptimization(f5);
assertEquals(1, f5());
assertEquals(1, f5());
assertEquals(1, f5());
......@@ -257,6 +262,7 @@ for (var lengthIndex = 0; lengthIndex < lengths.length; lengthIndex++) {
function f6() {
return 'abcbc'.indexOf('b', -10737418);
}
%PrepareFunctionForOptimization(f6);
assertEquals(1, f6());
assertEquals(1, f6());
assertEquals(1, f6());
......
......@@ -61,6 +61,7 @@
break;
}
}
%PrepareFunctionForOptimization(f);
function assertResult(r, label, b1, b2, b3) {
f(label, b1, b2, b3);
......
......@@ -50,6 +50,7 @@ float_array[0] = 1e51;
function __f_14159(buffer) {
try { return buffer.getUint16(Infinity, true); } catch(e) { return 0; }
}
%PrepareFunctionForOptimization(__f_14159);
__f_14159(buffer);
%OptimizeFunctionOnNextCall(__f_14159);
__f_14159(buffer);
......@@ -67,6 +68,7 @@ float_array[0] = 1e51;
}
}
}
%PrepareFunctionForOptimization(f);
f();
f();
%OptimizeFunctionOnNextCall(f);
......
......@@ -99,6 +99,7 @@ assertFalse(undetectable === %GetUndetectable());
function test2(a, b) {
return a == b;
}
%PrepareFunctionForOptimization(test2);
test2(0, 1);
test2(undetectable, {});
%OptimizeFunctionOnNextCall(test2);
......
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