diff options
author | 2014-09-25 13:37:06 +0000 | |
---|---|---|
committer | 2014-09-25 13:37:06 +0000 | |
commit | a72cb229d555a8ca86dca748733ea3791eaeec14 (patch) | |
tree | b051a0f2d10c126a83d22ff45f2feecf0365aca3 /compiler/optimizing/code_generator.cc | |
parent | d7e2f329ddacd2294ba94cd5acde026677d32e0d (diff) | |
parent | 3c04974a90b0e03f4b509010bff49f0b2a3da57f (diff) |
Merge "Optimize suspend checks in optimizing compiler."
Diffstat (limited to 'compiler/optimizing/code_generator.cc')
-rw-r--r-- | compiler/optimizing/code_generator.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/compiler/optimizing/code_generator.cc b/compiler/optimizing/code_generator.cc index 3231c99a7b..2a9a7b37ab 100644 --- a/compiler/optimizing/code_generator.cc +++ b/compiler/optimizing/code_generator.cc @@ -25,6 +25,7 @@ #include "gc_map_builder.h" #include "leb128.h" #include "mapping_table.h" +#include "ssa_liveness_analysis.h" #include "utils/assembler.h" #include "verifier/dex_gc_map.h" #include "vmap_table.h" @@ -518,4 +519,23 @@ void CodeGenerator::RestoreLiveRegisters(LocationSummary* locations) { } } +void CodeGenerator::ClearSpillSlotsFromLoopPhisInStackMap(HSuspendCheck* suspend_check) const { + LocationSummary* locations = suspend_check->GetLocations(); + HBasicBlock* block = suspend_check->GetBlock(); + DCHECK(block->GetLoopInformation()->GetSuspendCheck() == suspend_check); + DCHECK(block->IsLoopHeader()); + + for (HInstructionIterator it(block->GetPhis()); !it.Done(); it.Advance()) { + HInstruction* current = it.Current(); + LiveInterval* interval = current->GetLiveInterval(); + // We only need to clear bits of loop phis containing objects and allocated in register. + // Loop phis allocated on stack already have the object in the stack. + if (current->GetType() == Primitive::kPrimNot + && interval->HasRegister() + && interval->HasSpillSlot()) { + locations->ClearStackBit(interval->GetSpillSlot() / kVRegSize); + } + } +} + } // namespace art |