Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: src/compiler.cc

Issue 2448933002: [compiler] Make SFI "optimize" flag a "tier up" flag (Closed)
Patch Set: Do some renaming and remove a DCHECK Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/builtins/x87/builtins-x87.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler.cc
diff --git a/src/compiler.cc b/src/compiler.cc
index 1ccf5c2a394cb125b09e9c20549dab38d2b662b1..7480a0b35a3348edf1ccbbfea256bc5b6b660d1c 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -634,6 +634,9 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
DCHECK_IMPLIES(ignition_osr, !osr_ast_id.IsNone());
DCHECK_IMPLIES(ignition_osr, FLAG_ignition_osr);
+ // Shared function no longer needs to be tiered up
+ shared->set_marked_for_tier_up(false);
+
// Flag combination --ignition-osr --no-turbo-from-bytecode is unsupported.
if (ignition_osr && !FLAG_turbo_from_bytecode) return MaybeHandle<Code>();
@@ -870,6 +873,9 @@ MaybeHandle<Code> GetBaselineCode(Handle<JSFunction> function) {
ParseInfo parse_info(&zone, handle(function->shared()));
CompilationInfo info(&parse_info, function);
+ // Function no longer needs to be tiered up
+ function->shared()->set_marked_for_tier_up(false);
+
// Reset profiler ticks, function is no longer considered hot.
if (function->shared()->HasBytecodeArray()) {
function->shared()->set_profiler_ticks(0);
@@ -977,21 +983,43 @@ MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) {
return cached_code;
}
- if (function->shared()->was_marked_for_optimization()) {
- DCHECK(FLAG_optimize_shared_functions);
+ if (function->shared()->marked_for_tier_up()) {
+ DCHECK(FLAG_mark_shared_functions_for_tier_up);
- function->shared()->set_was_marked_for_optimization(false);
+ function->shared()->set_marked_for_tier_up(false);
- if (FLAG_trace_opt) {
- PrintF("[optimizing function ");
- function->PrintName();
- PrintF(" eagerly because shared function was previously marked]\n");
- }
+ switch (Compiler::NextCompilationTier(*function)) {
+ case Compiler::BASELINE: {
+ if (FLAG_trace_opt) {
+ PrintF("[recompiling function ");
+ function->ShortPrint();
+ PrintF(
+ " to baseline eagerly (shared function marked for tier up)]\n");
+ }
- Handle<Code> opt_code;
- if (GetOptimizedCode(function, Compiler::NOT_CONCURRENT)
- .ToHandle(&opt_code)) {
- return opt_code;
+ Handle<Code> code;
+ if (!GetBaselineCode(function).ToHandle(&code)) {
+ return code;
+ }
+ break;
+ }
+ case Compiler::OPTIMIZED: {
+ if (FLAG_trace_opt) {
+ PrintF("[optimizing method ");
+ function->ShortPrint();
+ PrintF(" eagerly (shared function marked for tier up)]\n");
+ }
+
+ Handle<Code> code;
+ // TODO(leszeks): Look into performing this compilation concurrently.
+ if (!GetOptimizedCode(function, Compiler::NOT_CONCURRENT)
+ .ToHandle(&code)) {
+ return code;
+ }
+ break;
+ }
+ default:
+ UNREACHABLE();
}
}
« no previous file with comments | « src/builtins/x87/builtins-x87.cc ('k') | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698