Skip to content

Commit 9e36f73

Browse files
verwaestV8 LUCI CQ
authored andcommitted
[compiler] Put reuse_scope_infos behind a disabled flag
Bug: 352673356 Change-Id: Ief4db2f6520b17a9098d9d7a80cd22e87be297b9 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/5703896 Reviewed-by: Jakob Kummerow <[email protected]> Auto-Submit: Toon Verwaest <[email protected]> Commit-Queue: Toon Verwaest <[email protected]> Commit-Queue: Jakob Kummerow <[email protected]> Cr-Commit-Position: refs/heads/main@{#95007}
1 parent 25bb6a6 commit 9e36f73

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/ast/scopes.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2716,7 +2716,9 @@ void Scope::AllocateScopeInfosRecursively(
27162716
#ifdef DEBUG
27172717
// Mark this ID as being used. Skip hidden scopes because they are
27182718
// synthetic, unreusable, but hard to make unique.
2719-
if (!is_hidden()) scope_infos_to_reuse[UniqueIdInScript()] = {};
2719+
if (v8_flags.reuse_scope_infos && !is_hidden()) {
2720+
scope_infos_to_reuse[UniqueIdInScript()] = {};
2721+
}
27202722
#endif
27212723
scope_info_ = ScopeInfo::Create(isolate, zone(), this, outer_scope);
27222724
DCHECK_EQ(UniqueIdInScript(), scope_info_->UniqueIdInScript());
@@ -2810,7 +2812,7 @@ void DeclarationScope::AllocateScopeInfos(ParseInfo* info,
28102812

28112813
Tagged<WeakFixedArray> infos = script->shared_function_infos();
28122814
std::unordered_map<int, Handle<ScopeInfo>> scope_infos_to_reuse;
2813-
if (infos->length() != 0) {
2815+
if (v8_flags.reuse_scope_infos && infos->length() != 0) {
28142816
// Look at all the existing inner functions (they are numbered id+1 until
28152817
// max_id+1) to reattach their outer scope infos to corresponding scopes.
28162818
for (int i = info->literal()->function_literal_id() + 1;

src/codegen/compiler.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2017,6 +2017,7 @@ class ConstantPoolPointerForwarder {
20172017
}
20182018

20192019
void RecordOuterScopeInfos(Tagged<MaybeObject> maybe_old_sfi) {
2020+
if (!v8_flags.reuse_scope_infos) return;
20202021
Tagged<SharedFunctionInfo> old_sfi =
20212022
Cast<SharedFunctionInfo>(maybe_old_sfi.GetHeapObjectAssumeWeak());
20222023
if (!old_sfi->HasOuterScopeInfo()) return;

src/flags/flag-definitions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -989,6 +989,9 @@ DEFINE_BOOL(trace_track_allocation_sites, false,
989989
DEFINE_BOOL(trace_migration, false, "trace object migration")
990990
DEFINE_BOOL(trace_generalization, false, "trace map generalization")
991991

992+
DEFINE_BOOL(reuse_scope_infos, false,
993+
"reuse scope infos from previous compiles")
994+
992995
// Flags for Sparkplug
993996
#undef FLAG
994997
#if V8_ENABLE_SPARKPLUG

0 commit comments

Comments
 (0)