summaryrefslogtreecommitdiff
path: root/compiler/optimizing/register_allocator.h
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-02-23 14:14:57 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2015-02-23 14:56:07 +0000
commit776b3184ee04092b11edc781cdb81e8ed60601e3 (patch)
tree98458c7087866b988468f5d356550ff14f2ee3af /compiler/optimizing/register_allocator.h
parent1382e569b31f4fab61fcfca5aa93275a2a3cb757 (diff)
Each primitive kind now spills to different locations.
Having different slots depending on the types greatly simplifies the parallel move resolver. It also avoids doing FPU <-> Core register swaps, and force backends to implement such a swap. Change-Id: Ide9f0452e7ccf9efb8adddbcc246d44b937b253c
Diffstat (limited to 'compiler/optimizing/register_allocator.h')
-rw-r--r--compiler/optimizing/register_allocator.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/compiler/optimizing/register_allocator.h b/compiler/optimizing/register_allocator.h
index b8f70bdc18..ff2f106b74 100644
--- a/compiler/optimizing/register_allocator.h
+++ b/compiler/optimizing/register_allocator.h
@@ -75,7 +75,10 @@ class RegisterAllocator {
}
size_t GetNumberOfSpillSlots() const {
- return spill_slots_.Size();
+ return int_spill_slots_.Size()
+ + long_spill_slots_.Size()
+ + float_spill_slots_.Size()
+ + double_spill_slots_.Size();
}
private:
@@ -171,8 +174,14 @@ class RegisterAllocator {
// where an instruction requires a temporary.
GrowableArray<LiveInterval*> temp_intervals_;
- // The spill slots allocated for live intervals.
- GrowableArray<size_t> spill_slots_;
+ // The spill slots allocated for live intervals. We ensure spill slots
+ // are typed to avoid (1) doing moves and swaps between two different kinds
+ // of registers, and (2) swapping between a single stack slot and a double
+ // stack slot. This simplifies the parallel move resolver.
+ GrowableArray<size_t> int_spill_slots_;
+ GrowableArray<size_t> long_spill_slots_;
+ GrowableArray<size_t> float_spill_slots_;
+ GrowableArray<size_t> double_spill_slots_;
// Instructions that need a safepoint.
GrowableArray<HInstruction*> safepoints_;