Skip to content

Commit e5c3c9b

Browse files
mlippautzV8 LUCI CQ
authored andcommitted
[zone] Remove zone compression
Compression has been unused for many years. Removing it allows simplifying allocation/freeing paths. Bug: 409953791 Change-Id: I65a38d48e8d2ca2e2ffb131799d20dacb7899d0a Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/6568895 Reviewed-by: Igor Sheludko <[email protected]> Commit-Queue: Michael Lippautz <[email protected]> Cr-Commit-Position: refs/heads/main@{#100686}
1 parent bfedbe7 commit e5c3c9b

57 files changed

Lines changed: 112 additions & 514 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

BUILD.bazel

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ load(":bazel/v8-non-pointer-compression.bzl", "v8_binary_non_pointer_compression
7575
# cppgc_enable_slow_api_checks
7676
# cppgc_enable_verify_heap
7777
# cppgc_enable_young_generation
78-
# v8_enable_zone_compression
7978
# v8_enable_precise_zone_stats
8079
# v8_enable_swiss_name_dictionary
8180
# v8_generate_external_defines_header
@@ -2580,15 +2579,13 @@ filegroup(
25802579
"src/utils/version.h",
25812580
"src/zone/accounting-allocator.cc",
25822581
"src/zone/accounting-allocator.h",
2583-
"src/zone/compressed-zone-ptr.h",
25842582
"src/zone/type-stats.cc",
25852583
"src/zone/type-stats.h",
25862584
"src/zone/zone.cc",
25872585
"src/zone/zone.h",
25882586
"src/zone/zone-allocator.h",
25892587
"src/zone/zone-chunk-list.h",
25902588
"src/zone/zone-compact-set.h",
2591-
"src/zone/zone-compression.h",
25922589
"src/zone/zone-containers.h",
25932590
"src/zone/zone-hashmap.h",
25942591
"src/zone/zone-list.h",

BUILD.gn

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,6 @@ declare_args() {
339339
# Enable allocations during prefinalizer invocations.
340340
cppgc_allow_allocations_in_prefinalizers = false
341341

342-
# Enable V8 zone compression experimental feature.
343-
# Sets -DV8_COMPRESS_ZONES.
344-
v8_enable_zone_compression = ""
345-
346342
# Enable the V8 sandbox.
347343
# Sets -DV8_ENABLE_SANDBOX.
348344
v8_enable_sandbox = ""
@@ -615,9 +611,6 @@ if (v8_enable_fast_torque == "") {
615611
if (v8_enable_concurrent_mksnapshot == "") {
616612
v8_enable_concurrent_mksnapshot = v8_enable_fast_mksnapshot
617613
}
618-
if (v8_enable_zone_compression == "") {
619-
v8_enable_zone_compression = false
620-
}
621614
if (v8_enable_short_builtin_calls == "") {
622615
v8_enable_short_builtin_calls =
623616
v8_current_cpu == "x64" || v8_current_cpu == "arm64" ||
@@ -1042,9 +1035,6 @@ if (v8_enable_pointer_compression) {
10421035
if (v8_enable_pointer_compression || v8_enable_31bit_smis_on_64bit_arch) {
10431036
enabled_external_v8_defines += [ "V8_31BIT_SMIS_ON_64BIT_ARCH" ]
10441037
}
1045-
if (v8_enable_zone_compression) {
1046-
enabled_external_v8_defines += [ "V8_COMPRESS_ZONES" ]
1047-
}
10481038
if (v8_enable_sandbox) {
10491039
enabled_external_v8_defines += [ "V8_ENABLE_SANDBOX" ]
10501040
}
@@ -2951,7 +2941,6 @@ generated_file("v8_generate_features_json") {
29512941
v8_enable_v8_checks = v8_enable_v8_checks
29522942
v8_enable_memory_accounting_checks = v8_enable_memory_accounting_checks
29532943
v8_enable_webassembly = v8_enable_webassembly
2954-
v8_enable_zone_compression = v8_enable_zone_compression
29552944
v8_imminent_deprecation_warnings = v8_imminent_deprecation_warnings
29562945
v8_optimized_debug = v8_optimized_debug
29572946
v8_random_seed = v8_random_seed
@@ -4398,12 +4387,10 @@ v8_header_set("v8_internal_headers") {
43984387
"src/utils/utils.h",
43994388
"src/utils/version.h",
44004389
"src/zone/accounting-allocator.h",
4401-
"src/zone/compressed-zone-ptr.h",
44024390
"src/zone/type-stats.h",
44034391
"src/zone/zone-allocator.h",
44044392
"src/zone/zone-chunk-list.h",
44054393
"src/zone/zone-compact-set.h",
4406-
"src/zone/zone-compression.h",
44074394
"src/zone/zone-containers.h",
44084395
"src/zone/zone-hashmap.h",
44094396
"src/zone/zone-list-inl.h",

src/common/globals.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -514,16 +514,6 @@ constexpr size_t kReservedCodeRangePages = 0;
514514

515515
static_assert(kSystemPointerSize == (1 << kSystemPointerSizeLog2));
516516

517-
#ifdef V8_COMPRESS_ZONES
518-
#define COMPRESS_ZONES_BOOL true
519-
#else
520-
#define COMPRESS_ZONES_BOOL false
521-
#endif // V8_COMPRESS_ZONES
522-
523-
// The flag controls whether zones pointer compression should be enabled for
524-
// TurboFan graphs or not.
525-
static constexpr bool kCompressGraphZone = COMPRESS_ZONES_BOOL;
526-
527517
#ifdef V8_COMPRESS_POINTERS
528518
static_assert(
529519
kSystemPointerSize == kInt64Size,

src/compiler/graph-zone-traits.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,10 @@ namespace compiler {
1414
// Forward declarations.
1515
class Node;
1616

17-
// GraphZoneTraits provides typedefs for zone pointer types that are either
18-
// compressed or not depending on the kCompressGraphZone flag.
19-
using GraphZoneTraits = ZoneTypeTraits<kCompressGraphZone>;
17+
// GraphZoneTraits provides typedefs for pointer in zones.
18+
using GraphZoneTraits = ZoneTypeTraits;
2019

21-
// ZoneNodePtr is a possibly compressed pointer to a Node allocated in a zone
22-
// memory.
20+
// ZoneNodePtr is a pointer to a Node allocated in a zone memory.
2321
using ZoneNodePtr = GraphZoneTraits::Ptr<Node>;
2422

2523
} // namespace compiler

src/compiler/node.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,6 @@ struct NodeWithInLineInputs {};
5757
template <typename NodePtrT>
5858
Node* Node::NewImpl(Zone* zone, NodeId id, const Operator* op, int input_count,
5959
NodePtrT const* inputs, bool has_extensible_inputs) {
60-
// Node uses compressed pointers, so zone must support pointer compression.
61-
DCHECK_IMPLIES(kCompressGraphZone, zone->supports_compression());
6260
DCHECK_GE(input_count, 0);
6361

6462
ZoneNodePtr* input_ptr;

src/compiler/pipeline-data-inl.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class TFPipelineData {
7171
may_have_unverifiable_graph_(v8_flags.turboshaft),
7272
zone_stats_(zone_stats),
7373
pipeline_statistics_(pipeline_statistics),
74-
graph_zone_(zone_stats_, kGraphZoneName, kCompressGraphZone),
74+
graph_zone_(zone_stats_, kGraphZoneName),
7575
instruction_zone_scope_(zone_stats_, kInstructionZoneName),
7676
instruction_zone_(instruction_zone_scope_.zone()),
7777
codegen_zone_scope_(zone_stats_, kCodegenZoneName),
@@ -125,7 +125,7 @@ class TFPipelineData {
125125
may_have_unverifiable_graph_(true),
126126
zone_stats_(zone_stats),
127127
pipeline_statistics_(pipeline_statistics),
128-
graph_zone_(zone_stats_, kGraphZoneName, kCompressGraphZone),
128+
graph_zone_(zone_stats_, kGraphZoneName),
129129
graph_(mcgraph->graph()),
130130
source_positions_(source_positions),
131131
node_origins_(node_origins),
@@ -160,7 +160,7 @@ class TFPipelineData {
160160
info_(info),
161161
debug_name_(info_->GetDebugName()),
162162
zone_stats_(zone_stats),
163-
graph_zone_(zone_stats_, kGraphZoneName, kCompressGraphZone),
163+
graph_zone_(zone_stats_, kGraphZoneName),
164164
graph_(graph),
165165
source_positions_(source_positions),
166166
node_origins_(node_origins),
@@ -202,7 +202,7 @@ class TFPipelineData {
202202
info_(info),
203203
debug_name_(info_->GetDebugName()),
204204
zone_stats_(zone_stats),
205-
graph_zone_(zone_stats_, kGraphZoneName, kCompressGraphZone),
205+
graph_zone_(zone_stats_, kGraphZoneName),
206206
instruction_zone_scope_(zone_stats_, kInstructionZoneName),
207207
instruction_zone_(sequence->zone()),
208208
sequence_(sequence),

src/compiler/pipeline.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2286,7 +2286,7 @@ CodeAssemblerCompilationJob::CodeAssemblerCompilationJob(
22862286
generator_(generator),
22872287
installer_(installer),
22882288
profile_data_(profile_data),
2289-
zone_(isolate->allocator(), ZONE_NAME, kCompressGraphZone),
2289+
zone_(isolate->allocator(), ZONE_NAME),
22902290
zone_stats_(isolate->allocator()),
22912291
code_assembler_state_(isolate, &zone_, get_call_descriptor(&zone_),
22922292
code_kind, name, builtin),
@@ -2699,7 +2699,7 @@ Pipeline::GenerateCodeForWasmNativeStubFromTurboshaft(
26992699
const char* debug_name, const AssemblerOptions& options,
27002700
SourcePositionTable* source_positions) {
27012701
wasm::WasmEngine* wasm_engine = wasm::GetWasmEngine();
2702-
Zone zone(wasm_engine->allocator(), ZONE_NAME, kCompressGraphZone);
2702+
Zone zone(wasm_engine->allocator(), ZONE_NAME);
27032703
WasmCallKind call_kind =
27042704
wrapper_info.code_kind == CodeKind::WASM_TO_JS_FUNCTION
27052705
? WasmCallKind::kWasmImportWrapper
@@ -2829,7 +2829,7 @@ wasm::WasmCompilationResult Pipeline::GenerateWasmCode(
28292829
}
28302830
ZoneStats zone_stats(wasm_engine->allocator());
28312831

2832-
Zone graph_zone{wasm_engine->allocator(), ZONE_NAME, kCompressGraphZone};
2832+
Zone graph_zone{wasm_engine->allocator(), ZONE_NAME};
28332833
OptimizedCompilationInfo info(
28342834
GetDebugName(&graph_zone, env->module,
28352835
compilation_data.wire_bytes_storage,

src/compiler/turbofan-graph.cc

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,7 @@ TFGraph::TFGraph(Zone* zone)
2222
next_node_id_(0),
2323
decorators_(zone),
2424
has_simd_(false),
25-
simd_stores_(zone) {
26-
// Nodes use compressed pointers, so zone must support pointer compression.
27-
// If the check fails, ensure the zone is created with kCompressGraphZone
28-
// flag.
29-
CHECK_IMPLIES(kCompressGraphZone, zone->supports_compression());
30-
}
25+
simd_stores_(zone) {}
3126

3227
void TFGraph::Decorate(Node* node) {
3328
for (GraphDecorator* const decorator : decorators_) {

src/compiler/wasm-compiler.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ wasm::WasmCompilationResult CompileWasmJSFastCallWrapper(
11991199
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.wasm.detailed"),
12001200
"wasm.CompileWasmJSFastCallWrapper");
12011201

1202-
Zone zone(wasm::GetWasmEngine()->allocator(), ZONE_NAME, kCompressGraphZone);
1202+
Zone zone(wasm::GetWasmEngine()->allocator(), ZONE_NAME);
12031203
SourcePositionTable* source_positions = nullptr;
12041204
MachineGraph* mcgraph = CreateCommonMachineGraph(&zone);
12051205

@@ -1232,8 +1232,8 @@ Handle<Code> CompileCWasmEntry(Isolate* isolate,
12321232
const wasm::CanonicalSig* sig) {
12331233
DCHECK(!v8_flags.wasm_jitless);
12341234

1235-
std::unique_ptr<Zone> zone = std::make_unique<Zone>(
1236-
isolate->allocator(), ZONE_NAME, kCompressGraphZone);
1235+
std::unique_ptr<Zone> zone =
1236+
std::make_unique<Zone>(isolate->allocator(), ZONE_NAME);
12371237
TFGraph* graph = zone->New<TFGraph>(zone.get());
12381238
CommonOperatorBuilder* common = zone->New<CommonOperatorBuilder>(zone.get());
12391239
MachineOperatorBuilder* machine = zone->New<MachineOperatorBuilder>(

src/compiler/zone-stats.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ size_t ZoneStats::GetTotalAllocatedBytes() const {
8686
return total_deleted_bytes_ + GetCurrentAllocatedBytes();
8787
}
8888

89-
Zone* ZoneStats::NewEmptyZone(const char* zone_name,
90-
bool support_zone_compression) {
91-
Zone* zone = new Zone(allocator_, zone_name, support_zone_compression);
89+
Zone* ZoneStats::NewEmptyZone(const char* zone_name) {
90+
Zone* zone = new Zone(allocator_, zone_name);
9291
zones_.push_back(zone);
9392
return zone;
9493
}

0 commit comments

Comments
 (0)