[compiler] Ship Ignition for all TurboFan code.
This enables Ignition unconditionally for all code that is destined for optimization with TurboFan. This ensures all optimization attempts will go through the BytecodeGraphBuilder and that the AstGraphBuilder pipe is dried out in practice. R=mvstanton@chromium.org Review-Url: https://chromiumcodereview.appspot.com/2427953002 Cr-Commit-Position: refs/heads/master@{#40462}
This commit is contained in:
parent
e75d6885cd
commit
20d29ff036
@ -2258,11 +2258,10 @@ MaybeLocal<Script> ScriptCompiler::Compile(Local<Context> context,
|
||||
source->info->set_script(script);
|
||||
|
||||
{
|
||||
// Create a canonical handle scope if compiling ignition bytecode. This is
|
||||
// Create a canonical handle scope for compiling Ignition bytecode. This is
|
||||
// required by the constant array builder to de-duplicate objects without
|
||||
// dereferencing handles.
|
||||
std::unique_ptr<i::CanonicalHandleScope> canonical;
|
||||
if (i::FLAG_ignition) canonical.reset(new i::CanonicalHandleScope(isolate));
|
||||
i::CanonicalHandleScope canonical(isolate);
|
||||
|
||||
// Do the parsing tasks which need to be done on the main thread. This will
|
||||
// also handle parse errors.
|
||||
|
@ -4061,7 +4061,7 @@ bool Genesis::InstallExtensions(Handle<Context> native_context,
|
||||
InstallExtension(isolate, "v8/statistics", &extension_states)) &&
|
||||
(!FLAG_expose_trigger_failure ||
|
||||
InstallExtension(isolate, "v8/trigger-failure", &extension_states)) &&
|
||||
(!(FLAG_ignition && FLAG_trace_ignition_dispatches) ||
|
||||
(!FLAG_trace_ignition_dispatches ||
|
||||
InstallExtension(isolate, "v8/ignition-statistics",
|
||||
&extension_states)) &&
|
||||
InstallRequestedExtensions(isolate, extensions, &extension_states);
|
||||
|
@ -151,11 +151,10 @@ bool CompilerDispatcherJob::FinalizeParsingOnMainThread() {
|
||||
parse_info_->set_shared_info(shared_);
|
||||
|
||||
{
|
||||
// Create a canonical handle scope if compiling ignition bytecode. This is
|
||||
// required by the constant array builder to de-duplicate objects without
|
||||
// dereferencing handles.
|
||||
std::unique_ptr<CanonicalHandleScope> canonical;
|
||||
if (FLAG_ignition) canonical.reset(new CanonicalHandleScope(isolate_));
|
||||
// Create a canonical handle scope for compiling Ignition bytecode. This
|
||||
// is required by the constant array builder to de-duplicate objects
|
||||
// without dereferencing handles.
|
||||
CanonicalHandleScope canonical(isolate_);
|
||||
|
||||
// Do the parsing tasks which need to be done on the main thread. This
|
||||
// will also handle parse errors.
|
||||
|
@ -252,11 +252,10 @@ void CompilationJob::RegisterWeakObjectsInOptimizedCode(Handle<Code> code) {
|
||||
namespace {
|
||||
|
||||
bool Parse(ParseInfo* info) {
|
||||
// Create a canonical handle scope if compiling ignition bytecode. This is
|
||||
// Create a canonical handle scope for compiling Ignition bytecode. This is
|
||||
// required by the constant array builder to de-duplicate objects without
|
||||
// dereferencing handles.
|
||||
std::unique_ptr<CanonicalHandleScope> canonical;
|
||||
if (FLAG_ignition) canonical.reset(new CanonicalHandleScope(info->isolate()));
|
||||
CanonicalHandleScope canonical(info->isolate());
|
||||
|
||||
return Parser::ParseStatic(info);
|
||||
}
|
||||
@ -314,21 +313,46 @@ void EnsureFeedbackMetadata(CompilationInfo* info) {
|
||||
info->literal()->feedback_vector_spec()));
|
||||
}
|
||||
|
||||
bool ShouldUseIgnition(CompilationInfo* info) {
|
||||
if (!FLAG_ignition) return false;
|
||||
bool UseTurboFan(Handle<SharedFunctionInfo> shared) {
|
||||
bool optimization_disabled = shared->optimization_disabled();
|
||||
bool dont_crankshaft = shared->dont_crankshaft();
|
||||
|
||||
// Check the enabling conditions for Turbofan.
|
||||
// 1. "use asm" code.
|
||||
bool is_turbofanable_asm =
|
||||
FLAG_turbo_asm && shared->asm_function() && !optimization_disabled;
|
||||
|
||||
// 2. Fallback for features unsupported by Crankshaft.
|
||||
bool is_unsupported_by_crankshaft_but_turbofanable =
|
||||
dont_crankshaft && strcmp(FLAG_turbo_filter, "~~") == 0 &&
|
||||
!optimization_disabled;
|
||||
|
||||
// 3. Explicitly enabled by the command-line filter.
|
||||
bool passes_turbo_filter = shared->PassesFilter(FLAG_turbo_filter);
|
||||
|
||||
return is_turbofanable_asm || is_unsupported_by_crankshaft_but_turbofanable ||
|
||||
passes_turbo_filter;
|
||||
}
|
||||
|
||||
bool ShouldUseIgnition(CompilationInfo* info) {
|
||||
DCHECK(info->has_shared_info());
|
||||
|
||||
// Skip Ignition for asm.js functions.
|
||||
if (info->shared_info()->asm_function()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 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() && info->shared_info()->is_compiled()) {
|
||||
return !info->shared_info()->HasBaselineCode();
|
||||
}
|
||||
|
||||
// Since we can't OSR from Ignition, skip Ignition for asm.js functions.
|
||||
if (info->shared_info()->asm_function()) {
|
||||
return false;
|
||||
}
|
||||
// Code destined for TurboFan should be compiled with Ignition first.
|
||||
if (UseTurboFan(info->shared_info())) return true;
|
||||
|
||||
// Only use Ignition for any other function if FLAG_ignition is true.
|
||||
if (!FLAG_ignition) return false;
|
||||
|
||||
// Checks whether top level functions should be passed by the filter.
|
||||
if (info->shared_info()->is_toplevel()) {
|
||||
@ -492,13 +516,10 @@ void InsertCodeIntoOptimizedCodeMap(CompilationInfo* info) {
|
||||
}
|
||||
|
||||
bool Renumber(ParseInfo* parse_info) {
|
||||
// Create a canonical handle scope if compiling ignition bytecode. This is
|
||||
// Create a canonical handle scope for compiling Ignition bytecode. This is
|
||||
// required by the constant array builder to de-duplicate objects without
|
||||
// dereferencing handles.
|
||||
std::unique_ptr<CanonicalHandleScope> canonical;
|
||||
if (FLAG_ignition) {
|
||||
canonical.reset(new CanonicalHandleScope(parse_info->isolate()));
|
||||
}
|
||||
CanonicalHandleScope canonical(parse_info->isolate());
|
||||
|
||||
if (!AstNumbering::Renumber(parse_info->isolate(), parse_info->zone(),
|
||||
parse_info->literal())) {
|
||||
@ -518,27 +539,6 @@ bool Renumber(ParseInfo* parse_info) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool UseTurboFan(Handle<SharedFunctionInfo> shared) {
|
||||
bool optimization_disabled = shared->optimization_disabled();
|
||||
bool dont_crankshaft = shared->dont_crankshaft();
|
||||
|
||||
// Check the enabling conditions for Turbofan.
|
||||
// 1. "use asm" code.
|
||||
bool is_turbofanable_asm =
|
||||
FLAG_turbo_asm && shared->asm_function() && !optimization_disabled;
|
||||
|
||||
// 2. Fallback for features unsupported by Crankshaft.
|
||||
bool is_unsupported_by_crankshaft_but_turbofanable =
|
||||
dont_crankshaft && strcmp(FLAG_turbo_filter, "~~") == 0 &&
|
||||
!optimization_disabled;
|
||||
|
||||
// 3. Explicitly enabled by the command-line filter.
|
||||
bool passes_turbo_filter = shared->PassesFilter(FLAG_turbo_filter);
|
||||
|
||||
return is_turbofanable_asm || is_unsupported_by_crankshaft_but_turbofanable ||
|
||||
passes_turbo_filter;
|
||||
}
|
||||
|
||||
bool GetOptimizedCodeNow(CompilationJob* job) {
|
||||
CompilationInfo* info = job->info();
|
||||
Isolate* isolate = info->isolate();
|
||||
|
@ -2788,7 +2788,7 @@ int Shell::Main(int argc, char* argv[]) {
|
||||
RunShell(isolate);
|
||||
}
|
||||
|
||||
if (i::FLAG_ignition && i::FLAG_trace_ignition_dispatches &&
|
||||
if (i::FLAG_trace_ignition_dispatches &&
|
||||
i::FLAG_trace_ignition_dispatches_output_file != nullptr) {
|
||||
WriteIgnitionDispatchCountersFile(isolate);
|
||||
}
|
||||
|
@ -439,8 +439,8 @@ StackFrame::Type StackFrame::ComputeType(const StackFrameIteratorBase* iterator,
|
||||
if (!marker->IsSmi()) {
|
||||
if (maybe_function->IsSmi()) {
|
||||
return NONE;
|
||||
} else if (FLAG_ignition && IsInterpreterFramePc(iterator->isolate(),
|
||||
*(state->pc_address))) {
|
||||
} else if (IsInterpreterFramePc(iterator->isolate(),
|
||||
*(state->pc_address))) {
|
||||
return INTERPRETED;
|
||||
} else {
|
||||
return JAVA_SCRIPT;
|
||||
|
@ -1632,7 +1632,7 @@ class MarkCompactCollector::EvacuateVisitorBase
|
||||
DCHECK_OBJECT_SIZE(size);
|
||||
DCHECK(IsAligned(size, kPointerSize));
|
||||
heap_->CopyBlock(dst_addr, src_addr, size);
|
||||
if ((mode == kProfiled) && FLAG_ignition && dst->IsBytecodeArray()) {
|
||||
if ((mode == kProfiled) && dst->IsBytecodeArray()) {
|
||||
PROFILE(heap_->isolate(),
|
||||
CodeMoveEvent(AbstractCode::cast(src), dst_addr));
|
||||
}
|
||||
|
@ -242,9 +242,8 @@ SharedFunctionInfo* IC::GetSharedFunctionInfo() const {
|
||||
// corresponding to the frame.
|
||||
StackFrameIterator it(isolate());
|
||||
while (it.frame()->fp() != this->fp()) it.Advance();
|
||||
if (FLAG_ignition && it.frame()->type() == StackFrame::STUB) {
|
||||
// Advance over bytecode handler frame.
|
||||
// TODO(rmcilroy): Remove this once bytecode handlers don't need a frame.
|
||||
if (it.frame()->type() == StackFrame::STUB) {
|
||||
// We might need to advance over bytecode handler frame for Ignition.
|
||||
it.Advance();
|
||||
}
|
||||
JavaScriptFrame* frame = JavaScriptFrame::cast(it.frame());
|
||||
|
@ -2535,9 +2535,7 @@ bool Isolate::Init(Deserializer* des) {
|
||||
}
|
||||
load_stub_cache_->Initialize();
|
||||
store_stub_cache_->Initialize();
|
||||
if (FLAG_ignition || serializer_enabled()) {
|
||||
interpreter_->Initialize();
|
||||
}
|
||||
interpreter_->Initialize();
|
||||
|
||||
heap_.NotifyDeserializationComplete();
|
||||
}
|
||||
|
@ -1484,8 +1484,6 @@ void Logger::LogCodeObjects() {
|
||||
}
|
||||
|
||||
void Logger::LogBytecodeHandlers() {
|
||||
if (!FLAG_ignition) return;
|
||||
|
||||
const interpreter::OperandScale kOperandScales[] = {
|
||||
#define VALUE(Name, _) interpreter::OperandScale::k##Name,
|
||||
OPERAND_SCALE_LIST(VALUE)
|
||||
|
@ -335,20 +335,30 @@
|
||||
|
||||
}], # 'arch == ppc64 and simulator_run == True'
|
||||
|
||||
##############################################################################
|
||||
['variant == turbofan', {
|
||||
|
||||
# TurboFan cpu profiler result is different.
|
||||
'test-cpu-profiler/CollectDeoptEvents': [FAIL],
|
||||
'test-cpu-profiler/DeoptAtFirstLevelInlinedSource': [FAIL],
|
||||
'test-cpu-profiler/DeoptAtSecondLevelInlinedSource': [FAIL],
|
||||
|
||||
}], # variant == turbofan
|
||||
|
||||
##############################################################################
|
||||
['variant == turbofan_opt', {
|
||||
# BUG(5193): Flaky.
|
||||
'test-cpu-profiler/FunctionApplySample': [PASS, ['system == windows', SKIP]],
|
||||
# TODO(mythria,4680): Lack of code-ageing in interpreter.
|
||||
'test-heap/Regress169209': [FAIL],
|
||||
|
||||
# TODO(mythria,4680): Lack of code-ageing and/or lack of compilation cache
|
||||
# in interpreter.
|
||||
'test-heap/CompilationCacheCachingBehavior': [FAIL],
|
||||
|
||||
# TODO(mstarzinger): Triggers Ignition+TurboFan on everything now and makes
|
||||
# the stack traces within the profilers look different. Needs investigation.
|
||||
'test-api/SetFunctionEntryHook': [SKIP],
|
||||
'test-cpu-profiler/BoundFunctionCall': [FAIL],
|
||||
'test-cpu-profiler/CollectSampleAPI': [FAIL],
|
||||
'test-cpu-profiler/FunctionApplySample': [FAIL],
|
||||
'test-cpu-profiler/FunctionCallSample': [FAIL],
|
||||
'test-cpu-profiler/JsNativeJsRuntimeJsSample': [FAIL],
|
||||
'test-cpu-profiler/JsNativeJsSample': [FAIL],
|
||||
'test-cpu-profiler/JsNativeJsRuntimeJsSampleMultiple': [FAIL],
|
||||
'test-cpu-profiler/JsNative1JsNative2JsSample': [FAIL],
|
||||
'test-cpu-profiler/NativeMethodUninitializedIC': [FAIL],
|
||||
'test-cpu-profiler/NativeAccessorUninitializedIC': [FAIL],
|
||||
'test-profile-generator/LineNumber': [FAIL],
|
||||
'test-sampler-api/StackFramesConsistent': [FAIL],
|
||||
}], # variant == turbofan_opt
|
||||
|
||||
##############################################################################
|
||||
@ -397,7 +407,7 @@
|
||||
}], # variant == ignition_staging
|
||||
|
||||
##############################################################################
|
||||
['variant == ignition_turbofan', {
|
||||
['variant == turbofan or variant == ignition_turbofan', {
|
||||
# TODO(rmcilroy,4680): Related to lack of code flushing. Check failed: !function->shared()->is_compiled() || function->IsOptimized().
|
||||
'test-heap/TestCodeFlushingPreAged': [FAIL],
|
||||
'test-heap/TestCodeFlushingIncrementalScavenge': [FAIL],
|
||||
@ -425,7 +435,7 @@
|
||||
|
||||
# BUG(5193): Flaky.
|
||||
'test-cpu-profiler/FunctionApplySample': [PASS, ['system == windows', SKIP]],
|
||||
}], # variant == ignition_turbofan
|
||||
}], # variant == turbofan or variant == ignition_turbofan
|
||||
|
||||
##############################################################################
|
||||
['variant != ignition and variant != ignition_staging and variant != ignition_turbofan', {
|
||||
|
@ -2657,8 +2657,8 @@ TEST(InstanceOfStubWriteBarrier) {
|
||||
namespace {
|
||||
|
||||
int GetProfilerTicks(SharedFunctionInfo* shared) {
|
||||
return FLAG_ignition ? shared->profiler_ticks()
|
||||
: shared->code()->profiler_ticks();
|
||||
return FLAG_ignition || FLAG_turbo ? shared->profiler_ticks()
|
||||
: shared->code()->profiler_ticks();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
@ -14581,7 +14581,7 @@ void SetFunctionEntryHookTest::RunTest() {
|
||||
RunLoopInNewEnv(isolate);
|
||||
|
||||
// Check the expected invocation counts.
|
||||
if (!i::FLAG_ignition) {
|
||||
if (!i::FLAG_ignition && !i::FLAG_turbo) {
|
||||
CHECK_EQ(2, CountInvocations(NULL, "bar"));
|
||||
CHECK_EQ(200, CountInvocations("bar", "foo"));
|
||||
CHECK_EQ(200, CountInvocations(NULL, "foo"));
|
||||
@ -14822,8 +14822,9 @@ UNINITIALIZED_TEST(SetJitCodeEventHandler) {
|
||||
for (int i = 0; i < kIterations; ++i) {
|
||||
LocalContext env(isolate);
|
||||
i::AlwaysAllocateScope always_allocate(i_isolate);
|
||||
i::heap::SimulateFullSpace(i::FLAG_ignition ? heap->old_space()
|
||||
: heap->code_space());
|
||||
i::heap::SimulateFullSpace(i::FLAG_ignition || i::FLAG_turbo
|
||||
? heap->old_space()
|
||||
: heap->code_space());
|
||||
CompileRun(script);
|
||||
|
||||
// Keep a strong reference to the code object in the handle scope.
|
||||
@ -21804,7 +21805,7 @@ void TestStubCache(bool primary) {
|
||||
// The test does not work with interpreter because bytecode handlers taken
|
||||
// from the snapshot already refer to ICs with disabled counters and there
|
||||
// is no way to trigger bytecode handlers recompilation.
|
||||
if (i::FLAG_ignition) return;
|
||||
if (i::FLAG_ignition || i::FLAG_turbo) return;
|
||||
|
||||
i::FLAG_native_code_counters = true;
|
||||
if (primary) {
|
||||
|
@ -322,9 +322,10 @@ TEST(FeedbackVectorPreservedAcrossRecompiles) {
|
||||
// of the full code.
|
||||
CHECK(f->IsOptimized());
|
||||
// If the baseline code is bytecode, then it will not have deoptimization
|
||||
// support. has_deoptimization_support() check is only required if the
|
||||
// support. The has_deoptimization_support() check is only required if the
|
||||
// baseline code is from fullcodegen.
|
||||
CHECK(f->shared()->has_deoptimization_support() || i::FLAG_ignition);
|
||||
CHECK(f->shared()->has_deoptimization_support() || i::FLAG_ignition ||
|
||||
i::FLAG_turbo);
|
||||
object = f->feedback_vector()->Get(slot_for_a);
|
||||
CHECK(object->IsWeakCell() &&
|
||||
WeakCell::cast(object)->value()->IsJSFunction());
|
||||
|
@ -81,9 +81,8 @@ static void construct_call(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
frame_iterator.Advance();
|
||||
CHECK(frame_iterator.frame()->is_construct());
|
||||
frame_iterator.Advance();
|
||||
if (i::FLAG_ignition) {
|
||||
if (frame_iterator.frame()->type() == i::StackFrame::STUB) {
|
||||
// Skip over bytecode handler frame.
|
||||
CHECK(frame_iterator.frame()->type() == i::StackFrame::STUB);
|
||||
frame_iterator.Advance();
|
||||
}
|
||||
i::StackFrame* calling_frame = frame_iterator.frame();
|
||||
|
@ -1678,7 +1678,7 @@ TEST(CodeSerializerInternalReference) {
|
||||
// In ignition there are only relative jumps, so the following code
|
||||
// would not have any internal references. This test is not relevant
|
||||
// for ignition.
|
||||
if (FLAG_ignition) {
|
||||
if (FLAG_ignition || FLAG_turbo) {
|
||||
return;
|
||||
}
|
||||
// Disable experimental natives that are loaded after deserialization.
|
||||
@ -1762,7 +1762,7 @@ TEST(CodeSerializerInternalReference) {
|
||||
}
|
||||
|
||||
TEST(CodeSerializerEagerCompilationAndPreAge) {
|
||||
if (FLAG_ignition) return;
|
||||
if (FLAG_ignition || FLAG_turbo) return;
|
||||
|
||||
FLAG_lazy = true;
|
||||
FLAG_serialize_toplevel = true;
|
||||
|
@ -59,6 +59,10 @@
|
||||
# not work, but we expect it to not crash.
|
||||
'debug-step-turbofan': [PASS, FAIL],
|
||||
|
||||
# Issue 4680: The eval'ed code is piped through Ignition and fails when being
|
||||
# live edited. This needs investigation.
|
||||
'debug-liveedit-double-call': [PASS, FAIL],
|
||||
|
||||
##############################################################################
|
||||
# Too slow in debug mode with --stress-opt mode.
|
||||
'regress/regress-2318': [PASS, ['mode == debug', SKIP]],
|
||||
@ -618,14 +622,6 @@
|
||||
'unicode-test': [SKIP],
|
||||
}], # variant == stress
|
||||
|
||||
##############################################################################
|
||||
['variant == turbofan', {
|
||||
|
||||
# Assumptions about optimization need investigation in TurboFan.
|
||||
'regress-sync-optimized-lists': [FAIL],
|
||||
|
||||
}], # variant == turbofan
|
||||
|
||||
##############################################################################
|
||||
['variant == turbofan_opt', {
|
||||
|
||||
@ -637,6 +633,7 @@
|
||||
'debug-evaluate-locals-optimized-double': [FAIL],
|
||||
'debug-liveedit-double-call': [FAIL],
|
||||
'es6/debug-evaluate-blockscopes': [FAIL],
|
||||
'ignition/debug-break-on-stack': [FAIL],
|
||||
|
||||
# TODO(jgruber): Fails in --turbo --always-opt mode.
|
||||
'regress/regress-105': [FAIL],
|
||||
|
@ -3,7 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
// TODO (mtrofin): re-enable ignition (v8:5345)
|
||||
// Flags: --no-ignition --no-ignition-staging
|
||||
// Flags: --no-turbo --no-ignition --no-ignition-staging
|
||||
// Flags: --expose-wasm --expose-gc --allow-natives-syntax
|
||||
|
||||
load("test/mjsunit/wasm/wasm-constants.js");
|
||||
|
Loading…
Reference in New Issue
Block a user