Commit 054af847 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[cleanup] Add PrepareFunctionForOptimization to regression tests

R=mythria@chromium.org

Bug: v8:9183
Change-Id: Id7c29452ef6d643b59eb3252df188bf288e2de23
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1660469Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#62168}
parent 0d894585
......@@ -40,6 +40,7 @@ function f(n, x, b) {
}
return sum;
}
%PrepareFunctionForOptimization(f);
f(10, o3);
f(20, o3);
......
......@@ -27,6 +27,7 @@ function dummy() {
(function () {
var o = {c: 10};
var f1 = get_closure2();
%PrepareFunctionForOptimization(f1);
f1(o);
f1(o);
%OptimizeFunctionOnNextCall(f1);
......@@ -38,6 +39,7 @@ var o = new Ctor();
function opt() {
(function () {
var f1 = get_closure();
%PrepareFunctionForOptimization(f1);
f1(new Ctor());
f1(new Ctor());
%OptimizeFunctionOnNextCall(f1);
......
......@@ -81,6 +81,7 @@ function __f_0(o) {
assertTrue(false);
}
}
%PrepareFunctionForOptimization(__f_0);
__v_4 = {};
__v_4.size = function() { return 42; }
__v_4.g = function() { return this.size(); };
......
......@@ -47,6 +47,7 @@ function __f_5(fun,a,b) {
}
function __f_8(a,b) { return a%b };
%PrepareFunctionForOptimization(__f_8);
__f_5(__f_8, 1 << 30, 1);
__f_5(__f_8, 1, 1 << 30);
......
......@@ -14,6 +14,7 @@ function foo() {
f(function() { x = i; });
}
}
%PrepareFunctionForOptimization(foo);
foo();
%OptimizeFunctionOnNextCall(foo);
......
......@@ -29,6 +29,7 @@ var foo = (function () {
return method.apply(receiver, arguments);
}
})();
%PrepareFunctionForOptimization(foo);
foo("a", "b", "c");
foo("a", "b", "c");
......
......@@ -14,6 +14,7 @@ function f(t) {
}
return result.join('');
}
%PrepareFunctionForOptimization(f);
var t = {a: "1", b: "2"};
assertEquals("aa11ab12ba21bb22", f(t));
......
......@@ -15,6 +15,7 @@ function foo(c) {
for (var p in c) { s++; }
return s;
}
%PrepareFunctionForOptimization(foo);
assertEquals(2, foo(a));
assertEquals(1, foo(b));
......
......@@ -12,6 +12,7 @@ function foo(a, c){
}
}
};
%PrepareFunctionForOptimization(foo);
c = {
"one" : { x : 1},
......
......@@ -10,6 +10,7 @@ var a = [];
Object.defineProperty(a, "0", {configurable: false, value: 10});
assertEquals(1, a.length);
var setter = ()=>{ a.length = 0; };
%PrepareFunctionForOptimization(setter);
assertThrows(setter);
assertThrows(setter);
%OptimizeFunctionOnNextCall(setter);
......
......@@ -33,5 +33,6 @@ function foo() {
}
// Test passing null or undefined as receiver.
function g() { return foo.apply(null, x()++); }
%PrepareFunctionForOptimization(g);
%OptimizeFunctionOnNextCall(g);
assertThrows(g);
......@@ -9,6 +9,7 @@ var f = (function() {
var max = Math.max;
return function f() { return max(0, -1); };
})();
%PrepareFunctionForOptimization(f);
assertEquals(0, f());
%OptimizeFunctionOnNextCall(f);
......
......@@ -14,6 +14,7 @@ function test_hole_check_for_let(a) {
}
}
}
%PrepareFunctionForOptimization(test_hole_check_for_let);
assertDoesNotThrow("test_hole_check_for_let(0)");
assertThrows("test_hole_check_for_let(1)", ReferenceError);
%OptimizeFunctionOnNextCall(test_hole_check_for_let)
......@@ -29,6 +30,7 @@ function test_hole_check_for_const(a) {
}
}
}
%PrepareFunctionForOptimization(test_hole_check_for_const);
assertThrows("test_hole_check_for_const(0)", TypeError);
assertThrows("test_hole_check_for_const(1)", ReferenceError);
%OptimizeFunctionOnNextCall(test_hole_check_for_const)
......
......@@ -5,6 +5,7 @@
// Flags: --allow-natives-syntax
function runNearStackLimit(f) { function t() { try { t(); } catch(e) { f(); } }; try { t(); } catch(e) {} }
%PrepareFunctionForOptimization(__f_3);
%OptimizeFunctionOnNextCall(__f_3);
function __f_3() {
var __v_5 = a[0];
......
......@@ -19,6 +19,7 @@ function foo() {
bar();
}
}
%PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo);
......
......@@ -13,6 +13,7 @@ class B {
class C extends B {
bar() { return super[%DeoptimizeFunction(C.prototype.bar), "foo"]() }
}
%PrepareFunctionForOptimization(C.prototype.bar);
assertEquals(23, new C().bar());
assertEquals(23, new C().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