Commit 2703c5d4 authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[parser] Skipping inner funcs: Fix DCHECKs.

The DCHECKs were checking that the data we stored about a Scope (param count
etc) matches the Scope where we're restoring the data to.

But for skipped functions, this data is not in the Scope, so it doesn't make
sense to DCHECK them.

BUG=v8:5516

Change-Id: I6ad66ec4dd5fe31da52c0d5b533b336e3956ee1d
Reviewed-on: https://chromium-review.googlesource.com/544300
Commit-Queue: Marja Hölttä <marja@chromium.org>
Reviewed-by: 's avatarDaniel Vogelheim <vogelheim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46134}
parent 1fce2d2d
......@@ -135,6 +135,16 @@ void PreParsedScopeData::RestoreData(Scope* scope, uint32_t* index_ptr) const {
uint32_t& index = *index_ptr;
if (IsSkippedFunctionScope(scope)) {
// This scope is a function scope representing a function we want to
// skip. So just skip over its data.
DCHECK(!scope->must_use_preparsed_scope_data());
// Check that we're moving forward (not backward) in the data.
DCHECK_GT(backing_store_[index + 2], index);
index = backing_store_[index + 2];
return;
}
#ifdef DEBUG
// Data integrity check.
if (scope->scope_type() == ScopeType::FUNCTION_SCOPE &&
......@@ -153,16 +163,6 @@ void PreParsedScopeData::RestoreData(Scope* scope, uint32_t* index_ptr) const {
}
#endif
if (IsSkippedFunctionScope(scope)) {
// This scope is a function scope representing a function we want to
// skip. So just skip over its data.
DCHECK(!scope->must_use_preparsed_scope_data());
// Check that we're moving forward (not backward) in the data.
DCHECK_GT(backing_store_[index + 2], index);
index = backing_store_[index + 2];
return;
}
DCHECK_GE(backing_store_.size(), index + 3);
DCHECK_EQ(backing_store_[index++], scope->scope_type());
......
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