Expose a lower bound of malloc'd memory via heap statistics
We expect that the majority of malloc'd memory held by V8 is allocated in Zone objects. Introduce an Allocator class that is used by Zones to manage memory, and allows for querying the current usage. BUG=none R=titzer@chromium.org,bmeurer@chromium.org,jarin@chromium.org LOG=n TBR=rossberg@chromium.org Review URL: https://codereview.chromium.org/1847543002 Cr-Commit-Position: refs/heads/master@{#35196}
This commit is contained in:
parent
3ffee875ef
commit
cb7aa79b12
2
BUILD.gn
2
BUILD.gn
@ -1752,6 +1752,8 @@ source_set("v8_libbase") {
|
||||
visibility = [ ":*" ] # Only targets in this file can depend on this.
|
||||
|
||||
sources = [
|
||||
"src/base/accounting-allocator.cc",
|
||||
"src/base/accounting-allocator.h",
|
||||
"src/base/adapters.h",
|
||||
"src/base/atomicops.h",
|
||||
"src/base/atomicops_internals_arm64_gcc.h",
|
||||
|
@ -5186,6 +5186,7 @@ class V8_EXPORT HeapStatistics {
|
||||
size_t total_available_size() { return total_available_size_; }
|
||||
size_t used_heap_size() { return used_heap_size_; }
|
||||
size_t heap_size_limit() { return heap_size_limit_; }
|
||||
size_t malloced_memory() { return malloced_memory_; }
|
||||
size_t does_zap_garbage() { return does_zap_garbage_; }
|
||||
|
||||
private:
|
||||
@ -5195,6 +5196,7 @@ class V8_EXPORT HeapStatistics {
|
||||
size_t total_available_size_;
|
||||
size_t used_heap_size_;
|
||||
size_t heap_size_limit_;
|
||||
size_t malloced_memory_;
|
||||
bool does_zap_garbage_;
|
||||
|
||||
friend class V8;
|
||||
|
12
src/api.cc
12
src/api.cc
@ -5494,13 +5494,15 @@ bool v8::V8::Dispose() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
HeapStatistics::HeapStatistics(): total_heap_size_(0),
|
||||
HeapStatistics::HeapStatistics()
|
||||
: total_heap_size_(0),
|
||||
total_heap_size_executable_(0),
|
||||
total_physical_size_(0),
|
||||
total_available_size_(0),
|
||||
used_heap_size_(0),
|
||||
heap_size_limit_(0) { }
|
||||
|
||||
heap_size_limit_(0),
|
||||
malloced_memory_(0),
|
||||
does_zap_garbage_(0) {}
|
||||
|
||||
HeapSpaceStatistics::HeapSpaceStatistics(): space_name_(0),
|
||||
space_size_(0),
|
||||
@ -7401,6 +7403,8 @@ void Isolate::GetHeapStatistics(HeapStatistics* heap_statistics) {
|
||||
heap_statistics->total_available_size_ = heap->Available();
|
||||
heap_statistics->used_heap_size_ = heap->SizeOfObjects();
|
||||
heap_statistics->heap_size_limit_ = heap->MaxReserved();
|
||||
heap_statistics->malloced_memory_ =
|
||||
isolate->allocator()->GetCurrentMemoryUsage();
|
||||
heap_statistics->does_zap_garbage_ = heap->ShouldZapGarbage();
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ BackgroundParsingTask::BackgroundParsingTask(
|
||||
|
||||
// Prepare the data for the internalization phase and compilation phase, which
|
||||
// will happen in the main thread after parsing.
|
||||
Zone* zone = new Zone();
|
||||
Zone* zone = new Zone(isolate->allocator());
|
||||
ParseInfo* info = new ParseInfo(zone);
|
||||
source->zone.Reset(zone);
|
||||
source->info.Reset(info);
|
||||
|
33
src/base/accounting-allocator.cc
Normal file
33
src/base/accounting-allocator.cc
Normal file
@ -0,0 +1,33 @@
|
||||
// Copyright 2016 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "src/base/accounting-allocator.h"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
#if V8_LIBC_BIONIC
|
||||
#include <malloc.h> // NOLINT
|
||||
#endif
|
||||
|
||||
namespace v8 {
|
||||
namespace base {
|
||||
|
||||
void* AccountingAllocator::Allocate(size_t bytes) {
|
||||
void* memory = malloc(bytes);
|
||||
if (memory) NoBarrier_AtomicIncrement(¤t_memory_usage_, bytes);
|
||||
return memory;
|
||||
}
|
||||
|
||||
void AccountingAllocator::Free(void* memory, size_t bytes) {
|
||||
free(memory);
|
||||
NoBarrier_AtomicIncrement(¤t_memory_usage_,
|
||||
-static_cast<AtomicWord>(bytes));
|
||||
}
|
||||
|
||||
size_t AccountingAllocator::GetCurrentMemoryUsage() const {
|
||||
return NoBarrier_Load(¤t_memory_usage_);
|
||||
}
|
||||
|
||||
} // namespace base
|
||||
} // namespace v8
|
34
src/base/accounting-allocator.h
Normal file
34
src/base/accounting-allocator.h
Normal file
@ -0,0 +1,34 @@
|
||||
// Copyright 2016 the V8 project authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef V8_BASE_ACCOUNTING_ALLOCATOR_H_
|
||||
#define V8_BASE_ACCOUNTING_ALLOCATOR_H_
|
||||
|
||||
#include "src/base/atomicops.h"
|
||||
#include "src/base/macros.h"
|
||||
|
||||
namespace v8 {
|
||||
namespace base {
|
||||
|
||||
class AccountingAllocator final {
|
||||
public:
|
||||
AccountingAllocator() = default;
|
||||
~AccountingAllocator() = default;
|
||||
|
||||
// Returns nullptr on failed allocation.
|
||||
void* Allocate(size_t bytes);
|
||||
void Free(void* memory, size_t bytes);
|
||||
|
||||
size_t GetCurrentMemoryUsage() const;
|
||||
|
||||
private:
|
||||
AtomicWord current_memory_usage_ = 0;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(AccountingAllocator);
|
||||
};
|
||||
|
||||
} // namespace base
|
||||
} // namespace v8
|
||||
|
||||
#endif // V8_BASE_ACCOUNTING_ALLOCATOR_H_
|
@ -4579,7 +4579,7 @@ Handle<Code> MacroAssemblerBuilder(Isolate* isolate,
|
||||
|
||||
Handle<Code> CodeStubAssemblerBuilder(Isolate* isolate,
|
||||
BuiltinDesc const* builtin_desc) {
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
compiler::CodeStubAssembler assembler(isolate, &zone, builtin_desc->argc,
|
||||
builtin_desc->flags,
|
||||
builtin_desc->s_name);
|
||||
|
@ -297,7 +297,7 @@ static Handle<Code> DoGenerateCode(Stub* stub) {
|
||||
if (FLAG_profile_hydrogen_code_stub_compilation) {
|
||||
timer.Start();
|
||||
}
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
CompilationInfo info(CodeStub::MajorName(stub->MajorKey()), isolate, &zone,
|
||||
stub->GetCodeFlags());
|
||||
// Parameter count is number of stack parameters.
|
||||
|
@ -455,7 +455,7 @@ void CompareICStub::Generate(MacroAssembler* masm) {
|
||||
|
||||
Handle<Code> TurboFanCodeStub::GenerateCode() {
|
||||
const char* name = CodeStub::MajorName(MajorKey());
|
||||
Zone zone;
|
||||
Zone zone(isolate()->allocator());
|
||||
CallInterfaceDescriptor descriptor(GetCallInterfaceDescriptor());
|
||||
compiler::CodeStubAssembler assembler(isolate(), &zone, descriptor,
|
||||
GetCodeFlags(), name);
|
||||
|
@ -85,7 +85,8 @@ class CompilationHandleScope BASE_EMBEDDED {
|
||||
class CompilationInfoWithZone : public CompilationInfo {
|
||||
public:
|
||||
explicit CompilationInfoWithZone(Handle<JSFunction> function)
|
||||
: CompilationInfo(new ParseInfo(&zone_, function)) {}
|
||||
: CompilationInfo(new ParseInfo(&zone_, function)),
|
||||
zone_(function->GetIsolate()->allocator()) {}
|
||||
|
||||
// Virtual destructor because a CompilationInfoWithZone has to exit the
|
||||
// zone scope and get rid of dependent maps even when the destructor is
|
||||
@ -1175,7 +1176,7 @@ bool CompileEvalForDebugging(Handle<JSFunction> function,
|
||||
Handle<Script> script(Script::cast(shared->script()));
|
||||
Handle<Context> context(function->context());
|
||||
|
||||
Zone zone;
|
||||
Zone zone(function->GetIsolate()->allocator());
|
||||
ParseInfo parse_info(&zone, script);
|
||||
CompilationInfo info(&parse_info);
|
||||
Isolate* isolate = info.isolate();
|
||||
@ -1430,7 +1431,7 @@ bool Compiler::CompileDebugCode(Handle<JSFunction> function) {
|
||||
bool Compiler::CompileDebugCode(Handle<SharedFunctionInfo> shared) {
|
||||
DCHECK(shared->allows_lazy_compilation_without_context());
|
||||
DCHECK(!IsEvalToplevel(shared));
|
||||
Zone zone;
|
||||
Zone zone(shared->GetIsolate()->allocator());
|
||||
ParseInfo parse_info(&zone, shared);
|
||||
CompilationInfo info(&parse_info);
|
||||
return CompileForDebugging(&info);
|
||||
@ -1483,7 +1484,7 @@ bool Compiler::EnsureDeoptimizationSupport(CompilationInfo* info) {
|
||||
|
||||
void Compiler::CompileForLiveEdit(Handle<Script> script) {
|
||||
// TODO(635): support extensions.
|
||||
Zone zone;
|
||||
Zone zone(script->GetIsolate()->allocator());
|
||||
ParseInfo parse_info(&zone, script);
|
||||
CompilationInfo info(&parse_info);
|
||||
PostponeInterruptsScope postpone(info.isolate());
|
||||
@ -1530,7 +1531,7 @@ MaybeHandle<JSFunction> Compiler::GetFunctionFromEval(
|
||||
script->set_column_offset(column_offset);
|
||||
}
|
||||
script->set_origin_options(options);
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
ParseInfo parse_info(&zone, script);
|
||||
CompilationInfo info(&parse_info);
|
||||
parse_info.set_eval();
|
||||
@ -1654,7 +1655,7 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfoForScript(
|
||||
}
|
||||
|
||||
// Compile the function and add it to the cache.
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
ParseInfo parse_info(&zone, script);
|
||||
CompilationInfo info(&parse_info);
|
||||
if (is_module) {
|
||||
@ -1758,7 +1759,7 @@ Handle<SharedFunctionInfo> Compiler::GetSharedFunctionInfo(
|
||||
result->set_is_toplevel(false);
|
||||
}
|
||||
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
ParseInfo parse_info(&zone, script);
|
||||
CompilationInfo info(&parse_info);
|
||||
parse_info.set_literal(literal);
|
||||
|
@ -20,7 +20,7 @@ namespace compiler {
|
||||
void GraphReplayPrinter::PrintReplay(Graph* graph) {
|
||||
GraphReplayPrinter replay;
|
||||
PrintF(" Node* nil = graph()->NewNode(common()->Dead());\n");
|
||||
Zone zone;
|
||||
Zone zone(graph->zone()->allocator());
|
||||
AllNodes nodes(&zone, graph);
|
||||
|
||||
// Allocate the nodes first.
|
||||
|
@ -197,7 +197,8 @@ class JSONGraphEdgeWriter {
|
||||
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const AsJSON& ad) {
|
||||
Zone tmp_zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone tmp_zone(&allocator);
|
||||
os << "{\n\"nodes\":[";
|
||||
JSONGraphNodeWriter(os, &tmp_zone, &ad.graph, ad.positions).Print();
|
||||
os << "],\n\"edges\":[";
|
||||
@ -583,14 +584,16 @@ void GraphC1Visualizer::PrintLiveRange(const LiveRange* range, const char* type,
|
||||
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const AsC1VCompilation& ac) {
|
||||
Zone tmp_zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone tmp_zone(&allocator);
|
||||
GraphC1Visualizer(os, &tmp_zone).PrintCompilation(ac.info_);
|
||||
return os;
|
||||
}
|
||||
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const AsC1V& ac) {
|
||||
Zone tmp_zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone tmp_zone(&allocator);
|
||||
GraphC1Visualizer(os, &tmp_zone)
|
||||
.PrintSchedule(ac.phase_, ac.schedule_, ac.positions_, ac.instructions_);
|
||||
return os;
|
||||
@ -599,7 +602,8 @@ std::ostream& operator<<(std::ostream& os, const AsC1V& ac) {
|
||||
|
||||
std::ostream& operator<<(std::ostream& os,
|
||||
const AsC1VRegisterAllocationData& ac) {
|
||||
Zone tmp_zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone tmp_zone(&allocator);
|
||||
GraphC1Visualizer(os, &tmp_zone).PrintLiveRanges(ac.phase_, ac.data_);
|
||||
return os;
|
||||
}
|
||||
@ -609,7 +613,8 @@ const int kOnStack = 1;
|
||||
const int kVisited = 2;
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const AsRPO& ar) {
|
||||
Zone local_zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone local_zone(&allocator);
|
||||
ZoneVector<byte> state(ar.graph.NodeCount(), kUnvisited, &local_zone);
|
||||
ZoneStack<Node*> stack(&local_zone);
|
||||
|
||||
|
@ -412,7 +412,7 @@ Reduction JSInliner::ReduceJSCall(Node* node, Handle<JSFunction> function) {
|
||||
return NoChange();
|
||||
}
|
||||
|
||||
Zone zone;
|
||||
Zone zone(info_->isolate()->allocator());
|
||||
ParseInfo parse_info(&zone, function);
|
||||
CompilationInfo info(&parse_info);
|
||||
if (info_->is_deoptimization_enabled()) info.MarkAsDeoptimizationEnabled();
|
||||
|
@ -143,7 +143,7 @@ void JumpThreading::ApplyForwarding(ZoneVector<RpoNumber>& result,
|
||||
InstructionSequence* code) {
|
||||
if (!FLAG_turbo_jt) return;
|
||||
|
||||
Zone local_zone;
|
||||
Zone local_zone(code->isolate()->allocator());
|
||||
ZoneVector<bool> skip(static_cast<int>(result.size()), false, &local_zone);
|
||||
|
||||
// Skip empty blocks when the previous block doesn't fall through.
|
||||
|
@ -116,6 +116,8 @@ class LoopTree : public ZoneObject {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Zone* zone() const { return zone_; }
|
||||
|
||||
private:
|
||||
friend class LoopFinderImpl;
|
||||
|
||||
|
@ -184,7 +184,7 @@ static void FindLoopExits(LoopTree* loop_tree, LoopTree::Loop* loop,
|
||||
|
||||
|
||||
bool LoopPeeler::CanPeel(LoopTree* loop_tree, LoopTree::Loop* loop) {
|
||||
Zone zone;
|
||||
Zone zone(loop_tree->zone()->allocator());
|
||||
NodeVector exits(&zone);
|
||||
NodeVector rets(&zone);
|
||||
FindLoopExits(loop_tree, loop, exits, rets);
|
||||
|
@ -1094,7 +1094,7 @@ void Pipeline::RunPrintAndVerify(const char* phase, bool untyped) {
|
||||
|
||||
|
||||
Handle<Code> Pipeline::GenerateCode() {
|
||||
ZonePool zone_pool;
|
||||
ZonePool zone_pool(isolate()->allocator());
|
||||
base::SmartPointer<PipelineStatistics> pipeline_statistics;
|
||||
|
||||
if (FLAG_turbo_stats) {
|
||||
@ -1255,7 +1255,7 @@ Handle<Code> Pipeline::GenerateCodeForCodeStub(Isolate* isolate,
|
||||
CompilationInfo info(debug_name, isolate, graph->zone(), flags);
|
||||
|
||||
// Construct a pipeline for scheduling and code generation.
|
||||
ZonePool zone_pool;
|
||||
ZonePool zone_pool(isolate->allocator());
|
||||
PipelineData data(&zone_pool, &info, graph, schedule);
|
||||
base::SmartPointer<PipelineStatistics> pipeline_statistics;
|
||||
if (FLAG_turbo_stats) {
|
||||
@ -1296,7 +1296,7 @@ Handle<Code> Pipeline::GenerateCodeForTesting(CompilationInfo* info,
|
||||
Graph* graph,
|
||||
Schedule* schedule) {
|
||||
// Construct a pipeline for scheduling and code generation.
|
||||
ZonePool zone_pool;
|
||||
ZonePool zone_pool(info->isolate()->allocator());
|
||||
PipelineData data(&zone_pool, info, graph, schedule);
|
||||
base::SmartPointer<PipelineStatistics> pipeline_statistics;
|
||||
if (FLAG_turbo_stats) {
|
||||
@ -1319,7 +1319,7 @@ bool Pipeline::AllocateRegistersForTesting(const RegisterConfiguration* config,
|
||||
InstructionSequence* sequence,
|
||||
bool run_verifier) {
|
||||
CompilationInfo info("testing", sequence->isolate(), sequence->zone());
|
||||
ZonePool zone_pool;
|
||||
ZonePool zone_pool(sequence->isolate()->allocator());
|
||||
PipelineData data(&zone_pool, &info, sequence);
|
||||
Pipeline pipeline(&info);
|
||||
pipeline.data_ = &data;
|
||||
@ -1442,7 +1442,7 @@ void Pipeline::AllocateRegisters(const RegisterConfiguration* config,
|
||||
base::SmartPointer<Zone> verifier_zone;
|
||||
RegisterAllocatorVerifier* verifier = nullptr;
|
||||
if (run_verifier) {
|
||||
verifier_zone.Reset(new Zone());
|
||||
verifier_zone.Reset(new Zone(isolate()->allocator()));
|
||||
verifier = new (verifier_zone.get()) RegisterAllocatorVerifier(
|
||||
verifier_zone.get(), config, data->sequence());
|
||||
}
|
||||
|
@ -63,7 +63,7 @@ Reduction SelectLowering::Reduce(Node* node) {
|
||||
bool SelectLowering::ReachableFrom(Node* const sink, Node* const source) {
|
||||
// TODO(turbofan): This is probably horribly expensive, and it should be moved
|
||||
// into node.h or somewhere else?!
|
||||
Zone zone;
|
||||
Zone zone(graph()->zone()->allocator());
|
||||
std::queue<Node*, NodeDeque> queue((NodeDeque(&zone)));
|
||||
BoolVector visited(graph()->NodeCount(), false, &zone);
|
||||
queue.push(source);
|
||||
|
@ -980,7 +980,7 @@ void Verifier::Visitor::Check(Node* node) {
|
||||
void Verifier::Run(Graph* graph, Typing typing) {
|
||||
CHECK_NOT_NULL(graph->start());
|
||||
CHECK_NOT_NULL(graph->end());
|
||||
Zone zone;
|
||||
Zone zone(graph->zone()->allocator());
|
||||
Visitor visitor(&zone, typing);
|
||||
AllNodes all(&zone, graph);
|
||||
for (Node* node : all.live) visitor.Check(node);
|
||||
@ -1070,7 +1070,7 @@ static void CheckInputsDominate(Schedule* schedule, BasicBlock* block,
|
||||
|
||||
void ScheduleVerifier::Run(Schedule* schedule) {
|
||||
const size_t count = schedule->BasicBlockCount();
|
||||
Zone tmp_zone;
|
||||
Zone tmp_zone(schedule->zone()->allocator());
|
||||
Zone* zone = &tmp_zone;
|
||||
BasicBlock* start = schedule->start();
|
||||
BasicBlockVector* rpo_order = schedule->rpo_order();
|
||||
|
@ -2523,7 +2523,7 @@ Handle<JSFunction> CompileJSToWasmWrapper(
|
||||
//----------------------------------------------------------------------------
|
||||
// Create the Graph
|
||||
//----------------------------------------------------------------------------
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
Graph graph(&zone);
|
||||
CommonOperatorBuilder common(&zone);
|
||||
JSOperatorBuilder javascript(&zone);
|
||||
@ -2615,7 +2615,7 @@ Handle<Code> CompileWasmToJSWrapper(Isolate* isolate, wasm::ModuleEnv* module,
|
||||
//----------------------------------------------------------------------------
|
||||
// Create the Graph
|
||||
//----------------------------------------------------------------------------
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
Graph graph(&zone);
|
||||
CommonOperatorBuilder common(&zone);
|
||||
JSOperatorBuilder javascript(&zone);
|
||||
@ -2709,7 +2709,7 @@ Handle<Code> CompileWasmFunction(wasm::ErrorThrower& thrower, Isolate* isolate,
|
||||
}
|
||||
|
||||
// Create a TF graph during decoding.
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
Graph graph(&zone);
|
||||
CommonOperatorBuilder common(&zone);
|
||||
MachineOperatorBuilder machine(
|
||||
@ -2721,7 +2721,8 @@ Handle<Code> CompileWasmFunction(wasm::ErrorThrower& thrower, Isolate* isolate,
|
||||
module_env, function.sig, module_env->module->module_start,
|
||||
module_env->module->module_start + function.code_start_offset,
|
||||
module_env->module->module_start + function.code_end_offset};
|
||||
wasm::TreeResult result = wasm::BuildTFGraph(&builder, body);
|
||||
wasm::TreeResult result =
|
||||
wasm::BuildTFGraph(isolate->allocator(), &builder, body);
|
||||
|
||||
if (result.failed()) {
|
||||
if (FLAG_trace_wasm_compiler) {
|
||||
@ -2740,7 +2741,7 @@ Handle<Code> CompileWasmFunction(wasm::ErrorThrower& thrower, Isolate* isolate,
|
||||
|
||||
int index = static_cast<int>(function.func_index);
|
||||
if (index >= FLAG_trace_wasm_ast_start && index < FLAG_trace_wasm_ast_end) {
|
||||
PrintAst(body);
|
||||
PrintAst(isolate->allocator(), body);
|
||||
}
|
||||
|
||||
if (FLAG_trace_wasm_decode_time) {
|
||||
|
@ -64,9 +64,8 @@ void ZonePool::StatsScope::ZoneReturned(Zone* zone) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ZonePool::ZonePool() : max_allocated_bytes_(0), total_deleted_bytes_(0) {}
|
||||
|
||||
ZonePool::ZonePool(base::AccountingAllocator* allocator)
|
||||
: max_allocated_bytes_(0), total_deleted_bytes_(0), allocator_(allocator) {}
|
||||
|
||||
ZonePool::~ZonePool() {
|
||||
DCHECK(used_.empty());
|
||||
@ -103,7 +102,7 @@ Zone* ZonePool::NewEmptyZone() {
|
||||
zone = unused_.back();
|
||||
unused_.pop_back();
|
||||
} else {
|
||||
zone = new Zone();
|
||||
zone = new Zone(allocator_);
|
||||
}
|
||||
used_.push_back(zone);
|
||||
DCHECK_EQ(0u, zone->allocation_size());
|
||||
|
@ -61,7 +61,7 @@ class ZonePool final {
|
||||
DISALLOW_COPY_AND_ASSIGN(StatsScope);
|
||||
};
|
||||
|
||||
ZonePool();
|
||||
explicit ZonePool(base::AccountingAllocator* allocator);
|
||||
~ZonePool();
|
||||
|
||||
size_t GetMaxAllocatedBytes();
|
||||
@ -82,6 +82,7 @@ class ZonePool final {
|
||||
Stats stats_;
|
||||
size_t max_allocated_bytes_;
|
||||
size_t total_deleted_bytes_;
|
||||
base::AccountingAllocator* allocator_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(ZonePool);
|
||||
};
|
||||
|
@ -11,7 +11,7 @@ namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
CompilationPhase::CompilationPhase(const char* name, CompilationInfo* info)
|
||||
: name_(name), info_(info) {
|
||||
: name_(name), info_(info), zone_(info->isolate()->allocator()) {
|
||||
if (FLAG_hydrogen_stats) {
|
||||
info_zone_start_allocation_size_ = info->zone()->allocation_size();
|
||||
timer_.Start();
|
||||
|
@ -510,9 +510,9 @@ LifetimePosition LiveRange::FirstIntersection(LiveRange* other) {
|
||||
return LifetimePosition::Invalid();
|
||||
}
|
||||
|
||||
|
||||
LAllocator::LAllocator(int num_values, HGraph* graph)
|
||||
: chunk_(NULL),
|
||||
: zone_(graph->isolate()->allocator()),
|
||||
chunk_(NULL),
|
||||
live_in_sets_(graph->blocks()->length(), zone()),
|
||||
live_ranges_(num_values * 2, zone()),
|
||||
fixed_live_ranges_(NULL),
|
||||
@ -529,7 +529,6 @@ LAllocator::LAllocator(int num_values, HGraph* graph)
|
||||
has_osr_entry_(false),
|
||||
allocation_ok_(true) {}
|
||||
|
||||
|
||||
void LAllocator::InitializeLivenessAnalysis() {
|
||||
// Initialize the live_in sets for each block to NULL.
|
||||
int block_count = graph_->blocks()->length();
|
||||
|
@ -82,7 +82,7 @@ ScopeIterator::ScopeIterator(Isolate* isolate, FrameInspector* frame_inspector,
|
||||
// Reparse the code and analyze the scopes.
|
||||
Scope* scope = NULL;
|
||||
// Check whether we are in global, eval or function code.
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
if (scope_info->scope_type() != FUNCTION_SCOPE) {
|
||||
// Global or eval code.
|
||||
Handle<Script> script(Script::cast(shared_info->script()));
|
||||
|
@ -1700,7 +1700,7 @@ static const char* DropActivationsInActiveThreadImpl(Isolate* isolate,
|
||||
TARGET& target, // NOLINT
|
||||
bool do_drop) {
|
||||
Debug* debug = isolate->debug();
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
Vector<StackFrame*> frames = CreateStackMap(isolate, &zone);
|
||||
|
||||
|
||||
|
@ -307,7 +307,7 @@ void Deoptimizer::DeoptimizeMarkedCodeForContext(Context* context) {
|
||||
|
||||
// Move marked code from the optimized code list to the deoptimized
|
||||
// code list, collecting them into a ZoneList.
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
ZoneList<Code*> codes(10, &zone);
|
||||
|
||||
// Walk over all optimized code objects in this native context.
|
||||
|
@ -17,7 +17,7 @@ namespace v8 {
|
||||
namespace internal {
|
||||
|
||||
FastAccessorAssembler::FastAccessorAssembler(Isolate* isolate)
|
||||
: zone_(),
|
||||
: zone_(isolate->allocator()),
|
||||
isolate_(isolate),
|
||||
assembler_(new CodeStubAssembler(isolate, zone(), 1,
|
||||
Code::ComputeFlags(Code::STUB),
|
||||
|
@ -1941,7 +1941,7 @@ static void UnregisterCodeEntry(JITCodeEntry* entry) {
|
||||
|
||||
static JITCodeEntry* CreateELFObject(CodeDescription* desc, Isolate* isolate) {
|
||||
#ifdef __MACH_O
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
MachO mach_o(&zone);
|
||||
Writer w(&mach_o);
|
||||
|
||||
@ -1953,7 +1953,7 @@ static JITCodeEntry* CreateELFObject(CodeDescription* desc, Isolate* isolate) {
|
||||
|
||||
mach_o.Write(&w, desc->CodeStart(), desc->CodeSize());
|
||||
#else
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
ELF elf(&zone);
|
||||
Writer w(&elf);
|
||||
|
||||
|
@ -118,9 +118,8 @@ Address HandleScope::current_limit_address(Isolate* isolate) {
|
||||
return reinterpret_cast<Address>(&isolate->handle_scope_data()->limit);
|
||||
}
|
||||
|
||||
|
||||
CanonicalHandleScope::CanonicalHandleScope(Isolate* isolate)
|
||||
: isolate_(isolate) {
|
||||
: isolate_(isolate), zone_(isolate->allocator()) {
|
||||
HandleScopeData* handle_scope_data = isolate_->handle_scope_data();
|
||||
prev_canonical_scope_ = handle_scope_data->canonical_scope;
|
||||
handle_scope_data->canonical_scope = this;
|
||||
|
@ -30,7 +30,7 @@ Interpreter::Interpreter(Isolate* isolate) : isolate_(isolate) {
|
||||
void Interpreter::Initialize() {
|
||||
DCHECK(FLAG_ignition);
|
||||
if (IsDispatchTableInitialized()) return;
|
||||
Zone zone;
|
||||
Zone zone(isolate_->allocator());
|
||||
HandleScope scope(isolate_);
|
||||
|
||||
// Generate bytecode handlers for all bytecodes and scales.
|
||||
|
@ -1816,6 +1816,8 @@ Isolate::Isolate(bool enable_serializer)
|
||||
descriptor_lookup_cache_(NULL),
|
||||
handle_scope_implementer_(NULL),
|
||||
unicode_cache_(NULL),
|
||||
runtime_zone_(&allocator_),
|
||||
interface_descriptor_zone_(&allocator_),
|
||||
inner_pointer_to_code_cache_(NULL),
|
||||
global_handles_(NULL),
|
||||
eternal_handles_(NULL),
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "include/v8-debug.h"
|
||||
#include "src/allocation.h"
|
||||
#include "src/assert-scope.h"
|
||||
#include "src/base/accounting-allocator.h"
|
||||
#include "src/base/atomicops.h"
|
||||
#include "src/builtins.h"
|
||||
#include "src/cancelable-task.h"
|
||||
@ -26,8 +27,8 @@
|
||||
#include "src/messages.h"
|
||||
#include "src/optimizing-compile-dispatcher.h"
|
||||
#include "src/regexp/regexp-stack.h"
|
||||
#include "src/runtime/runtime.h"
|
||||
#include "src/runtime-profiler.h"
|
||||
#include "src/runtime/runtime.h"
|
||||
#include "src/zone.h"
|
||||
|
||||
namespace v8 {
|
||||
@ -1118,6 +1119,8 @@ class Isolate {
|
||||
|
||||
interpreter::Interpreter* interpreter() const { return interpreter_; }
|
||||
|
||||
base::AccountingAllocator* allocator() { return &allocator_; }
|
||||
|
||||
protected:
|
||||
explicit Isolate(bool enable_serializer);
|
||||
|
||||
@ -1258,6 +1261,7 @@ class Isolate {
|
||||
HandleScopeData handle_scope_data_;
|
||||
HandleScopeImplementer* handle_scope_implementer_;
|
||||
UnicodeCache* unicode_cache_;
|
||||
base::AccountingAllocator allocator_;
|
||||
Zone runtime_zone_;
|
||||
Zone interface_descriptor_zone_;
|
||||
InnerPointerToCodeCache* inner_pointer_to_code_cache_;
|
||||
|
@ -37,6 +37,7 @@ class JsonParser BASE_EMBEDDED {
|
||||
source_length_(source->length()),
|
||||
isolate_(source->map()->GetHeap()->isolate()),
|
||||
factory_(isolate_->factory()),
|
||||
zone_(isolate_->allocator()),
|
||||
object_constructor_(isolate_->native_context()->object_function(),
|
||||
isolate_),
|
||||
position_(-1) {
|
||||
|
@ -8647,7 +8647,7 @@ Maybe<bool> JSProxy::OwnPropertyKeys(Isolate* isolate,
|
||||
return accumulator->AddKeysFromProxy(proxy, trap_result);
|
||||
}
|
||||
// 16. Let uncheckedResultKeys be a new List which is a copy of trapResult.
|
||||
Zone set_zone;
|
||||
Zone set_zone(isolate->allocator());
|
||||
const int kPresent = 1;
|
||||
const int kGone = 0;
|
||||
IdentityMap<int> unchecked_result_keys(isolate->heap(), &set_zone);
|
||||
|
@ -4218,7 +4218,7 @@ FunctionLiteral* Parser::ParseFunctionLiteral(
|
||||
// temp_zone is deallocated. These objects are instead allocated in a
|
||||
// parser-persistent zone (see parser_zone_ in AstNodeFactory).
|
||||
{
|
||||
Zone temp_zone;
|
||||
Zone temp_zone(zone()->allocator());
|
||||
AstNodeFactory::BodyScope inner(factory(), &temp_zone, use_temp_zone);
|
||||
|
||||
body = ParseEagerFunctionBody(function_name, pos, formals, kind,
|
||||
|
@ -135,7 +135,7 @@ MaybeHandle<Object> RegExpImpl::Compile(Handle<JSRegExp> re,
|
||||
Handle<String> pattern,
|
||||
JSRegExp::Flags flags) {
|
||||
Isolate* isolate = re->GetIsolate();
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
CompilationCache* compilation_cache = isolate->compilation_cache();
|
||||
MaybeHandle<FixedArray> maybe_cached =
|
||||
compilation_cache->LookupRegExp(pattern, flags);
|
||||
@ -346,7 +346,7 @@ bool RegExpImpl::CompileIrregexp(Handle<JSRegExp> re,
|
||||
bool is_one_byte) {
|
||||
// Compile the RegExp.
|
||||
Isolate* isolate = re->GetIsolate();
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
PostponeInterruptsScope postpone(isolate);
|
||||
// If we had a compilation error the last time this is saved at the
|
||||
// saved code index.
|
||||
|
@ -386,7 +386,7 @@ bool ComputeLocation(Isolate* isolate, MessageLocation* target) {
|
||||
Handle<String> RenderCallSite(Isolate* isolate, Handle<Object> object) {
|
||||
MessageLocation location;
|
||||
if (ComputeLocation(isolate, &location)) {
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
base::SmartPointer<ParseInfo> info(
|
||||
location.function()->shared()->is_function()
|
||||
? new ParseInfo(&zone, location.function())
|
||||
|
@ -13,12 +13,13 @@ namespace internal {
|
||||
class TypeCache final {
|
||||
private:
|
||||
// This has to be first for the initialization magic to work.
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone_;
|
||||
|
||||
public:
|
||||
static TypeCache const& Get();
|
||||
|
||||
TypeCache() = default;
|
||||
TypeCache() : zone_(&allocator) {}
|
||||
|
||||
Type* const kInt8 =
|
||||
CreateNative(CreateRange<int8_t>(), Type::UntaggedIntegral8());
|
||||
|
@ -1626,23 +1626,25 @@ class SR_WasmDecoder : public WasmDecoder {
|
||||
}
|
||||
};
|
||||
|
||||
std::vector<LocalType>* DecodeLocalDeclsForTesting(const byte* start,
|
||||
const byte* end) {
|
||||
Zone zone;
|
||||
std::vector<LocalType>* DecodeLocalDeclsForTesting(
|
||||
base::AccountingAllocator* allocator, const byte* start, const byte* end) {
|
||||
Zone zone(allocator);
|
||||
FunctionBody body = {nullptr, nullptr, nullptr, start, end};
|
||||
SR_WasmDecoder decoder(&zone, nullptr, body);
|
||||
return decoder.DecodeLocalDeclsForTesting();
|
||||
}
|
||||
|
||||
TreeResult VerifyWasmCode(FunctionBody& body) {
|
||||
Zone zone;
|
||||
TreeResult VerifyWasmCode(base::AccountingAllocator* allocator,
|
||||
FunctionBody& body) {
|
||||
Zone zone(allocator);
|
||||
SR_WasmDecoder decoder(&zone, nullptr, body);
|
||||
TreeResult result = decoder.Decode();
|
||||
return result;
|
||||
}
|
||||
|
||||
TreeResult BuildTFGraph(TFBuilder* builder, FunctionBody& body) {
|
||||
Zone zone;
|
||||
TreeResult BuildTFGraph(base::AccountingAllocator* allocator,
|
||||
TFBuilder* builder, FunctionBody& body) {
|
||||
Zone zone(allocator);
|
||||
SR_WasmDecoder decoder(&zone, builder, body);
|
||||
TreeResult result = decoder.Decode();
|
||||
return result;
|
||||
@ -1686,8 +1688,8 @@ int OpcodeArity(ModuleEnv* module, FunctionSig* sig, const byte* pc,
|
||||
return decoder.OpcodeArity(pc);
|
||||
}
|
||||
|
||||
void PrintAst(FunctionBody& body) {
|
||||
Zone zone;
|
||||
void PrintAst(base::AccountingAllocator* allocator, FunctionBody& body) {
|
||||
Zone zone(allocator);
|
||||
SR_WasmDecoder decoder(&zone, nullptr, body);
|
||||
|
||||
OFStream os(stdout);
|
||||
|
@ -194,21 +194,25 @@ typedef Result<Tree*> TreeResult;
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const Tree& tree);
|
||||
|
||||
TreeResult VerifyWasmCode(FunctionBody& body);
|
||||
TreeResult BuildTFGraph(TFBuilder* builder, FunctionBody& body);
|
||||
void PrintAst(FunctionBody& body);
|
||||
TreeResult VerifyWasmCode(base::AccountingAllocator* allocator,
|
||||
FunctionBody& body);
|
||||
TreeResult BuildTFGraph(base::AccountingAllocator* allocator,
|
||||
TFBuilder* builder, FunctionBody& body);
|
||||
void PrintAst(base::AccountingAllocator* allocator, FunctionBody& body);
|
||||
|
||||
inline TreeResult VerifyWasmCode(ModuleEnv* module, FunctionSig* sig,
|
||||
inline TreeResult VerifyWasmCode(base::AccountingAllocator* allocator,
|
||||
ModuleEnv* module, FunctionSig* sig,
|
||||
const byte* start, const byte* end) {
|
||||
FunctionBody body = {module, sig, nullptr, start, end};
|
||||
return VerifyWasmCode(body);
|
||||
return VerifyWasmCode(allocator, body);
|
||||
}
|
||||
|
||||
inline TreeResult BuildTFGraph(TFBuilder* builder, ModuleEnv* module,
|
||||
inline TreeResult BuildTFGraph(base::AccountingAllocator* allocator,
|
||||
TFBuilder* builder, ModuleEnv* module,
|
||||
FunctionSig* sig, const byte* start,
|
||||
const byte* end) {
|
||||
FunctionBody body = {module, sig, nullptr, start, end};
|
||||
return BuildTFGraph(builder, body);
|
||||
return BuildTFGraph(allocator, builder, body);
|
||||
}
|
||||
|
||||
enum ReadUnsignedLEB128ErrorCode { kNoError, kInvalidLEB128, kMissingLEB128 };
|
||||
@ -216,8 +220,8 @@ enum ReadUnsignedLEB128ErrorCode { kNoError, kInvalidLEB128, kMissingLEB128 };
|
||||
ReadUnsignedLEB128ErrorCode ReadUnsignedLEB128Operand(const byte*, const byte*,
|
||||
int*, uint32_t*);
|
||||
|
||||
std::vector<LocalType>* DecodeLocalDeclsForTesting(const byte* start,
|
||||
const byte* end);
|
||||
std::vector<LocalType>* DecodeLocalDeclsForTesting(
|
||||
base::AccountingAllocator* allocator, const byte* start, const byte* end);
|
||||
BitVector* AnalyzeLoopAssignmentForTesting(Zone* zone, size_t num_locals,
|
||||
const byte* start, const byte* end);
|
||||
|
||||
|
@ -575,7 +575,7 @@ class ModuleDecoder : public Decoder {
|
||||
FunctionBody body = {menv, function->sig, start_,
|
||||
start_ + function->code_start_offset,
|
||||
start_ + function->code_end_offset};
|
||||
TreeResult result = VerifyWasmCode(body);
|
||||
TreeResult result = VerifyWasmCode(module_zone->allocator(), body);
|
||||
if (result.failed()) {
|
||||
// Wrap the error message from the function decoder.
|
||||
std::ostringstream str;
|
||||
|
@ -86,7 +86,7 @@ void VerifyModule(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
RawBuffer buffer = GetRawBufferArgument(thrower, args);
|
||||
if (thrower.error()) return;
|
||||
|
||||
i::Zone zone;
|
||||
i::Zone zone(isolate->allocator());
|
||||
internal::wasm::ModuleResult result =
|
||||
internal::wasm::DecodeWasmModule(isolate, &zone, buffer.start, buffer.end,
|
||||
true, internal::wasm::kWasmOrigin);
|
||||
@ -111,7 +111,7 @@ void VerifyFunction(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
{
|
||||
// Verification of a single function shouldn't allocate.
|
||||
i::DisallowHeapAllocation no_allocation;
|
||||
i::Zone zone;
|
||||
i::Zone zone(isolate->allocator());
|
||||
result = internal::wasm::DecodeWasmFunction(isolate, &zone, nullptr,
|
||||
buffer.start, buffer.end);
|
||||
}
|
||||
@ -170,7 +170,7 @@ void InstantiateModuleCommon(const v8::FunctionCallbackInfo<v8::Value>& args,
|
||||
|
||||
// Decode but avoid a redundant pass over function bodies for verification.
|
||||
// Verification will happen during compilation.
|
||||
i::Zone zone;
|
||||
i::Zone zone(isolate->allocator());
|
||||
internal::wasm::ModuleResult result = internal::wasm::DecodeWasmModule(
|
||||
isolate, &zone, start, end, false, origin);
|
||||
|
||||
@ -209,7 +209,7 @@ void InstantiateModuleFromAsm(const v8::FunctionCallbackInfo<v8::Value>& args) {
|
||||
}
|
||||
|
||||
i::Factory* factory = isolate->factory();
|
||||
i::Zone zone;
|
||||
i::Zone zone(isolate->allocator());
|
||||
Local<String> source = Local<String>::Cast(args[0]);
|
||||
i::Handle<i::Script> script = factory->NewScript(Utils::OpenHandle(*source));
|
||||
i::ParseInfo info(&zone, script);
|
||||
|
@ -589,7 +589,7 @@ compiler::CallDescriptor* ModuleEnv::GetCallDescriptor(Zone* zone,
|
||||
int32_t CompileAndRunWasmModule(Isolate* isolate, const byte* module_start,
|
||||
const byte* module_end, bool asm_js) {
|
||||
HandleScope scope(isolate);
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
// Decode the module, but don't verify function bodies, since we'll
|
||||
// be compiling them anyway.
|
||||
ModuleResult result = DecodeWasmModule(isolate, &zone, module_start,
|
||||
|
@ -72,15 +72,14 @@ class Segment {
|
||||
size_t size_;
|
||||
};
|
||||
|
||||
|
||||
Zone::Zone()
|
||||
Zone::Zone(base::AccountingAllocator* allocator)
|
||||
: allocation_size_(0),
|
||||
segment_bytes_allocated_(0),
|
||||
position_(0),
|
||||
limit_(0),
|
||||
allocator_(allocator),
|
||||
segment_head_(nullptr) {}
|
||||
|
||||
|
||||
Zone::~Zone() {
|
||||
DeleteAll();
|
||||
DeleteKeptSegment();
|
||||
@ -201,7 +200,7 @@ void Zone::DeleteKeptSegment() {
|
||||
// Creates a new segment, sets it size, and pushes it to the front
|
||||
// of the segment chain. Returns the new segment.
|
||||
Segment* Zone::NewSegment(size_t size) {
|
||||
Segment* result = reinterpret_cast<Segment*>(Malloced::New(size));
|
||||
Segment* result = reinterpret_cast<Segment*>(allocator_->Allocate(size));
|
||||
segment_bytes_allocated_ += size;
|
||||
if (result != nullptr) {
|
||||
result->Initialize(segment_head_, size);
|
||||
@ -214,7 +213,7 @@ Segment* Zone::NewSegment(size_t size) {
|
||||
// Deletes the given segment. Does not touch the segment chain.
|
||||
void Zone::DeleteSegment(Segment* segment, size_t size) {
|
||||
segment_bytes_allocated_ -= size;
|
||||
Malloced::Delete(segment);
|
||||
allocator_->Free(segment, size);
|
||||
}
|
||||
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include "src/allocation.h"
|
||||
#include "src/base/accounting-allocator.h"
|
||||
#include "src/base/logging.h"
|
||||
#include "src/globals.h"
|
||||
#include "src/hashmap.h"
|
||||
@ -35,7 +35,7 @@ class Segment;
|
||||
// from multi-threaded code.
|
||||
class Zone final {
|
||||
public:
|
||||
Zone();
|
||||
explicit Zone(base::AccountingAllocator* allocator);
|
||||
~Zone();
|
||||
|
||||
// Allocate 'size' bytes of memory in the Zone; expands the Zone by
|
||||
@ -64,6 +64,8 @@ class Zone final {
|
||||
|
||||
size_t allocation_size() const { return allocation_size_; }
|
||||
|
||||
base::AccountingAllocator* allocator() const { return allocator_; }
|
||||
|
||||
private:
|
||||
// All pointers returned from New() have this alignment. In addition, if the
|
||||
// object being allocated has a size that is divisible by 8 then its alignment
|
||||
@ -114,6 +116,8 @@ class Zone final {
|
||||
Address position_;
|
||||
Address limit_;
|
||||
|
||||
base::AccountingAllocator* allocator_;
|
||||
|
||||
Segment* segment_head_;
|
||||
};
|
||||
|
||||
|
@ -585,12 +585,13 @@ class InitializedHandleScope {
|
||||
|
||||
class HandleAndZoneScope : public InitializedHandleScope {
|
||||
public:
|
||||
HandleAndZoneScope() {}
|
||||
HandleAndZoneScope() : main_zone_(&allocator_) {}
|
||||
|
||||
// Prefixing the below with main_ reduces a lot of naming clashes.
|
||||
i::Zone* main_zone() { return &main_zone_; }
|
||||
|
||||
private:
|
||||
v8::base::AccountingAllocator allocator_;
|
||||
i::Zone main_zone_;
|
||||
};
|
||||
|
||||
|
@ -175,7 +175,7 @@ class FunctionTester : public InitializedHandleScope {
|
||||
uint32_t flags_;
|
||||
|
||||
Handle<JSFunction> Compile(Handle<JSFunction> function) {
|
||||
Zone zone;
|
||||
Zone zone(function->GetIsolate()->allocator());
|
||||
ParseInfo parse_info(&zone, function);
|
||||
CompilationInfo info(&parse_info);
|
||||
info.MarkAsDeoptimizationEnabled();
|
||||
@ -224,7 +224,7 @@ class FunctionTester : public InitializedHandleScope {
|
||||
// Compile the given machine graph instead of the source of the function
|
||||
// and replace the JSFunction's code with the result.
|
||||
Handle<JSFunction> CompileGraph(Graph* graph) {
|
||||
Zone zone;
|
||||
Zone zone(function->GetIsolate()->allocator());
|
||||
ParseInfo parse_info(&zone, function);
|
||||
CompilationInfo info(&parse_info);
|
||||
|
||||
|
@ -268,7 +268,8 @@ TEST(InstructionAddGapMove) {
|
||||
|
||||
|
||||
TEST(InstructionOperands) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
|
||||
{
|
||||
TestInstr* i = TestInstr::New(&zone, 101);
|
||||
|
@ -106,7 +106,8 @@ class TestCode : public HandleAndZoneScope {
|
||||
|
||||
|
||||
void VerifyForwarding(TestCode& code, int count, int* expected) {
|
||||
Zone local_zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone local_zone(&allocator);
|
||||
ZoneVector<RpoNumber> result(&local_zone);
|
||||
JumpThreading::ComputeForwarding(&local_zone, result, &code.sequence_, true);
|
||||
|
||||
|
@ -96,7 +96,7 @@ TEST(TestLinkageRuntimeCall) {
|
||||
|
||||
TEST(TestLinkageStubCall) {
|
||||
Isolate* isolate = CcTest::InitIsolateOnce();
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
ToNumberStub stub(isolate);
|
||||
CompilationInfo info("test", isolate, &zone, Code::ComputeFlags(Code::STUB));
|
||||
CallInterfaceDescriptor interface_descriptor =
|
||||
|
@ -127,7 +127,7 @@ class LoopFinderTester : HandleAndZoneScope {
|
||||
OFStream os(stdout);
|
||||
os << AsRPO(graph);
|
||||
}
|
||||
Zone zone;
|
||||
Zone zone(main_isolate()->allocator());
|
||||
loop_tree = LoopFinder::BuildLoopTree(&graph, &zone);
|
||||
}
|
||||
return loop_tree;
|
||||
|
@ -69,7 +69,8 @@ CallDescriptor* GetCallDescriptor(Zone* zone, int return_count,
|
||||
|
||||
|
||||
TEST(ReturnThreeValues) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
CallDescriptor* desc = GetCallDescriptor(&zone, 3, 2);
|
||||
HandleAndZoneScope handles;
|
||||
RawMachineAssembler m(handles.main_isolate(),
|
||||
|
@ -141,7 +141,8 @@ void CheckInputs(Node* node, Node** inputs, int input_count) {
|
||||
|
||||
|
||||
TEST(NodeUseIteratorReplaceUses) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
Node* n0 = graph.NewNode(&dummy_operator0);
|
||||
Node* n1 = graph.NewNode(&dummy_operator1, n0);
|
||||
@ -166,7 +167,8 @@ TEST(NodeUseIteratorReplaceUses) {
|
||||
|
||||
|
||||
TEST(NodeUseIteratorReplaceUsesSelf) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
Node* n0 = graph.NewNode(&dummy_operator0);
|
||||
Node* n1 = graph.NewNode(&dummy_operator1, n0);
|
||||
@ -190,7 +192,8 @@ TEST(NodeUseIteratorReplaceUsesSelf) {
|
||||
|
||||
|
||||
TEST(ReplaceInput) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
Node* n0 = graph.NewNode(&dummy_operator0);
|
||||
Node* n1 = graph.NewNode(&dummy_operator0);
|
||||
@ -216,7 +219,8 @@ TEST(ReplaceInput) {
|
||||
|
||||
|
||||
TEST(OwnedBy) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
|
||||
{
|
||||
@ -266,7 +270,8 @@ TEST(OwnedBy) {
|
||||
|
||||
|
||||
TEST(Uses) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
|
||||
Node* n0 = graph.NewNode(&dummy_operator0);
|
||||
@ -288,7 +293,8 @@ TEST(Uses) {
|
||||
|
||||
|
||||
TEST(Inputs) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
|
||||
Node* n0 = graph.NewNode(&dummy_operator0);
|
||||
@ -316,7 +322,8 @@ TEST(Inputs) {
|
||||
|
||||
|
||||
TEST(RemoveInput) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
|
||||
Node* n0 = graph.NewNode(&dummy_operator0);
|
||||
@ -346,7 +353,8 @@ TEST(RemoveInput) {
|
||||
|
||||
|
||||
TEST(AppendInputsAndIterator) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
|
||||
Node* n0 = graph.NewNode(&dummy_operator0);
|
||||
@ -368,7 +376,8 @@ TEST(AppendInputsAndIterator) {
|
||||
|
||||
|
||||
TEST(NullInputsSimple) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
|
||||
Node* n0 = graph.NewNode(&dummy_operator0);
|
||||
@ -395,7 +404,8 @@ TEST(NullInputsSimple) {
|
||||
|
||||
|
||||
TEST(NullInputsAppended) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
|
||||
Node* n0 = graph.NewNode(&dummy_operator0);
|
||||
@ -418,7 +428,8 @@ TEST(NullInputsAppended) {
|
||||
|
||||
|
||||
TEST(ReplaceUsesFromAppendedInputs) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
|
||||
Node* n0 = graph.NewNode(&dummy_operator0);
|
||||
@ -446,7 +457,8 @@ TEST(ReplaceUsesFromAppendedInputs) {
|
||||
|
||||
|
||||
TEST(ReplaceInputMultipleUses) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
|
||||
Node* n0 = graph.NewNode(&dummy_operator0);
|
||||
@ -464,7 +476,8 @@ TEST(ReplaceInputMultipleUses) {
|
||||
|
||||
|
||||
TEST(TrimInputCountInline) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
|
||||
{
|
||||
@ -532,7 +545,8 @@ TEST(TrimInputCountInline) {
|
||||
|
||||
|
||||
TEST(TrimInputCountOutOfLine1) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
|
||||
{
|
||||
@ -626,7 +640,8 @@ TEST(TrimInputCountOutOfLine1) {
|
||||
|
||||
|
||||
TEST(TrimInputCountOutOfLine2) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
|
||||
{
|
||||
@ -695,7 +710,8 @@ TEST(TrimInputCountOutOfLine2) {
|
||||
|
||||
|
||||
TEST(NullAllInputs) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
|
||||
for (int i = 0; i < 2; i++) {
|
||||
@ -747,7 +763,8 @@ TEST(NullAllInputs) {
|
||||
|
||||
|
||||
TEST(AppendAndTrim) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
|
||||
Node* nodes[] = {
|
||||
|
@ -270,7 +270,7 @@ Handle<Code> CompileGraph(const char* name, CallDescriptor* desc, Graph* graph,
|
||||
|
||||
|
||||
Handle<Code> WrapWithCFunction(Handle<Code> inner, CallDescriptor* desc) {
|
||||
Zone zone;
|
||||
Zone zone(inner->GetIsolate()->allocator());
|
||||
MachineSignature* msig =
|
||||
const_cast<MachineSignature*>(desc->GetMachineSignature());
|
||||
int param_count = static_cast<int>(msig->parameter_count());
|
||||
@ -437,7 +437,7 @@ class Computer {
|
||||
Handle<Code> inner = Handle<Code>::null();
|
||||
{
|
||||
// Build the graph for the computation.
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
Graph graph(&zone);
|
||||
RawMachineAssembler raw(isolate, &graph, desc);
|
||||
build(desc, raw);
|
||||
@ -452,7 +452,7 @@ class Computer {
|
||||
Handle<Code> wrapper = Handle<Code>::null();
|
||||
{
|
||||
// Wrap the above code with a callable function that passes constants.
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
Graph graph(&zone);
|
||||
CallDescriptor* cdesc = Linkage::GetSimplifiedCDescriptor(&zone, &csig);
|
||||
RawMachineAssembler raw(isolate, &graph, cdesc);
|
||||
@ -484,7 +484,7 @@ class Computer {
|
||||
Handle<Code> wrapper = Handle<Code>::null();
|
||||
{
|
||||
// Wrap the above code with a callable function that loads from {input}.
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
Graph graph(&zone);
|
||||
CallDescriptor* cdesc = Linkage::GetSimplifiedCDescriptor(&zone, &csig);
|
||||
RawMachineAssembler raw(isolate, &graph, cdesc);
|
||||
@ -522,7 +522,7 @@ class Computer {
|
||||
static void TestInt32Sub(CallDescriptor* desc) {
|
||||
Isolate* isolate = CcTest::InitIsolateOnce();
|
||||
HandleScope scope(isolate);
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
GraphAndBuilders inner(&zone);
|
||||
{
|
||||
// Build the add function.
|
||||
@ -563,7 +563,7 @@ static void CopyTwentyInt32(CallDescriptor* desc) {
|
||||
Handle<Code> inner = Handle<Code>::null();
|
||||
{
|
||||
// Writes all parameters into the output buffer.
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
Graph graph(&zone);
|
||||
RawMachineAssembler raw(isolate, &graph, desc);
|
||||
Node* base = raw.PointerConstant(output);
|
||||
@ -580,7 +580,7 @@ static void CopyTwentyInt32(CallDescriptor* desc) {
|
||||
Handle<Code> wrapper = Handle<Code>::null();
|
||||
{
|
||||
// Loads parameters from the input buffer and calls the above code.
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
Graph graph(&zone);
|
||||
CallDescriptor* cdesc = Linkage::GetSimplifiedCDescriptor(&zone, &csig);
|
||||
RawMachineAssembler raw(isolate, &graph, cdesc);
|
||||
@ -619,7 +619,8 @@ static void CopyTwentyInt32(CallDescriptor* desc) {
|
||||
|
||||
static void Test_RunInt32SubWithRet(int retreg) {
|
||||
Int32Signature sig(2);
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
RegisterPairs pairs;
|
||||
while (pairs.More()) {
|
||||
int parray[2];
|
||||
@ -670,7 +671,8 @@ TEST(Run_Int32Sub_all_allocatable_single) {
|
||||
Int32Signature sig(2);
|
||||
RegisterPairs pairs;
|
||||
while (pairs.More()) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
int parray[1];
|
||||
int rarray[1];
|
||||
pairs.Next(&rarray[0], &parray[0], true);
|
||||
@ -687,7 +689,8 @@ TEST(Run_CopyTwentyInt32_all_allocatable_pairs) {
|
||||
Int32Signature sig(20);
|
||||
RegisterPairs pairs;
|
||||
while (pairs.More()) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
int parray[2];
|
||||
int rarray[] = {
|
||||
RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN)
|
||||
@ -739,7 +742,8 @@ static void Test_Int32_WeightedSum_of_size(int count) {
|
||||
Int32Signature sig(count);
|
||||
for (int p0 = 0; p0 < Register::kNumRegisters; p0++) {
|
||||
if (Register::from_code(p0).IsAllocatable()) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
|
||||
int parray[] = {p0};
|
||||
int rarray[] = {
|
||||
@ -807,7 +811,8 @@ void Test_Int32_Select() {
|
||||
Allocator rets(rarray, 1, nullptr, 0);
|
||||
RegisterConfig config(params, rets);
|
||||
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
|
||||
for (int i = which + 1; i <= 64; i++) {
|
||||
Int32Signature sig(i);
|
||||
@ -849,7 +854,8 @@ TEST(Int64Select_registers) {
|
||||
ArgsBuffer<int64_t>::Sig sig(2);
|
||||
|
||||
RegisterPairs pairs;
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
while (pairs.More()) {
|
||||
int parray[2];
|
||||
pairs.Next(&parray[0], &parray[1], false);
|
||||
@ -876,7 +882,8 @@ TEST(Float32Select_registers) {
|
||||
ArgsBuffer<float32>::Sig sig(2);
|
||||
|
||||
Float32RegisterPairs pairs;
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
while (pairs.More()) {
|
||||
int parray[2];
|
||||
pairs.Next(&parray[0], &parray[1], false);
|
||||
@ -904,7 +911,8 @@ TEST(Float64Select_registers) {
|
||||
ArgsBuffer<float64>::Sig sig(2);
|
||||
|
||||
Float64RegisterPairs pairs;
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
while (pairs.More()) {
|
||||
int parray[2];
|
||||
pairs.Next(&parray[0], &parray[1], false);
|
||||
@ -927,7 +935,8 @@ TEST(Float32Select_stack_params_return_reg) {
|
||||
Allocator rets(nullptr, 0, rarray, 1);
|
||||
RegisterConfig config(params, rets);
|
||||
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
for (int count = 1; count < 6; count++) {
|
||||
ArgsBuffer<float32>::Sig sig(count);
|
||||
CallDescriptor* desc = config.Create(&zone, &sig);
|
||||
@ -949,7 +958,8 @@ TEST(Float64Select_stack_params_return_reg) {
|
||||
Allocator rets(nullptr, 0, rarray, 1);
|
||||
RegisterConfig config(params, rets);
|
||||
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
for (int count = 1; count < 6; count++) {
|
||||
ArgsBuffer<float64>::Sig sig(count);
|
||||
CallDescriptor* desc = config.Create(&zone, &sig);
|
||||
@ -972,7 +982,7 @@ static void Build_Select_With_Call(CallDescriptor* desc,
|
||||
{
|
||||
Isolate* isolate = CcTest::InitIsolateOnce();
|
||||
// Build the actual select.
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
Graph graph(&zone);
|
||||
RawMachineAssembler raw(isolate, &graph, desc);
|
||||
raw.Return(raw.Parameter(which));
|
||||
@ -1002,7 +1012,8 @@ TEST(Float64StackParamsToStackParams) {
|
||||
Allocator params(nullptr, 0, nullptr, 0);
|
||||
Allocator rets(nullptr, 0, rarray, 1);
|
||||
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
ArgsBuffer<float64>::Sig sig(2);
|
||||
RegisterConfig config(params, rets);
|
||||
CallDescriptor* desc = config.Create(&zone, &sig);
|
||||
@ -1068,7 +1079,8 @@ void MixedParamTest(int start) {
|
||||
RegisterConfig config(palloc, ralloc);
|
||||
|
||||
for (int which = 0; which < num_params; which++) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
HandleScope scope(isolate);
|
||||
MachineSignature::Builder builder(&zone, 1, num_params);
|
||||
builder.AddReturn(params[which]);
|
||||
@ -1079,7 +1091,7 @@ void MixedParamTest(int start) {
|
||||
Handle<Code> select;
|
||||
{
|
||||
// build the select.
|
||||
Zone zone;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
RawMachineAssembler raw(isolate, &graph, desc);
|
||||
raw.Return(raw.Parameter(which));
|
||||
@ -1096,7 +1108,7 @@ void MixedParamTest(int start) {
|
||||
CSignature0<int32_t> csig;
|
||||
{
|
||||
// Wrap the select code with a callable function that passes constants.
|
||||
Zone zone;
|
||||
Zone zone(&allocator);
|
||||
Graph graph(&zone);
|
||||
CallDescriptor* cdesc = Linkage::GetSimplifiedCDescriptor(&zone, &csig);
|
||||
RawMachineAssembler raw(isolate, &graph, cdesc);
|
||||
@ -1189,7 +1201,7 @@ void TestStackSlot(MachineType slot_type, T expected) {
|
||||
Allocator ralloc(rarray_gp, 1, rarray_fp, 1);
|
||||
RegisterConfig config(palloc, ralloc);
|
||||
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
HandleScope scope(isolate);
|
||||
MachineSignature::Builder builder(&zone, 1, 12);
|
||||
builder.AddReturn(MachineType::Int32());
|
||||
|
@ -578,7 +578,7 @@ TEST(InterpreterLoadNamedProperty) {
|
||||
HandleAndZoneScope handles;
|
||||
i::Isolate* isolate = handles.main_isolate();
|
||||
i::Factory* factory = isolate->factory();
|
||||
i::Zone zone;
|
||||
i::Zone zone(isolate->allocator());
|
||||
|
||||
i::FeedbackVectorSpec feedback_spec(&zone);
|
||||
i::FeedbackVectorSlot slot = feedback_spec.AddLoadICSlot();
|
||||
@ -631,7 +631,7 @@ TEST(InterpreterLoadKeyedProperty) {
|
||||
HandleAndZoneScope handles;
|
||||
i::Isolate* isolate = handles.main_isolate();
|
||||
i::Factory* factory = isolate->factory();
|
||||
i::Zone zone;
|
||||
i::Zone zone(isolate->allocator());
|
||||
|
||||
i::FeedbackVectorSpec feedback_spec(&zone);
|
||||
i::FeedbackVectorSlot slot = feedback_spec.AddKeyedLoadICSlot();
|
||||
@ -673,7 +673,7 @@ TEST(InterpreterStoreNamedProperty) {
|
||||
HandleAndZoneScope handles;
|
||||
i::Isolate* isolate = handles.main_isolate();
|
||||
i::Factory* factory = isolate->factory();
|
||||
i::Zone zone;
|
||||
i::Zone zone(isolate->allocator());
|
||||
|
||||
i::FeedbackVectorSpec feedback_spec(&zone);
|
||||
i::FeedbackVectorSlot slot = feedback_spec.AddStoreICSlot();
|
||||
@ -732,7 +732,7 @@ TEST(InterpreterStoreKeyedProperty) {
|
||||
HandleAndZoneScope handles;
|
||||
i::Isolate* isolate = handles.main_isolate();
|
||||
i::Factory* factory = isolate->factory();
|
||||
i::Zone zone;
|
||||
i::Zone zone(isolate->allocator());
|
||||
|
||||
i::FeedbackVectorSpec feedback_spec(&zone);
|
||||
i::FeedbackVectorSlot slot = feedback_spec.AddKeyedStoreICSlot();
|
||||
@ -779,7 +779,7 @@ static void TestInterpreterCall(TailCallMode tail_call_mode) {
|
||||
HandleAndZoneScope handles;
|
||||
i::Isolate* isolate = handles.main_isolate();
|
||||
i::Factory* factory = isolate->factory();
|
||||
i::Zone zone;
|
||||
i::Zone zone(isolate->allocator());
|
||||
|
||||
i::FeedbackVectorSpec feedback_spec(&zone);
|
||||
i::FeedbackVectorSlot slot = feedback_spec.AddLoadICSlot();
|
||||
|
@ -38,7 +38,8 @@ TEST(List) {
|
||||
List<AstNode*>* list = new List<AstNode*>(0);
|
||||
CHECK_EQ(0, list->length());
|
||||
|
||||
Zone zone;
|
||||
v8::base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
AstValueFactory value_factory(&zone, 0);
|
||||
AstNodeFactory factory(&value_factory);
|
||||
AstNode* node = factory.NewEmptyStatement(RelocInfo::kNoPosition);
|
||||
|
@ -35,7 +35,8 @@
|
||||
using namespace v8::internal;
|
||||
|
||||
TEST(BitVector) {
|
||||
Zone zone;
|
||||
v8::base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
{
|
||||
BitVector v(15, &zone);
|
||||
v.Add(1);
|
||||
|
@ -574,7 +574,7 @@ static void TestGeneralizeRepresentation(
|
||||
CHECK(map->is_stable());
|
||||
CHECK(expectations.Check(*map));
|
||||
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
|
||||
if (is_detached_map) {
|
||||
detach_point_map = Map::ReconfigureProperty(
|
||||
@ -966,7 +966,7 @@ static void TestReconfigureDataFieldAttribute_GeneralizeRepresentation(
|
||||
CHECK(map2->is_stable());
|
||||
CHECK(expectations2.Check(*map2));
|
||||
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
Handle<Map> field_owner(map->FindFieldOwner(kSplitProp), isolate);
|
||||
CompilationInfo info("testing", isolate, &zone);
|
||||
CHECK(!info.dependencies()->HasAborted());
|
||||
@ -1051,7 +1051,7 @@ static void TestReconfigureDataFieldAttribute_GeneralizeRepresentationTrivial(
|
||||
CHECK(map2->is_stable());
|
||||
CHECK(expectations2.Check(*map2));
|
||||
|
||||
Zone zone;
|
||||
Zone zone(isolate->allocator());
|
||||
Handle<Map> field_owner(map->FindFieldOwner(kSplitProp), isolate);
|
||||
CompilationInfo info("testing", isolate, &zone);
|
||||
CHECK(!info.dependencies()->HasAborted());
|
||||
|
@ -95,7 +95,8 @@ void CompareStringsOneWay(const char* s1, const char* s2,
|
||||
int expected_diff_parameter = -1) {
|
||||
StringCompareInput input(s1, s2);
|
||||
|
||||
Zone zone;
|
||||
v8::base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
|
||||
DiffChunkStruct* first_chunk;
|
||||
ListDiffOutputWriter writer(&first_chunk, &zone);
|
||||
|
@ -153,7 +153,7 @@ TEST(ScanHTMLEndComments) {
|
||||
i::CompleteParserRecorder log;
|
||||
i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
|
||||
scanner.Initialize(&stream);
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::AstValueFactory ast_value_factory(
|
||||
&zone, CcTest::i_isolate()->heap()->HashSeed());
|
||||
i::PreParser preparser(&zone, &scanner, &ast_value_factory, &log,
|
||||
@ -171,7 +171,7 @@ TEST(ScanHTMLEndComments) {
|
||||
i::CompleteParserRecorder log;
|
||||
i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
|
||||
scanner.Initialize(&stream);
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::AstValueFactory ast_value_factory(
|
||||
&zone, CcTest::i_isolate()->heap()->HashSeed());
|
||||
i::PreParser preparser(&zone, &scanner, &ast_value_factory, &log,
|
||||
@ -332,7 +332,7 @@ TEST(StandAlonePreParser) {
|
||||
i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
|
||||
scanner.Initialize(&stream);
|
||||
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::AstValueFactory ast_value_factory(
|
||||
&zone, CcTest::i_isolate()->heap()->HashSeed());
|
||||
i::PreParser preparser(&zone, &scanner, &ast_value_factory, &log,
|
||||
@ -369,7 +369,7 @@ TEST(StandAlonePreParserNoNatives) {
|
||||
scanner.Initialize(&stream);
|
||||
|
||||
// Preparser defaults to disallowing natives syntax.
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::AstValueFactory ast_value_factory(
|
||||
&zone, CcTest::i_isolate()->heap()->HashSeed());
|
||||
i::PreParser preparser(&zone, &scanner, &ast_value_factory, &log,
|
||||
@ -438,7 +438,7 @@ TEST(RegressChromium62639) {
|
||||
i::CompleteParserRecorder log;
|
||||
i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
|
||||
scanner.Initialize(&stream);
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::AstValueFactory ast_value_factory(&zone,
|
||||
CcTest::i_isolate()->heap()->HashSeed());
|
||||
i::PreParser preparser(&zone, &scanner, &ast_value_factory, &log,
|
||||
@ -473,7 +473,7 @@ TEST(Regress928) {
|
||||
i::CompleteParserRecorder log;
|
||||
i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
|
||||
scanner.Initialize(&stream);
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::AstValueFactory ast_value_factory(&zone,
|
||||
CcTest::i_isolate()->heap()->HashSeed());
|
||||
i::PreParser preparser(&zone, &scanner, &ast_value_factory, &log,
|
||||
@ -526,7 +526,7 @@ TEST(PreParseOverflow) {
|
||||
i::Scanner scanner(CcTest::i_isolate()->unicode_cache());
|
||||
scanner.Initialize(&stream);
|
||||
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::AstValueFactory ast_value_factory(&zone,
|
||||
CcTest::i_isolate()->heap()->HashSeed());
|
||||
i::PreParser preparser(&zone, &scanner, &ast_value_factory, &log,
|
||||
@ -843,7 +843,7 @@ void TestScanRegExp(const char* re_source, const char* expected) {
|
||||
CHECK(start == i::Token::DIV || start == i::Token::ASSIGN_DIV);
|
||||
CHECK(scanner.ScanRegExpPattern(start == i::Token::ASSIGN_DIV));
|
||||
scanner.Next(); // Current token is now the regexp literal.
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::AstValueFactory ast_value_factory(&zone,
|
||||
CcTest::i_isolate()->heap()->HashSeed());
|
||||
ast_value_factory.Internalize(CcTest::i_isolate());
|
||||
@ -1067,7 +1067,7 @@ TEST(ScopeUsesArgumentsSuperThis) {
|
||||
factory->NewStringFromUtf8(i::CStrVector(program.start()))
|
||||
.ToHandleChecked();
|
||||
i::Handle<i::Script> script = factory->NewScript(source);
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::ParseInfo info(&zone, script);
|
||||
i::Parser parser(&info);
|
||||
parser.set_allow_harmony_sloppy(true);
|
||||
@ -1385,7 +1385,7 @@ TEST(ScopePositions) {
|
||||
i::CStrVector(program.start())).ToHandleChecked();
|
||||
CHECK_EQ(source->length(), kProgramSize);
|
||||
i::Handle<i::Script> script = factory->NewScript(source);
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::ParseInfo info(&zone, script);
|
||||
i::Parser parser(&info);
|
||||
parser.set_allow_lazy(true);
|
||||
@ -1434,7 +1434,7 @@ TEST(DiscardFunctionBody) {
|
||||
i::Handle<i::String> source_code =
|
||||
factory->NewStringFromUtf8(i::CStrVector(source)).ToHandleChecked();
|
||||
i::Handle<i::Script> script = factory->NewScript(source_code);
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::ParseInfo info(&zone, script);
|
||||
info.set_allow_lazy_parsing();
|
||||
i::Parser parser(&info);
|
||||
@ -1556,7 +1556,7 @@ void TestParserSyncWithFlags(i::Handle<i::String> source,
|
||||
if (test_preparser) {
|
||||
i::Scanner scanner(isolate->unicode_cache());
|
||||
i::GenericStringUtf16CharacterStream stream(source, 0, source->length());
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::AstValueFactory ast_value_factory(
|
||||
&zone, CcTest::i_isolate()->heap()->HashSeed());
|
||||
i::PreParser preparser(&zone, &scanner, &ast_value_factory, &log,
|
||||
@ -1573,7 +1573,7 @@ void TestParserSyncWithFlags(i::Handle<i::String> source,
|
||||
i::FunctionLiteral* function;
|
||||
{
|
||||
i::Handle<i::Script> script = factory->NewScript(source);
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::ParseInfo info(&zone, script);
|
||||
i::Parser parser(&info);
|
||||
SetParserFlags(&parser, flags);
|
||||
@ -2662,7 +2662,7 @@ TEST(DontRegressPreParserDataSizes) {
|
||||
i::Handle<i::String> source =
|
||||
factory->NewStringFromUtf8(i::CStrVector(program)).ToHandleChecked();
|
||||
i::Handle<i::Script> script = factory->NewScript(source);
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::ParseInfo info(&zone, script);
|
||||
i::ScriptData* sd = NULL;
|
||||
info.set_cached_data(&sd);
|
||||
@ -3288,7 +3288,7 @@ TEST(SerializationOfMaybeAssignmentFlag) {
|
||||
i::Handle<i::String> source = factory->InternalizeUtf8String(program.start());
|
||||
source->PrintOn(stdout);
|
||||
printf("\n");
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
v8::Local<v8::Value> v = CompileRun(src);
|
||||
i::Handle<i::Object> o = v8::Utils::OpenHandle(*v);
|
||||
i::Handle<i::JSFunction> f = i::Handle<i::JSFunction>::cast(o);
|
||||
@ -3338,7 +3338,7 @@ TEST(IfArgumentsArrayAccessedThenParametersMaybeAssigned) {
|
||||
i::Handle<i::String> source = factory->InternalizeUtf8String(program.start());
|
||||
source->PrintOn(stdout);
|
||||
printf("\n");
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
v8::Local<v8::Value> v = CompileRun(src);
|
||||
i::Handle<i::Object> o = v8::Utils::OpenHandle(*v);
|
||||
i::Handle<i::JSFunction> f = i::Handle<i::JSFunction>::cast(o);
|
||||
@ -3482,7 +3482,7 @@ TEST(InnerAssignment) {
|
||||
printf("\n");
|
||||
|
||||
i::Handle<i::Script> script = factory->NewScript(source);
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::ParseInfo info(&zone, script);
|
||||
i::Parser parser(&info);
|
||||
CHECK(parser.Parse(&info));
|
||||
@ -5627,7 +5627,7 @@ TEST(BasicImportExportParsing) {
|
||||
// Show that parsing as a module works
|
||||
{
|
||||
i::Handle<i::Script> script = factory->NewScript(source);
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::ParseInfo info(&zone, script);
|
||||
i::Parser parser(&info);
|
||||
info.set_module();
|
||||
@ -5652,7 +5652,7 @@ TEST(BasicImportExportParsing) {
|
||||
// And that parsing a script does not.
|
||||
{
|
||||
i::Handle<i::Script> script = factory->NewScript(source);
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::ParseInfo info(&zone, script);
|
||||
i::Parser parser(&info);
|
||||
info.set_global();
|
||||
@ -5742,7 +5742,7 @@ TEST(ImportExportParsingErrors) {
|
||||
factory->NewStringFromAsciiChecked(kErrorSources[i]);
|
||||
|
||||
i::Handle<i::Script> script = factory->NewScript(source);
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::ParseInfo info(&zone, script);
|
||||
i::Parser parser(&info);
|
||||
info.set_module();
|
||||
@ -5770,7 +5770,7 @@ TEST(ModuleParsingInternals) {
|
||||
"import 'q.js'";
|
||||
i::Handle<i::String> source = factory->NewStringFromAsciiChecked(kSource);
|
||||
i::Handle<i::Script> script = factory->NewScript(source);
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::ParseInfo info(&zone, script);
|
||||
i::Parser parser(&info);
|
||||
info.set_module();
|
||||
@ -5883,7 +5883,7 @@ void TestLanguageMode(const char* source,
|
||||
|
||||
i::Handle<i::Script> script =
|
||||
factory->NewScript(factory->NewStringFromAsciiChecked(source));
|
||||
i::Zone zone;
|
||||
i::Zone zone(CcTest::i_isolate()->allocator());
|
||||
i::ParseInfo info(&zone, script);
|
||||
i::Parser parser(&info);
|
||||
info.set_global();
|
||||
|
@ -97,7 +97,7 @@ using namespace v8::internal;
|
||||
|
||||
static bool CheckParse(const char* input) {
|
||||
v8::HandleScope scope(CcTest::isolate());
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
|
||||
RegExpCompileData result;
|
||||
return v8::internal::RegExpParser::ParseRegExp(
|
||||
@ -108,7 +108,7 @@ static bool CheckParse(const char* input) {
|
||||
static void CheckParseEq(const char* input, const char* expected,
|
||||
bool unicode = false) {
|
||||
v8::HandleScope scope(CcTest::isolate());
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
|
||||
RegExpCompileData result;
|
||||
JSRegExp::Flags flags = JSRegExp::kNone;
|
||||
@ -128,7 +128,7 @@ static void CheckParseEq(const char* input, const char* expected,
|
||||
|
||||
static bool CheckSimple(const char* input) {
|
||||
v8::HandleScope scope(CcTest::isolate());
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
|
||||
RegExpCompileData result;
|
||||
CHECK(v8::internal::RegExpParser::ParseRegExp(
|
||||
@ -146,7 +146,7 @@ struct MinMaxPair {
|
||||
|
||||
static MinMaxPair CheckMinMaxMatch(const char* input) {
|
||||
v8::HandleScope scope(CcTest::isolate());
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
|
||||
RegExpCompileData result;
|
||||
CHECK(v8::internal::RegExpParser::ParseRegExp(
|
||||
@ -461,7 +461,7 @@ TEST(ParserRegression) {
|
||||
static void ExpectError(const char* input,
|
||||
const char* expected) {
|
||||
v8::HandleScope scope(CcTest::isolate());
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
FlatStringReader reader(CcTest::i_isolate(), CStrVector(input));
|
||||
RegExpCompileData result;
|
||||
CHECK(!v8::internal::RegExpParser::ParseRegExp(
|
||||
@ -530,7 +530,7 @@ static bool NotWord(uc16 c) {
|
||||
|
||||
|
||||
static void TestCharacterClassEscapes(uc16 c, bool (pred)(uc16 c)) {
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
ZoneList<CharacterRange>* ranges =
|
||||
new(&zone) ZoneList<CharacterRange>(2, &zone);
|
||||
CharacterRange::AddClassEscape(c, ranges, &zone);
|
||||
@ -581,7 +581,7 @@ static RegExpNode* Compile(const char* input, bool multiline, bool unicode,
|
||||
static void Execute(const char* input, bool multiline, bool unicode,
|
||||
bool is_one_byte, bool dot_output = false) {
|
||||
v8::HandleScope scope(CcTest::isolate());
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
RegExpNode* node = Compile(input, multiline, unicode, is_one_byte, &zone);
|
||||
USE(node);
|
||||
#ifdef DEBUG
|
||||
@ -619,7 +619,7 @@ static unsigned PseudoRandom(int i, int j) {
|
||||
|
||||
TEST(SplayTreeSimple) {
|
||||
static const unsigned kLimit = 1000;
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
ZoneSplayTree<TestConfig> tree(&zone);
|
||||
bool seen[kLimit];
|
||||
for (unsigned i = 0; i < kLimit; i++) seen[i] = false;
|
||||
@ -686,7 +686,7 @@ TEST(DispatchTableConstruction) {
|
||||
}
|
||||
}
|
||||
// Enter test data into dispatch table.
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
DispatchTable table(&zone);
|
||||
for (int i = 0; i < kRangeCount; i++) {
|
||||
uc16* range = ranges[i];
|
||||
@ -800,7 +800,7 @@ TEST(MacroAssemblerNativeSuccess) {
|
||||
ContextInitializer initializer;
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Factory* factory = isolate->factory();
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
|
||||
4);
|
||||
@ -838,7 +838,7 @@ TEST(MacroAssemblerNativeSimple) {
|
||||
ContextInitializer initializer;
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Factory* factory = isolate->factory();
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
|
||||
4);
|
||||
@ -905,7 +905,7 @@ TEST(MacroAssemblerNativeSimpleUC16) {
|
||||
ContextInitializer initializer;
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Factory* factory = isolate->factory();
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::UC16,
|
||||
4);
|
||||
@ -978,7 +978,7 @@ TEST(MacroAssemblerNativeBacktrack) {
|
||||
ContextInitializer initializer;
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Factory* factory = isolate->factory();
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
|
||||
0);
|
||||
@ -1019,7 +1019,7 @@ TEST(MacroAssemblerNativeBackReferenceLATIN1) {
|
||||
ContextInitializer initializer;
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Factory* factory = isolate->factory();
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
|
||||
4);
|
||||
@ -1069,7 +1069,7 @@ TEST(MacroAssemblerNativeBackReferenceUC16) {
|
||||
ContextInitializer initializer;
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Factory* factory = isolate->factory();
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::UC16,
|
||||
4);
|
||||
@ -1122,7 +1122,7 @@ TEST(MacroAssemblernativeAtStart) {
|
||||
ContextInitializer initializer;
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Factory* factory = isolate->factory();
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
|
||||
0);
|
||||
@ -1182,7 +1182,7 @@ TEST(MacroAssemblerNativeBackRefNoCase) {
|
||||
ContextInitializer initializer;
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Factory* factory = isolate->factory();
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
|
||||
4);
|
||||
@ -1241,7 +1241,7 @@ TEST(MacroAssemblerNativeRegisters) {
|
||||
ContextInitializer initializer;
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Factory* factory = isolate->factory();
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
|
||||
6);
|
||||
@ -1343,7 +1343,7 @@ TEST(MacroAssemblerStackOverflow) {
|
||||
ContextInitializer initializer;
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Factory* factory = isolate->factory();
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
|
||||
0);
|
||||
@ -1382,7 +1382,7 @@ TEST(MacroAssemblerNativeLotsOfRegisters) {
|
||||
ContextInitializer initializer;
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Factory* factory = isolate->factory();
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
ArchRegExpMacroAssembler m(isolate, &zone, NativeRegExpMacroAssembler::LATIN1,
|
||||
2);
|
||||
@ -1430,7 +1430,7 @@ TEST(MacroAssemblerNativeLotsOfRegisters) {
|
||||
|
||||
TEST(MacroAssembler) {
|
||||
byte codes[1024];
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
RegExpMacroAssemblerIrregexp m(CcTest::i_isolate(), Vector<byte>(codes, 1024),
|
||||
&zone);
|
||||
// ^f(o)o.
|
||||
@ -1498,7 +1498,7 @@ TEST(AddInverseToTable) {
|
||||
static const int kLimit = 1000;
|
||||
static const int kRangeCount = 16;
|
||||
for (int t = 0; t < 10; t++) {
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
ZoneList<CharacterRange>* ranges =
|
||||
new(&zone) ZoneList<CharacterRange>(kRangeCount, &zone);
|
||||
for (int i = 0; i < kRangeCount; i++) {
|
||||
@ -1519,7 +1519,7 @@ TEST(AddInverseToTable) {
|
||||
CHECK_EQ(is_on, set->Get(0) == false);
|
||||
}
|
||||
}
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
ZoneList<CharacterRange>* ranges =
|
||||
new(&zone) ZoneList<CharacterRange>(1, &zone);
|
||||
ranges->Add(CharacterRange::Range(0xFFF0, 0xFFFE), &zone);
|
||||
@ -1632,7 +1632,7 @@ TEST(UncanonicalizeEquivalence) {
|
||||
|
||||
static void TestRangeCaseIndependence(Isolate* isolate, CharacterRange input,
|
||||
Vector<CharacterRange> expected) {
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
int count = expected.length();
|
||||
ZoneList<CharacterRange>* list =
|
||||
new(&zone) ZoneList<CharacterRange>(count, &zone);
|
||||
@ -1701,7 +1701,7 @@ static bool InClass(uc32 c, ZoneList<CharacterRange>* ranges) {
|
||||
|
||||
|
||||
TEST(UnicodeRangeSplitter) {
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
ZoneList<CharacterRange>* base =
|
||||
new(&zone) ZoneList<CharacterRange>(1, &zone);
|
||||
base->Add(CharacterRange::Everything(), &zone);
|
||||
@ -1745,7 +1745,7 @@ TEST(UnicodeRangeSplitter) {
|
||||
|
||||
|
||||
TEST(CanonicalizeCharacterSets) {
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
ZoneList<CharacterRange>* list =
|
||||
new(&zone) ZoneList<CharacterRange>(4, &zone);
|
||||
CharacterSet set(list);
|
||||
@ -1806,7 +1806,7 @@ TEST(CanonicalizeCharacterSets) {
|
||||
|
||||
|
||||
TEST(CharacterRangeMerge) {
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
ZoneList<CharacterRange> l1(4, &zone);
|
||||
ZoneList<CharacterRange> l2(4, &zone);
|
||||
// Create all combinations of intersections of ranges, both singletons and
|
||||
|
@ -25,8 +25,8 @@ static int32_t DummyStaticFunction(Object* result) { return 1; }
|
||||
|
||||
TEST(WasmRelocationIa32) {
|
||||
CcTest::InitializeVM();
|
||||
Zone zone;
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Zone zone(isolate->allocator());
|
||||
HandleScope scope(isolate);
|
||||
v8::internal::byte buffer[4096];
|
||||
Assembler assm(isolate, buffer, sizeof buffer);
|
||||
|
@ -25,8 +25,8 @@ static int32_t DummyStaticFunction(Object* result) { return 1; }
|
||||
|
||||
TEST(WasmRelocationIa32) {
|
||||
CcTest::InitializeVM();
|
||||
Zone zone;
|
||||
Isolate* isolate = CcTest::i_isolate();
|
||||
Zone zone(isolate->allocator());
|
||||
HandleScope scope(isolate);
|
||||
v8::internal::byte buffer[4096];
|
||||
Assembler assm(isolate, buffer, sizeof buffer);
|
||||
|
@ -40,7 +40,7 @@ struct Tests {
|
||||
Tests()
|
||||
: isolate(CcTest::InitIsolateOnce()),
|
||||
scope(isolate),
|
||||
zone(),
|
||||
zone(isolate->allocator()),
|
||||
T(&zone, isolate, isolate->random_number_generator()) {}
|
||||
|
||||
bool IsBitset(Type* type) { return type->IsBitsetForTesting(); }
|
||||
|
@ -143,7 +143,7 @@ TEST(UniqueSet_Add) {
|
||||
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
|
||||
MAKE_UNIQUES_A_B_C;
|
||||
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
UniqueSet<String>* set = new(&zone) UniqueSet<String>();
|
||||
|
||||
@ -170,7 +170,7 @@ TEST(UniqueSet_Remove) {
|
||||
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
|
||||
MAKE_UNIQUES_A_B_C;
|
||||
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
UniqueSet<String>* set = new(&zone) UniqueSet<String>();
|
||||
|
||||
@ -210,7 +210,7 @@ TEST(UniqueSet_Contains) {
|
||||
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
|
||||
MAKE_UNIQUES_A_B_C;
|
||||
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
UniqueSet<String>* set = new(&zone) UniqueSet<String>();
|
||||
|
||||
@ -241,7 +241,7 @@ TEST(UniqueSet_At) {
|
||||
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
|
||||
MAKE_UNIQUES_A_B_C;
|
||||
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
UniqueSet<String>* set = new(&zone) UniqueSet<String>();
|
||||
|
||||
@ -278,7 +278,7 @@ TEST(UniqueSet_Equals) {
|
||||
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
|
||||
MAKE_UNIQUES_A_B_C;
|
||||
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
UniqueSet<String>* set1 = new(&zone) UniqueSet<String>();
|
||||
UniqueSet<String>* set2 = new(&zone) UniqueSet<String>();
|
||||
@ -316,7 +316,7 @@ TEST(UniqueSet_IsSubset1) {
|
||||
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
|
||||
MAKE_UNIQUES_A_B_C;
|
||||
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
UniqueSet<String>* set1 = new(&zone) UniqueSet<String>();
|
||||
UniqueSet<String>* set2 = new(&zone) UniqueSet<String>();
|
||||
@ -351,7 +351,7 @@ TEST(UniqueSet_IsSubset2) {
|
||||
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
|
||||
MAKE_UNIQUES_A_B_C_D_E_F_G;
|
||||
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
UniqueSet<String>* set1 = new(&zone) UniqueSet<String>();
|
||||
UniqueSet<String>* set2 = new(&zone) UniqueSet<String>();
|
||||
@ -394,7 +394,7 @@ TEST(UniqueSet_IsSubsetExhaustive) {
|
||||
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
|
||||
MAKE_UNIQUES_A_B_C_D_E_F_G;
|
||||
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
Unique<String> elements[] = {
|
||||
A, B, C, D, E, F, G
|
||||
@ -417,7 +417,7 @@ TEST(UniqueSet_Intersect1) {
|
||||
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
|
||||
MAKE_UNIQUES_A_B_C;
|
||||
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
UniqueSet<String>* set1 = new(&zone) UniqueSet<String>();
|
||||
UniqueSet<String>* set2 = new(&zone) UniqueSet<String>();
|
||||
@ -458,7 +458,7 @@ TEST(UniqueSet_IntersectExhaustive) {
|
||||
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
|
||||
MAKE_UNIQUES_A_B_C_D_E_F_G;
|
||||
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
Unique<String> elements[] = {
|
||||
A, B, C, D, E, F, G
|
||||
@ -485,7 +485,7 @@ TEST(UniqueSet_Union1) {
|
||||
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
|
||||
MAKE_UNIQUES_A_B_C;
|
||||
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
UniqueSet<String>* set1 = new(&zone) UniqueSet<String>();
|
||||
UniqueSet<String>* set2 = new(&zone) UniqueSet<String>();
|
||||
@ -526,7 +526,7 @@ TEST(UniqueSet_UnionExhaustive) {
|
||||
MAKE_HANDLES_AND_DISALLOW_ALLOCATION;
|
||||
MAKE_UNIQUES_A_B_C_D_E_F_G;
|
||||
|
||||
Zone zone;
|
||||
Zone zone(CcTest::i_isolate()->allocator());
|
||||
|
||||
Unique<String> elements[] = {
|
||||
A, B, C, D, E, F, G
|
||||
|
@ -69,7 +69,8 @@ TEST(Run_WasmModule_CallAdd_rev) {
|
||||
|
||||
TEST(Run_WasmModule_Return114) {
|
||||
static const int32_t kReturnValue = 114;
|
||||
Zone zone;
|
||||
v8::base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
WasmModuleBuilder* builder = new (&zone) WasmModuleBuilder(&zone);
|
||||
uint16_t f_index = builder->AddFunction();
|
||||
WasmFunctionBuilder* f = builder->FunctionAt(f_index);
|
||||
@ -83,7 +84,8 @@ TEST(Run_WasmModule_Return114) {
|
||||
|
||||
|
||||
TEST(Run_WasmModule_CallAdd) {
|
||||
Zone zone;
|
||||
v8::base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
WasmModuleBuilder* builder = new (&zone) WasmModuleBuilder(&zone);
|
||||
uint16_t f1_index = builder->AddFunction();
|
||||
WasmFunctionBuilder* f = builder->FunctionAt(f1_index);
|
||||
@ -106,7 +108,8 @@ TEST(Run_WasmModule_CallAdd) {
|
||||
|
||||
TEST(Run_WasmModule_ReadLoadedDataSegment) {
|
||||
static const byte kDataSegmentDest0 = 12;
|
||||
Zone zone;
|
||||
v8::base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
WasmModuleBuilder* builder = new (&zone) WasmModuleBuilder(&zone);
|
||||
uint16_t f_index = builder->AddFunction();
|
||||
WasmFunctionBuilder* f = builder->FunctionAt(f_index);
|
||||
@ -124,7 +127,8 @@ TEST(Run_WasmModule_ReadLoadedDataSegment) {
|
||||
|
||||
TEST(Run_WasmModule_CheckMemoryIsZero) {
|
||||
static const int kCheckSize = 16 * 1024;
|
||||
Zone zone;
|
||||
v8::base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
WasmModuleBuilder* builder = new (&zone) WasmModuleBuilder(&zone);
|
||||
uint16_t f_index = builder->AddFunction();
|
||||
WasmFunctionBuilder* f = builder->FunctionAt(f_index);
|
||||
@ -145,7 +149,8 @@ TEST(Run_WasmModule_CheckMemoryIsZero) {
|
||||
}
|
||||
|
||||
TEST(Run_WasmModule_CallMain_recursive) {
|
||||
Zone zone;
|
||||
v8::base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
WasmModuleBuilder* builder = new (&zone) WasmModuleBuilder(&zone);
|
||||
uint16_t f_index = builder->AddFunction();
|
||||
WasmFunctionBuilder* f = builder->FunctionAt(f_index);
|
||||
@ -166,7 +171,8 @@ TEST(Run_WasmModule_CallMain_recursive) {
|
||||
}
|
||||
|
||||
TEST(Run_WasmModule_Global) {
|
||||
Zone zone;
|
||||
v8::base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
WasmModuleBuilder* builder = new (&zone) WasmModuleBuilder(&zone);
|
||||
uint32_t global1 = builder->AddGlobal(MachineType::Int32(), 0);
|
||||
uint32_t global2 = builder->AddGlobal(MachineType::Int32(), 0);
|
||||
|
@ -1714,8 +1714,8 @@ TEST(Run_Wasm_Infinite_Loop_not_taken2_brif) {
|
||||
static void TestBuildGraphForSimpleExpression(WasmOpcode opcode) {
|
||||
if (!WasmOpcodes::IsSupported(opcode)) return;
|
||||
|
||||
Zone zone;
|
||||
Isolate* isolate = CcTest::InitIsolateOnce();
|
||||
Zone zone(isolate->allocator());
|
||||
HandleScope scope(isolate);
|
||||
// Enable all optional operators.
|
||||
CommonOperatorBuilder common(&zone);
|
||||
@ -2141,7 +2141,8 @@ static void Run_WasmMixedCall_N(int start) {
|
||||
|
||||
int num_params = static_cast<int>(arraysize(mixed)) - start;
|
||||
for (int which = 0; which < num_params; which++) {
|
||||
Zone zone;
|
||||
v8::base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
TestingModule module;
|
||||
module.AddMemory(1024);
|
||||
MachineType* memtypes = &mixed[start];
|
||||
@ -2780,7 +2781,8 @@ void CompileCallIndirectMany(LocalType param) {
|
||||
// with many many parameters.
|
||||
TestSignatures sigs;
|
||||
for (byte num_params = 0; num_params < 40; num_params++) {
|
||||
Zone zone;
|
||||
v8::base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
HandleScope scope(CcTest::InitIsolateOnce());
|
||||
TestingModule module;
|
||||
FunctionSig* sig = sigs.many(&zone, kAstStmt, param, num_params);
|
||||
|
@ -221,7 +221,8 @@ inline void TestBuildingGraph(Zone* zone, JSGraph* jsgraph, ModuleEnv* module,
|
||||
FunctionSig* sig, const byte* start,
|
||||
const byte* end) {
|
||||
compiler::WasmGraphBuilder builder(zone, jsgraph, sig);
|
||||
TreeResult result = BuildTFGraph(&builder, module, sig, start, end);
|
||||
TreeResult result =
|
||||
BuildTFGraph(zone->allocator(), &builder, module, sig, start, end);
|
||||
if (result.failed()) {
|
||||
ptrdiff_t pc = result.error_pc - result.start;
|
||||
ptrdiff_t pt = result.error_pt - result.start;
|
||||
@ -485,8 +486,8 @@ class WasmRunner {
|
||||
MachineType p1 = MachineType::None(),
|
||||
MachineType p2 = MachineType::None(),
|
||||
MachineType p3 = MachineType::None())
|
||||
: compiled_(false),
|
||||
|
||||
: zone(&allocator_),
|
||||
compiled_(false),
|
||||
signature_(MachineTypeForC<ReturnType>() == MachineType::None() ? 0 : 1,
|
||||
GetParameterCount(p0, p1, p2, p3), storage_),
|
||||
compiler_(&signature_, nullptr) {
|
||||
@ -497,7 +498,8 @@ class WasmRunner {
|
||||
MachineType p1 = MachineType::None(),
|
||||
MachineType p2 = MachineType::None(),
|
||||
MachineType p3 = MachineType::None())
|
||||
: compiled_(false),
|
||||
: zone(&allocator_),
|
||||
compiled_(false),
|
||||
signature_(MachineTypeForC<ReturnType>() == MachineType::None() ? 0 : 1,
|
||||
GetParameterCount(p0, p1, p2, p3), storage_),
|
||||
compiler_(&signature_, module) {
|
||||
@ -577,6 +579,7 @@ class WasmRunner {
|
||||
byte AllocateLocal(LocalType type) { return compiler_.AllocateLocal(type); }
|
||||
|
||||
protected:
|
||||
v8::base::AccountingAllocator allocator_;
|
||||
Zone zone;
|
||||
bool compiled_;
|
||||
LocalType storage_[WASM_RUNNER_MAX_NUM_PARAMETERS];
|
||||
|
@ -33,7 +33,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
|
||||
|
||||
v8::internal::Handle<v8::internal::Script> script =
|
||||
factory->NewScript(source.ToHandleChecked());
|
||||
v8::internal::Zone zone;
|
||||
v8::internal::Zone zone(i_isolate->allocator());
|
||||
v8::internal::ParseInfo info(&zone, script);
|
||||
info.set_global();
|
||||
v8::internal::Parser parser(&info);
|
||||
|
@ -64,7 +64,7 @@ class LoopPeelingTest : public GraphTest {
|
||||
OFStream os(stdout);
|
||||
os << AsRPO(*graph());
|
||||
}
|
||||
Zone zone;
|
||||
Zone zone(isolate()->allocator());
|
||||
return LoopFinder::BuildLoopTree(graph(), &zone);
|
||||
}
|
||||
|
||||
|
@ -12,7 +12,7 @@ namespace compiler {
|
||||
|
||||
class ZonePoolTest : public TestWithIsolate {
|
||||
public:
|
||||
ZonePoolTest() {}
|
||||
ZonePoolTest() : zone_pool_(&allocator_) {}
|
||||
|
||||
protected:
|
||||
ZonePool* zone_pool() { return &zone_pool_; }
|
||||
@ -38,6 +38,7 @@ class ZonePoolTest : public TestWithIsolate {
|
||||
}
|
||||
|
||||
private:
|
||||
base::AccountingAllocator allocator_;
|
||||
ZonePool zone_pool_;
|
||||
base::RandomNumberGenerator rng;
|
||||
};
|
||||
|
@ -93,12 +93,13 @@ class TestWithIsolate : public virtual ::v8::TestWithIsolate {
|
||||
|
||||
class TestWithZone : public virtual ::testing::Test {
|
||||
public:
|
||||
TestWithZone() {}
|
||||
TestWithZone() : zone_(&allocator_) {}
|
||||
virtual ~TestWithZone();
|
||||
|
||||
Zone* zone() { return &zone_; }
|
||||
|
||||
private:
|
||||
base::AccountingAllocator allocator_;
|
||||
Zone zone_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(TestWithZone);
|
||||
@ -107,12 +108,13 @@ class TestWithZone : public virtual ::testing::Test {
|
||||
|
||||
class TestWithIsolateAndZone : public virtual TestWithIsolate {
|
||||
public:
|
||||
TestWithIsolateAndZone() {}
|
||||
TestWithIsolateAndZone() : zone_(&allocator_) {}
|
||||
virtual ~TestWithIsolateAndZone();
|
||||
|
||||
Zone* zone() { return &zone_; }
|
||||
|
||||
private:
|
||||
base::AccountingAllocator allocator_;
|
||||
Zone zone_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(TestWithIsolateAndZone);
|
||||
|
@ -80,7 +80,8 @@ class AstDecoderTest : public TestWithZone {
|
||||
const byte* end) {
|
||||
local_decls.Prepend(&start, &end);
|
||||
// Verify the code.
|
||||
TreeResult result = VerifyWasmCode(module, sig, start, end);
|
||||
TreeResult result =
|
||||
VerifyWasmCode(zone()->allocator(), module, sig, start, end);
|
||||
|
||||
if (result.error_code != expected) {
|
||||
ptrdiff_t pc = result.error_pc - result.start;
|
||||
@ -2211,7 +2212,9 @@ class LocalDeclDecoderTest : public TestWithZone {
|
||||
|
||||
TEST_F(LocalDeclDecoderTest, NoLocals) {
|
||||
static const byte data[] = {0};
|
||||
LocalTypeMap map = DecodeLocalDeclsForTesting(data, data + sizeof(data));
|
||||
base::AccountingAllocator allocator;
|
||||
LocalTypeMap map =
|
||||
DecodeLocalDeclsForTesting(&allocator, data, data + sizeof(data));
|
||||
EXPECT_EQ(0, map->size());
|
||||
if (map) delete map;
|
||||
}
|
||||
@ -2221,7 +2224,9 @@ TEST_F(LocalDeclDecoderTest, OneLocal) {
|
||||
LocalType type = kLocalTypes[i];
|
||||
const byte data[] = {
|
||||
1, 1, static_cast<byte>(WasmOpcodes::LocalTypeCodeFor(type))};
|
||||
LocalTypeMap map = DecodeLocalDeclsForTesting(data, data + sizeof(data));
|
||||
base::AccountingAllocator allocator;
|
||||
LocalTypeMap map =
|
||||
DecodeLocalDeclsForTesting(&allocator, data, data + sizeof(data));
|
||||
EXPECT_EQ(1, map->size());
|
||||
EXPECT_EQ(type, map->at(0));
|
||||
if (map) delete map;
|
||||
@ -2233,7 +2238,9 @@ TEST_F(LocalDeclDecoderTest, FiveLocals) {
|
||||
LocalType type = kLocalTypes[i];
|
||||
const byte data[] = {
|
||||
1, 5, static_cast<byte>(WasmOpcodes::LocalTypeCodeFor(type))};
|
||||
LocalTypeMap map = DecodeLocalDeclsForTesting(data, data + sizeof(data));
|
||||
base::AccountingAllocator allocator;
|
||||
LocalTypeMap map =
|
||||
DecodeLocalDeclsForTesting(&allocator, data, data + sizeof(data));
|
||||
EXPECT_EQ(5, map->size());
|
||||
ExpectRun(map, 0, type, 5);
|
||||
if (map) delete map;
|
||||
@ -2247,8 +2254,9 @@ TEST_F(LocalDeclDecoderTest, MixedLocals) {
|
||||
for (byte d = 0; d < 3; d++) {
|
||||
const byte data[] = {4, a, kLocalI32, b, kLocalI64,
|
||||
c, kLocalF32, d, kLocalF64};
|
||||
base::AccountingAllocator allocator;
|
||||
LocalTypeMap map =
|
||||
DecodeLocalDeclsForTesting(data, data + sizeof(data));
|
||||
DecodeLocalDeclsForTesting(&allocator, data, data + sizeof(data));
|
||||
EXPECT_EQ(a + b + c + d, map->size());
|
||||
|
||||
size_t pos = 0;
|
||||
@ -2274,7 +2282,8 @@ TEST_F(LocalDeclDecoderTest, UseEncoder) {
|
||||
local_decls.AddLocals(212, kAstI64);
|
||||
local_decls.Prepend(&data, &end);
|
||||
|
||||
LocalTypeMap map = DecodeLocalDeclsForTesting(data, end);
|
||||
base::AccountingAllocator allocator;
|
||||
LocalTypeMap map = DecodeLocalDeclsForTesting(&allocator, data, end);
|
||||
size_t pos = 0;
|
||||
pos = ExpectRun(map, pos, kAstF32, 5);
|
||||
pos = ExpectRun(map, pos, kAstI32, 1337);
|
||||
|
@ -52,7 +52,8 @@ class EncoderTest : public TestWithZone {
|
||||
|
||||
|
||||
TEST_F(EncoderTest, Function_Builder_Variable_Indexing) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
WasmModuleBuilder* builder = new (&zone) WasmModuleBuilder(&zone);
|
||||
uint16_t f_index = builder->AddFunction();
|
||||
WasmFunctionBuilder* function = builder->FunctionAt(f_index);
|
||||
@ -90,7 +91,8 @@ TEST_F(EncoderTest, Function_Builder_Variable_Indexing) {
|
||||
|
||||
|
||||
TEST_F(EncoderTest, Function_Builder_Indexing_Variable_Width) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
WasmModuleBuilder* builder = new (&zone) WasmModuleBuilder(&zone);
|
||||
uint16_t f_index = builder->AddFunction();
|
||||
WasmFunctionBuilder* function = builder->FunctionAt(f_index);
|
||||
@ -109,7 +111,8 @@ TEST_F(EncoderTest, Function_Builder_Indexing_Variable_Width) {
|
||||
}
|
||||
|
||||
TEST_F(EncoderTest, Function_Builder_Block_Variable_Width) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
WasmModuleBuilder* builder = new (&zone) WasmModuleBuilder(&zone);
|
||||
uint16_t f_index = builder->AddFunction();
|
||||
WasmFunctionBuilder* function = builder->FunctionAt(f_index);
|
||||
@ -123,7 +126,8 @@ TEST_F(EncoderTest, Function_Builder_Block_Variable_Width) {
|
||||
}
|
||||
|
||||
TEST_F(EncoderTest, Function_Builder_EmitEditableVarIntImmediate) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
WasmModuleBuilder* builder = new (&zone) WasmModuleBuilder(&zone);
|
||||
uint16_t f_index = builder->AddFunction();
|
||||
WasmFunctionBuilder* function = builder->FunctionAt(f_index);
|
||||
@ -139,7 +143,8 @@ TEST_F(EncoderTest, Function_Builder_EmitEditableVarIntImmediate) {
|
||||
}
|
||||
|
||||
TEST_F(EncoderTest, Function_Builder_EmitEditableVarIntImmediate_Locals) {
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
WasmModuleBuilder* builder = new (&zone) WasmModuleBuilder(&zone);
|
||||
uint16_t f_index = builder->AddFunction();
|
||||
WasmFunctionBuilder* function = builder->FunctionAt(f_index);
|
||||
|
@ -779,7 +779,8 @@ class WasmSignatureDecodeTest : public TestWithZone {};
|
||||
|
||||
TEST_F(WasmSignatureDecodeTest, Ok_v_v) {
|
||||
static const byte data[] = {0, 0};
|
||||
Zone zone;
|
||||
base::AccountingAllocator allocator;
|
||||
Zone zone(&allocator);
|
||||
FunctionSig* sig =
|
||||
DecodeWasmSignatureForTesting(&zone, data, data + arraysize(data));
|
||||
|
||||
|
@ -1674,6 +1674,8 @@
|
||||
'../..',
|
||||
],
|
||||
'sources': [
|
||||
'../../src/base/accounting-allocator.cc',
|
||||
'../../src/base/accounting-allocator.h',
|
||||
'../../src/base/adapters.h',
|
||||
'../../src/base/atomicops.h',
|
||||
'../../src/base/atomicops_internals_arm64_gcc.h',
|
||||
|
@ -102,7 +102,7 @@ std::pair<v8::base::TimeDelta, v8::base::TimeDelta> RunBaselineParser(
|
||||
i::ScriptData* cached_data_impl = NULL;
|
||||
// First round of parsing (produce data to cache).
|
||||
{
|
||||
Zone zone;
|
||||
Zone zone(reinterpret_cast<i::Isolate*>(isolate)->allocator());
|
||||
ParseInfo info(&zone, script);
|
||||
info.set_global();
|
||||
info.set_cached_data(&cached_data_impl);
|
||||
@ -120,7 +120,7 @@ std::pair<v8::base::TimeDelta, v8::base::TimeDelta> RunBaselineParser(
|
||||
}
|
||||
// Second round of parsing (consume cached data).
|
||||
{
|
||||
Zone zone;
|
||||
Zone zone(reinterpret_cast<i::Isolate*>(isolate)->allocator());
|
||||
ParseInfo info(&zone, script);
|
||||
info.set_global();
|
||||
info.set_cached_data(&cached_data_impl);
|
||||
|
Loading…
Reference in New Issue
Block a user