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

Unified Diff: src/compiler.cc

Issue 2684033007: Allow a ParseInfo without a script for %SetCode users (Closed)
Patch Set: nit Created 3 years, 10 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 | src/compiler/pipeline.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 6292d65a8604c5abd32e46425e13e5eb623b6dd2..e2cd16ae29c27c43caf494fc9d34551d6f016f6e 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -348,10 +348,8 @@ bool UseTurboFan(Handle<SharedFunctionInfo> shared) {
passes_turbo_filter;
}
-bool ShouldUseIgnition(CompilationInfo* info) {
- DCHECK(info->has_shared_info());
- Handle<SharedFunctionInfo> shared = info->shared_info();
-
+bool ShouldUseIgnition(Handle<SharedFunctionInfo> shared,
+ bool marked_as_debug) {
// Code which can't be supported by the old pipeline should use Ignition.
if (shared->must_use_ignition_turbo()) return true;
@@ -370,7 +368,7 @@ bool ShouldUseIgnition(CompilationInfo* info) {
// When requesting debug code as a replacement for existing code, we provide
// the same kind as the existing code (to prevent implicit tier-change).
- if (info->is_debug() && shared->is_compiled()) {
+ if (marked_as_debug && shared->is_compiled()) {
return !shared->HasBaselineCode();
}
@@ -381,6 +379,11 @@ bool ShouldUseIgnition(CompilationInfo* info) {
return FLAG_ignition;
}
+bool ShouldUseIgnition(CompilationInfo* info) {
+ DCHECK(info->has_shared_info());
+ return ShouldUseIgnition(info->shared_info(), info->is_debug());
+}
+
bool UseAsmWasm(DeclarationScope* scope, Handle<SharedFunctionInfo> shared_info,
bool is_debug) {
return FLAG_validate_asm && scope->asm_module() &&
@@ -845,8 +848,12 @@ MaybeHandle<Code> GetOptimizedCode(Handle<JSFunction> function,
DCHECK(!isolate->has_pending_exception());
PostponeInterruptsScope postpone(isolate);
bool use_turbofan = UseTurboFan(shared) || ignition_osr;
+ bool has_script = shared->script()->IsScript();
+ // BUG(5946): This DCHECK is necessary to make certain that we won't tolerate
+ // the lack of a script without bytecode.
+ DCHECK_IMPLIES(!has_script, ShouldUseIgnition(shared, false));
std::unique_ptr<CompilationJob> job(
- use_turbofan ? compiler::Pipeline::NewCompilationJob(function)
+ use_turbofan ? compiler::Pipeline::NewCompilationJob(function, has_script)
: new HCompilationJob(function));
CompilationInfo* info = job->info();
ParseInfo* parse_info = info->parse_info();
@@ -1069,17 +1076,10 @@ MaybeHandle<Code> GetLazyCode(Handle<JSFunction> function) {
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> code;
- if (GetBaselineCode(function).ToHandle(&code)) {
- return code;
- }
+ // We don't try to handle baseline here because GetBaselineCode()
+ // doesn't handle top-level code. We aren't supporting
+ // the hybrid pipeline going forward (where Ignition is a first
+ // tier followed by full-code).
break;
}
case Compiler::OPTIMIZED: {
« no previous file with comments | « no previous file | src/compiler/pipeline.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698