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,38 +569,31 @@ bool FinalizeUnoptimizedCode( ...@@ -569,38 +569,31 @@ bool FinalizeUnoptimizedCode(
UnoptimizedCompilationJobList* inner_function_jobs) { UnoptimizedCompilationJobList* inner_function_jobs) {
DCHECK(AllowCompilation::IsAllowed(isolate)); DCHECK(AllowCompilation::IsAllowed(isolate));
{ // TODO(rmcilroy): Clear native context in debug once AsmJS generates doesn't
#ifdef DEBUG // rely on accessing native context during finalization.
// Unoptimized compilation should be context-independent. Verify that we
// don't access the native context by nulling it out during finalization. // Allocate scope infos for the literal.
SaveContext save(isolate); DeclarationScope::AllocateScopeInfos(parse_info, isolate);
isolate->set_context(Context());
#endif // Finalize the outer-most function's compilation job.
if (FinalizeUnoptimizedCompilationJob(outer_function_job, shared_info,
// Allocate scope infos for the literal. isolate) != CompilationJob::SUCCEEDED) {
DeclarationScope::AllocateScopeInfos(parse_info, isolate); return false;
}
// Finalize the outer-most function's compilation job.
if (FinalizeUnoptimizedCompilationJob(outer_function_job, shared_info, // Finalize the inner functions' compilation jobs.
for (auto&& inner_job : *inner_function_jobs) {
Handle<SharedFunctionInfo> inner_shared_info =
Compiler::GetSharedFunctionInfo(
inner_job->compilation_info()->literal(), parse_info->script(),
isolate);
// The inner function might be compiled already if compiling for debug.
if (inner_shared_info->is_compiled()) continue;
if (FinalizeUnoptimizedCompilationJob(inner_job.get(), inner_shared_info,
isolate) != isolate) !=
CompilationJob::SUCCEEDED) { CompilationJob::SUCCEEDED) {
return false; return false;
} }
// Finalize the inner functions' compilation jobs.
for (auto&& inner_job : *inner_function_jobs) {
Handle<SharedFunctionInfo> inner_shared_info =
Compiler::GetSharedFunctionInfo(
inner_job->compilation_info()->literal(), parse_info->script(),
isolate);
// The inner function might be compiled already if compiling for debug.
if (inner_shared_info->is_compiled()) continue;
if (FinalizeUnoptimizedCompilationJob(inner_job.get(), inner_shared_info,
isolate) !=
CompilationJob::SUCCEEDED) {
return false;
}
}
} }
// Report any warnings generated during compilation. // Report any warnings generated during compilation.
......
...@@ -928,6 +928,13 @@ BytecodeGenerator::BytecodeGenerator( ...@@ -928,6 +928,13 @@ 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);
if (block_coverage_builder_) { 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