Chromium Code Reviews| Index: src/compiler/pipeline.cc |
| diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc |
| index 3fe6582cb1ac3a4df150122c1a7cc516ce38e761..3e7d3bcccc80af266a22733ccebebab2dda82c2c 100644 |
| --- a/src/compiler/pipeline.cc |
| +++ b/src/compiler/pipeline.cc |
| @@ -276,11 +276,8 @@ class PipelineData { |
| info()->isolate(), instruction_zone(), instruction_blocks); |
| } |
| - void InitializeRegisterAllocationData(const RegisterConfiguration* config, |
| - CallDescriptor* descriptor, |
| - const char* debug_name) { |
| + void InitializeFrameData(CallDescriptor* descriptor) { |
| DCHECK(frame_ == nullptr); |
| - DCHECK(register_allocation_data_ == nullptr); |
| int fixed_frame_size = 0; |
| if (descriptor != nullptr) { |
| fixed_frame_size = (descriptor->IsCFunctionCall()) |
| @@ -289,6 +286,12 @@ class PipelineData { |
| : StandardFrameConstants::kFixedSlotCount; |
| } |
| frame_ = new (instruction_zone()) Frame(fixed_frame_size, descriptor); |
| + } |
| + |
| + void InitializeRegisterAllocationData(const RegisterConfiguration* config, |
| + CallDescriptor* descriptor, |
| + const char* debug_name) { |
| + DCHECK(register_allocation_data_ == nullptr); |
| register_allocation_data_ = new (register_allocation_zone()) |
| RegisterAllocationData(config, register_allocation_zone(), frame(), |
| sequence(), debug_name); |
| @@ -816,7 +819,7 @@ struct InstructionSelectionPhase { |
| void Run(PipelineData* data, Zone* temp_zone, Linkage* linkage) { |
| InstructionSelector selector( |
| temp_zone, data->graph()->NodeCount(), linkage, data->sequence(), |
| - data->schedule(), data->source_positions(), |
| + data->schedule(), data->source_positions(), data->frame(), |
| data->info()->is_source_positions_enabled() |
| ? InstructionSelector::kAllSourcePositions |
| : InstructionSelector::kCallSourcePositions); |
| @@ -1281,6 +1284,7 @@ bool Pipeline::AllocateRegistersForTesting(const RegisterConfiguration* config, |
| PipelineData data(&zone_pool, &info, sequence); |
| Pipeline pipeline(&info); |
| pipeline.data_ = &data; |
| + pipeline.InitializeFrame(nullptr); |
| pipeline.AllocateRegisters(config, nullptr, run_verifier); |
| return !data.compilation_failed(); |
| } |
| @@ -1303,6 +1307,7 @@ Handle<Code> Pipeline::ScheduleAndGenerateCode( |
| data->InitializeInstructionSequence(); |
| + InitializeFrame(call_descriptor); |
| // Select and schedule instructions covering the scheduled graph. |
| Linkage linkage(call_descriptor); |
| Run<InstructionSelectionPhase>(&linkage); |
| @@ -1324,6 +1329,7 @@ Handle<Code> Pipeline::ScheduleAndGenerateCode( |
| BeginPhaseKind("register allocation"); |
| bool run_verifier = FLAG_turbo_verify_allocation; |
| + |
| // Allocate registers. |
| AllocateRegisters( |
| RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN), |
| @@ -1384,6 +1390,10 @@ Handle<Code> Pipeline::ScheduleAndGenerateCode( |
| return code; |
| } |
| +void Pipeline::InitializeFrame(CallDescriptor* descriptor) { |
|
titzer
2016/01/28 09:02:18
You can just inline this method into the callers.
ahaas
2016/01/28 14:55:44
Done.
|
| + PipelineData* data = this->data_; |
| + data->InitializeFrameData(descriptor); |
| +} |
| void Pipeline::AllocateRegisters(const RegisterConfiguration* config, |
| CallDescriptor* descriptor, |