From: sanjoy@chromium.org Date: Wed, 20 Jun 2012 08:58:41 +0000 (+0000) Subject: One Zone per CompilationInfo. X-Git-Tag: upstream/4.7.83~16493 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9e4fbb45c1edaed1b61d4bbe1a579ea3511eb7a7;p=platform%2Fupstream%2Fv8.git One Zone per CompilationInfo. The CompilationInfo record now saves a Zone, and the compiler pipeline allocates memory from the Zone in the CompilationInfo. Before compiling a function, we create a Zone on the stack and save a pointer to that Zone to the CompilationInfo; which then gets picked up and allocated from. BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10534139 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@11877 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc index 30c131c..33a22f1 100644 --- a/src/arm/full-codegen-arm.cc +++ b/src/arm/full-codegen-arm.cc @@ -1607,7 +1607,7 @@ void FullCodeGenerator::VisitObjectLiteral(ObjectLiteral* expr) { // marked expressions, no store code is emitted. expr->CalculateEmitStore(zone()); - AccessorTable accessor_table(isolate()->zone()); + AccessorTable accessor_table(zone()); for (int i = 0; i < expr->properties()->length(); i++) { ObjectLiteral::Property* property = expr->properties()->at(i); if (property->IsCompileTimeValue()) continue; diff --git a/src/arm/lithium-codegen-arm.h b/src/arm/lithium-codegen-arm.h index f35c69b..880d225 100644 --- a/src/arm/lithium-codegen-arm.h +++ b/src/arm/lithium-codegen-arm.h @@ -43,26 +43,25 @@ class SafepointGenerator; class LCodeGen BASE_EMBEDDED { public: - LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info, - Zone* zone) - : chunk_(chunk), + LCodeGen(LChunk* chunk, MacroAssembler* assembler, CompilationInfo* info) + : zone_(info->zone()), + chunk_(chunk), masm_(assembler), info_(info), current_block_(-1), current_instruction_(-1), instructions_(chunk->instructions()), - deoptimizations_(4, zone), - deopt_jump_table_(4, zone), - deoptimization_literals_(8, zone), + deoptimizations_(4, info->zone()), + deopt_jump_table_(4, info->zone()), + deoptimization_literals_(8, info->zone()), inlined_function_count_(0), scope_(info->scope()), status_(UNUSED), - translations_(zone), - deferred_(8, zone), + translations_(info->zone()), + deferred_(8, info->zone()), osr_pc_offset_(-1), last_lazy_deopt_pc_(0), - safepoints_(zone), - zone_(zone), + safepoints_(info->zone()), resolver_(this), expected_safepoint_kind_(Safepoint::kSimple) { PopulateDeoptimizationLiteralsWithInlinedFunctions(); @@ -350,6 +349,7 @@ class LCodeGen BASE_EMBEDDED { void EnsureSpaceForLazyDeopt(); + Zone* zone_; LChunk* const chunk_; MacroAssembler* const masm_; CompilationInfo* const info_; @@ -372,8 +372,6 @@ class LCodeGen BASE_EMBEDDED { // itself is emitted at the end of the generated code. SafepointTableBuilder safepoints_; - Zone* zone_; - // Compiler from a set of parallel moves to a sequential list of moves. LGapResolver resolver_; diff --git a/src/ast.h b/src/ast.h index b495bfe..2ebf7f9 100644 --- a/src/ast.h +++ b/src/ast.h @@ -2639,9 +2639,9 @@ class AstNullVisitor BASE_EMBEDDED { template class AstNodeFactory BASE_EMBEDDED { public: - explicit AstNodeFactory(Isolate* isolate) + AstNodeFactory(Isolate* isolate, Zone* zone) : isolate_(isolate), - zone_(isolate_->zone()) { } + zone_(zone) { } Visitor* visitor() { return &visitor_; } @@ -2711,10 +2711,9 @@ class AstNodeFactory BASE_EMBEDDED { Block* NewBlock(ZoneStringList* labels, int capacity, - bool is_initializer_block, - Zone* zone) { + bool is_initializer_block) { Block* block = new(zone_) Block( - isolate_, labels, capacity, is_initializer_block, zone); + isolate_, labels, capacity, is_initializer_block, zone_); VISIT_AND_RETURN(Block, block) } diff --git a/src/compiler.cc b/src/compiler.cc index 632f3bd..f706c7d 100644 --- a/src/compiler.cc +++ b/src/compiler.cc @@ -51,7 +51,7 @@ namespace v8 { namespace internal { -CompilationInfo::CompilationInfo(Handle