[turbofan] reduce allocations outside of pipeline
authordcarney@chromium.org <dcarney@chromium.org>
Mon, 27 Oct 2014 12:39:20 +0000 (12:39 +0000)
committerdcarney@chromium.org <dcarney@chromium.org>
Mon, 27 Oct 2014 12:40:13 +0000 (12:40 +0000)
BUG=
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/679793003

Cr-Commit-Position: refs/heads/master@{#24904}
git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24904 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

22 files changed:
src/compiler/arm/code-generator-arm.cc
src/compiler/arm64/code-generator-arm64.cc
src/compiler/ast-graph-builder.cc
src/compiler/code-generator.cc
src/compiler/code-generator.h
src/compiler/ia32/code-generator-ia32.cc
src/compiler/js-generic-lowering.cc
src/compiler/linkage.cc
src/compiler/linkage.h
src/compiler/mips/code-generator-mips.cc
src/compiler/pipeline.cc
src/compiler/x64/code-generator-x64.cc
test/cctest/compiler/codegen-tester.h
test/cctest/compiler/function-tester.h
test/cctest/compiler/graph-builder-tester.cc
test/cctest/compiler/test-changes-lowering.cc
test/cctest/compiler/test-codegen-deopt.cc
test/cctest/compiler/test-instruction.cc
test/cctest/compiler/test-linkage.cc
test/cctest/compiler/test-simplified-lowering.cc
test/unittests/compiler/change-lowering-unittest.cc
test/unittests/compiler/instruction-selector-unittest.cc

index c21858762608f66d51201efe7e6e19773f5dff13..c0e50042abd292c2516fc4cab2f2f3d99648067c 100644 (file)
@@ -682,7 +682,7 @@ void CodeGenerator::AssemblePrologue() {
       __ stm(db_w, sp, saves);
     }
   } else if (descriptor->IsJSFunctionCall()) {
-    CompilationInfo* info = linkage()->info();
+    CompilationInfo* info = this->info();
     __ Prologue(info->IsCodePreAgingActive());
     frame()->SetRegisterSaveAreaSize(
         StandardFrameConstants::kFixedFrameSizeFromFp);
@@ -914,7 +914,7 @@ void CodeGenerator::AddNopForSmiCodeInlining() {
 
 void CodeGenerator::EnsureSpaceForLazyDeopt() {
   int space_needed = Deoptimizer::patch_size();
-  if (!linkage()->info()->IsStub()) {
+  if (!info()->IsStub()) {
     // Ensure that we have enough space after the previous lazy-bailout
     // instruction for patching the code here.
     int current_pc = masm()->pc_offset();
index 04acfb8aa634fece924544cb51adce072271007e..c3a4f408568716f2ffb0b0fefe3ece17ec6e10cb 100644 (file)
@@ -752,7 +752,7 @@ void CodeGenerator::AssemblePrologue() {
     __ PushCalleeSavedRegisters();
     frame()->SetRegisterSaveAreaSize(20 * kPointerSize);
   } else if (descriptor->IsJSFunctionCall()) {
-    CompilationInfo* info = linkage()->info();
+    CompilationInfo* info = this->info();
     __ SetStackPointer(jssp);
     __ Prologue(info->IsCodePreAgingActive());
     frame()->SetRegisterSaveAreaSize(
@@ -967,7 +967,7 @@ void CodeGenerator::AddNopForSmiCodeInlining() { __ movz(xzr, 0); }
 
 void CodeGenerator::EnsureSpaceForLazyDeopt() {
   int space_needed = Deoptimizer::patch_size();
-  if (!linkage()->info()->IsStub()) {
+  if (!info()->IsStub()) {
     // Ensure that we have enough space after the previous lazy-bailout
     // instruction for patching the code here.
     intptr_t current_pc = masm()->pc_offset();
index b97260111ea45ffb0ea1683b4347183bb90be733..b230090888cbf25df65a1c01cf536678b97f3e61 100644 (file)
@@ -22,10 +22,10 @@ AstGraphBuilder::AstGraphBuilder(Zone* local_zone, CompilationInfo* info,
     : StructuredGraphBuilder(local_zone, jsgraph->graph(), jsgraph->common()),
       info_(info),
       jsgraph_(jsgraph),
-      globals_(0, info->zone()),
+      globals_(0, local_zone),
       breakable_(NULL),
       execution_context_(NULL) {
-  InitializeAstVisitor(info->zone());
+  InitializeAstVisitor(local_zone);
 }
 
 
index 4f278fdcd5a4a5f2fb581f96f8481b7673de2d02..7ca27ce7596e90326b26bf574a4798ac8ca8bc9e 100644 (file)
@@ -13,10 +13,11 @@ namespace internal {
 namespace compiler {
 
 CodeGenerator::CodeGenerator(Frame* frame, Linkage* linkage,
-                             InstructionSequence* code)
+                             InstructionSequence* code, CompilationInfo* info)
     : frame_(frame),
       linkage_(linkage),
       code_(code),
+      info_(info),
       current_block_(BasicBlock::RpoNumber::Invalid()),
       current_source_position_(SourcePosition::Invalid()),
       masm_(code->zone()->isolate(), NULL, 0),
@@ -29,7 +30,7 @@ CodeGenerator::CodeGenerator(Frame* frame, Linkage* linkage,
 
 
 Handle<Code> CodeGenerator::GenerateCode() {
-  CompilationInfo* info = linkage()->info();
+  CompilationInfo* info = this->info();
 
   // Emit a code line info recording start event.
   PositionsRecorder* recorder = masm()->positions_recorder();
@@ -166,7 +167,7 @@ void CodeGenerator::AssembleSourcePosition(SourcePositionInstruction* instr) {
     masm()->positions_recorder()->WriteRecordedPositions();
     if (FLAG_code_comments) {
       Vector<char> buffer = Vector<char>::New(256);
-      CompilationInfo* info = linkage()->info();
+      CompilationInfo* info = this->info();
       int ln = Script::GetLineNumber(info->script(), code_pos);
       int cn = Script::GetColumnNumber(info->script(), code_pos);
       if (info->script()->name()->IsString()) {
@@ -196,7 +197,7 @@ void CodeGenerator::AssembleGap(GapInstruction* instr) {
 
 
 void CodeGenerator::PopulateDeoptimizationData(Handle<Code> code_object) {
-  CompilationInfo* info = linkage()->info();
+  CompilationInfo* info = this->info();
   int deopt_count = static_cast<int>(deoptimization_states_.size());
   if (deopt_count == 0) return;
   Handle<DeoptimizationInputData> data =
index d7ce6d5c6d836762924356dfe92b2b19c62190cd..494f91e5517a2d4aee3d00b4c74e0562ca61f1ca 100644 (file)
@@ -21,7 +21,7 @@ namespace compiler {
 class CodeGenerator FINAL : public GapResolver::Assembler {
  public:
   explicit CodeGenerator(Frame* frame, Linkage* linkage,
-                         InstructionSequence* code);
+                         InstructionSequence* code, CompilationInfo* info);
 
   // Generate native code.
   Handle<Code> GenerateCode();
@@ -36,6 +36,7 @@ class CodeGenerator FINAL : public GapResolver::Assembler {
   GapResolver* resolver() { return &resolver_; }
   SafepointTableBuilder* safepoints() { return &safepoints_; }
   Zone* zone() const { return code()->zone(); }
+  CompilationInfo* info() const { return info_; }
 
   // Checks if {block} will appear directly after {current_block_} when
   // assembling code, in which case, a fall-through can be used.
@@ -118,6 +119,7 @@ class CodeGenerator FINAL : public GapResolver::Assembler {
   Frame* const frame_;
   Linkage* const linkage_;
   InstructionSequence* const code_;
+  CompilationInfo* const info_;
   BasicBlock::RpoNumber current_block_;
   SourcePosition current_source_position_;
   MacroAssembler masm_;
index 87d8c1813012fb80c66bfa9d58910b1b1fbb6220..d7098ae8dc7d3d5aa686622044747f018ed35bfe 100644 (file)
@@ -793,7 +793,7 @@ void CodeGenerator::AssemblePrologue() {
       frame->SetRegisterSaveAreaSize(register_save_area_size);
     }
   } else if (descriptor->IsJSFunctionCall()) {
-    CompilationInfo* info = linkage()->info();
+    CompilationInfo* info = this->info();
     __ Prologue(info->IsCodePreAgingActive());
     frame->SetRegisterSaveAreaSize(
         StandardFrameConstants::kFixedFrameSizeFromFp);
@@ -1023,7 +1023,7 @@ void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); }
 
 void CodeGenerator::EnsureSpaceForLazyDeopt() {
   int space_needed = Deoptimizer::patch_size();
-  if (!linkage()->info()->IsStub()) {
+  if (!info()->IsStub()) {
     // Ensure that we have enough space after the previous lazy-bailout
     // instruction for patching the code here.
     int current_pc = masm()->pc_offset();
index 9240b06602fa9b87ca4a938c4a77b90ac58431ae..c16aa82bafaad8e3af459df12a8099a7d08a8b61 100644 (file)
@@ -19,7 +19,7 @@ namespace compiler {
 JSGenericLowering::JSGenericLowering(CompilationInfo* info, JSGraph* jsgraph)
     : info_(info),
       jsgraph_(jsgraph),
-      linkage_(new (jsgraph->zone()) Linkage(info)) {}
+      linkage_(new (jsgraph->zone()) Linkage(jsgraph->zone(), info)) {}
 
 
 void JSGenericLowering::PatchOperator(Node* node, const Operator* op) {
index 4239f9fef92493dfe70a121311973b05bfa94206..481b44353b6f97ea191ef2b31dc555897faaa4ae 100644 (file)
@@ -39,28 +39,30 @@ std::ostream& operator<<(std::ostream& os, const CallDescriptor& d) {
 }
 
 
-Linkage::Linkage(CompilationInfo* info) : info_(info) {
+CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) {
   if (info->function() != NULL) {
     // If we already have the function literal, use the number of parameters
     // plus the receiver.
-    incoming_ = GetJSCallDescriptor(1 + info->function()->parameter_count());
-  } else if (!info->closure().is_null()) {
+    return GetJSCallDescriptor(1 + info->function()->parameter_count(), zone);
+  }
+  if (!info->closure().is_null()) {
     // If we are compiling a JS function, use a JS call descriptor,
     // plus the receiver.
     SharedFunctionInfo* shared = info->closure()->shared();
-    incoming_ = GetJSCallDescriptor(1 + shared->formal_parameter_count());
-  } else if (info->code_stub() != NULL) {
+    return GetJSCallDescriptor(1 + shared->formal_parameter_count(), zone);
+  }
+  if (info->code_stub() != NULL) {
     // Use the code stub interface descriptor.
     CallInterfaceDescriptor descriptor =
         info->code_stub()->GetCallInterfaceDescriptor();
-    incoming_ = GetStubCallDescriptor(descriptor);
-  } else {
-    incoming_ = NULL;  // TODO(titzer): ?
+    return GetStubCallDescriptor(descriptor, 0, CallDescriptor::kNoFlags, zone);
   }
+  return NULL;  // TODO(titzer): ?
 }
 
 
-FrameOffset Linkage::GetFrameOffset(int spill_slot, Frame* frame, int extra) {
+FrameOffset Linkage::GetFrameOffset(int spill_slot, Frame* frame,
+                                    int extra) const {
   if (frame->GetSpillSlotCount() > 0 || incoming_->IsJSFunctionCall() ||
       incoming_->kind() == CallDescriptor::kCallAddress) {
     int offset;
@@ -87,24 +89,22 @@ FrameOffset Linkage::GetFrameOffset(int spill_slot, Frame* frame, int extra) {
 }
 
 
-CallDescriptor* Linkage::GetJSCallDescriptor(int parameter_count) {
-  return GetJSCallDescriptor(parameter_count, this->info_->zone());
+CallDescriptor* Linkage::GetJSCallDescriptor(int parameter_count) const {
+  return GetJSCallDescriptor(parameter_count, zone_);
 }
 
 
 CallDescriptor* Linkage::GetRuntimeCallDescriptor(
     Runtime::FunctionId function, int parameter_count,
-    Operator::Properties properties) {
-  return GetRuntimeCallDescriptor(function, parameter_count, properties,
-                                  this->info_->zone());
+    Operator::Properties properties) const {
+  return GetRuntimeCallDescriptor(function, parameter_count, properties, zone_);
 }
 
 
 CallDescriptor* Linkage::GetStubCallDescriptor(
     CallInterfaceDescriptor descriptor, int stack_parameter_count,
-    CallDescriptor::Flags flags) {
-  return GetStubCallDescriptor(descriptor, stack_parameter_count, flags,
-                               this->info_->zone());
+    CallDescriptor::Flags flags) const {
+  return GetStubCallDescriptor(descriptor, stack_parameter_count, flags, zone_);
 }
 
 
index 63d9f1bff22d650758bc86c394a2029c4c303ccd..cc5be9ba621d7dd91345d04d3214a8a0d10d8334 100644 (file)
@@ -129,16 +129,18 @@ class CallDescriptor FINAL : public ZoneObject {
  private:
   friend class Linkage;
 
-  Kind kind_;
-  MachineType target_type_;
-  LinkageLocation target_loc_;
-  MachineSignature* machine_sig_;
-  LocationSignature* location_sig_;
-  size_t js_param_count_;
-  Operator::Properties properties_;
-  RegList callee_saved_registers_;
-  Flags flags_;
-  const char* debug_name_;
+  const Kind kind_;
+  const MachineType target_type_;
+  const LinkageLocation target_loc_;
+  const MachineSignature* const machine_sig_;
+  const LocationSignature* const location_sig_;
+  const size_t js_param_count_;
+  const Operator::Properties properties_;
+  const RegList callee_saved_registers_;
+  const Flags flags_;
+  const char* const debug_name_;
+
+  DISALLOW_COPY_AND_ASSIGN(CallDescriptor);
 };
 
 DEFINE_OPERATORS_FOR_FLAGS(CallDescriptor::Flags)
@@ -161,25 +163,28 @@ std::ostream& operator<<(std::ostream& os, const CallDescriptor::Kind& k);
 // Call[Runtime]    CEntryStub, arg 1, arg 2, arg 3, [...], fun, #arg, context
 class Linkage : public ZoneObject {
  public:
-  explicit Linkage(CompilationInfo* info);
-  explicit Linkage(CompilationInfo* info, CallDescriptor* incoming)
-      : info_(info), incoming_(incoming) {}
+  Linkage(Zone* zone, CompilationInfo* info)
+      : zone_(zone), incoming_(ComputeIncoming(zone, info)) {}
+  Linkage(Zone* zone, CallDescriptor* incoming)
+      : zone_(zone), incoming_(incoming) {}
+
+  static CallDescriptor* ComputeIncoming(Zone* zone, CompilationInfo* info);
 
   // The call descriptor for this compilation unit describes the locations
   // of incoming parameters and the outgoing return value(s).
-  CallDescriptor* GetIncomingDescriptor() { return incoming_; }
-  CallDescriptor* GetJSCallDescriptor(int parameter_count);
+  CallDescriptor* GetIncomingDescriptor() const { return incoming_; }
+  CallDescriptor* GetJSCallDescriptor(int parameter_count) const;
   static CallDescriptor* GetJSCallDescriptor(int parameter_count, Zone* zone);
-  CallDescriptor* GetRuntimeCallDescriptor(Runtime::FunctionId function,
-                                           int parameter_count,
-                                           Operator::Properties properties);
+  CallDescriptor* GetRuntimeCallDescriptor(
+      Runtime::FunctionId function, int parameter_count,
+      Operator::Properties properties) const;
   static CallDescriptor* GetRuntimeCallDescriptor(
       Runtime::FunctionId function, int parameter_count,
       Operator::Properties properties, Zone* zone);
 
   CallDescriptor* GetStubCallDescriptor(
       CallInterfaceDescriptor descriptor, int stack_parameter_count = 0,
-      CallDescriptor::Flags flags = CallDescriptor::kNoFlags);
+      CallDescriptor::Flags flags = CallDescriptor::kNoFlags) const;
   static CallDescriptor* GetStubCallDescriptor(
       CallInterfaceDescriptor descriptor, int stack_parameter_count,
       CallDescriptor::Flags flags, Zone* zone);
@@ -192,37 +197,37 @@ class Linkage : public ZoneObject {
                                                   MachineSignature* sig);
 
   // Get the location of an (incoming) parameter to this function.
-  LinkageLocation GetParameterLocation(int index) {
+  LinkageLocation GetParameterLocation(int index) const {
     return incoming_->GetInputLocation(index + 1);  // + 1 to skip target.
   }
 
   // Get the machine type of an (incoming) parameter to this function.
-  MachineType GetParameterType(int index) {
+  MachineType GetParameterType(int index) const {
     return incoming_->GetInputType(index + 1);  // + 1 to skip target.
   }
 
   // Get the location where this function should place its return value.
-  LinkageLocation GetReturnLocation() {
+  LinkageLocation GetReturnLocation() const {
     return incoming_->GetReturnLocation(0);
   }
 
   // Get the machine type of this function's return value.
-  MachineType GetReturnType() { return incoming_->GetReturnType(0); }
+  MachineType GetReturnType() const { return incoming_->GetReturnType(0); }
 
   // Get the frame offset for a given spill slot. The location depends on the
   // calling convention and the specific frame layout, and may thus be
   // architecture-specific. Negative spill slots indicate arguments on the
   // caller's frame. The {extra} parameter indicates an additional offset from
   // the frame offset, e.g. to index into part of a double slot.
-  FrameOffset GetFrameOffset(int spill_slot, Frame* frame, int extra = 0);
-
-  CompilationInfo* info() const { return info_; }
+  FrameOffset GetFrameOffset(int spill_slot, Frame* frame, int extra = 0) const;
 
   static bool NeedsFrameState(Runtime::FunctionId function);
 
  private:
-  CompilationInfo* info_;
-  CallDescriptor* incoming_;
+  Zone* const zone_;
+  CallDescriptor* const incoming_;
+
+  DISALLOW_COPY_AND_ASSIGN(Linkage);
 };
 
 }  // namespace compiler
index 9609cf4e64a2c939c22e8f8620b169db79edc3f0..9a8b98a6355409f5eb72e27cdc2aee6f4b59772c 100644 (file)
@@ -709,7 +709,7 @@ void CodeGenerator::AssemblePrologue() {
       __ MultiPush(saves);
     }
   } else if (descriptor->IsJSFunctionCall()) {
-    CompilationInfo* info = linkage()->info();
+    CompilationInfo* info = this->info();
     __ Prologue(info->IsCodePreAgingActive());
     frame()->SetRegisterSaveAreaSize(
         StandardFrameConstants::kFixedFrameSizeFromFp);
@@ -942,7 +942,7 @@ void CodeGenerator::AddNopForSmiCodeInlining() {
 
 void CodeGenerator::EnsureSpaceForLazyDeopt() {
   int space_needed = Deoptimizer::patch_size();
-  if (!linkage()->info()->IsStub()) {
+  if (!info()->IsStub()) {
     // Ensure that we have enough space after the previous lazy-bailout
     // instruction for patching the code here.
     int current_pc = masm()->pc_offset();
index b44fe9b71ec80d0c639edc3cf004f765b2dd5b6c..bf64f6665c79d4c7274a8d016e7ec2116cd617fa 100644 (file)
@@ -397,7 +397,7 @@ Handle<Code> Pipeline::GenerateCode() {
       PhaseScope phase_scope(pipeline_statistics.get(), "change lowering");
       SourcePositionTable::Scope pos(data.source_positions(),
                                      SourcePosition::Unknown());
-      Linkage linkage(info());
+      Linkage linkage(data.graph_zone(), info());
       ValueNumberingReducer vn_reducer(data.graph_zone());
       SimplifiedOperatorReducer simple_reducer(data.jsgraph());
       ChangeLowering lowering(data.jsgraph(), &linkage);
@@ -452,7 +452,7 @@ Handle<Code> Pipeline::GenerateCode() {
   Handle<Code> code = Handle<Code>::null();
   {
     // Generate optimized code.
-    Linkage linkage(info());
+    Linkage linkage(data.instruction_zone(), info());
     code = GenerateCode(&linkage, &data);
     info()->SetCode(code);
   }
@@ -552,14 +552,13 @@ Handle<Code> Pipeline::GenerateCode(Linkage* linkage, PipelineData* data) {
   {
     int node_count = sequence.VirtualRegisterCount();
     if (node_count > UnallocatedOperand::kMaxVirtualRegisters) {
-      linkage->info()->AbortOptimization(kNotEnoughVirtualRegistersForValues);
+      info()->AbortOptimization(kNotEnoughVirtualRegistersForValues);
       return Handle<Code>::null();
     }
     ZonePool::Scope zone_scope(data->zone_pool());
-    RegisterAllocator allocator(zone_scope.zone(), &frame, linkage->info(),
-                                &sequence);
+    RegisterAllocator allocator(zone_scope.zone(), &frame, info(), &sequence);
     if (!allocator.Allocate(data->pipeline_statistics())) {
-      linkage->info()->AbortOptimization(kNotEnoughVirtualRegistersRegalloc);
+      info()->AbortOptimization(kNotEnoughVirtualRegistersRegalloc);
       return Handle<Code>::null();
     }
     if (FLAG_trace_turbo) {
@@ -582,7 +581,7 @@ Handle<Code> Pipeline::GenerateCode(Linkage* linkage, PipelineData* data) {
   Handle<Code> code;
   {
     PhaseScope phase_scope(data->pipeline_statistics(), "generate code");
-    CodeGenerator generator(&frame, linkage, &sequence);
+    CodeGenerator generator(&frame, linkage, &sequence, info());
     code = generator.GenerateCode();
   }
   if (profiler_data != NULL) {
index f8f0e5022912ac2dbfa7354afb33c6f30f1526e4..de9710323b6d9b3d4800d46352a1b9bf96ffe22b 100644 (file)
@@ -766,7 +766,7 @@ void CodeGenerator::AssemblePrologue() {
       frame()->SetRegisterSaveAreaSize(register_save_area_size);
     }
   } else if (descriptor->IsJSFunctionCall()) {
-    CompilationInfo* info = linkage()->info();
+    CompilationInfo* info = this->info();
     __ Prologue(info->IsCodePreAgingActive());
     frame()->SetRegisterSaveAreaSize(
         StandardFrameConstants::kFixedFrameSizeFromFp);
@@ -992,7 +992,7 @@ void CodeGenerator::AddNopForSmiCodeInlining() { __ nop(); }
 
 void CodeGenerator::EnsureSpaceForLazyDeopt() {
   int space_needed = Deoptimizer::patch_size();
-  if (!linkage()->info()->IsStub()) {
+  if (!info()->IsStub()) {
     // Ensure that we have enough space after the previous lazy-bailout
     // instruction for patching the code here.
     int current_pc = masm()->pc_offset();
index 6aa5bae56069a182b07f5e8c69957a9be23e84be..6af5c78aa804684ba45ccc208f90e445a116acc6 100644 (file)
@@ -66,7 +66,7 @@ class MachineAssemblerTester : public HandleAndZoneScope,
       CallDescriptor* call_descriptor = this->call_descriptor();
       Graph* graph = this->graph();
       CompilationInfo info(graph->zone()->isolate(), graph->zone());
-      Linkage linkage(&info, call_descriptor);
+      Linkage linkage(graph->zone(), call_descriptor);
       Pipeline pipeline(&info);
       code_ = pipeline.GenerateCodeForMachineGraph(&linkage, graph, schedule);
     }
index 34c663f212bd29a61c146938d1deec671687b66d..eb6bd498cc19e34a415b74dd84cb3601bcb11002 100644 (file)
@@ -221,7 +221,7 @@ class FunctionTester : public InitializedHandleScope {
     CHECK(Compiler::EnsureDeoptimizationSupport(&info));
 
     Pipeline pipeline(&info);
-    Linkage linkage(&info);
+    Linkage linkage(info.zone(), &info);
     Handle<Code> code = pipeline.GenerateCodeForMachineGraph(&linkage, graph);
     CHECK(!code.is_null());
     function->ReplaceCode(*code);
index bfa822645865ac650137d674458caeae3dfa3e87..9c4379c52017be2388b22be4a4bd708a28d045cd 100644 (file)
@@ -36,7 +36,7 @@ byte* MachineCallHelper::Generate() {
   if (code_.is_null()) {
     Zone* zone = graph_->zone();
     CompilationInfo info(zone->isolate(), zone);
-    Linkage linkage(&info,
+    Linkage linkage(zone,
                     Linkage::GetSimplifiedCDescriptor(zone, machine_sig_));
     Pipeline pipeline(&info);
     code_ = pipeline.GenerateCodeForMachineGraph(&linkage, graph_);
index 9402e36a1c206c129ca4d52fcfef56c715826ca9..a015c501adba42e780e52721888e9fa2ffa18a66 100644 (file)
@@ -125,7 +125,7 @@ class ChangesLoweringTester : public GraphBuilderTester<ReturnType> {
   void LowerChange(Node* change) {
     // Run the graph reducer with changes lowering on a single node.
     CompilationInfo info(this->isolate(), this->zone());
-    Linkage linkage(&info);
+    Linkage linkage(this->zone(), &info);
     ChangeLowering lowering(&jsgraph, &linkage);
     GraphReducer reducer(this->graph());
     reducer.AddReducer(&lowering);
index 0feeda18598dcbb323fae40154ea76bad80869b8..799fa9438e47029d06ce692801f4a17f5ad30e5e 100644 (file)
@@ -66,7 +66,7 @@ class DeoptCodegenTester {
     }
 
     // Initialize the codegen and generate code.
-    Linkage* linkage = new (scope_->main_zone()) Linkage(&info);
+    Linkage* linkage = new (scope_->main_zone()) Linkage(info.zone(), &info);
     code = new v8::internal::compiler::InstructionSequence(scope_->main_zone(),
                                                            graph, schedule);
     SourcePositionTable source_positions(graph);
@@ -88,7 +88,7 @@ class DeoptCodegenTester {
          << *code;
     }
 
-    compiler::CodeGenerator generator(&frame, linkage, code);
+    compiler::CodeGenerator generator(&frame, linkage, code, &info);
     result_code = generator.GenerateCode();
 
 #ifdef OBJECT_PRINT
index fc48ca2c1a9c6e667b74632eb0ae1f63ac0c25c6..d61f34c4bffbb4659a4bf6a64377fe9c87898a04 100644 (file)
@@ -31,7 +31,7 @@ class InstructionTester : public HandleAndZoneScope {
         graph(zone()),
         schedule(zone()),
         info(static_cast<HydrogenCodeStub*>(NULL), main_isolate()),
-        linkage(&info),
+        linkage(zone(), &info),
         common(zone()),
         code(NULL) {}
 
index ff65d6e4d6151a9577421f982f4d0441440628e5..923f7fcaa71389d5cdfb9ccd7da712c456314551 100644 (file)
@@ -45,7 +45,7 @@ TEST(TestLinkageCreate) {
   InitializedHandleScope handles;
   Handle<JSFunction> function = Compile("a + b");
   CompilationInfoWithZone info(function);
-  Linkage linkage(&info);
+  Linkage linkage(info.zone(), &info);
 }
 
 
@@ -60,7 +60,7 @@ TEST(TestLinkageJSFunctionIncoming) {
     Handle<JSFunction> function = v8::Utils::OpenHandle(
         *v8::Handle<v8::Function>::Cast(CompileRun(sources[i])));
     CompilationInfoWithZone info(function);
-    Linkage linkage(&info);
+    Linkage linkage(info.zone(), &info);
 
     CallDescriptor* descriptor = linkage.GetIncomingDescriptor();
     CHECK_NE(NULL, descriptor);
@@ -76,7 +76,7 @@ TEST(TestLinkageJSFunctionIncoming) {
 TEST(TestLinkageCodeStubIncoming) {
   Isolate* isolate = CcTest::InitIsolateOnce();
   CompilationInfoWithZone info(static_cast<HydrogenCodeStub*>(NULL), isolate);
-  Linkage linkage(&info);
+  Linkage linkage(info.zone(), &info);
   // TODO(titzer): test linkage creation with a bonafide code stub.
   // this just checks current behavior.
   CHECK_EQ(NULL, linkage.GetIncomingDescriptor());
@@ -87,7 +87,7 @@ TEST(TestLinkageJSCall) {
   HandleAndZoneScope handles;
   Handle<JSFunction> function = Compile("a + c");
   CompilationInfoWithZone info(function);
-  Linkage linkage(&info);
+  Linkage linkage(info.zone(), &info);
 
   for (int i = 0; i < 32; i++) {
     CallDescriptor* descriptor = linkage.GetJSCallDescriptor(i);
index 3d1c2551d00c140b57e38d0fed0edab5a966e938..47acbe1a9b02d4a88f58e76ea80988860c6068e2 100644 (file)
@@ -61,7 +61,7 @@ class SimplifiedLoweringTester : public GraphBuilderTester<ReturnType> {
     Zone* zone = this->zone();
     CompilationInfo info(zone->isolate(), zone);
     Linkage linkage(
-        &info, Linkage::GetSimplifiedCDescriptor(zone, this->machine_sig_));
+        zone, Linkage::GetSimplifiedCDescriptor(zone, this->machine_sig_));
     ChangeLowering lowering(&jsgraph, &linkage);
     GraphReducer reducer(this->graph());
     reducer.AddReducer(&lowering);
index 3f77a8f83c38f7aebb635e7636262f5689b2587a..ed57513ca241be460a37bdc6a4a0d51b3678d8a2 100644 (file)
@@ -69,7 +69,7 @@ class ChangeLoweringTest : public GraphTest {
     JSOperatorBuilder javascript(zone());
     JSGraph jsgraph(graph(), common(), &javascript, &machine);
     CompilationInfo info(isolate(), zone());
-    Linkage linkage(&info);
+    Linkage linkage(zone(), &info);
     ChangeLowering reducer(&jsgraph, &linkage);
     return reducer.Reduce(node);
   }
index defc9535029698b70d1b48036bd50d385acdc917..0c5cdc5ddb1060bdcf86a09923d4393feafd8502 100644 (file)
@@ -36,8 +36,7 @@ InstructionSelectorTest::Stream InstructionSelectorTest::StreamBuilder::Build(
   }
   EXPECT_NE(0, graph()->NodeCount());
   int initial_node_count = graph()->NodeCount();
-  CompilationInfo info(test_->isolate(), test_->zone());
-  Linkage linkage(&info, call_descriptor());
+  Linkage linkage(test_->zone(), call_descriptor());
   InstructionSequence sequence(test_->zone(), graph(), schedule);
   SourcePositionTable source_position_table(graph());
   InstructionSelector selector(test_->zone(), &linkage, &sequence, schedule,