Index: src/lithium-allocator.cc |
diff --git a/src/lithium-allocator.cc b/src/lithium-allocator.cc |
index ac61c17ba7685615fe49dd3f66928e291b9f69a8..bc5d6cc5f25af5892d5f0e43e555d8331ff994b5 100644 |
--- a/src/lithium-allocator.cc |
+++ b/src/lithium-allocator.cc |
@@ -27,7 +27,6 @@ |
#include "lithium-allocator.h" |
-#include "data-flow.h" |
#include "hydrogen.h" |
#include "string-stream.h" |
@@ -763,6 +762,7 @@ void LAllocator::AddConstraintsGapMove(int index, |
void LAllocator::MeetRegisterConstraints(HBasicBlock* block) { |
+ first_artificial_register_ = next_virtual_register_; |
int start = block->first_instruction_index(); |
int end = block->last_instruction_index(); |
for (int i = start; i <= end; ++i) { |
@@ -834,6 +834,13 @@ void LAllocator::MeetConstraintsBetween(InstructionSummary* first, |
} else if (cur_input->policy() == LUnallocated::WRITABLE_REGISTER) { |
LUnallocated* input_copy = cur_input->CopyUnconstrained(); |
cur_input->set_virtual_register(next_virtual_register_++); |
+ |
+ if (RequiredRegisterKind(input_copy->virtual_register()) == |
+ DOUBLE_REGISTERS) { |
+ double_artificial_registers_.Add( |
+ cur_input->virtual_register() - first_artificial_register_); |
+ } |
+ |
second->AddTemp(cur_input); |
AddConstraintsGapMove(gap_index, input_copy, cur_input); |
} |
@@ -1564,10 +1571,16 @@ bool LAllocator::HasTaggedValue(int virtual_register) const { |
RegisterKind LAllocator::RequiredRegisterKind(int virtual_register) const { |
- HValue* value = graph()->LookupValue(virtual_register); |
- if (value != NULL && value->representation().IsDouble()) { |
+ if (virtual_register < first_artificial_register_) { |
+ HValue* value = graph()->LookupValue(virtual_register); |
+ if (value != NULL && value->representation().IsDouble()) { |
+ return DOUBLE_REGISTERS; |
+ } |
+ } else if (double_artificial_registers_.Contains( |
+ virtual_register - first_artificial_register_)) { |
return DOUBLE_REGISTERS; |
} |
+ |
return GENERAL_REGISTERS; |
} |