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

Unified Diff: src/lithium-allocator.cc

Issue 6065010: Remember required register kind when creating artificial virtual register. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 12 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
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;
}
« 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