[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: Daniel Vogelheim <vogelheim@chromium.org> Cr-Commit-Position: refs/heads/master@{#46134}
This commit is contained in:
parent
1fce2d2d61
commit
2703c5d425
@ -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());
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user