Commit 3c54b7a4 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

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

This reverts commit dcd75706.

Reason for revert: Breaks layout tests, blocks roll, see
https://crrev.com/c/1396602; there are wasm CLs in this range too,
but this CL looks like the most likely culprit.

Original change's description:
> Reland: [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.
> 
> Reland of CL: https://chromium-review.googlesource.com/c/v8/v8/+/1349236
> 
> Change-Id: I718090850870c61733e0719d4091ec60bc080ebb
> Reviewed-on: https://chromium-review.googlesource.com/c/1396201
> Commit-Queue: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Dan Elphick <delphick@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#58558}

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

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

Change-Id: I5f547319f31f87777165361747dd42d223fc0b0e
Reviewed-on: https://chromium-review.googlesource.com/c/1396427Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58564}
parent b6bcf321
......@@ -569,21 +569,15 @@ bool FinalizeUnoptimizedCode(
UnoptimizedCompilationJobList* inner_function_jobs) {
DCHECK(AllowCompilation::IsAllowed(isolate));
{
#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
// TODO(rmcilroy): Clear native context in debug once AsmJS generates doesn't
// rely on accessing native context during finalization.
// Allocate scope infos for the literal.
DeclarationScope::AllocateScopeInfos(parse_info, isolate);
// Finalize the outer-most function's compilation job.
if (FinalizeUnoptimizedCompilationJob(outer_function_job, shared_info,
isolate) !=
CompilationJob::SUCCEEDED) {
isolate) != CompilationJob::SUCCEEDED) {
return false;
}
......@@ -601,7 +595,6 @@ bool FinalizeUnoptimizedCode(
return false;
}
}
}
// Report any warnings generated during compilation.
if (parse_info->pending_error_handler()->has_pending_warnings()) {
......
......@@ -928,6 +928,13 @@ 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(Context());
#endif
AllocateDeferredConstants(isolate, script);
if (block_coverage_builder_) {
......
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