Commit 7dda7e80 authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[parser] Skipping inner funcs: allow handle deref when restoring the data.

This stopped working because of r47337 (
https://chromium-review.googlesource.com/c/v8/v8/+/605949/8/src/compiler.cc#418
).

Also enhanced the test so that it would've caught this.

BUG=v8:5516

Change-Id: I933a8b5d787c3eb8b2cc230e2b35df1f25b500e7
Reviewed-on: https://chromium-review.googlesource.com/625618Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47498}
parent 313f8d3f
......@@ -665,6 +665,7 @@ void DeclarationScope::Analyze(ParseInfo* info) {
if (scope->must_use_preparsed_scope_data_) {
DCHECK(FLAG_preparser_scope_analysis);
DCHECK_EQ(scope->scope_type_, ScopeType::FUNCTION_SCOPE);
allow_deref.emplace();
info->consumed_preparsed_scope_data()->RestoreScopeAllocationData(scope);
}
......
......@@ -407,6 +407,9 @@ std::unique_ptr<CompilationJob> GenerateUnoptimizedCode(
DisallowHandleDereference no_deref;
DCHECK(inner_function_jobs->empty());
DCHECK_IMPLIES(parse_info->consumed_preparsed_scope_data()->HasData(),
ThreadId::Current().Equals(isolate->thread_id()));
Compiler::EagerInnerFunctionLiterals inner_literals;
if (!Compiler::Analyze(parse_info, &inner_literals)) {
return std::unique_ptr<CompilationJob>();
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --preparser-scope-analysis
// Flags: --preparser-scope-analysis --enable-slow-asserts
(function TestBasicSkipping() {
var result = 0;
......@@ -82,7 +82,7 @@
})();
// Skippable top level functions.
let result = 0;
var result = 0;
function lazy_top_level(ctxt_alloc_param) {
let ctxt_alloc_var = 24;
function skip_me() {
......
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