Commit 886cd71e authored by Yang Guo's avatar Yang Guo Committed by Commit Bot

Revert "[Compiler] Ensure unoptimized code generation is context independent."

This reverts commit 38cd61d0.

Reason for revert: Layout test http/tests/asmjs/asm-warnings.html fails due to missing context.

See https://ci.chromium.org/p/chromium/builders/luci.chromium.try/linux_chromium_rel_ng/238991


crash log for renderer (pid <unknown>):
STDOUT: <empty>
STDERR: [1:1:1123/024436.020348:FATAL:script_state.h(140)] Check failed: !context.IsEmpty(). 
STDERR: #0 0x5556817298df base::debug::StackTrace::StackTrace()
STDERR: #1 0x55568167b5fb logging::LogMessage::~LogMessage()
STDERR: #2 0x55568154ed45 blink::ScriptState::From()
STDERR: #3 0x555683047aa9 blink::V8Initializer::MessageHandlerInMainThread()
STDERR: #4 0x5556801793c8 v8::internal::MessageHandler::ReportMessageNoExceptions()
STDERR: #5 0x555680178652 v8::internal::MessageHandler::ReportMessage()
STDERR: #6 0x5556802c2563 v8::internal::PendingCompilationErrorHandler::ReportWarnings()
STDERR: #7 0x55567fc8bcd3 v8::internal::(anonymous namespace)::FinalizeUnoptimizedCode()
STDERR: #8 0x55567fc8b668 v8::internal::Compiler::Compile()
STDERR: #9 0x55567fc8be6b v8::internal::Compiler::Compile()
STDERR: #10 0x55568033a36f v8::internal::__RT_impl_Runtime_CompileLazy()
STDERR: #11 0x5556808f2492 <unknown>
STDERR: 
STDERR: [25209:25254:1123/024436.075700:WARNING:crash_handler_host_linux.cc(341)] Could not translate tid, attempt = 1 retry ...


The issue seems to be that we do require the context for when we report a compile error when finalizing the compilation.

Original change's description:
> [Compiler] Ensure unoptimized code generation is context independent.
> 
> Now that Asm.js code is also context independent, move code to ensure context independence
> from BytecodeGenerator to FinalizeUnoptimizedCode.
> 
> Change-Id: I7738eb3b347ea82764ecd3b5548dc82cb06d2f4e
> Reviewed-on: https://chromium-review.googlesource.com/c/1347483
> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org>
> Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#57730}

TBR=rmcilroy@chromium.org,mstarzinger@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Iaa15e608b35a3396ba51a03f996c6de1330f0016
Reviewed-on: https://chromium-review.googlesource.com/c/1349236
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57785}
parent 63960f7b
...@@ -555,12 +555,8 @@ bool FinalizeUnoptimizedCode( ...@@ -555,12 +555,8 @@ bool FinalizeUnoptimizedCode(
UnoptimizedCompilationJobList* inner_function_jobs) { UnoptimizedCompilationJobList* inner_function_jobs) {
DCHECK(AllowCompilation::IsAllowed(isolate)); DCHECK(AllowCompilation::IsAllowed(isolate));
#ifdef DEBUG // TODO(rmcilroy): Clear native context in debug once AsmJS generates doesn't
// Unoptimized compilation should be context-independent. Verify that we don't // rely on accessing native context during finalization.
// access the native context by nulling it out during finalization.
SaveContext save(isolate);
isolate->set_context(Context());
#endif
// Allocate scope infos for the literal. // Allocate scope infos for the literal.
DeclarationScope::AllocateScopeInfos(parse_info, isolate); DeclarationScope::AllocateScopeInfos(parse_info, isolate);
......
...@@ -924,6 +924,12 @@ BytecodeGenerator::BytecodeGenerator( ...@@ -924,6 +924,12 @@ BytecodeGenerator::BytecodeGenerator(
Handle<BytecodeArray> BytecodeGenerator::FinalizeBytecode( Handle<BytecodeArray> BytecodeGenerator::FinalizeBytecode(
Isolate* isolate, Handle<Script> script) { Isolate* isolate, Handle<Script> script) {
DCHECK(ThreadId::Current().Equals(isolate->thread_id())); DCHECK(ThreadId::Current().Equals(isolate->thread_id()));
#ifdef DEBUG
// Unoptimized compilation should be context-independent. Verify that we don't
// access the native context by nulling it out during finalization.
SaveContext save(isolate);
isolate->set_context(Context());
#endif
AllocateDeferredConstants(isolate, script); AllocateDeferredConstants(isolate, script);
......
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