Commit 38cd61d0 authored by Ross McIlroy's avatar Ross McIlroy Committed by Commit Bot

[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/1347483Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57730}
parent b544277a
......@@ -555,8 +555,12 @@ bool FinalizeUnoptimizedCode(
UnoptimizedCompilationJobList* inner_function_jobs) {
DCHECK(AllowCompilation::IsAllowed(isolate));
// TODO(rmcilroy): Clear native context in debug once AsmJS generates doesn't
// rely on accessing native context during finalization.
#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(nullptr);
#endif
// Allocate scope infos for the literal.
DeclarationScope::AllocateScopeInfos(parse_info, isolate);
......
......@@ -924,12 +924,6 @@ BytecodeGenerator::BytecodeGenerator(
Handle<BytecodeArray> BytecodeGenerator::FinalizeBytecode(
Isolate* isolate, Handle<Script> script) {
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(nullptr);
#endif
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