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

Unified Diff: src/compiler.cc

Issue 2341663002: [compiler] Fix confusion about OSR BailoutId semantics. (Closed)
Patch Set: Fix typo. Created 4 years, 3 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 | « no previous file | test/mjsunit/regress/regress-5380.js » ('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 bdddfd35465f9d781c232b5fb5ab38604ccaf17b..b3c9df1c825ac954ad0e547c503b8c55785ab567 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -692,6 +692,7 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
// TurboFan can optimize directly from existing bytecode.
if (FLAG_turbo_from_bytecode && use_turbofan && ShouldUseIgnition(info)) {
+ if (info->is_osr() && !ignition_osr) return MaybeHandle<Code>();
if (!Compiler::EnsureBytecode(info)) {
if (isolate->has_pending_exception()) isolate->clear_pending_exception();
return MaybeHandle<Code>();
@@ -707,6 +708,16 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
parse_info->set_lazy(false);
}
+ // Verify that OSR compilations are delegated to the correct graph builder.
+ // Depending on the underlying frame the semantics of the {BailoutId} differ
+ // and the various graph builders hard-code a certain semantic:
+ // - Interpreter : The BailoutId represents a bytecode offset.
+ // - FullCodegen : The BailoutId represents the id of an AST node.
+ DCHECK_IMPLIES(info->is_osr() && ignition_osr,
+ info->is_optimizing_from_bytecode());
+ DCHECK_IMPLIES(info->is_osr() && !ignition_osr,
+ !info->is_optimizing_from_bytecode());
+
// In case of concurrent recompilation, all handles below this point will be
// allocated in a deferred handle scope that is detached and handed off to
// the background thread when we return.
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-5380.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698