@@ -2574,7 +2574,6 @@ void ModuleScope::AllocateModuleVariables() {
25742574// Needs to be kept in sync with ScopeInfo::UniqueIdInScript and
25752575// SharedFunctionInfo::UniqueIdInScript.
25762576int Scope::UniqueIdInScript () const {
2577- DCHECK (!is_hidden_catch_scope ());
25782577 // Script scopes start "before" the script to avoid clashing with a scope that
25792578 // starts on character 0.
25802579 if (is_script_scope () || scope_type () == EVAL_SCOPE ||
@@ -2652,17 +2651,14 @@ void Scope::AllocateScopeInfosRecursively(
26522651 DCHECK (scope_info_.is_null ());
26532652 MaybeHandle<ScopeInfo> next_outer_scope = outer_scope;
26542653
2655- auto it = is_hidden_catch_scope ()
2656- ? scope_infos_to_reuse.end ()
2657- : scope_infos_to_reuse.find (UniqueIdInScript ());
2654+ auto it = scope_infos_to_reuse.find (UniqueIdInScript ());
26582655 if (it != scope_infos_to_reuse.end ()) {
26592656 scope_info_ = it->second ;
26602657 CHECK (NeedsContext ());
26612658 // The ScopeInfo chain mirrors the context chain, so we only link to the
26622659 // next outer scope that needs a context.
26632660 next_outer_scope = scope_info_;
26642661 DCHECK (!scope_info_.is_null ());
2665- DCHECK (!is_hidden_catch_scope ());
26662662 CHECK_EQ (scope_info_->scope_type (), scope_type_);
26672663 CHECK_EQ (scope_info_->ContextLength (), num_heap_slots_);
26682664#ifdef DEBUG
@@ -2672,9 +2668,8 @@ void Scope::AllocateScopeInfosRecursively(
26722668 } else if (NeedsScopeInfo ()) {
26732669 scope_info_ = ScopeInfo::Create (isolate, zone (), this , outer_scope);
26742670#ifdef DEBUG
2675- // Mark this ID as being used. Skip hidden scopes because they are
2676- // synthetic, unreusable, but hard to make unique.
2677- if (v8_flags.reuse_scope_infos && !is_hidden_catch_scope ()) {
2671+ // Mark this ID as being used.
2672+ if (v8_flags.reuse_scope_infos ) {
26782673 scope_infos_to_reuse[UniqueIdInScript ()] = {};
26792674 DCHECK_EQ (UniqueIdInScript (), scope_info_->UniqueIdInScript ());
26802675 }
@@ -2687,12 +2682,9 @@ void Scope::AllocateScopeInfosRecursively(
26872682 // Allocate ScopeInfos for inner scopes.
26882683 for (Scope* scope = inner_scope_; scope != nullptr ; scope = scope->sibling_ ) {
26892684#ifdef DEBUG
2690- if (!scope->is_hidden_catch_scope ()) {
2691- DCHECK_GT (scope->UniqueIdInScript (), UniqueIdInScript ());
2692- DCHECK_IMPLIES (
2693- scope->sibling_ && !scope->sibling_ ->is_hidden_catch_scope (),
2694- scope->sibling_ ->UniqueIdInScript () != scope->UniqueIdInScript ());
2695- }
2685+ DCHECK_GT (scope->UniqueIdInScript (), UniqueIdInScript ());
2686+ DCHECK_IMPLIES (scope->sibling_ , scope->sibling_ ->UniqueIdInScript () !=
2687+ scope->UniqueIdInScript ());
26962688#endif
26972689 if (!scope->is_function_scope () ||
26982690 scope->AsDeclarationScope ()->ShouldEagerCompile ()) {
0 commit comments