Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: src/lithium-allocator.cc

Issue 6660023: Initialize zone lists in the register allocator with more reasonable initial ... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/lithium-allocator.h ('K') | « src/lithium-allocator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lithium-allocator.cc
===================================================================
--- src/lithium-allocator.cc (revision 7109)
+++ src/lithium-allocator.cc (working copy)
@@ -525,6 +525,24 @@
}
+LAllocator::LAllocator(int num_values, HGraph* graph)
+ : chunk_(NULL),
+ live_in_sets_(graph->blocks()->length()),
+ live_ranges_(num_values * 2),
+ fixed_live_ranges_(NULL),
+ fixed_double_live_ranges_(NULL),
+ unhandled_live_ranges_(num_values * 2),
+ active_live_ranges_(8),
+ inactive_live_ranges_(8),
+ reusable_slots_(8),
+ next_virtual_register_(num_values),
+ first_artificial_register_(num_values),
+ mode_(NONE),
+ num_registers_(-1),
+ graph_(graph),
+ has_osr_entry_(false) {}
+
+
void LAllocator::InitializeLivenessAnalysis() {
// Initialize the live_in sets for each block to NULL.
int block_count = graph_->blocks()->length();
@@ -618,11 +636,7 @@
LiveRange* LAllocator::FixedLiveRangeFor(int index) {
- if (index >= fixed_live_ranges_.length()) {
- fixed_live_ranges_.AddBlock(NULL,
- index - fixed_live_ranges_.length() + 1);
- }
-
+ ASSERT(index < Register::kNumAllocatableRegisters);
LiveRange* result = fixed_live_ranges_[index];
if (result == NULL) {
result = new LiveRange(FixedLiveRangeID(index));
@@ -635,11 +649,7 @@
LiveRange* LAllocator::FixedDoubleLiveRangeFor(int index) {
- if (index >= fixed_double_live_ranges_.length()) {
- fixed_double_live_ranges_.AddBlock(NULL,
- index - fixed_double_live_ranges_.length() + 1);
- }
-
+ ASSERT(index < DoubleRegister::kNumAllocatableRegisters);
LiveRange* result = fixed_double_live_ranges_[index];
if (result == NULL) {
result = new LiveRange(FixedDoubleLiveRangeID(index));
@@ -650,6 +660,7 @@
return result;
}
+
LiveRange* LAllocator::LiveRangeFor(int index) {
if (index >= live_ranges_.length()) {
live_ranges_.AddBlock(NULL, index - live_ranges_.length() + 1);
« src/lithium-allocator.h ('K') | « src/lithium-allocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698