Commit 0b7361d1 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[Interpreter] Fix --print-bytecode after moving of SFI creation.

After moving the shared function info creation to be during unoptmized
compile finalization the --print-bytecode flag caused a crash by trying
to access the shared function info before it was created. This CL fixes it.

BUG=v8:5203

Change-Id: I82c0431bace51aa44154c55ad4bebde897f7a39e
Reviewed-on: https://chromium-review.googlesource.com/579769Reviewed-by: 's avatarMythri Alle <mythria@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46810}
parent 0e4965e5
......@@ -67,7 +67,6 @@ class InterpreterCompilationJob final : public CompilationJob {
BytecodeGenerator generator_;
RuntimeCallStats* runtime_call_stats_;
RuntimeCallCounter background_execute_counter_;
bool print_bytecode_;
DISALLOW_COPY_AND_ASSIGN(InterpreterCompilationJob);
};
......@@ -148,19 +147,10 @@ InterpreterCompilationJob::InterpreterCompilationJob(CompilationInfo* info)
: CompilationJob(info->isolate(), info, "Ignition"),
generator_(info),
runtime_call_stats_(info->isolate()->counters()->runtime_call_stats()),
background_execute_counter_("CompileBackgroundIgnition"),
print_bytecode_(ShouldPrintBytecode(info->shared_info())) {}
background_execute_counter_("CompileBackgroundIgnition") {}
InterpreterCompilationJob::Status InterpreterCompilationJob::PrepareJobImpl() {
CodeGenerator::MakeCodePrologue(info(), "interpreter");
if (print_bytecode_) {
OFStream os(stdout);
std::unique_ptr<char[]> name = info()->GetDebugName();
os << "[generating bytecode for function: " << info()->GetDebugName().get()
<< "]" << std::endl;
}
return SUCCEEDED;
}
......@@ -195,8 +185,11 @@ InterpreterCompilationJob::Status InterpreterCompilationJob::FinalizeJobImpl() {
return FAILED;
}
if (print_bytecode_) {
if (ShouldPrintBytecode(info()->shared_info())) {
OFStream os(stdout);
std::unique_ptr<char[]> name = info()->GetDebugName();
os << "[generating bytecode for function: " << info()->GetDebugName().get()
<< "]" << std::endl;
bytecodes->Disassemble(os);
os << std::flush;
}
......
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