Commit 2990658e authored by Ross McIlroy's avatar Ross McIlroy Committed by V8 LUCI CQ

[Tests] Add %OptimizeFunctionForTopTier test function

And use it to remove the set of TurboProp test skips.

BUG=v8:9684,v8:12013

Change-Id: I878e2b9c595449c954735290959d3b38eead5a5b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3043963
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75865}
parent c573dcc8
...@@ -42,6 +42,11 @@ V8_WARN_UNUSED_RESULT Object CrashUnlessFuzzing(Isolate* isolate) { ...@@ -42,6 +42,11 @@ V8_WARN_UNUSED_RESULT Object CrashUnlessFuzzing(Isolate* isolate) {
return ReadOnlyRoots(isolate).undefined_value(); return ReadOnlyRoots(isolate).undefined_value();
} }
V8_WARN_UNUSED_RESULT bool CrashUnlessFuzzingReturnFalse(Isolate* isolate) {
CHECK(FLAG_fuzzing);
return false;
}
// Returns |value| unless correctness-fuzzer-supressions is enabled, // Returns |value| unless correctness-fuzzer-supressions is enabled,
// otherwise returns undefined_value. // otherwise returns undefined_value.
V8_WARN_UNUSED_RESULT Object ReturnFuzzSafe(Object value, Isolate* isolate) { V8_WARN_UNUSED_RESULT Object ReturnFuzzSafe(Object value, Isolate* isolate) {
...@@ -212,42 +217,35 @@ namespace { ...@@ -212,42 +217,35 @@ namespace {
enum class TierupKind { kTierupBytecode, kTierupBytecodeOrMidTier }; enum class TierupKind { kTierupBytecode, kTierupBytecodeOrMidTier };
Object OptimizeFunctionOnNextCall(RuntimeArguments& args, Isolate* isolate, bool CanOptimizeFunction(Handle<JSFunction> function, Isolate* isolate,
TierupKind tierup_kind) { TierupKind tierup_kind,
if (args.length() != 1 && args.length() != 2) { IsCompiledScope* is_compiled_scope) {
return CrashUnlessFuzzing(isolate);
}
CONVERT_ARG_HANDLE_CHECKED(Object, function_object, 0);
if (!function_object->IsJSFunction()) return CrashUnlessFuzzing(isolate);
Handle<JSFunction> function = Handle<JSFunction>::cast(function_object);
// The following conditions were lifted (in part) from the DCHECK inside // The following conditions were lifted (in part) from the DCHECK inside
// JSFunction::MarkForOptimization(). // JSFunction::MarkForOptimization().
if (!function->shared().allows_lazy_compilation()) { if (!function->shared().allows_lazy_compilation()) {
return CrashUnlessFuzzing(isolate); return CrashUnlessFuzzingReturnFalse(isolate);
} }
// If function isn't compiled, compile it now. // If function isn't compiled, compile it now.
IsCompiledScope is_compiled_scope( if (!is_compiled_scope->is_compiled() &&
function->shared().is_compiled_scope(isolate));
if (!is_compiled_scope.is_compiled() &&
!Compiler::Compile(isolate, function, Compiler::CLEAR_EXCEPTION, !Compiler::Compile(isolate, function, Compiler::CLEAR_EXCEPTION,
&is_compiled_scope)) { is_compiled_scope)) {
return CrashUnlessFuzzing(isolate); return CrashUnlessFuzzingReturnFalse(isolate);
} }
if (!FLAG_opt) return ReadOnlyRoots(isolate).undefined_value(); if (!FLAG_opt) return false;
if (function->shared().optimization_disabled() && if (function->shared().optimization_disabled() &&
function->shared().disable_optimization_reason() == function->shared().disable_optimization_reason() ==
BailoutReason::kNeverOptimize) { BailoutReason::kNeverOptimize) {
return CrashUnlessFuzzing(isolate); return CrashUnlessFuzzingReturnFalse(isolate);
} }
#if V8_ENABLE_WEBASSEMBLY #if V8_ENABLE_WEBASSEMBLY
if (function->shared().HasAsmWasmData()) return CrashUnlessFuzzing(isolate); if (function->shared().HasAsmWasmData()) {
return CrashUnlessFuzzingReturnFalse(isolate);
}
#endif // V8_ENABLE_WEBASSEMBLY #endif // V8_ENABLE_WEBASSEMBLY
if (FLAG_testing_d8_test_runner) { if (FLAG_testing_d8_test_runner) {
...@@ -263,6 +261,26 @@ Object OptimizeFunctionOnNextCall(RuntimeArguments& args, Isolate* isolate, ...@@ -263,6 +261,26 @@ Object OptimizeFunctionOnNextCall(RuntimeArguments& args, Isolate* isolate,
if (FLAG_testing_d8_test_runner) { if (FLAG_testing_d8_test_runner) {
PendingOptimizationTable::FunctionWasOptimized(isolate, function); PendingOptimizationTable::FunctionWasOptimized(isolate, function);
} }
return false;
}
return true;
}
Object OptimizeFunctionOnNextCall(RuntimeArguments& args, Isolate* isolate,
TierupKind tierup_kind) {
if (args.length() != 1 && args.length() != 2) {
return CrashUnlessFuzzing(isolate);
}
CONVERT_ARG_HANDLE_CHECKED(Object, function_object, 0);
if (!function_object->IsJSFunction()) return CrashUnlessFuzzing(isolate);
Handle<JSFunction> function = Handle<JSFunction>::cast(function_object);
IsCompiledScope is_compiled_scope(
function->shared().is_compiled_scope(isolate));
if (!CanOptimizeFunction(function, isolate, tierup_kind,
&is_compiled_scope)) {
return ReadOnlyRoots(isolate).undefined_value(); return ReadOnlyRoots(isolate).undefined_value();
} }
...@@ -420,6 +438,32 @@ RUNTIME_FUNCTION(Runtime_PrepareFunctionForOptimization) { ...@@ -420,6 +438,32 @@ RUNTIME_FUNCTION(Runtime_PrepareFunctionForOptimization) {
return ReadOnlyRoots(isolate).undefined_value(); return ReadOnlyRoots(isolate).undefined_value();
} }
RUNTIME_FUNCTION(Runtime_OptimizeFunctionForTopTier) {
// TODO(rmcilroy): Ideally this should be rolled into
// OptimizeFunctionOnNextCall, but there is no way to mark the tier to be
// optimized using the regular optimization marking system.
HandleScope scope(isolate);
if (args.length() != 1) {
return CrashUnlessFuzzing(isolate);
}
CONVERT_ARG_HANDLE_CHECKED(Object, function_object, 0);
if (!function_object->IsJSFunction()) return CrashUnlessFuzzing(isolate);
Handle<JSFunction> function = Handle<JSFunction>::cast(function_object);
IsCompiledScope is_compiled_scope(
function->shared().is_compiled_scope(isolate));
if (!CanOptimizeFunction(function, isolate,
TierupKind::kTierupBytecodeOrMidTier,
&is_compiled_scope)) {
return ReadOnlyRoots(isolate).undefined_value();
}
Compiler::CompileOptimized(isolate, function, ConcurrencyMode::kNotConcurrent,
CodeKindForTopTier());
return ReadOnlyRoots(isolate).undefined_value();
}
RUNTIME_FUNCTION(Runtime_OptimizeOsr) { RUNTIME_FUNCTION(Runtime_OptimizeOsr) {
HandleScope scope(isolate); HandleScope scope(isolate);
DCHECK(args.length() == 0 || args.length() == 1); DCHECK(args.length() == 0 || args.length() == 1);
......
...@@ -531,6 +531,7 @@ namespace internal { ...@@ -531,6 +531,7 @@ namespace internal {
F(NotifyContextDisposed, 0, 1) \ F(NotifyContextDisposed, 0, 1) \
F(OptimizeFunctionOnNextCall, -1, 1) \ F(OptimizeFunctionOnNextCall, -1, 1) \
F(TierupFunctionOnNextCall, -1, 1) \ F(TierupFunctionOnNextCall, -1, 1) \
F(OptimizeFunctionForTopTier, 1, 1) \
F(OptimizeOsr, -1, 1) \ F(OptimizeOsr, -1, 1) \
F(NewRegExpWithBacktrackLimit, 3, 1) \ F(NewRegExpWithBacktrackLimit, 3, 1) \
F(PrepareFunctionForOptimization, -1, 1) \ F(PrepareFunctionForOptimization, -1, 1) \
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
assertFalse(foo()); assertFalse(foo());
assertFalse(foo()); assertFalse(foo());
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertFalse(foo()); assertFalse(foo());
})(); })();
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
assertFalse(foo()); assertFalse(foo());
assertFalse(foo()); assertFalse(foo());
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertFalse(foo()); assertFalse(foo());
})(); })();
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
assertFalse(foo()); assertFalse(foo());
assertFalse(foo()); assertFalse(foo());
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertFalse(foo()); assertFalse(foo());
})(); })();
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
assertFalse(foo()); assertFalse(foo());
assertFalse(foo()); assertFalse(foo());
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertFalse(foo()); assertFalse(foo());
})(); })();
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
assertFalse(foo()); assertFalse(foo());
assertFalse(foo()); assertFalse(foo());
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertFalse(foo()); assertFalse(foo());
})(); })();
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
assertFalse(foo(a)); assertFalse(foo(a));
assertTrue(foo(b)); assertTrue(foo(b));
assertFalse(foo(a)); assertFalse(foo(a));
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertTrue(foo(b)); assertTrue(foo(b));
assertFalse(foo(a)); assertFalse(foo(a));
...@@ -107,7 +107,7 @@ ...@@ -107,7 +107,7 @@
assertFalse(foo(a)); assertFalse(foo(a));
assertTrue(foo(b)); assertTrue(foo(b));
assertFalse(foo(a)); assertFalse(foo(a));
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertTrue(foo(b)); assertTrue(foo(b));
assertFalse(foo(a)); assertFalse(foo(a));
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
assertFalse(foo(a)); assertFalse(foo(a));
assertTrue(foo(b)); assertTrue(foo(b));
assertFalse(foo(a)); assertFalse(foo(a));
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertTrue(foo(b)); assertTrue(foo(b));
assertFalse(foo(a)); assertFalse(foo(a));
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
assertFalse(foo(a)); assertFalse(foo(a));
assertTrue(foo(b)); assertTrue(foo(b));
assertFalse(foo(a)); assertFalse(foo(a));
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertTrue(foo(b)); assertTrue(foo(b));
assertFalse(foo(a)); assertFalse(foo(a));
assertTrue(foo(null)); assertTrue(foo(null));
...@@ -173,7 +173,7 @@ ...@@ -173,7 +173,7 @@
assertFalse(foo(a)); assertFalse(foo(a));
assertTrue(foo(b)); assertTrue(foo(b));
assertFalse(foo(a)); assertFalse(foo(a));
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertTrue(foo(b)); assertTrue(foo(b));
assertFalse(foo(a)); assertFalse(foo(a));
assertTrue(foo(null)); assertTrue(foo(null));
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
assertTrue(sum_js_got_interpreted); assertTrue(sum_js_got_interpreted);
// The protector should be invalidated, which prevents inlining. // The protector should be invalidated, which prevents inlining.
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertEquals('AxB', foo('A', 'B')); assertEquals('AxB', foo('A', 'B'));
assertTrue(sum_js_got_interpreted); assertTrue(sum_js_got_interpreted);
assertOptimized(foo); assertOptimized(foo);
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
assertEquals('AundefinedB', foo('A', 'B')); assertEquals('AundefinedB', foo('A', 'B'));
assertTrue(sum_js_got_interpreted); assertTrue(sum_js_got_interpreted);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertEquals('AundefinedB', foo('A', 'B')); assertEquals('AundefinedB', foo('A', 'B'));
assertFalse(sum_js_got_interpreted); assertFalse(sum_js_got_interpreted);
assertOptimized(foo); assertOptimized(foo);
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
// Now the call will not be inlined. // Now the call will not be inlined.
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertEquals('AxB', foo('A', 'B')); assertEquals('AxB', foo('A', 'B'));
assertTrue(sum_js_got_interpreted); assertTrue(sum_js_got_interpreted);
assertOptimized(foo); assertOptimized(foo);
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
assertTrue(sum_js_got_interpreted); assertTrue(sum_js_got_interpreted);
// Compile function foo; inlines 'sum_js' into 'foo'. // Compile function foo; inlines 'sum_js' into 'foo'.
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertEquals(78, foo(26, 6, 46, null)); assertEquals(78, foo(26, 6, 46, null));
assertOptimized(foo); assertOptimized(foo);
......
...@@ -45,8 +45,8 @@ ...@@ -45,8 +45,8 @@
assertTrue(log_got_interpreted); assertTrue(log_got_interpreted);
// Compile foo. // Compile foo.
%OptimizeFunctionOnNextCall(log); %OptimizeFunctionForTopTier(log);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertEquals(42, foo()); assertEquals(42, foo());
// The call with spread should not have been inlined, because of the // The call with spread should not have been inlined, because of the
// generator/iterator. // generator/iterator.
......
...@@ -45,8 +45,8 @@ ...@@ -45,8 +45,8 @@
assertTrue(log_got_interpreted); assertTrue(log_got_interpreted);
// Compile foo. // Compile foo.
%OptimizeFunctionOnNextCall(log); %OptimizeFunctionForTopTier(log);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertEquals(42, foo()); assertEquals(42, foo());
// The call with spread should not have been inlined, because of the // The call with spread should not have been inlined, because of the
// generator/iterator. // generator/iterator.
......
...@@ -37,8 +37,8 @@ ...@@ -37,8 +37,8 @@
assertTrue(log_got_interpreted); assertTrue(log_got_interpreted);
// Compile foo. // Compile foo.
%OptimizeFunctionOnNextCall(log); %OptimizeFunctionForTopTier(log);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertEquals(1, foo()); assertEquals(1, foo());
// The call with spread should have been inlined. // The call with spread should have been inlined.
assertFalse(log_got_interpreted); assertFalse(log_got_interpreted);
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
// Recompile 'foo'. // Recompile 'foo'.
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertEquals(42, foo()); assertEquals(42, foo());
// The call with spread will not be inlined because we have redefined the // The call with spread will not be inlined because we have redefined the
// array iterator. // array iterator.
......
...@@ -31,7 +31,7 @@ function boom() { ...@@ -31,7 +31,7 @@ function boom() {
foo(); foo();
foo(); foo();
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
foo(); foo();
})(); })();
...@@ -62,6 +62,6 @@ function boom() { ...@@ -62,6 +62,6 @@ function boom() {
foo(); foo();
foo(); foo();
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
foo(); foo();
})(); })();
...@@ -22,5 +22,5 @@ function foo() { return %TurbofanStaticAssert(bar(global)); } ...@@ -22,5 +22,5 @@ function foo() { return %TurbofanStaticAssert(bar(global)); }
bar({gaga() {}}); bar({gaga() {}});
foo(); foo();
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
foo(); foo();
...@@ -22,5 +22,5 @@ function foo(obj) { obj.gaga; %TurbofanStaticAssert(bar(obj)); } ...@@ -22,5 +22,5 @@ function foo(obj) { obj.gaga; %TurbofanStaticAssert(bar(obj)); }
bar({gaga() {}}); bar({gaga() {}});
foo(global); foo(global);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
foo(global); foo(global);
...@@ -12,6 +12,6 @@ function foo(x) { ...@@ -12,6 +12,6 @@ function foo(x) {
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
foo(121); foo(121);
foo(122); foo(122);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
foo(123); foo(123);
})(); })();
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
assertEquals(1, foo()); assertEquals(1, foo());
assertEquals(1, foo()); assertEquals(1, foo());
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertEquals(1, foo()); assertEquals(1, foo());
assertOptimized(foo); assertOptimized(foo);
a.length = 1; a.length = 1;
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
assertEquals(1, foo()); assertEquals(1, foo());
assertEquals(1, foo()); assertEquals(1, foo());
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertEquals(1, foo()); assertEquals(1, foo());
assertOptimized(foo); assertOptimized(foo);
a[0] = 42; a[0] = 42;
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
assertEquals(1, foo()); assertEquals(1, foo());
assertEquals(1, foo()); assertEquals(1, foo());
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertEquals(1, foo()); assertEquals(1, foo());
assertOptimized(foo); assertOptimized(foo);
a[0] = 42; a[0] = 42;
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
assertEquals(1, foo()); assertEquals(1, foo());
assertEquals(1, foo()); assertEquals(1, foo());
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertEquals(1, foo()); assertEquals(1, foo());
assertOptimized(foo); assertOptimized(foo);
a[0] = 42; a[0] = 42;
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
assertEquals(1, foo()); assertEquals(1, foo());
assertEquals(1, foo()); assertEquals(1, foo());
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertEquals(1, foo()); assertEquals(1, foo());
assertOptimized(foo); assertOptimized(foo);
a[0] = 42; a[0] = 42;
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
assertEquals(1, foo()); assertEquals(1, foo());
assertEquals(1, foo()); assertEquals(1, foo());
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertEquals(1, foo()); assertEquals(1, foo());
assertOptimized(foo); assertOptimized(foo);
a[0] = 42; a[0] = 42;
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
assertEquals(1, foo()); assertEquals(1, foo());
assertEquals(1, foo()); assertEquals(1, foo());
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertEquals(1, foo()); assertEquals(1, foo());
assertOptimized(foo); assertOptimized(foo);
a[0] = 42; a[0] = 42;
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
assertEquals(1, foo()); assertEquals(1, foo());
assertEquals(1, foo()); assertEquals(1, foo());
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertEquals(1, foo()); assertEquals(1, foo());
assertOptimized(foo); assertOptimized(foo);
a[0] = 42; a[0] = 42;
......
...@@ -30,5 +30,5 @@ bar({aaaa:1}); ...@@ -30,5 +30,5 @@ bar({aaaa:1});
bar({aaaaa:1}); bar({aaaaa:1});
foo(); foo();
foo(); foo();
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
foo(); foo();
...@@ -26,5 +26,5 @@ bar({aaaa:1}); ...@@ -26,5 +26,5 @@ bar({aaaa:1});
bar({aaaaa:1}); bar({aaaaa:1});
foo(); foo();
foo(); foo();
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
foo(); foo();
...@@ -25,5 +25,5 @@ new class extends C { constructor() { super(); this.c = 1 } } ...@@ -25,5 +25,5 @@ new class extends C { constructor() { super(); this.c = 1 } }
new class extends C { constructor() { super(); this.d = 1 } } new class extends C { constructor() { super(); this.d = 1 } }
foo(); foo();
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
foo(); foo();
...@@ -18,5 +18,5 @@ function foo(cond, v1, v2) { ...@@ -18,5 +18,5 @@ function foo(cond, v1, v2) {
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
foo(1, 10, 20); foo(2, 30, 40); foo(1, 10, 20); foo(2, 30, 40);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
foo(1, 10, 20); foo(2, 30, 40); foo(1, 10, 20); foo(2, 30, 40);
...@@ -13,5 +13,5 @@ function foo() { return %IsBeingInterpreted(); } ...@@ -13,5 +13,5 @@ function foo() { return %IsBeingInterpreted(); }
assertTrue(bar()); assertTrue(bar());
assertTrue(bar()); assertTrue(bar());
%OptimizeFunctionOnNextCall(bar); %OptimizeFunctionForTopTier(bar);
assertFalse(bar()); assertFalse(bar());
...@@ -13,5 +13,5 @@ function foo() { return %IsBeingInterpreted(); } ...@@ -13,5 +13,5 @@ function foo() { return %IsBeingInterpreted(); }
assertTrue(bar()); assertTrue(bar());
assertTrue(bar()); assertTrue(bar());
%OptimizeFunctionOnNextCall(bar); %OptimizeFunctionForTopTier(bar);
assertTrue(bar()); assertTrue(bar());
...@@ -37,5 +37,5 @@ function main() { ...@@ -37,5 +37,5 @@ function main() {
main(); main();
main(); main();
%OptimizeFunctionOnNextCall(main); %OptimizeFunctionForTopTier(main);
main(); main();
...@@ -29,5 +29,5 @@ bar({aaaa:1}); ...@@ -29,5 +29,5 @@ bar({aaaa:1});
bar({aaaaa:1}); bar({aaaaa:1});
foo(); foo();
foo(); foo();
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
foo(); foo();
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
%PrepareFunctionForOptimization(lit_const_smi); %PrepareFunctionForOptimization(lit_const_smi);
lit_const_smi(); lit_const_smi(); lit_const_smi(); lit_const_smi();
%OptimizeFunctionOnNextCall(lit_const_smi); lit_const_smi(); %OptimizeFunctionForTopTier(lit_const_smi); lit_const_smi();
function lit_const_object() { function lit_const_object() {
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
%PrepareFunctionForOptimization(lit_const_object); %PrepareFunctionForOptimization(lit_const_object);
lit_const_object(); lit_const_object(); lit_const_object(); lit_const_object();
%OptimizeFunctionOnNextCall(lit_const_object); lit_const_object(); %OptimizeFunctionForTopTier(lit_const_object); lit_const_object();
function lit_computed_smi(k) { function lit_computed_smi(k) {
...@@ -62,11 +62,11 @@ ...@@ -62,11 +62,11 @@
%PrepareFunctionForOptimization(lit_computed_smi); %PrepareFunctionForOptimization(lit_computed_smi);
lit_computed_smi(1); lit_computed_smi(2); lit_computed_smi(1); lit_computed_smi(2);
%OptimizeFunctionOnNextCall(lit_computed_smi); lit_computed_smi(3); %OptimizeFunctionForTopTier(lit_computed_smi); lit_computed_smi(3);
// TODO(bmeurer): Fix const tracking for double fields in object literals // TODO(bmeurer): Fix const tracking for double fields in object literals
// lit_computed_smi(1.1); lit_computed_smi(2.2); // lit_computed_smi(1.1); lit_computed_smi(2.2);
// %OptimizeFunctionOnNextCall(lit_computed_smi); lit_computed_smi(3.3); // %OptimizeFunctionForTopTier(lit_computed_smi); lit_computed_smi(3.3);
function lit_param_object(k) { function lit_param_object(k) {
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
%PrepareFunctionForOptimization(lit_param_object); %PrepareFunctionForOptimization(lit_param_object);
lit_param_object({x: 1}); lit_param_object({x: 2}); lit_param_object({x: 1}); lit_param_object({x: 2});
%OptimizeFunctionOnNextCall(lit_param_object); lit_param_object({x: 3}); %OptimizeFunctionForTopTier(lit_param_object); lit_param_object({x: 3});
function nested_lit_param(k) { function nested_lit_param(k) {
...@@ -96,11 +96,11 @@ ...@@ -96,11 +96,11 @@
%PrepareFunctionForOptimization(nested_lit_param); %PrepareFunctionForOptimization(nested_lit_param);
nested_lit_param(1); nested_lit_param(2); nested_lit_param(1); nested_lit_param(2);
%OptimizeFunctionOnNextCall(nested_lit_param); nested_lit_param(3); %OptimizeFunctionForTopTier(nested_lit_param); nested_lit_param(3);
// TODO(bmeurer): Fix const tracking for double fields in object literals // TODO(bmeurer): Fix const tracking for double fields in object literals
// nested_lit_param(1.1); nested_lit_param(2.2); // nested_lit_param(1.1); nested_lit_param(2.2);
// %OptimizeFunctionOnNextCall(nested_lit_param); nested_lit_param(3.3); // %OptimizeFunctionForTopTier(nested_lit_param); nested_lit_param(3.3);
function nested_lit_param_object(k) { function nested_lit_param_object(k) {
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
%PrepareFunctionForOptimization(nested_lit_param_object); %PrepareFunctionForOptimization(nested_lit_param_object);
nested_lit_param_object({x: 1}); nested_lit_param_object({x: 2}); nested_lit_param_object({x: 1}); nested_lit_param_object({x: 2});
%OptimizeFunctionOnNextCall(nested_lit_param_object); %OptimizeFunctionForTopTier(nested_lit_param_object);
nested_lit_param_object({x: 3}); nested_lit_param_object({x: 3});
...@@ -138,16 +138,16 @@ ...@@ -138,16 +138,16 @@
%PrepareFunctionForOptimization(inst_param); %PrepareFunctionForOptimization(inst_param);
inst_param(1); inst_param(2); inst_param(1); inst_param(2);
%OptimizeFunctionOnNextCall(inst_param); inst_param(3); %OptimizeFunctionForTopTier(inst_param); inst_param(3);
// TODO(gsps): Reenable once we fully support const field information // TODO(gsps): Reenable once we fully support const field information
// tracking in the presence of pointer compression. // tracking in the presence of pointer compression.
// inst_param(1.1); inst_param(2.2); // inst_param(1.1); inst_param(2.2);
// %OptimizeFunctionOnNextCall(inst_param); inst_param(3.3); // %OptimizeFunctionForTopTier(inst_param); inst_param(3.3);
%PrepareFunctionForOptimization(inst_param); %PrepareFunctionForOptimization(inst_param);
inst_param({x: 1}); inst_param({x: 2}); inst_param({x: 1}); inst_param({x: 2});
%OptimizeFunctionOnNextCall(inst_param); inst_param({x: 3}); %OptimizeFunctionForTopTier(inst_param); inst_param({x: 3});
function inst_computed(k) { function inst_computed(k) {
...@@ -168,9 +168,9 @@ ...@@ -168,9 +168,9 @@
%PrepareFunctionForOptimization(inst_computed); %PrepareFunctionForOptimization(inst_computed);
inst_computed(1); inst_computed(2); inst_computed(1); inst_computed(2);
%OptimizeFunctionOnNextCall(inst_computed); inst_computed(3); %OptimizeFunctionForTopTier(inst_computed); inst_computed(3);
%PrepareFunctionForOptimization(inst_computed); %PrepareFunctionForOptimization(inst_computed);
inst_computed(1.1); inst_computed(2.2); inst_computed(1.1); inst_computed(2.2);
%OptimizeFunctionOnNextCall(inst_computed); inst_computed(3.3); %OptimizeFunctionForTopTier(inst_computed); inst_computed(3.3);
})(); })();
...@@ -22,7 +22,7 @@ function TestFunctionPrototypeApply(x) { ...@@ -22,7 +22,7 @@ function TestFunctionPrototypeApply(x) {
%PrepareFunctionForOptimization(TestFunctionPrototypeApply); %PrepareFunctionForOptimization(TestFunctionPrototypeApply);
assertEquals(TestFunctionPrototypeApply(-13), 13); assertEquals(TestFunctionPrototypeApply(-13), 13);
assertEquals(TestFunctionPrototypeApply(42), 42); assertEquals(TestFunctionPrototypeApply(42), 42);
%OptimizeFunctionOnNextCall(TestFunctionPrototypeApply); %OptimizeFunctionForTopTier(TestFunctionPrototypeApply);
assertEquals(TestFunctionPrototypeApply(-13), 13); assertEquals(TestFunctionPrototypeApply(-13), 13);
assertOptimized(TestFunctionPrototypeApply); assertOptimized(TestFunctionPrototypeApply);
TestFunctionPrototypeApply("abc"); TestFunctionPrototypeApply("abc");
...@@ -39,7 +39,7 @@ function TestFunctionPrototypeApplyReceiver(func, x, y) { ...@@ -39,7 +39,7 @@ function TestFunctionPrototypeApplyReceiver(func, x, y) {
%PrepareFunctionForOptimization(TestFunctionPrototypeApplyReceiver); %PrepareFunctionForOptimization(TestFunctionPrototypeApplyReceiver);
assertEquals(-13, TestFunctionPrototypeApplyReceiver(MathMin, -13, 42)); assertEquals(-13, TestFunctionPrototypeApplyReceiver(MathMin, -13, 42));
assertEquals(-4, TestFunctionPrototypeApplyReceiver(MathMin, 3, -4)); assertEquals(-4, TestFunctionPrototypeApplyReceiver(MathMin, 3, -4));
%OptimizeFunctionOnNextCall(TestFunctionPrototypeApplyReceiver); %OptimizeFunctionForTopTier(TestFunctionPrototypeApplyReceiver);
assertEquals(7, TestFunctionPrototypeApplyReceiver(MathMin, 7, 9)); assertEquals(7, TestFunctionPrototypeApplyReceiver(MathMin, 7, 9));
assertOptimized(TestFunctionPrototypeApplyReceiver); assertOptimized(TestFunctionPrototypeApplyReceiver);
TestFunctionPrototypeApplyReceiver(MathMin, "abc"); TestFunctionPrototypeApplyReceiver(MathMin, "abc");
...@@ -60,14 +60,14 @@ assertUnoptimized(TestFunctionPrototypeApplyReceiver); ...@@ -60,14 +60,14 @@ assertUnoptimized(TestFunctionPrototypeApplyReceiver);
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
%PrepareFunctionForOptimization(test); %PrepareFunctionForOptimization(test);
assertEquals(-13, test(-13, 42)); assertEquals(-13, test(-13, 42));
%OptimizeFunctionOnNextCall(test); %OptimizeFunctionForTopTier(test);
assertEquals(-13, test(-13, 42)); assertEquals(-13, test(-13, 42));
assertOptimized(test); assertOptimized(test);
%PrepareFunctionForOptimization(test); %PrepareFunctionForOptimization(test);
F = Math.max; F = Math.max;
assertEquals(42, test(-13, 42)); assertEquals(42, test(-13, 42));
assertUnoptimized(test); assertUnoptimized(test);
%OptimizeFunctionOnNextCall(test); %OptimizeFunctionForTopTier(test);
assertEquals(42, test(-13, 42)); assertEquals(42, test(-13, 42));
F = Math.min; F = Math.min;
assertEquals(-13, test(-13, 42)); assertEquals(-13, test(-13, 42));
...@@ -82,7 +82,7 @@ function TestFunctionPrototypeCall(x) { ...@@ -82,7 +82,7 @@ function TestFunctionPrototypeCall(x) {
%PrepareFunctionForOptimization(TestFunctionPrototypeCall); %PrepareFunctionForOptimization(TestFunctionPrototypeCall);
TestFunctionPrototypeCall(42); TestFunctionPrototypeCall(42);
TestFunctionPrototypeCall(52); TestFunctionPrototypeCall(52);
%OptimizeFunctionOnNextCall(TestFunctionPrototypeCall); %OptimizeFunctionForTopTier(TestFunctionPrototypeCall);
TestFunctionPrototypeCall(12); TestFunctionPrototypeCall(12);
assertOptimized(TestFunctionPrototypeCall); assertOptimized(TestFunctionPrototypeCall);
TestFunctionPrototypeCall("abc"); TestFunctionPrototypeCall("abc");
...@@ -97,7 +97,7 @@ function TestArrayForEach(x) { ...@@ -97,7 +97,7 @@ function TestArrayForEach(x) {
%PrepareFunctionForOptimization(TestArrayForEach); %PrepareFunctionForOptimization(TestArrayForEach);
TestArrayForEach([1, 3, -4]); TestArrayForEach([1, 3, -4]);
TestArrayForEach([-9, 9, 0]); TestArrayForEach([-9, 9, 0]);
%OptimizeFunctionOnNextCall(TestArrayForEach); %OptimizeFunctionForTopTier(TestArrayForEach);
TestArrayForEach([1, 3, -4]); TestArrayForEach([1, 3, -4]);
assertOptimized(TestArrayForEach); assertOptimized(TestArrayForEach);
TestArrayForEach(["abc", "xy"]); TestArrayForEach(["abc", "xy"]);
...@@ -112,7 +112,7 @@ function TestArrayReduce(x) { ...@@ -112,7 +112,7 @@ function TestArrayReduce(x) {
%PrepareFunctionForOptimization(TestArrayReduce); %PrepareFunctionForOptimization(TestArrayReduce);
assertEquals(TestArrayReduce([1, 2, -3, 4]), -24); assertEquals(TestArrayReduce([1, 2, -3, 4]), -24);
assertEquals(TestArrayReduce([3, 5, 7]), 105); assertEquals(TestArrayReduce([3, 5, 7]), 105);
%OptimizeFunctionOnNextCall(TestArrayReduce); %OptimizeFunctionForTopTier(TestArrayReduce);
assertEquals(TestArrayReduce([1, 2, -3, 4]), -24); assertEquals(TestArrayReduce([1, 2, -3, 4]), -24);
assertOptimized(TestArrayReduce); assertOptimized(TestArrayReduce);
TestArrayReduce(["abc", "xy"]); TestArrayReduce(["abc", "xy"]);
...@@ -127,7 +127,7 @@ function TestArrayReduceRight(x) { ...@@ -127,7 +127,7 @@ function TestArrayReduceRight(x) {
%PrepareFunctionForOptimization(TestArrayReduceRight); %PrepareFunctionForOptimization(TestArrayReduceRight);
assertEquals(TestArrayReduceRight([1, 2, -3, 4]), -24); assertEquals(TestArrayReduceRight([1, 2, -3, 4]), -24);
assertEquals(TestArrayReduceRight([3, 5, 7]), 105); assertEquals(TestArrayReduceRight([3, 5, 7]), 105);
%OptimizeFunctionOnNextCall(TestArrayReduceRight); %OptimizeFunctionForTopTier(TestArrayReduceRight);
assertEquals(TestArrayReduceRight([1, 2, -3, 4]), -24); assertEquals(TestArrayReduceRight([1, 2, -3, 4]), -24);
assertOptimized(TestArrayReduceRight); assertOptimized(TestArrayReduceRight);
TestArrayReduceRight(["abc", "xy"]); TestArrayReduceRight(["abc", "xy"]);
...@@ -142,7 +142,7 @@ function TestArrayMap(x) { ...@@ -142,7 +142,7 @@ function TestArrayMap(x) {
%PrepareFunctionForOptimization(TestArrayMap); %PrepareFunctionForOptimization(TestArrayMap);
assertEquals(TestArrayMap([1, -2, -3, 4]), [1, 2, 3, 4]); assertEquals(TestArrayMap([1, -2, -3, 4]), [1, 2, 3, 4]);
assertEquals(TestArrayMap([5, -5, 5, -5]), [5, 5, 5, 5]); assertEquals(TestArrayMap([5, -5, 5, -5]), [5, 5, 5, 5]);
%OptimizeFunctionOnNextCall(TestArrayMap); %OptimizeFunctionForTopTier(TestArrayMap);
assertEquals(TestArrayMap([1, -2, 3, -4]), [1, 2, 3, 4]); assertEquals(TestArrayMap([1, -2, 3, -4]), [1, 2, 3, 4]);
assertOptimized(TestArrayMap); assertOptimized(TestArrayMap);
TestArrayMap(["abc", "xy"]); TestArrayMap(["abc", "xy"]);
...@@ -157,7 +157,7 @@ function TestArrayFilter(x) { ...@@ -157,7 +157,7 @@ function TestArrayFilter(x) {
%PrepareFunctionForOptimization(TestArrayFilter); %PrepareFunctionForOptimization(TestArrayFilter);
assertEquals(TestArrayFilter([-2, 0, 3, -4]), [-2, 3, -4]); assertEquals(TestArrayFilter([-2, 0, 3, -4]), [-2, 3, -4]);
assertEquals(TestArrayFilter([0, 1, 1, 0]), [1, 1]); assertEquals(TestArrayFilter([0, 1, 1, 0]), [1, 1]);
%OptimizeFunctionOnNextCall(TestArrayFilter); %OptimizeFunctionForTopTier(TestArrayFilter);
assertEquals(TestArrayFilter([-2, 0, 3, -4]), [-2, 3, -4]); assertEquals(TestArrayFilter([-2, 0, 3, -4]), [-2, 3, -4]);
assertOptimized(TestArrayFilter); assertOptimized(TestArrayFilter);
TestArrayFilter(["abc", "xy"]); TestArrayFilter(["abc", "xy"]);
...@@ -172,7 +172,7 @@ function TestArrayFind(x) { ...@@ -172,7 +172,7 @@ function TestArrayFind(x) {
%PrepareFunctionForOptimization(TestArrayFind); %PrepareFunctionForOptimization(TestArrayFind);
assertEquals(TestArrayFind([0, 0, -3, 12]), -3); assertEquals(TestArrayFind([0, 0, -3, 12]), -3);
assertEquals(TestArrayFind([0, -18]), -18); assertEquals(TestArrayFind([0, -18]), -18);
%OptimizeFunctionOnNextCall(TestArrayFind); %OptimizeFunctionForTopTier(TestArrayFind);
assertEquals(TestArrayFind([0, 0, -3, 12]), -3); assertEquals(TestArrayFind([0, 0, -3, 12]), -3);
assertOptimized(TestArrayFind); assertOptimized(TestArrayFind);
TestArrayFind(["", "abc", "xy"]); TestArrayFind(["", "abc", "xy"]);
...@@ -187,7 +187,7 @@ function TestArrayFindIndex(x) { ...@@ -187,7 +187,7 @@ function TestArrayFindIndex(x) {
%PrepareFunctionForOptimization(TestArrayFindIndex); %PrepareFunctionForOptimization(TestArrayFindIndex);
assertEquals(TestArrayFindIndex([0, 0, -3, 12]), 2); assertEquals(TestArrayFindIndex([0, 0, -3, 12]), 2);
assertEquals(TestArrayFindIndex([0, -18]), 1); assertEquals(TestArrayFindIndex([0, -18]), 1);
%OptimizeFunctionOnNextCall(TestArrayFindIndex); %OptimizeFunctionForTopTier(TestArrayFindIndex);
assertEquals(TestArrayFindIndex([0, 0, -3, 12]), 2); assertEquals(TestArrayFindIndex([0, 0, -3, 12]), 2);
assertOptimized(TestArrayFindIndex); assertOptimized(TestArrayFindIndex);
TestArrayFindIndex(["", "abc", "xy"]); TestArrayFindIndex(["", "abc", "xy"]);
...@@ -202,7 +202,7 @@ function TestArrayEvery(x) { ...@@ -202,7 +202,7 @@ function TestArrayEvery(x) {
%PrepareFunctionForOptimization(TestArrayEvery); %PrepareFunctionForOptimization(TestArrayEvery);
assertEquals(TestArrayEvery([3, 0, -9]), false); assertEquals(TestArrayEvery([3, 0, -9]), false);
assertEquals(TestArrayEvery([2, 12, -1]), true); assertEquals(TestArrayEvery([2, 12, -1]), true);
%OptimizeFunctionOnNextCall(TestArrayEvery); %OptimizeFunctionForTopTier(TestArrayEvery);
assertEquals(TestArrayEvery([3, 0, -9]), false); assertEquals(TestArrayEvery([3, 0, -9]), false);
assertOptimized(TestArrayEvery); assertOptimized(TestArrayEvery);
TestArrayEvery(["abc", "xy"]); TestArrayEvery(["abc", "xy"]);
...@@ -217,7 +217,7 @@ function TestArraySome(x) { ...@@ -217,7 +217,7 @@ function TestArraySome(x) {
%PrepareFunctionForOptimization(TestArraySome); %PrepareFunctionForOptimization(TestArraySome);
assertEquals(TestArraySome([3, 0, -9]), true); assertEquals(TestArraySome([3, 0, -9]), true);
assertEquals(TestArraySome([0, 0]), false); assertEquals(TestArraySome([0, 0]), false);
%OptimizeFunctionOnNextCall(TestArraySome); %OptimizeFunctionForTopTier(TestArraySome);
assertEquals(TestArraySome([3, 0, -9]), true); assertEquals(TestArraySome([3, 0, -9]), true);
assertOptimized(TestArraySome); assertOptimized(TestArraySome);
TestArraySome(["abc", "xy"]); TestArraySome(["abc", "xy"]);
...@@ -233,7 +233,7 @@ function TestJSCallWithJSFunction(x) { ...@@ -233,7 +233,7 @@ function TestJSCallWithJSFunction(x) {
%PrepareFunctionForOptimization(TestJSCallWithJSFunction); %PrepareFunctionForOptimization(TestJSCallWithJSFunction);
assertEquals(TestJSCallWithJSFunction(-14), 42); assertEquals(TestJSCallWithJSFunction(-14), 42);
assertEquals(TestJSCallWithJSFunction(14), -42); assertEquals(TestJSCallWithJSFunction(14), -42);
%OptimizeFunctionOnNextCall(TestJSCallWithJSFunction); %OptimizeFunctionForTopTier(TestJSCallWithJSFunction);
assertEquals(TestJSCallWithJSFunction(-14), 42); assertEquals(TestJSCallWithJSFunction(-14), 42);
assertOptimized(TestJSCallWithJSFunction); assertOptimized(TestJSCallWithJSFunction);
TestJSCallWithJSFunction("abc"); TestJSCallWithJSFunction("abc");
...@@ -248,7 +248,7 @@ function TestJSCallWithJSBoundFunction(x) { ...@@ -248,7 +248,7 @@ function TestJSCallWithJSBoundFunction(x) {
%PrepareFunctionForOptimization(TestJSCallWithJSBoundFunction); %PrepareFunctionForOptimization(TestJSCallWithJSBoundFunction);
assertEquals(TestJSCallWithJSBoundFunction(-14), 42); assertEquals(TestJSCallWithJSBoundFunction(-14), 42);
assertEquals(TestJSCallWithJSBoundFunction(14), -42); assertEquals(TestJSCallWithJSBoundFunction(14), -42);
%OptimizeFunctionOnNextCall(TestJSCallWithJSBoundFunction); %OptimizeFunctionForTopTier(TestJSCallWithJSBoundFunction);
assertEquals(TestJSCallWithJSBoundFunction(-14), 42); assertEquals(TestJSCallWithJSBoundFunction(-14), 42);
assertOptimized(TestJSCallWithJSBoundFunction); assertOptimized(TestJSCallWithJSBoundFunction);
TestJSCallWithJSBoundFunction("abc"); TestJSCallWithJSBoundFunction("abc");
...@@ -268,7 +268,7 @@ function TestReflectApply(x) { ...@@ -268,7 +268,7 @@ function TestReflectApply(x) {
%PrepareFunctionForOptimization(TestReflectApply); %PrepareFunctionForOptimization(TestReflectApply);
assertEquals(TestReflectApply(-9), 9); assertEquals(TestReflectApply(-9), 9);
assertEquals(TestReflectApply(7), 7); assertEquals(TestReflectApply(7), 7);
%OptimizeFunctionOnNextCall(TestReflectApply); %OptimizeFunctionForTopTier(TestReflectApply);
assertEquals(TestReflectApply(-9), 9); assertEquals(TestReflectApply(-9), 9);
assertOptimized(TestReflectApply); assertOptimized(TestReflectApply);
TestReflectApply("abc"); TestReflectApply("abc");
...@@ -288,7 +288,7 @@ function TestCallWithSpread(x) { ...@@ -288,7 +288,7 @@ function TestCallWithSpread(x) {
%PrepareFunctionForOptimization(TestCallWithSpread); %PrepareFunctionForOptimization(TestCallWithSpread);
assertEquals(TestCallWithSpread(-13), 169); assertEquals(TestCallWithSpread(-13), 169);
assertEquals(TestCallWithSpread(7), 49); assertEquals(TestCallWithSpread(7), 49);
%OptimizeFunctionOnNextCall(TestCallWithSpread); %OptimizeFunctionForTopTier(TestCallWithSpread);
assertEquals(TestCallWithSpread(-13), 169); assertEquals(TestCallWithSpread(-13), 169);
assertOptimized(TestCallWithSpread); assertOptimized(TestCallWithSpread);
TestCallWithSpread("abc"); TestCallWithSpread("abc");
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), Promise); assertInstanceof(foo(), Promise);
assertInstanceof(foo(), Promise); assertInstanceof(foo(), Promise);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertInstanceof(foo(), Promise); assertInstanceof(foo(), Promise);
assertOptimized(foo); assertOptimized(foo);
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
assertInstanceof(foo(), Promise); assertInstanceof(foo(), Promise);
assertInstanceof(foo(), Promise); assertInstanceof(foo(), Promise);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertInstanceof(foo(), Promise); assertInstanceof(foo(), Promise);
assertOptimized(foo); assertOptimized(foo);
......
...@@ -45,7 +45,7 @@ assertOptimized(bar); ...@@ -45,7 +45,7 @@ assertOptimized(bar);
// Instead we trigger optimization of foo, which will inline bar (this time // Instead we trigger optimization of foo, which will inline bar (this time
// based on the new PACKED_ELEMENTS map. // based on the new PACKED_ELEMENTS map.
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
foo(a); foo(a);
assertOptimized(foo); assertOptimized(foo);
%PrepareFunctionForOptimization(foo); %PrepareFunctionForOptimization(foo);
...@@ -61,6 +61,6 @@ assertOptimized(bar); ...@@ -61,6 +61,6 @@ assertOptimized(bar);
// Now ensure there is no deopt-loop. There used to be a deopt-loop because, as // Now ensure there is no deopt-loop. There used to be a deopt-loop because, as
// a result of over-eager checkpoint elimination, we used to deopt into foo // a result of over-eager checkpoint elimination, we used to deopt into foo
// (right before the call to bar) rather than into bar (right before the load). // (right before the call to bar) rather than into bar (right before the load).
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
foo(b); foo(b);
assertOptimized(foo); assertOptimized(foo);
...@@ -33,7 +33,7 @@ foo(a); ...@@ -33,7 +33,7 @@ foo(a);
foo(a); foo(a);
// Trigger optimization of bar, based on PACKED_SMI_ELEMENTS feedback. // Trigger optimization of bar, based on PACKED_SMI_ELEMENTS feedback.
%OptimizeFunctionOnNextCall(bar); %OptimizeFunctionForTopTier(bar);
bar(a); bar(a);
assertOptimized(bar); assertOptimized(bar);
%PrepareFunctionForOptimization(bar); %PrepareFunctionForOptimization(bar);
...@@ -49,7 +49,7 @@ assertOptimized(bar); ...@@ -49,7 +49,7 @@ assertOptimized(bar);
// Instead we trigger optimization of foo, which will inline bar (this time // Instead we trigger optimization of foo, which will inline bar (this time
// based on the new PACKED_ELEMENTS map. // based on the new PACKED_ELEMENTS map.
assertOptimized(bar); assertOptimized(bar);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
assertOptimized(bar); assertOptimized(bar);
foo(a); foo(a);
assertOptimized(bar); assertOptimized(bar);
...@@ -66,6 +66,6 @@ assertOptimized(bar); ...@@ -66,6 +66,6 @@ assertOptimized(bar);
// Now ensure there is no deopt-loop. There used to be a deopt-loop because, as // Now ensure there is no deopt-loop. There used to be a deopt-loop because, as
// a result of over-eager checkpoint elimination, we used to deopt into foo // a result of over-eager checkpoint elimination, we used to deopt into foo
// (right before the call to bar) rather than into bar (right before the load). // (right before the call to bar) rather than into bar (right before the load).
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
foo(b); foo(b);
assertOptimized(foo); assertOptimized(foo);
...@@ -37,6 +37,6 @@ function foo() { ...@@ -37,6 +37,6 @@ function foo() {
foo(); foo();
foo(); foo();
%OptimizeFunctionOnNextCall(foo);
expect_interpreted = false; expect_interpreted = false;
%OptimizeFunctionForTopTier(foo);
foo(); foo();
...@@ -23,5 +23,5 @@ function bar() { ...@@ -23,5 +23,5 @@ function bar() {
%PrepareFunctionForOptimization(apply); %PrepareFunctionForOptimization(apply);
assertTrue(bar()); assertTrue(bar());
assertTrue(bar()); assertTrue(bar());
%OptimizeFunctionOnNextCall(bar); %OptimizeFunctionForTopTier(bar);
assertFalse(bar()); assertFalse(bar());
...@@ -23,5 +23,5 @@ function bar() { ...@@ -23,5 +23,5 @@ function bar() {
%PrepareFunctionForOptimization(call); %PrepareFunctionForOptimization(call);
assertTrue(bar()); assertTrue(bar());
assertTrue(bar()); assertTrue(bar());
%OptimizeFunctionOnNextCall(bar); %OptimizeFunctionForTopTier(bar);
assertFalse(bar()); assertFalse(bar());
...@@ -39,5 +39,5 @@ assertTrue(main(true, true)); ...@@ -39,5 +39,5 @@ assertTrue(main(true, true));
assertTrue(main(true, true)); assertTrue(main(true, true));
assertTrue(main(false, true)); assertTrue(main(false, true));
assertTrue(main(false, true)); assertTrue(main(false, true));
%OptimizeFunctionOnNextCall(main); %OptimizeFunctionForTopTier(main);
assertFalse(main(false)); assertFalse(main(false));
...@@ -37,5 +37,5 @@ assertTrue(main(true, true)); ...@@ -37,5 +37,5 @@ assertTrue(main(true, true));
assertTrue(main(true, true)); assertTrue(main(true, true));
assertTrue(main(false, true)); assertTrue(main(false, true));
assertTrue(main(false, true)); assertTrue(main(false, true));
%OptimizeFunctionOnNextCall(main); %OptimizeFunctionForTopTier(main);
assertFalse(main(false)); assertFalse(main(false));
...@@ -23,5 +23,5 @@ bar({bla: 1}); ...@@ -23,5 +23,5 @@ bar({bla: 1});
bar({blu: 1}); bar({blu: 1});
bar({blo: 1}); bar({blo: 1});
foo(obj); foo(obj);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
foo(obj); foo(obj);
...@@ -28,5 +28,5 @@ bar({bla: 1}); ...@@ -28,5 +28,5 @@ bar({bla: 1});
bar({blu: 1}); bar({blu: 1});
bar({blo: 1}); bar({blo: 1});
foo(obj); foo(obj);
%OptimizeFunctionOnNextCall(foo); %OptimizeFunctionForTopTier(foo);
foo(obj); foo(obj);
...@@ -54,6 +54,6 @@ var g = new G; ...@@ -54,6 +54,6 @@ var g = new G;
foo(); foo();
foo(); foo();
%OptimizeFunctionOnNextCall(foo);
expect_interpreted = false; expect_interpreted = false;
%OptimizeFunctionForTopTier(foo);
foo(); foo();
...@@ -1278,45 +1278,6 @@ ...@@ -1278,45 +1278,6 @@
'regress/regress-crbug-1104608': [SKIP], 'regress/regress-crbug-1104608': [SKIP],
}], }],
##############################################################################
['variant == turboprop or variant == turboprop_as_toptier or variant == future or deopt_fuzzer or (tsan and not concurrent_marking)', {
# # Deopts differently than TurboFan.
'compiler/regress-9945-*': [SKIP],
# Static asserts for optimizations don't hold due to removed optimization
# phases.
'compiler/concurrent-inlining-1': [SKIP],
'compiler/concurrent-inlining-2': [SKIP],
'compiler/constant-fold-add-static': [SKIP],
'compiler/diamond-followedby-branch': [SKIP],
'compiler/is-being-interpreted-*': [SKIP],
'compiler/load-elimination-const-field': [SKIP],
'compiler/serializer-accessors': [SKIP],
'compiler/serializer-apply': [SKIP],
'compiler/serializer-call': [SKIP],
'compiler/serializer-dead-after-jump': [SKIP],
'compiler/serializer-dead-after-return': [SKIP],
'compiler/serializer-feedback-propagation-*': [SKIP],
'compiler/serializer-transition-propagation': [SKIP],
# Some tests rely on TurboFan inlining heuristics.
'compiler/call-with-arraylike-or-spread*': [SKIP],
'compiler/opt-higher-order-functions': [SKIP],
# Tests failing for the lack of function context specialization in Turboprop.
'compiler/abstract-equal-receiver': [SKIP],
'compiler/constant-fold-cow-array': [SKIP],
'compiler/promise-resolve-stable-maps': [SKIP],
# Tests failing due to reduced constant propagation in Turboprop.
'compiler/js-create-arguments': [SKIP],
'compiler/catch-block-load': [SKIP],
'compiler/construct-bound-function': [SKIP],
'compiler/construct-object': [SKIP],
'compiler/construct-receiver': [SKIP],
'compiler/js-create': [SKIP],
}], # variant == turboprop or variant = turboprop_as_toptier
############################################################################## ##############################################################################
['variant == top_level_await', { ['variant == top_level_await', {
# specifically expects to fail on top level await. # specifically expects to fail on top level await.
......
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