Commit 2f839277 authored by Igor Sheludko's avatar Igor Sheludko Committed by Commit Bot

[zone-compr] Add kCompressGraphZone constant

... that controls whether the TF graph zones should support compression.

Bug: v8:9923
Change-Id: Ifbe237b75e9c92e62eb32b69d6b3b1a818269b83
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2308347
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69036}
parent 06b2e89d
...@@ -158,7 +158,7 @@ Code BuildWithCodeStubAssemblerJS(Isolate* isolate, int32_t builtin_index, ...@@ -158,7 +158,7 @@ Code BuildWithCodeStubAssemblerJS(Isolate* isolate, int32_t builtin_index,
// to code targets without dereferencing their handles. // to code targets without dereferencing their handles.
CanonicalHandleScope canonical(isolate); CanonicalHandleScope canonical(isolate);
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME, kCompressGraphZone);
const int argc_with_recv = const int argc_with_recv =
(argc == kDontAdaptArgumentsSentinel) ? 0 : argc + 1; (argc == kDontAdaptArgumentsSentinel) ? 0 : argc + 1;
compiler::CodeAssemblerState state( compiler::CodeAssemblerState state(
...@@ -180,7 +180,7 @@ Code BuildWithCodeStubAssemblerCS(Isolate* isolate, int32_t builtin_index, ...@@ -180,7 +180,7 @@ Code BuildWithCodeStubAssemblerCS(Isolate* isolate, int32_t builtin_index,
// Canonicalize handles, so that we can share constant pool entries pointing // Canonicalize handles, so that we can share constant pool entries pointing
// to code targets without dereferencing their handles. // to code targets without dereferencing their handles.
CanonicalHandleScope canonical(isolate); CanonicalHandleScope canonical(isolate);
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME, kCompressGraphZone);
// The interface descriptor with given key must be initialized at this point // The interface descriptor with given key must be initialized at this point
// and this construction just queries the details from the descriptors table. // and this construction just queries the details from the descriptors table.
CallInterfaceDescriptor descriptor(interface_descriptor); CallInterfaceDescriptor descriptor(interface_descriptor);
......
...@@ -146,7 +146,7 @@ class PipelineData { ...@@ -146,7 +146,7 @@ class PipelineData {
roots_relative_addressing_enabled_( roots_relative_addressing_enabled_(
!isolate->serializer_enabled() && !isolate->serializer_enabled() &&
!isolate->IsGeneratingEmbeddedBuiltins()), !isolate->IsGeneratingEmbeddedBuiltins()),
graph_zone_scope_(zone_stats_, kGraphZoneName), graph_zone_scope_(zone_stats_, kGraphZoneName, kCompressGraphZone),
graph_zone_(graph_zone_scope_.zone()), graph_zone_(graph_zone_scope_.zone()),
instruction_zone_scope_(zone_stats_, kInstructionZoneName), instruction_zone_scope_(zone_stats_, kInstructionZoneName),
instruction_zone_(instruction_zone_scope_.zone()), instruction_zone_(instruction_zone_scope_.zone()),
...@@ -194,7 +194,7 @@ class PipelineData { ...@@ -194,7 +194,7 @@ class PipelineData {
may_have_unverifiable_graph_(false), may_have_unverifiable_graph_(false),
zone_stats_(zone_stats), zone_stats_(zone_stats),
pipeline_statistics_(pipeline_statistics), pipeline_statistics_(pipeline_statistics),
graph_zone_scope_(zone_stats_, kGraphZoneName), graph_zone_scope_(zone_stats_, kGraphZoneName, kCompressGraphZone),
graph_zone_(graph_zone_scope_.zone()), graph_zone_(graph_zone_scope_.zone()),
graph_(mcgraph->graph()), graph_(mcgraph->graph()),
source_positions_(source_positions), source_positions_(source_positions),
...@@ -225,7 +225,7 @@ class PipelineData { ...@@ -225,7 +225,7 @@ class PipelineData {
info_(info), info_(info),
debug_name_(info_->GetDebugName()), debug_name_(info_->GetDebugName()),
zone_stats_(zone_stats), zone_stats_(zone_stats),
graph_zone_scope_(zone_stats_, kGraphZoneName), graph_zone_scope_(zone_stats_, kGraphZoneName, kCompressGraphZone),
graph_zone_(graph_zone_scope_.zone()), graph_zone_(graph_zone_scope_.zone()),
graph_(graph), graph_(graph),
source_positions_(source_positions), source_positions_(source_positions),
...@@ -268,7 +268,7 @@ class PipelineData { ...@@ -268,7 +268,7 @@ class PipelineData {
info_(info), info_(info),
debug_name_(info_->GetDebugName()), debug_name_(info_->GetDebugName()),
zone_stats_(zone_stats), zone_stats_(zone_stats),
graph_zone_scope_(zone_stats_, kGraphZoneName), graph_zone_scope_(zone_stats_, kGraphZoneName, kCompressGraphZone),
instruction_zone_scope_(zone_stats_, kInstructionZoneName), instruction_zone_scope_(zone_stats_, kInstructionZoneName),
instruction_zone_(sequence->zone()), instruction_zone_(sequence->zone()),
sequence_(sequence), sequence_(sequence),
......
...@@ -6687,8 +6687,8 @@ std::unique_ptr<OptimizedCompilationJob> NewJSToWasmCompilationJob( ...@@ -6687,8 +6687,8 @@ std::unique_ptr<OptimizedCompilationJob> NewJSToWasmCompilationJob(
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// Create the Graph. // Create the Graph.
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
std::unique_ptr<Zone> zone = std::unique_ptr<Zone> zone = std::make_unique<Zone>(
std::make_unique<Zone>(wasm_engine->allocator(), ZONE_NAME); wasm_engine->allocator(), ZONE_NAME, kCompressGraphZone);
Graph* graph = zone->New<Graph>(zone.get()); Graph* graph = zone->New<Graph>(zone.get());
CommonOperatorBuilder* common = zone->New<CommonOperatorBuilder>(zone.get()); CommonOperatorBuilder* common = zone->New<CommonOperatorBuilder>(zone.get());
MachineOperatorBuilder* machine = zone->New<MachineOperatorBuilder>( MachineOperatorBuilder* machine = zone->New<MachineOperatorBuilder>(
...@@ -6881,7 +6881,7 @@ wasm::WasmCompilationResult CompileWasmMathIntrinsic( ...@@ -6881,7 +6881,7 @@ wasm::WasmCompilationResult CompileWasmMathIntrinsic(
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.wasm.detailed"), TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.wasm.detailed"),
"wasm.CompileWasmMathIntrinsic"); "wasm.CompileWasmMathIntrinsic");
Zone zone(wasm_engine->allocator(), ZONE_NAME); Zone zone(wasm_engine->allocator(), ZONE_NAME, kCompressGraphZone);
// Compile a Wasm function with a single bytecode and let TurboFan // Compile a Wasm function with a single bytecode and let TurboFan
// generate either inlined machine code or a call to a helper. // generate either inlined machine code or a call to a helper.
...@@ -6957,7 +6957,7 @@ wasm::WasmCompilationResult CompileWasmImportCallWrapper( ...@@ -6957,7 +6957,7 @@ wasm::WasmCompilationResult CompileWasmImportCallWrapper(
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// Create the Graph // Create the Graph
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
Zone zone(wasm_engine->allocator(), ZONE_NAME); Zone zone(wasm_engine->allocator(), ZONE_NAME, kCompressGraphZone);
Graph* graph = zone.New<Graph>(&zone); Graph* graph = zone.New<Graph>(&zone);
CommonOperatorBuilder* common = zone.New<CommonOperatorBuilder>(&zone); CommonOperatorBuilder* common = zone.New<CommonOperatorBuilder>(&zone);
MachineOperatorBuilder* machine = zone.New<MachineOperatorBuilder>( MachineOperatorBuilder* machine = zone.New<MachineOperatorBuilder>(
...@@ -6998,7 +6998,7 @@ wasm::WasmCode* CompileWasmCapiCallWrapper(wasm::WasmEngine* wasm_engine, ...@@ -6998,7 +6998,7 @@ wasm::WasmCode* CompileWasmCapiCallWrapper(wasm::WasmEngine* wasm_engine,
TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.wasm.detailed"), TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("v8.wasm.detailed"),
"wasm.CompileWasmCapiFunction"); "wasm.CompileWasmCapiFunction");
Zone zone(wasm_engine->allocator(), ZONE_NAME); Zone zone(wasm_engine->allocator(), ZONE_NAME, kCompressGraphZone);
// TODO(jkummerow): Extract common code into helper method. // TODO(jkummerow): Extract common code into helper method.
SourcePositionTable* source_positions = nullptr; SourcePositionTable* source_positions = nullptr;
...@@ -7046,8 +7046,8 @@ wasm::WasmCode* CompileWasmCapiCallWrapper(wasm::WasmEngine* wasm_engine, ...@@ -7046,8 +7046,8 @@ wasm::WasmCode* CompileWasmCapiCallWrapper(wasm::WasmEngine* wasm_engine,
MaybeHandle<Code> CompileJSToJSWrapper(Isolate* isolate, MaybeHandle<Code> CompileJSToJSWrapper(Isolate* isolate,
const wasm::FunctionSig* sig) { const wasm::FunctionSig* sig) {
std::unique_ptr<Zone> zone = std::unique_ptr<Zone> zone = std::make_unique<Zone>(
std::make_unique<Zone>(isolate->allocator(), ZONE_NAME); isolate->allocator(), ZONE_NAME, kCompressGraphZone);
Graph* graph = zone->New<Graph>(zone.get()); Graph* graph = zone->New<Graph>(zone.get());
CommonOperatorBuilder* common = zone->New<CommonOperatorBuilder>(zone.get()); CommonOperatorBuilder* common = zone->New<CommonOperatorBuilder>(zone.get());
MachineOperatorBuilder* machine = zone->New<MachineOperatorBuilder>( MachineOperatorBuilder* machine = zone->New<MachineOperatorBuilder>(
...@@ -7091,8 +7091,8 @@ MaybeHandle<Code> CompileJSToJSWrapper(Isolate* isolate, ...@@ -7091,8 +7091,8 @@ MaybeHandle<Code> CompileJSToJSWrapper(Isolate* isolate,
} }
Handle<Code> CompileCWasmEntry(Isolate* isolate, const wasm::FunctionSig* sig) { Handle<Code> CompileCWasmEntry(Isolate* isolate, const wasm::FunctionSig* sig) {
std::unique_ptr<Zone> zone = std::unique_ptr<Zone> zone = std::make_unique<Zone>(
std::make_unique<Zone>(isolate->allocator(), ZONE_NAME); isolate->allocator(), ZONE_NAME, kCompressGraphZone);
Graph* graph = zone->New<Graph>(zone.get()); Graph* graph = zone->New<Graph>(zone.get());
CommonOperatorBuilder* common = zone->New<CommonOperatorBuilder>(zone.get()); CommonOperatorBuilder* common = zone->New<CommonOperatorBuilder>(zone.get());
MachineOperatorBuilder* machine = zone->New<MachineOperatorBuilder>( MachineOperatorBuilder* machine = zone->New<MachineOperatorBuilder>(
...@@ -7204,7 +7204,7 @@ wasm::WasmCompilationResult ExecuteTurbofanWasmCompilation( ...@@ -7204,7 +7204,7 @@ wasm::WasmCompilationResult ExecuteTurbofanWasmCompilation(
TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("v8.wasm.detailed"), TRACE_EVENT2(TRACE_DISABLED_BY_DEFAULT("v8.wasm.detailed"),
"wasm.CompileTopTier", "func_index", func_index, "body_size", "wasm.CompileTopTier", "func_index", func_index, "body_size",
func_body.end - func_body.start); func_body.end - func_body.start);
Zone zone(wasm_engine->allocator(), ZONE_NAME); Zone zone(wasm_engine->allocator(), ZONE_NAME, kCompressGraphZone);
MachineGraph* mcgraph = zone.New<MachineGraph>( MachineGraph* mcgraph = zone.New<MachineGraph>(
zone.New<Graph>(&zone), zone.New<CommonOperatorBuilder>(&zone), zone.New<Graph>(&zone), zone.New<CommonOperatorBuilder>(&zone),
zone.New<MachineOperatorBuilder>( zone.New<MachineOperatorBuilder>(
......
...@@ -86,8 +86,9 @@ size_t ZoneStats::GetTotalAllocatedBytes() const { ...@@ -86,8 +86,9 @@ size_t ZoneStats::GetTotalAllocatedBytes() const {
return total_deleted_bytes_ + GetCurrentAllocatedBytes(); return total_deleted_bytes_ + GetCurrentAllocatedBytes();
} }
Zone* ZoneStats::NewEmptyZone(const char* zone_name) { Zone* ZoneStats::NewEmptyZone(const char* zone_name,
Zone* zone = new Zone(allocator_, zone_name); bool support_zone_compression) {
Zone* zone = new Zone(allocator_, zone_name, support_zone_compression);
zones_.push_back(zone); zones_.push_back(zone);
return zone; return zone;
} }
......
...@@ -20,12 +20,18 @@ class V8_EXPORT_PRIVATE ZoneStats final { ...@@ -20,12 +20,18 @@ class V8_EXPORT_PRIVATE ZoneStats final {
public: public:
class Scope final { class Scope final {
public: public:
explicit Scope(ZoneStats* zone_stats, const char* zone_name) explicit Scope(ZoneStats* zone_stats, const char* zone_name,
: zone_name_(zone_name), zone_stats_(zone_stats), zone_(nullptr) {} bool support_zone_compression = false)
: zone_name_(zone_name),
zone_stats_(zone_stats),
zone_(nullptr),
support_zone_compression_(support_zone_compression) {}
~Scope() { Destroy(); } ~Scope() { Destroy(); }
Zone* zone() { Zone* zone() {
if (zone_ == nullptr) zone_ = zone_stats_->NewEmptyZone(zone_name_); if (zone_ == nullptr)
zone_ =
zone_stats_->NewEmptyZone(zone_name_, support_zone_compression_);
return zone_; return zone_;
} }
void Destroy() { void Destroy() {
...@@ -39,6 +45,7 @@ class V8_EXPORT_PRIVATE ZoneStats final { ...@@ -39,6 +45,7 @@ class V8_EXPORT_PRIVATE ZoneStats final {
const char* zone_name_; const char* zone_name_;
ZoneStats* const zone_stats_; ZoneStats* const zone_stats_;
Zone* zone_; Zone* zone_;
const bool support_zone_compression_;
DISALLOW_COPY_AND_ASSIGN(Scope); DISALLOW_COPY_AND_ASSIGN(Scope);
}; };
...@@ -73,7 +80,7 @@ class V8_EXPORT_PRIVATE ZoneStats final { ...@@ -73,7 +80,7 @@ class V8_EXPORT_PRIVATE ZoneStats final {
size_t GetCurrentAllocatedBytes() const; size_t GetCurrentAllocatedBytes() const;
private: private:
Zone* NewEmptyZone(const char* zone_name); Zone* NewEmptyZone(const char* zone_name, bool support_zone_compression);
void ReturnZone(Zone* zone); void ReturnZone(Zone* zone);
static const size_t kMaxUnusedSize = 3; static const size_t kMaxUnusedSize = 3;
......
...@@ -3110,7 +3110,7 @@ Handle<Code> GenerateBytecodeHandler(Isolate* isolate, const char* debug_name, ...@@ -3110,7 +3110,7 @@ Handle<Code> GenerateBytecodeHandler(Isolate* isolate, const char* debug_name,
OperandScale operand_scale, OperandScale operand_scale,
int builtin_index, int builtin_index,
const AssemblerOptions& options) { const AssemblerOptions& options) {
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME, kCompressGraphZone);
compiler::CodeAssemblerState state( compiler::CodeAssemblerState state(
isolate, &zone, InterpreterDispatchDescriptor{}, Code::BYTECODE_HANDLER, isolate, &zone, InterpreterDispatchDescriptor{}, Code::BYTECODE_HANDLER,
debug_name, debug_name,
......
...@@ -39,6 +39,10 @@ constexpr size_t kZoneReservationSize = 1; ...@@ -39,6 +39,10 @@ constexpr size_t kZoneReservationSize = 1;
constexpr size_t kZoneReservationAlignment = 1; constexpr size_t kZoneReservationAlignment = 1;
#endif // V8_COMPRESS_ZONES #endif // V8_COMPRESS_ZONES
// The flags controlling whether zones that will be used for allocating
// TurboFan graphs should be compressed or not.
static constexpr bool kCompressGraphZone = COMPRESS_ZONES_BOOL;
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -239,8 +239,9 @@ InitializedHandleScope::InitializedHandleScope() ...@@ -239,8 +239,9 @@ InitializedHandleScope::InitializedHandleScope()
InitializedHandleScope::~InitializedHandleScope() = default; InitializedHandleScope::~InitializedHandleScope() = default;
HandleAndZoneScope::HandleAndZoneScope() HandleAndZoneScope::HandleAndZoneScope(bool support_zone_compression)
: main_zone_(new i::Zone(&allocator_, ZONE_NAME)) {} : main_zone_(
new i::Zone(&allocator_, ZONE_NAME, support_zone_compression)) {}
HandleAndZoneScope::~HandleAndZoneScope() = default; HandleAndZoneScope::~HandleAndZoneScope() = default;
......
...@@ -614,7 +614,7 @@ class InitializedHandleScope { ...@@ -614,7 +614,7 @@ class InitializedHandleScope {
class HandleAndZoneScope : public InitializedHandleScope { class HandleAndZoneScope : public InitializedHandleScope {
public: public:
HandleAndZoneScope(); explicit HandleAndZoneScope(bool support_zone_compression = false);
~HandleAndZoneScope(); ~HandleAndZoneScope();
// Prefixing the below with main_ reduces a lot of naming clashes. // Prefixing the below with main_ reduces a lot of naming clashes.
......
...@@ -20,7 +20,7 @@ class CodeAssemblerTester { ...@@ -20,7 +20,7 @@ class CodeAssemblerTester {
public: public:
// Test generating code for a stub. Assumes VoidDescriptor call interface. // Test generating code for a stub. Assumes VoidDescriptor call interface.
explicit CodeAssemblerTester(Isolate* isolate, const char* name = "test") explicit CodeAssemblerTester(Isolate* isolate, const char* name = "test")
: zone_(isolate->allocator(), ZONE_NAME), : zone_(isolate->allocator(), ZONE_NAME, kCompressGraphZone),
scope_(isolate), scope_(isolate),
state_(isolate, &zone_, VoidDescriptor{}, Code::STUB, name, state_(isolate, &zone_, VoidDescriptor{}, Code::STUB, name,
PoisoningMitigationLevel::kDontPoison) {} PoisoningMitigationLevel::kDontPoison) {}
...@@ -29,21 +29,21 @@ class CodeAssemblerTester { ...@@ -29,21 +29,21 @@ class CodeAssemblerTester {
CodeAssemblerTester(Isolate* isolate, int parameter_count, CodeAssemblerTester(Isolate* isolate, int parameter_count,
Code::Kind kind = Code::BUILTIN, Code::Kind kind = Code::BUILTIN,
const char* name = "test") const char* name = "test")
: zone_(isolate->allocator(), ZONE_NAME), : zone_(isolate->allocator(), ZONE_NAME, kCompressGraphZone),
scope_(isolate), scope_(isolate),
state_(isolate, &zone_, parameter_count, kind, name, state_(isolate, &zone_, parameter_count, kind, name,
PoisoningMitigationLevel::kDontPoison) {} PoisoningMitigationLevel::kDontPoison) {}
CodeAssemblerTester(Isolate* isolate, Code::Kind kind, CodeAssemblerTester(Isolate* isolate, Code::Kind kind,
const char* name = "test") const char* name = "test")
: zone_(isolate->allocator(), ZONE_NAME), : zone_(isolate->allocator(), ZONE_NAME, kCompressGraphZone),
scope_(isolate), scope_(isolate),
state_(isolate, &zone_, 0, kind, name, state_(isolate, &zone_, 0, kind, name,
PoisoningMitigationLevel::kDontPoison) {} PoisoningMitigationLevel::kDontPoison) {}
CodeAssemblerTester(Isolate* isolate, CallDescriptor* call_descriptor, CodeAssemblerTester(Isolate* isolate, CallDescriptor* call_descriptor,
const char* name = "test") const char* name = "test")
: zone_(isolate->allocator(), ZONE_NAME), : zone_(isolate->allocator(), ZONE_NAME, kCompressGraphZone),
scope_(isolate), scope_(isolate),
state_(isolate, &zone_, call_descriptor, Code::STUB, name, state_(isolate, &zone_, call_descriptor, Code::STUB, name,
PoisoningMitigationLevel::kDontPoison, Builtins::kNoBuiltinId) {} PoisoningMitigationLevel::kDontPoison, Builtins::kNoBuiltinId) {}
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "src/compiler/pipeline.h" #include "src/compiler/pipeline.h"
#include "src/compiler/raw-machine-assembler.h" #include "src/compiler/raw-machine-assembler.h"
#include "src/execution/simulator.h" #include "src/execution/simulator.h"
#include "src/zone/zone-fwd.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
#include "test/cctest/compiler/call-tester.h" #include "test/cctest/compiler/call-tester.h"
...@@ -24,7 +25,7 @@ class RawMachineAssemblerTester : public HandleAndZoneScope, ...@@ -24,7 +25,7 @@ class RawMachineAssemblerTester : public HandleAndZoneScope,
public: public:
template <typename... ParamMachTypes> template <typename... ParamMachTypes>
explicit RawMachineAssemblerTester(ParamMachTypes... p) explicit RawMachineAssemblerTester(ParamMachTypes... p)
: HandleAndZoneScope(), : HandleAndZoneScope(kCompressGraphZone),
CallHelper<ReturnType>( CallHelper<ReturnType>(
main_isolate(), main_isolate(),
CSignature::New(main_zone(), MachineTypeForC<ReturnType>(), p...)), CSignature::New(main_zone(), MachineTypeForC<ReturnType>(), p...)),
...@@ -41,7 +42,7 @@ class RawMachineAssemblerTester : public HandleAndZoneScope, ...@@ -41,7 +42,7 @@ class RawMachineAssemblerTester : public HandleAndZoneScope,
template <typename... ParamMachTypes> template <typename... ParamMachTypes>
RawMachineAssemblerTester(Code::Kind kind, ParamMachTypes... p) RawMachineAssemblerTester(Code::Kind kind, ParamMachTypes... p)
: HandleAndZoneScope(), : HandleAndZoneScope(kCompressGraphZone),
CallHelper<ReturnType>( CallHelper<ReturnType>(
main_isolate(), main_isolate(),
CSignature::New(main_zone(), MachineTypeForC<ReturnType>(), p...)), CSignature::New(main_zone(), MachineTypeForC<ReturnType>(), p...)),
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "src/compiler/schedule.h" #include "src/compiler/schedule.h"
#include "src/compiler/scheduler.h" #include "src/compiler/scheduler.h"
#include "src/compiler/verifier.h" #include "src/compiler/verifier.h"
#include "src/zone/zone-fwd.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
namespace v8 { namespace v8 {
...@@ -27,7 +28,7 @@ static Operator dummy_operator6(IrOpcode::kParameter, Operator::kNoWrite, ...@@ -27,7 +28,7 @@ static Operator dummy_operator6(IrOpcode::kParameter, Operator::kNoWrite,
TEST(NodeWithNullInputReachableFromEnd) { TEST(NodeWithNullInputReachableFromEnd) {
HandleAndZoneScope scope; HandleAndZoneScope scope(kCompressGraphZone);
Graph graph(scope.main_zone()); Graph graph(scope.main_zone());
CommonOperatorBuilder common(scope.main_zone()); CommonOperatorBuilder common(scope.main_zone());
...@@ -46,7 +47,7 @@ TEST(NodeWithNullInputReachableFromEnd) { ...@@ -46,7 +47,7 @@ TEST(NodeWithNullInputReachableFromEnd) {
TEST(NodeWithNullControlReachableFromEnd) { TEST(NodeWithNullControlReachableFromEnd) {
HandleAndZoneScope scope; HandleAndZoneScope scope(kCompressGraphZone);
Graph graph(scope.main_zone()); Graph graph(scope.main_zone());
CommonOperatorBuilder common(scope.main_zone()); CommonOperatorBuilder common(scope.main_zone());
...@@ -65,7 +66,7 @@ TEST(NodeWithNullControlReachableFromEnd) { ...@@ -65,7 +66,7 @@ TEST(NodeWithNullControlReachableFromEnd) {
TEST(NodeWithNullInputReachableFromStart) { TEST(NodeWithNullInputReachableFromStart) {
HandleAndZoneScope scope; HandleAndZoneScope scope(kCompressGraphZone);
Graph graph(scope.main_zone()); Graph graph(scope.main_zone());
CommonOperatorBuilder common(scope.main_zone()); CommonOperatorBuilder common(scope.main_zone());
...@@ -84,7 +85,7 @@ TEST(NodeWithNullInputReachableFromStart) { ...@@ -84,7 +85,7 @@ TEST(NodeWithNullInputReachableFromStart) {
TEST(NodeWithNullControlReachableFromStart) { TEST(NodeWithNullControlReachableFromStart) {
HandleAndZoneScope scope; HandleAndZoneScope scope(kCompressGraphZone);
Graph graph(scope.main_zone()); Graph graph(scope.main_zone());
CommonOperatorBuilder common(scope.main_zone()); CommonOperatorBuilder common(scope.main_zone());
...@@ -101,7 +102,7 @@ TEST(NodeWithNullControlReachableFromStart) { ...@@ -101,7 +102,7 @@ TEST(NodeWithNullControlReachableFromStart) {
TEST(NodeNetworkOfDummiesReachableFromEnd) { TEST(NodeNetworkOfDummiesReachableFromEnd) {
HandleAndZoneScope scope; HandleAndZoneScope scope(kCompressGraphZone);
Graph graph(scope.main_zone()); Graph graph(scope.main_zone());
CommonOperatorBuilder common(scope.main_zone()); CommonOperatorBuilder common(scope.main_zone());
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "src/compiler/backend/instruction-scheduler.h" #include "src/compiler/backend/instruction-scheduler.h"
#include "src/compiler/backend/instruction-selector-impl.h" #include "src/compiler/backend/instruction-selector-impl.h"
#include "src/compiler/backend/instruction.h" #include "src/compiler/backend/instruction.h"
#include "src/zone/zone-fwd.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
namespace v8 { namespace v8 {
...@@ -26,7 +26,7 @@ InstructionBlocks* CreateSingleBlock(Zone* zone) { ...@@ -26,7 +26,7 @@ InstructionBlocks* CreateSingleBlock(Zone* zone) {
class InstructionSchedulerTester { class InstructionSchedulerTester {
public: public:
InstructionSchedulerTester() InstructionSchedulerTester()
: scope_(), : scope_(kCompressGraphZone),
blocks_(CreateSingleBlock(scope_.main_zone())), blocks_(CreateSingleBlock(scope_.main_zone())),
sequence_(scope_.main_isolate(), scope_.main_zone(), blocks_), sequence_(scope_.main_isolate(), scope_.main_zone(), blocks_),
scheduler_(scope_.main_zone(), &sequence_) {} scheduler_(scope_.main_zone(), &sequence_) {}
......
...@@ -26,7 +26,8 @@ using TestInstrSeq = v8::internal::compiler::InstructionSequence; ...@@ -26,7 +26,8 @@ using TestInstrSeq = v8::internal::compiler::InstructionSequence;
class InstructionTester : public HandleAndZoneScope { class InstructionTester : public HandleAndZoneScope {
public: // We're all friends here. public: // We're all friends here.
InstructionTester() InstructionTester()
: graph(zone()), : HandleAndZoneScope(kCompressGraphZone),
graph(zone()),
schedule(zone()), schedule(zone()),
common(zone()), common(zone()),
machine(zone()), machine(zone()),
......
...@@ -34,7 +34,8 @@ class JSConstantCacheTester : public HandleAndZoneScope, ...@@ -34,7 +34,8 @@ class JSConstantCacheTester : public HandleAndZoneScope,
public JSGraph { public JSGraph {
public: public:
JSConstantCacheTester() JSConstantCacheTester()
: JSCacheTesterHelper(main_zone()), : HandleAndZoneScope(kCompressGraphZone),
JSCacheTesterHelper(main_zone()),
JSGraph(main_isolate(), &main_graph_, &main_common_, &main_javascript_, JSGraph(main_isolate(), &main_graph_, &main_common_, &main_javascript_,
nullptr, &main_machine_), nullptr, &main_machine_),
canonical_(main_isolate()), canonical_(main_isolate()),
......
...@@ -24,7 +24,8 @@ namespace compiler { ...@@ -24,7 +24,8 @@ namespace compiler {
class ContextSpecializationTester : public HandleAndZoneScope { class ContextSpecializationTester : public HandleAndZoneScope {
public: public:
explicit ContextSpecializationTester(Maybe<OuterContext> context) explicit ContextSpecializationTester(Maybe<OuterContext> context)
: canonical_(main_isolate()), : HandleAndZoneScope(kCompressGraphZone),
canonical_(main_isolate()),
graph_(main_zone()->New<Graph>(main_zone())), graph_(main_zone()->New<Graph>(main_zone())),
common_(main_zone()), common_(main_zone()),
javascript_(main_zone()), javascript_(main_zone()),
......
...@@ -25,7 +25,8 @@ namespace compiler { ...@@ -25,7 +25,8 @@ namespace compiler {
class JSTypedLoweringTester : public HandleAndZoneScope { class JSTypedLoweringTester : public HandleAndZoneScope {
public: public:
explicit JSTypedLoweringTester(int num_parameters = 0) explicit JSTypedLoweringTester(int num_parameters = 0)
: isolate(main_isolate()), : HandleAndZoneScope(kCompressGraphZone),
isolate(main_isolate()),
canonical(isolate), canonical(isolate),
js_heap_broker(isolate, main_zone(), isolate->NewPersistentHandles()), js_heap_broker(isolate, main_zone(), isolate->NewPersistentHandles()),
binop(nullptr), binop(nullptr),
......
...@@ -36,7 +36,8 @@ static const int kNumLeafs = 4; ...@@ -36,7 +36,8 @@ static const int kNumLeafs = 4;
class LoopFinderTester : HandleAndZoneScope { class LoopFinderTester : HandleAndZoneScope {
public: public:
LoopFinderTester() LoopFinderTester()
: isolate(main_isolate()), : HandleAndZoneScope(kCompressGraphZone),
isolate(main_isolate()),
common(main_zone()), common(main_zone()),
graph(main_zone()), graph(main_zone()),
jsgraph(main_isolate(), &graph, &common, nullptr, nullptr, nullptr), jsgraph(main_isolate(), &graph, &common, nullptr, nullptr, nullptr),
......
...@@ -78,7 +78,8 @@ class ReducerTester : public HandleAndZoneScope { ...@@ -78,7 +78,8 @@ class ReducerTester : public HandleAndZoneScope {
explicit ReducerTester(int num_parameters = 0, explicit ReducerTester(int num_parameters = 0,
MachineOperatorBuilder::Flags flags = MachineOperatorBuilder::Flags flags =
MachineOperatorBuilder::kAllOptionalOps) MachineOperatorBuilder::kAllOptionalOps)
: isolate(main_isolate()), : HandleAndZoneScope(kCompressGraphZone),
isolate(main_isolate()),
binop(nullptr), binop(nullptr),
unop(nullptr), unop(nullptr),
machine(main_zone(), MachineType::PointerRepresentation(), flags), machine(main_zone(), MachineType::PointerRepresentation(), flags),
......
...@@ -143,7 +143,7 @@ void TestReturnMultipleValues(MachineType type) { ...@@ -143,7 +143,7 @@ void TestReturnMultipleValues(MachineType type) {
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME);
CallDescriptor* desc = CallDescriptor* desc =
CreateCallDescriptor(&zone, count, param_count, type); CreateCallDescriptor(&zone, count, param_count, type);
HandleAndZoneScope handles; HandleAndZoneScope handles(kCompressGraphZone);
RawMachineAssembler m( RawMachineAssembler m(
handles.main_isolate(), handles.main_isolate(),
handles.main_zone()->New<Graph>(handles.main_zone()), desc, handles.main_zone()->New<Graph>(handles.main_zone()), desc,
...@@ -253,7 +253,7 @@ void ReturnLastValue(MachineType type) { ...@@ -253,7 +253,7 @@ void ReturnLastValue(MachineType type) {
CallDescriptor* desc = CreateCallDescriptor(&zone, return_count, 0, type); CallDescriptor* desc = CreateCallDescriptor(&zone, return_count, 0, type);
HandleAndZoneScope handles; HandleAndZoneScope handles(kCompressGraphZone);
RawMachineAssembler m(handles.main_isolate(), RawMachineAssembler m(handles.main_isolate(),
handles.main_zone()->New<Graph>(handles.main_zone()), handles.main_zone()->New<Graph>(handles.main_zone()),
desc, MachineType::PointerRepresentation(), desc, MachineType::PointerRepresentation(),
...@@ -316,7 +316,7 @@ void ReturnSumOfReturns(MachineType type) { ...@@ -316,7 +316,7 @@ void ReturnSumOfReturns(MachineType type) {
CallDescriptor* desc = CreateCallDescriptor(&zone, return_count, 0, type); CallDescriptor* desc = CreateCallDescriptor(&zone, return_count, 0, type);
HandleAndZoneScope handles; HandleAndZoneScope handles(kCompressGraphZone);
RawMachineAssembler m(handles.main_isolate(), RawMachineAssembler m(handles.main_isolate(),
handles.main_zone()->New<Graph>(handles.main_zone()), handles.main_zone()->New<Graph>(handles.main_zone()),
desc, MachineType::PointerRepresentation(), desc, MachineType::PointerRepresentation(),
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "src/compiler/graph.h" #include "src/compiler/graph.h"
#include "src/compiler/node.h" #include "src/compiler/node.h"
#include "src/compiler/operator.h" #include "src/compiler/operator.h"
#include "src/zone/zone-fwd.h"
#include "test/cctest/cctest.h" #include "test/cctest/cctest.h"
namespace v8 { namespace v8 {
...@@ -156,7 +157,7 @@ void CheckInputs(Node* node, Node** inputs, int input_count) { ...@@ -156,7 +157,7 @@ void CheckInputs(Node* node, Node** inputs, int input_count) {
TEST(NodeUseIteratorReplaceUses) { TEST(NodeUseIteratorReplaceUses) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
Node* n0 = graph.NewNode(&dummy_operator0); Node* n0 = graph.NewNode(&dummy_operator0);
Node* n1 = graph.NewNode(&dummy_operator1, n0); Node* n1 = graph.NewNode(&dummy_operator1, n0);
...@@ -182,7 +183,7 @@ TEST(NodeUseIteratorReplaceUses) { ...@@ -182,7 +183,7 @@ TEST(NodeUseIteratorReplaceUses) {
TEST(NodeUseIteratorReplaceUsesSelf) { TEST(NodeUseIteratorReplaceUsesSelf) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
Node* n0 = graph.NewNode(&dummy_operator0); Node* n0 = graph.NewNode(&dummy_operator0);
Node* n1 = graph.NewNode(&dummy_operator1, n0); Node* n1 = graph.NewNode(&dummy_operator1, n0);
...@@ -207,7 +208,7 @@ TEST(NodeUseIteratorReplaceUsesSelf) { ...@@ -207,7 +208,7 @@ TEST(NodeUseIteratorReplaceUsesSelf) {
TEST(ReplaceInput) { TEST(ReplaceInput) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
Node* n0 = graph.NewNode(&dummy_operator0); Node* n0 = graph.NewNode(&dummy_operator0);
Node* n1 = graph.NewNode(&dummy_operator0); Node* n1 = graph.NewNode(&dummy_operator0);
...@@ -234,7 +235,7 @@ TEST(ReplaceInput) { ...@@ -234,7 +235,7 @@ TEST(ReplaceInput) {
TEST(OwnedBy) { TEST(OwnedBy) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
{ {
...@@ -285,7 +286,7 @@ TEST(OwnedBy) { ...@@ -285,7 +286,7 @@ TEST(OwnedBy) {
TEST(Uses) { TEST(Uses) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
Node* n0 = graph.NewNode(&dummy_operator0); Node* n0 = graph.NewNode(&dummy_operator0);
...@@ -308,7 +309,7 @@ TEST(Uses) { ...@@ -308,7 +309,7 @@ TEST(Uses) {
TEST(Inputs) { TEST(Inputs) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
Node* n0 = graph.NewNode(&dummy_operator0); Node* n0 = graph.NewNode(&dummy_operator0);
...@@ -336,7 +337,7 @@ TEST(Inputs) { ...@@ -336,7 +337,7 @@ TEST(Inputs) {
TEST(InsertInputs) { TEST(InsertInputs) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
Node* n0 = graph.NewNode(&dummy_operator0); Node* n0 = graph.NewNode(&dummy_operator0);
...@@ -411,7 +412,7 @@ TEST(InsertInputs) { ...@@ -411,7 +412,7 @@ TEST(InsertInputs) {
TEST(RemoveInput) { TEST(RemoveInput) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
Node* n0 = graph.NewNode(&dummy_operator0); Node* n0 = graph.NewNode(&dummy_operator0);
...@@ -442,7 +443,7 @@ TEST(RemoveInput) { ...@@ -442,7 +443,7 @@ TEST(RemoveInput) {
TEST(AppendInputsAndIterator) { TEST(AppendInputsAndIterator) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
Node* n0 = graph.NewNode(&dummy_operator0); Node* n0 = graph.NewNode(&dummy_operator0);
...@@ -465,7 +466,7 @@ TEST(AppendInputsAndIterator) { ...@@ -465,7 +466,7 @@ TEST(AppendInputsAndIterator) {
TEST(NullInputsSimple) { TEST(NullInputsSimple) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
Node* n0 = graph.NewNode(&dummy_operator0); Node* n0 = graph.NewNode(&dummy_operator0);
...@@ -493,7 +494,7 @@ TEST(NullInputsSimple) { ...@@ -493,7 +494,7 @@ TEST(NullInputsSimple) {
TEST(NullInputsAppended) { TEST(NullInputsAppended) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
Node* n0 = graph.NewNode(&dummy_operator0); Node* n0 = graph.NewNode(&dummy_operator0);
...@@ -517,7 +518,7 @@ TEST(NullInputsAppended) { ...@@ -517,7 +518,7 @@ TEST(NullInputsAppended) {
TEST(ReplaceUsesFromAppendedInputs) { TEST(ReplaceUsesFromAppendedInputs) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
Node* n0 = graph.NewNode(&dummy_operator0); Node* n0 = graph.NewNode(&dummy_operator0);
...@@ -546,7 +547,7 @@ TEST(ReplaceUsesFromAppendedInputs) { ...@@ -546,7 +547,7 @@ TEST(ReplaceUsesFromAppendedInputs) {
TEST(ReplaceInputMultipleUses) { TEST(ReplaceInputMultipleUses) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
Node* n0 = graph.NewNode(&dummy_operator0); Node* n0 = graph.NewNode(&dummy_operator0);
...@@ -565,7 +566,7 @@ TEST(ReplaceInputMultipleUses) { ...@@ -565,7 +566,7 @@ TEST(ReplaceInputMultipleUses) {
TEST(TrimInputCountInline) { TEST(TrimInputCountInline) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
{ {
...@@ -634,7 +635,7 @@ TEST(TrimInputCountInline) { ...@@ -634,7 +635,7 @@ TEST(TrimInputCountInline) {
TEST(TrimInputCountOutOfLine1) { TEST(TrimInputCountOutOfLine1) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
{ {
...@@ -729,7 +730,7 @@ TEST(TrimInputCountOutOfLine1) { ...@@ -729,7 +730,7 @@ TEST(TrimInputCountOutOfLine1) {
TEST(TrimInputCountOutOfLine2) { TEST(TrimInputCountOutOfLine2) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
{ {
...@@ -799,7 +800,7 @@ TEST(TrimInputCountOutOfLine2) { ...@@ -799,7 +800,7 @@ TEST(TrimInputCountOutOfLine2) {
TEST(NullAllInputs) { TEST(NullAllInputs) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
...@@ -852,7 +853,7 @@ TEST(NullAllInputs) { ...@@ -852,7 +853,7 @@ TEST(NullAllInputs) {
TEST(AppendAndTrim) { TEST(AppendAndTrim) {
v8::internal::AccountingAllocator allocator; v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
Node* nodes[] = { Node* nodes[] = {
......
...@@ -23,7 +23,8 @@ class RepresentationChangerTester : public HandleAndZoneScope, ...@@ -23,7 +23,8 @@ class RepresentationChangerTester : public HandleAndZoneScope,
public GraphAndBuilders { public GraphAndBuilders {
public: public:
explicit RepresentationChangerTester(int num_parameters = 0) explicit RepresentationChangerTester(int num_parameters = 0)
: GraphAndBuilders(main_zone()), : HandleAndZoneScope(kCompressGraphZone),
GraphAndBuilders(main_zone()),
javascript_(main_zone()), javascript_(main_zone()),
jsgraph_(main_isolate(), main_graph_, &main_common_, &javascript_, jsgraph_(main_isolate(), main_graph_, &main_common_, &javascript_,
&main_simplified_, &main_machine_), &main_simplified_, &main_machine_),
......
...@@ -262,7 +262,7 @@ Handle<Code> CompileGraph(const char* name, CallDescriptor* call_descriptor, ...@@ -262,7 +262,7 @@ Handle<Code> CompileGraph(const char* name, CallDescriptor* call_descriptor,
Handle<Code> WrapWithCFunction(Handle<Code> inner, Handle<Code> WrapWithCFunction(Handle<Code> inner,
CallDescriptor* call_descriptor) { CallDescriptor* call_descriptor) {
Zone zone(inner->GetIsolate()->allocator(), ZONE_NAME); Zone zone(inner->GetIsolate()->allocator(), ZONE_NAME, kCompressGraphZone);
int param_count = static_cast<int>(call_descriptor->ParameterCount()); int param_count = static_cast<int>(call_descriptor->ParameterCount());
GraphAndBuilders caller(&zone); GraphAndBuilders caller(&zone);
{ {
...@@ -429,7 +429,7 @@ class Computer { ...@@ -429,7 +429,7 @@ class Computer {
Handle<Code> inner = Handle<Code>::null(); Handle<Code> inner = Handle<Code>::null();
{ {
// Build the graph for the computation. // Build the graph for the computation.
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
RawMachineAssembler raw(isolate, &graph, desc); RawMachineAssembler raw(isolate, &graph, desc);
build(desc, &raw); build(desc, &raw);
...@@ -444,7 +444,7 @@ class Computer { ...@@ -444,7 +444,7 @@ class Computer {
Handle<Code> wrapper = Handle<Code>::null(); Handle<Code> wrapper = Handle<Code>::null();
{ {
// Wrap the above code with a callable function that passes constants. // Wrap the above code with a callable function that passes constants.
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
CallDescriptor* cdesc = Linkage::GetSimplifiedCDescriptor(&zone, &csig); CallDescriptor* cdesc = Linkage::GetSimplifiedCDescriptor(&zone, &csig);
RawMachineAssembler raw(isolate, &graph, cdesc); RawMachineAssembler raw(isolate, &graph, cdesc);
...@@ -478,7 +478,7 @@ class Computer { ...@@ -478,7 +478,7 @@ class Computer {
Handle<Code> wrapper = Handle<Code>::null(); Handle<Code> wrapper = Handle<Code>::null();
{ {
// Wrap the above code with a callable function that loads from {input}. // Wrap the above code with a callable function that loads from {input}.
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
CallDescriptor* cdesc = Linkage::GetSimplifiedCDescriptor(&zone, &csig); CallDescriptor* cdesc = Linkage::GetSimplifiedCDescriptor(&zone, &csig);
RawMachineAssembler raw(isolate, &graph, cdesc); RawMachineAssembler raw(isolate, &graph, cdesc);
...@@ -519,7 +519,7 @@ class Computer { ...@@ -519,7 +519,7 @@ class Computer {
static void TestInt32Sub(CallDescriptor* desc) { static void TestInt32Sub(CallDescriptor* desc) {
Isolate* isolate = CcTest::InitIsolateOnce(); Isolate* isolate = CcTest::InitIsolateOnce();
HandleScope scope(isolate); HandleScope scope(isolate);
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME, kCompressGraphZone);
GraphAndBuilders inner(&zone); GraphAndBuilders inner(&zone);
{ {
// Build the add function. // Build the add function.
...@@ -561,7 +561,7 @@ static void CopyTwentyInt32(CallDescriptor* desc) { ...@@ -561,7 +561,7 @@ static void CopyTwentyInt32(CallDescriptor* desc) {
Handle<Code> inner = Handle<Code>::null(); Handle<Code> inner = Handle<Code>::null();
{ {
// Writes all parameters into the output buffer. // Writes all parameters into the output buffer.
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
RawMachineAssembler raw(isolate, &graph, desc); RawMachineAssembler raw(isolate, &graph, desc);
Node* base = raw.PointerConstant(output); Node* base = raw.PointerConstant(output);
...@@ -578,7 +578,7 @@ static void CopyTwentyInt32(CallDescriptor* desc) { ...@@ -578,7 +578,7 @@ static void CopyTwentyInt32(CallDescriptor* desc) {
Handle<Code> wrapper = Handle<Code>::null(); Handle<Code> wrapper = Handle<Code>::null();
{ {
// Loads parameters from the input buffer and calls the above code. // Loads parameters from the input buffer and calls the above code.
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
CallDescriptor* cdesc = Linkage::GetSimplifiedCDescriptor(&zone, &csig); CallDescriptor* cdesc = Linkage::GetSimplifiedCDescriptor(&zone, &csig);
RawMachineAssembler raw(isolate, &graph, cdesc); RawMachineAssembler raw(isolate, &graph, cdesc);
...@@ -947,7 +947,7 @@ static void Build_Select_With_Call(CallDescriptor* desc, ...@@ -947,7 +947,7 @@ static void Build_Select_With_Call(CallDescriptor* desc,
{ {
Isolate* isolate = CcTest::InitIsolateOnce(); Isolate* isolate = CcTest::InitIsolateOnce();
// Build the actual select. // Build the actual select.
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
RawMachineAssembler raw(isolate, &graph, desc); RawMachineAssembler raw(isolate, &graph, desc);
raw.Return(raw.Parameter(which)); raw.Return(raw.Parameter(which));
...@@ -1044,7 +1044,7 @@ void MixedParamTest(int start) { ...@@ -1044,7 +1044,7 @@ void MixedParamTest(int start) {
Handle<Code> select; Handle<Code> select;
{ {
// build the select. // build the select.
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
RawMachineAssembler raw(isolate, &graph, desc); RawMachineAssembler raw(isolate, &graph, desc);
raw.Return(raw.Parameter(which)); raw.Return(raw.Parameter(which));
...@@ -1061,7 +1061,7 @@ void MixedParamTest(int start) { ...@@ -1061,7 +1061,7 @@ void MixedParamTest(int start) {
CSignatureOf<int32_t> csig; CSignatureOf<int32_t> csig;
{ {
// Wrap the select code with a callable function that passes constants. // Wrap the select code with a callable function that passes constants.
Zone zone(&allocator, ZONE_NAME); Zone zone(&allocator, ZONE_NAME, kCompressGraphZone);
Graph graph(&zone); Graph graph(&zone);
CallDescriptor* cdesc = Linkage::GetSimplifiedCDescriptor(&zone, &csig); CallDescriptor* cdesc = Linkage::GetSimplifiedCDescriptor(&zone, &csig);
RawMachineAssembler raw(isolate, &graph, cdesc); RawMachineAssembler raw(isolate, &graph, cdesc);
...@@ -1145,7 +1145,7 @@ void TestStackSlot(MachineType slot_type, T expected) { ...@@ -1145,7 +1145,7 @@ void TestStackSlot(MachineType slot_type, T expected) {
Allocator ralloc(rarray_gp, 1, rarray_fp, 1); Allocator ralloc(rarray_gp, 1, rarray_fp, 1);
RegisterConfig config(palloc, ralloc); RegisterConfig config(palloc, ralloc);
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME, kCompressGraphZone);
HandleScope scope(isolate); HandleScope scope(isolate);
MachineSignature::Builder builder(&zone, 1, 12); MachineSignature::Builder builder(&zone, 1, 12);
builder.AddReturn(MachineType::Int32()); builder.AddReturn(MachineType::Int32());
......
...@@ -2004,7 +2004,7 @@ WASM_EXEC_TEST(Infinite_Loop_not_taken2_brif) { ...@@ -2004,7 +2004,7 @@ WASM_EXEC_TEST(Infinite_Loop_not_taken2_brif) {
static void TestBuildGraphForSimpleExpression(WasmOpcode opcode) { static void TestBuildGraphForSimpleExpression(WasmOpcode opcode) {
Isolate* isolate = CcTest::InitIsolateOnce(); Isolate* isolate = CcTest::InitIsolateOnce();
Zone zone(isolate->allocator(), ZONE_NAME); Zone zone(isolate->allocator(), ZONE_NAME, kCompressGraphZone);
HandleScope scope(isolate); HandleScope scope(isolate);
// TODO(ahaas): Enable this test for externref opcodes when code generation // TODO(ahaas): Enable this test for externref opcodes when code generation
// for them is implemented. // for them is implemented.
......
...@@ -357,13 +357,13 @@ class WasmFunctionCompiler : public compiler::GraphAndBuilders { ...@@ -357,13 +357,13 @@ class WasmFunctionCompiler : public compiler::GraphAndBuilders {
// A helper class to build a module around Wasm bytecode, generate machine // A helper class to build a module around Wasm bytecode, generate machine
// code, and run that code. // code, and run that code.
class WasmRunnerBase : public HandleAndZoneScope { class WasmRunnerBase : public InitializedHandleScope {
public: public:
WasmRunnerBase(ManuallyImportedJSFunction* maybe_import, WasmRunnerBase(ManuallyImportedJSFunction* maybe_import,
ExecutionTier execution_tier, int num_params, ExecutionTier execution_tier, int num_params,
RuntimeExceptionSupport runtime_exception_support, RuntimeExceptionSupport runtime_exception_support,
LowerSimd lower_simd) LowerSimd lower_simd)
: zone_(&allocator_, ZONE_NAME), : zone_(&allocator_, ZONE_NAME, kCompressGraphZone),
builder_(&zone_, maybe_import, execution_tier, builder_(&zone_, maybe_import, execution_tier,
runtime_exception_support, lower_simd), runtime_exception_support, lower_simd),
wrapper_(&zone_, num_params) {} wrapper_(&zone_, num_params) {}
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#define V8_UNITTESTS_CODE_STUB_ASSEMBLER_UNITTEST_H_ #define V8_UNITTESTS_CODE_STUB_ASSEMBLER_UNITTEST_H_
#include "src/codegen/code-stub-assembler.h" #include "src/codegen/code-stub-assembler.h"
#include "src/zone/zone-fwd.h"
#include "test/unittests/test-utils.h" #include "test/unittests/test-utils.h"
#include "testing/gmock-support.h" #include "testing/gmock-support.h"
...@@ -14,7 +15,7 @@ namespace internal { ...@@ -14,7 +15,7 @@ namespace internal {
class CodeStubAssemblerTest : public TestWithIsolateAndZone { class CodeStubAssemblerTest : public TestWithIsolateAndZone {
public: public:
CodeStubAssemblerTest() = default; CodeStubAssemblerTest() : TestWithIsolateAndZone(kCompressGraphZone) {}
~CodeStubAssemblerTest() override = default; ~CodeStubAssemblerTest() override = default;
}; };
......
...@@ -17,7 +17,9 @@ namespace v8 { ...@@ -17,7 +17,9 @@ namespace v8 {
namespace internal { namespace internal {
namespace compiler { namespace compiler {
InstructionSelectorTest::InstructionSelectorTest() : rng_(FLAG_random_seed) {} InstructionSelectorTest::InstructionSelectorTest()
: TestWithNativeContextAndZone(kCompressGraphZone),
rng_(FLAG_random_seed) {}
InstructionSelectorTest::~InstructionSelectorTest() = default; InstructionSelectorTest::~InstructionSelectorTest() = default;
......
...@@ -234,7 +234,7 @@ class AB2Sorter final : public Reducer { ...@@ -234,7 +234,7 @@ class AB2Sorter final : public Reducer {
class AdvancedReducerTest : public TestWithZone { class AdvancedReducerTest : public TestWithZone {
public: public:
AdvancedReducerTest() : graph_(zone()) {} AdvancedReducerTest() : TestWithZone(kCompressGraphZone), graph_(zone()) {}
protected: protected:
Graph* graph() { return &graph_; } Graph* graph() { return &graph_; }
...@@ -411,7 +411,7 @@ TEST_F(AdvancedReducerTest, ReplaceWithValue_ControlUse3) { ...@@ -411,7 +411,7 @@ TEST_F(AdvancedReducerTest, ReplaceWithValue_ControlUse3) {
class GraphReducerTest : public TestWithZone { class GraphReducerTest : public TestWithZone {
public: public:
GraphReducerTest() : graph_(zone()) {} GraphReducerTest() : TestWithZone(kCompressGraphZone), graph_(zone()) {}
static void SetUpTestCase() { static void SetUpTestCase() {
TestWithZone::SetUpTestCase(); TestWithZone::SetUpTestCase();
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "src/compiler/node-properties.h" #include "src/compiler/node-properties.h"
#include "src/heap/factory.h" #include "src/heap/factory.h"
#include "src/objects/objects-inl.h" // TODO(everyone): Make typer.h IWYU compliant. #include "src/objects/objects-inl.h" // TODO(everyone): Make typer.h IWYU compliant.
#include "src/zone/zone-fwd.h"
#include "test/unittests/compiler/node-test-utils.h" #include "test/unittests/compiler/node-test-utils.h"
namespace v8 { namespace v8 {
...@@ -15,7 +16,8 @@ namespace internal { ...@@ -15,7 +16,8 @@ namespace internal {
namespace compiler { namespace compiler {
GraphTest::GraphTest(int num_parameters) GraphTest::GraphTest(int num_parameters)
: canonical_(isolate()), : TestWithNativeContextAndZone(kCompressGraphZone),
canonical_(isolate()),
common_(zone()), common_(zone()),
graph_(zone()), graph_(zone()),
broker_(isolate(), zone(), isolate()->NewPersistentHandles()), broker_(isolate(), zone(), isolate()->NewPersistentHandles()),
......
...@@ -23,6 +23,8 @@ MachineType kMachineTypes[] = { ...@@ -23,6 +23,8 @@ MachineType kMachineTypes[] = {
class LinkageTailCall : public TestWithZone { class LinkageTailCall : public TestWithZone {
protected: protected:
LinkageTailCall() : TestWithZone(kCompressGraphZone) {}
CallDescriptor* NewStandardCallDescriptor(LocationSignature* locations) { CallDescriptor* NewStandardCallDescriptor(LocationSignature* locations) {
DCHECK(arraysize(kMachineTypes) >= DCHECK(arraysize(kMachineTypes) >=
locations->return_count() + locations->parameter_count()); locations->return_count() + locations->parameter_count());
......
...@@ -18,6 +18,8 @@ namespace node_properties_unittest { ...@@ -18,6 +18,8 @@ namespace node_properties_unittest {
class NodePropertiesTest : public TestWithZone { class NodePropertiesTest : public TestWithZone {
public: public:
NodePropertiesTest() : TestWithZone(kCompressGraphZone) {}
Node* NewMockNode(const Operator* op) { Node* NewMockNode(const Operator* op) {
return Node::New(zone(), 0, op, 0, nullptr, false); return Node::New(zone(), 0, op, 0, nullptr, false);
} }
......
...@@ -17,7 +17,10 @@ namespace internal { ...@@ -17,7 +17,10 @@ namespace internal {
namespace compiler { namespace compiler {
namespace node_unittest { namespace node_unittest {
using NodeTest = TestWithZone; class NodeTest : public TestWithZone {
public:
NodeTest() : TestWithZone(kCompressGraphZone) {}
};
const IrOpcode::Value kOpcode0 = static_cast<IrOpcode::Value>(0); const IrOpcode::Value kOpcode0 = static_cast<IrOpcode::Value>(0);
const IrOpcode::Value kOpcode1 = static_cast<IrOpcode::Value>(1); const IrOpcode::Value kOpcode1 = static_cast<IrOpcode::Value>(1);
......
...@@ -2,8 +2,10 @@ ...@@ -2,8 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "src/compiler/node.h"
#include "src/compiler/schedule.h" #include "src/compiler/schedule.h"
#include "src/compiler/node.h"
#include "src/zone/zone-fwd.h"
#include "test/unittests/test-utils.h" #include "test/unittests/test-utils.h"
#include "testing/gmock/include/gmock/gmock.h" #include "testing/gmock/include/gmock/gmock.h"
...@@ -67,7 +69,10 @@ TEST_F(BasicBlockTest, GetCommonDominator3) { ...@@ -67,7 +69,10 @@ TEST_F(BasicBlockTest, GetCommonDominator3) {
EXPECT_EQ(&b0, BasicBlock::GetCommonDominator(&b3, &b1)); EXPECT_EQ(&b0, BasicBlock::GetCommonDominator(&b3, &b1));
} }
using ScheduleTest = TestWithZone; class ScheduleTest : public TestWithZone {
public:
ScheduleTest() : TestWithZone(kCompressGraphZone) {}
};
const Operator kCallOperator(IrOpcode::kCall, Operator::kNoProperties, const Operator kCallOperator(IrOpcode::kCall, Operator::kNoProperties,
"MockCall", 0, 0, 0, 0, 0, 0); "MockCall", 0, 0, 0, 0, 0, 0);
......
...@@ -30,7 +30,11 @@ namespace compiler { ...@@ -30,7 +30,11 @@ namespace compiler {
class SchedulerTest : public TestWithIsolateAndZone { class SchedulerTest : public TestWithIsolateAndZone {
public: public:
SchedulerTest() SchedulerTest()
: graph_(zone()), common_(zone()), simplified_(zone()), js_(zone()) {} : TestWithIsolateAndZone(kCompressGraphZone),
graph_(zone()),
common_(zone()),
simplified_(zone()),
js_(zone()) {}
Schedule* ComputeAndVerifySchedule(size_t expected) { Schedule* ComputeAndVerifySchedule(size_t expected) {
if (FLAG_trace_turbo) { if (FLAG_trace_turbo) {
......
...@@ -2,12 +2,14 @@ ...@@ -2,12 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "src/compiler/value-numbering-reducer.h"
#include <limits> #include <limits>
#include "src/compiler/graph.h" #include "src/compiler/graph.h"
#include "src/compiler/node.h" #include "src/compiler/node.h"
#include "src/compiler/operator.h" #include "src/compiler/operator.h"
#include "src/compiler/value-numbering-reducer.h" #include "src/zone/zone-fwd.h"
#include "test/unittests/test-utils.h" #include "test/unittests/test-utils.h"
namespace v8 { namespace v8 {
...@@ -30,7 +32,9 @@ static const TestOperator kOp1(1, Operator::kIdempotent, 1, 1); ...@@ -30,7 +32,9 @@ static const TestOperator kOp1(1, Operator::kIdempotent, 1, 1);
class ValueNumberingReducerTest : public TestWithZone { class ValueNumberingReducerTest : public TestWithZone {
public: public:
ValueNumberingReducerTest() ValueNumberingReducerTest()
: graph_(zone()), reducer_(zone(), graph()->zone()) {} : TestWithZone(kCompressGraphZone),
graph_(zone()),
reducer_(zone(), graph()->zone()) {}
protected: protected:
Reduction Reduce(Node* node) { return reducer_.Reduce(node); } Reduction Reduce(Node* node) { return reducer_.Reduce(node); }
......
...@@ -28,7 +28,7 @@ class InterpreterAssemblerTestState : public compiler::CodeAssemblerState { ...@@ -28,7 +28,7 @@ class InterpreterAssemblerTestState : public compiler::CodeAssemblerState {
class InterpreterAssemblerTest : public TestWithIsolateAndZone { class InterpreterAssemblerTest : public TestWithIsolateAndZone {
public: public:
InterpreterAssemblerTest() = default; InterpreterAssemblerTest() : TestWithIsolateAndZone(kCompressGraphZone) {}
~InterpreterAssemblerTest() override = default; ~InterpreterAssemblerTest() override = default;
class InterpreterAssemblerForTest final : public InterpreterAssembler { class InterpreterAssemblerForTest final : public InterpreterAssembler {
......
...@@ -205,7 +205,8 @@ class WithInternalIsolateMixin : public TMixin { ...@@ -205,7 +205,8 @@ class WithInternalIsolateMixin : public TMixin {
template <typename TMixin> template <typename TMixin>
class WithZoneMixin : public TMixin { class WithZoneMixin : public TMixin {
public: public:
WithZoneMixin() : zone_(&allocator_, ZONE_NAME) {} explicit WithZoneMixin(bool support_zone_compression = false)
: zone_(&allocator_, ZONE_NAME, support_zone_compression) {}
Zone* zone() { return &zone_; } Zone* zone() { return &zone_; }
...@@ -224,11 +225,11 @@ using TestWithIsolate = // ...@@ -224,11 +225,11 @@ using TestWithIsolate = //
using TestWithZone = WithZoneMixin<::testing::Test>; using TestWithZone = WithZoneMixin<::testing::Test>;
using TestWithIsolateAndZone = // using TestWithIsolateAndZone = //
WithInternalIsolateMixin< // WithZoneMixin< //
WithIsolateScopeMixin< // WithInternalIsolateMixin< //
WithIsolateMixin< // WithIsolateScopeMixin< //
WithZoneMixin< // WithIsolateMixin< //
::testing::Test>>>>; ::testing::Test>>>>;
using TestWithNativeContext = // using TestWithNativeContext = //
......
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