diff options
Diffstat (limited to 'compiler/optimizing')
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 17 | ||||
-rw-r--r-- | compiler/optimizing/scheduler.cc | 16 |
2 files changed, 17 insertions, 16 deletions
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index 76a243f793..51101f104a 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -1210,14 +1210,14 @@ bool OptimizingCompiler::JitCompile(Thread* self, uint8_t* stack_map_data = nullptr; uint8_t* method_info_data = nullptr; uint8_t* roots_data = nullptr; - code_cache->ReserveData(self, - stack_map_size, - method_info_size, - number_of_roots, - method, - &stack_map_data, - &method_info_data, - &roots_data); + uint32_t data_size = code_cache->ReserveData(self, + stack_map_size, + method_info_size, + number_of_roots, + method, + &stack_map_data, + &method_info_data, + &roots_data); if (stack_map_data == nullptr || roots_data == nullptr) { return false; } @@ -1238,6 +1238,7 @@ bool OptimizingCompiler::JitCompile(Thread* self, codegen->GetFpuSpillMask(), code_allocator.GetMemory().data(), code_allocator.GetSize(), + data_size, osr, roots, codegen->GetGraph()->HasShouldDeoptimizeFlag(), diff --git a/compiler/optimizing/scheduler.cc b/compiler/optimizing/scheduler.cc index 5ad011d8f9..3e373d16fb 100644 --- a/compiler/optimizing/scheduler.cc +++ b/compiler/optimizing/scheduler.cc @@ -554,6 +554,14 @@ SchedulingNode* CriticalPathSchedulingNodeSelector::GetHigherPrioritySchedulingN } void HScheduler::Schedule(HGraph* graph) { + // We run lsa here instead of in a separate pass to better control whether we + // should run the analysis or not. + LoadStoreAnalysis lsa(graph); + if (!only_optimize_loop_blocks_ || graph->HasLoops()) { + lsa.Run(); + scheduling_graph_.SetHeapLocationCollector(lsa.GetHeapLocationCollector()); + } + for (HBasicBlock* block : graph->GetReversePostOrder()) { if (IsSchedulable(block)) { Schedule(block); @@ -566,14 +574,6 @@ void HScheduler::Schedule(HBasicBlock* block) { // Build the scheduling graph. scheduling_graph_.Clear(); - - // Only perform LSA/HeapLocation analysis on the basic block that - // is going to get instruction scheduled. - HeapLocationCollector heap_location_collector(block->GetGraph()); - heap_location_collector.VisitBasicBlock(block); - heap_location_collector.BuildAliasingMatrix(); - scheduling_graph_.SetHeapLocationCollector(heap_location_collector); - for (HBackwardInstructionIterator it(block->GetInstructions()); !it.Done(); it.Advance()) { HInstruction* instruction = it.Current(); CHECK_EQ(instruction->GetBlock(), block) |