Commit c445e1e9 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[Compiler] Remove EnsureBaseline.

We only optimize functions which are already compiled, so there is no need
to ensure baseline in pipeline.cc, and since ast-graph-builder doesn't
do inlining, there are no other uses.

BUG=v8:5203, v8:6409

Change-Id: I830c8868d50363f61193a96d9a5774e059a1af0e
Reviewed-on: https://chromium-review.googlesource.com/570033
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46649}
parent 632221ac
......@@ -1289,29 +1289,6 @@ bool Compiler::EnsureBytecode(CompilationInfo* info) {
return info->shared_info()->HasBytecodeArray();
}
// TODO(turbofan): In the future, unoptimized code with deopt support could
// be generated lazily once deopt is triggered.
bool Compiler::EnsureBaselineCode(CompilationInfo* info) {
DCHECK_NOT_NULL(info->literal());
DCHECK_NOT_NULL(info->scope());
Handle<SharedFunctionInfo> shared = info->shared_info();
if (!shared->HasBaselineCode()) {
// Don't generate full-codegen code for functions which should use Ignition.
if (!ShouldUseFullCodegen(shared)) return false;
DCHECK(!shared->must_use_ignition());
DCHECK(!IsResumableFunction(shared->kind()));
Zone compile_zone(info->isolate()->allocator(), ZONE_NAME);
CompilationInfo unoptimized(&compile_zone, info->parse_info(),
info->isolate(), info->closure());
DCHECK(ShouldUseFullCodegen(&unoptimized));
GenerateUnoptimizedCode(&unoptimized);
}
return true;
}
MaybeHandle<JSFunction> Compiler::GetFunctionFromEval(
Handle<String> source, Handle<SharedFunctionInfo> outer_info,
Handle<Context> context, LanguageMode language_mode,
......
......@@ -78,8 +78,6 @@ class V8_EXPORT_PRIVATE Compiler : public AllStatic {
// Convenience function
static bool Analyze(CompilationInfo* info,
EagerInnerFunctionLiterals* eager_literals = nullptr);
// Ensure that baseline code is generated, requires ParseAndAnalyze.
static bool EnsureBaselineCode(CompilationInfo* info);
// Ensures that bytecode is generated, calls ParseAndAnalyze internally.
static bool EnsureBytecode(CompilationInfo* info);
......
......@@ -648,6 +648,9 @@ PipelineCompilationJob::Status PipelineCompilationJob::PrepareJobImpl() {
}
if (info()->is_optimizing_from_bytecode()) {
info()->MarkAsDeoptimizationEnabled();
if (FLAG_turbo_inlining) {
info()->MarkAsInliningEnabled();
}
if (FLAG_inline_accessors) {
info()->MarkAsAccessorInliningEnabled();
}
......@@ -655,10 +658,6 @@ PipelineCompilationJob::Status PipelineCompilationJob::PrepareJobImpl() {
isolate()->heap()->one_closure_cell_map()) {
info()->MarkAsFunctionContextSpecializing();
}
}
if (!info()->is_optimizing_from_bytecode()) {
if (!Compiler::EnsureBaselineCode(info())) return FAILED;
} else if (FLAG_turbo_inlining) {
info()->MarkAsInliningEnabled();
}
......
......@@ -179,7 +179,6 @@ Handle<JSFunction> FunctionTester::Compile(Handle<JSFunction> function) {
info.MarkAsOptimizeFromBytecode();
} else {
CHECK(Compiler::ParseAndAnalyze(&info));
CHECK(Compiler::EnsureBaselineCode(&info));
}
JSFunction::EnsureLiterals(function);
......
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