diff options
author | 2014-05-22 12:50:17 +0100 | |
---|---|---|
committer | 2014-05-26 11:31:38 +0100 | |
commit | a7062e05e6048c7f817d784a5b94e3122e25b1ec (patch) | |
tree | a5d6b64ae6d5352f761fc2547bda863281adbe40 /compiler/utils/growable_array.h | |
parent | 8b5b1e5593ffa77c393e4172b71a3d5a821d2ed8 (diff) |
Add a linear scan register allocator to the optimizing compiler.
This is a "by-the-book" implementation. It currently only deals
with allocating registers, with no hint optimizations.
The changes remaining to make it functional are:
- Allocate spill slots.
- Resolution and placements of Move instructions.
- Connect it to the code generator.
Change-Id: Ie0b2f6ba1b98da85425be721ce4afecd6b4012a4
Diffstat (limited to 'compiler/utils/growable_array.h')
-rw-r--r-- | compiler/utils/growable_array.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/utils/growable_array.h b/compiler/utils/growable_array.h index e703d8e25a..a1a3312576 100644 --- a/compiler/utils/growable_array.h +++ b/compiler/utils/growable_array.h @@ -169,6 +169,13 @@ class GrowableArray { num_used_--; }; + void DeleteAt(size_t index) { + for (size_t i = index; i < num_used_ - 1; i++) { + elem_list_[i] = elem_list_[i + 1]; + } + num_used_--; + }; + size_t GetNumAllocated() const { return num_allocated_; } size_t Size() const { return num_used_; } |