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

Unified Diff: src/lithium-allocator.cc

Issue 7348008: Merge up to 8597 to experimental/gc from the bleeding edge. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: '' Created 9 years, 5 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
« no previous file with comments | « src/lithium-allocator.h ('k') | src/lithium-allocator-inl.h » ('j') | 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 8618)
+++ src/lithium-allocator.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright 2010 the V8 project authors. All rights reserved.
+// Copyright 2011 the V8 project authors. All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
@@ -303,6 +303,11 @@
// we need to split use positons in a special way.
bool split_at_start = false;
+ if (current->start().Value() == position.Value()) {
+ // When splitting at start we need to locate the previous use interval.
+ current = first_interval_;
+ }
+
while (current != NULL) {
if (current->Contains(position)) {
current->SplitAt(position);
@@ -352,6 +357,11 @@
}
result->first_pos_ = use_after;
+ // Discard cached iteration state. It might be pointing
+ // to the use that no longer belongs to this live range.
+ last_processed_use_ = NULL;
+ current_interval_ = NULL;
+
// Link the new live range in the chain before any of the other
// ranges linked from the range before the split.
result->parent_ = (parent_ == NULL) ? this : parent_;
@@ -565,10 +575,10 @@
BitVector* live_out = new BitVector(next_virtual_register_);
// Process all successor blocks.
- HBasicBlock* successor = block->end()->FirstSuccessor();
- while (successor != NULL) {
+ for (HSuccessorIterator it(block->end()); !it.Done(); it.Advance()) {
// Add values live on entry to the successor. Note the successor's
// live_in will not be computed yet for backwards edges.
+ HBasicBlock* successor = it.Current();
BitVector* live_in = live_in_sets_[successor->block_id()];
if (live_in != NULL) live_out->Union(*live_in);
@@ -582,11 +592,6 @@
live_out->Add(phi->OperandAt(index)->id());
}
}
-
- // Check if we are done with second successor.
- if (successor == block->end()->SecondSuccessor()) break;
-
- successor = block->end()->SecondSuccessor();
}
return live_out;
@@ -790,8 +795,8 @@
int gap_index) {
// Handle fixed temporaries.
if (first != NULL) {
- for (TempIterator it(first); it.HasNext(); it.Advance()) {
- LUnallocated* temp = LUnallocated::cast(it.Next());
+ for (TempIterator it(first); !it.Done(); it.Advance()) {
+ LUnallocated* temp = LUnallocated::cast(it.Current());
if (temp->HasFixedPolicy()) {
AllocateFixed(temp, gap_index - 1, false);
}
@@ -832,8 +837,8 @@
// Handle fixed input operands of second instruction.
if (second != NULL) {
- for (UseIterator it(second); it.HasNext(); it.Advance()) {
- LUnallocated* cur_input = LUnallocated::cast(it.Next());
+ for (UseIterator it(second); !it.Done(); it.Advance()) {
+ LUnallocated* cur_input = LUnallocated::cast(it.Current());
if (cur_input->HasFixedPolicy()) {
LUnallocated* input_copy = cur_input->CopyUnconstrained();
bool is_tagged = HasTaggedValue(cur_input->VirtualRegister());
@@ -968,8 +973,8 @@
}
}
- for (UseIterator it(instr); it.HasNext(); it.Advance()) {
- LOperand* input = it.Next();
+ for (UseIterator it(instr); !it.Done(); it.Advance()) {
+ LOperand* input = it.Current();
LifetimePosition use_pos;
if (input->IsUnallocated() &&
@@ -983,8 +988,8 @@
if (input->IsUnallocated()) live->Add(input->VirtualRegister());
}
- for (TempIterator it(instr); it.HasNext(); it.Advance()) {
- LOperand* temp = it.Next();
+ for (TempIterator it(instr); !it.Done(); it.Advance()) {
+ LOperand* temp = it.Current();
if (instr->IsMarkedAsCall()) {
if (temp->IsRegister()) continue;
if (temp->IsUnallocated()) {
@@ -1019,7 +1024,7 @@
operand = chunk_->DefineConstantOperand(constant);
} else {
ASSERT(!op->EmitAtUses());
- LUnallocated* unalloc = new LUnallocated(LUnallocated::NONE);
+ LUnallocated* unalloc = new LUnallocated(LUnallocated::ANY);
unalloc->set_virtual_register(op->id());
operand = unalloc;
}
« no previous file with comments | « src/lithium-allocator.h ('k') | src/lithium-allocator-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698