Commit 15709b5a authored by Mythri A's avatar Mythri A Committed by Commit Bot

[cleanup] Add %PrepareFunctionForOptimization for few more tests

Bug: v8:8394, v8:8801, v8:9183
Change-Id: Ia5169541ada58bf2bea64e720cae5e5c04617cbd
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1667001
Commit-Queue: Mythri Alle <mythria@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62278}
parent 4fe611ec
......@@ -14,8 +14,13 @@ function nest(body, name, depth) {
body = body + "}"
}
return body.replace(new RegExp("function " + name + "\\(\\) {"),
"function " + name + "_" + x + "() {\n" + header);
// Replace function name
var new_func = body.replace(new RegExp("function " + name + "\\(\\) {"),
"function " + name + "_" + x + "() {\n" + header);
// Replace PrepareForOptimize
return new_func.replace(new RegExp("%PrepareFunctionForOptimization\\(" + name + "\\);"),
"%PrepareFunctionForOptimization(" + name + "_" + x + ");");
}
function test(expected, func, depth) {
......
......@@ -9,7 +9,7 @@ var counter = 111;
function gen(w) { // defeat compiler cache.
var num = counter++;
var Z = [ "", "", "", ];
Z[w] = "%OptimizeOsr()";
Z[w] = "%OptimizeOsr(); %PrepareFunctionForOptimization(f" + num + ")";
var src =
"function f" + num + "(a,b,c) {" +
" var x = 0;" +
......
......@@ -9,7 +9,7 @@ var counter = 188;
function gen(w) { // defeat compiler cache.
var num = counter++;
var Z = [ "", "", "", ];
Z[w] = "%OptimizeOsr()";
Z[w] = "%OptimizeOsr(); %PrepareFunctionForOptimization(f" + num + ")";
var src =
"function f" + num + "(a,b,c) {" +
" var x = 0;" +
......
......@@ -20,6 +20,5 @@ function f(v3) {
};
%PrepareFunctionForOptimization(f);
f(Object);
%PrepareFunctionForOptimization(f);
%OptimizeFunctionOnNextCall(f);
f(Object);
......@@ -9,7 +9,6 @@ function foo(r) {
}
const resolution = Promise.resolve();
%PrepareFunctionForOptimization(foo);
foo(resolution);
function bar() {
......@@ -18,6 +17,7 @@ function bar() {
} catch (e) {}
}
%PrepareFunctionForOptimization(bar);
bar();
bar();
%OptimizeFunctionOnNextCall(bar);
......
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