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

Unified Diff: src/lithium-allocator.cc

Issue 6577036: [Isolates] Merge from bleeding_edge to isolates, revisions 6100-6300. (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/isolates/
Patch Set: '' Created 9 years, 10 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/liveedit.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 6941)
+++ src/lithium-allocator.cc (working copy)
@@ -27,7 +27,6 @@
#include "lithium-allocator.h"
-#include "data-flow.h"
#include "hydrogen.h"
#include "string-stream.h"
@@ -107,9 +106,6 @@
case LUnallocated::SAME_AS_FIRST_INPUT:
stream->Add("(1)");
break;
- case LUnallocated::SAME_AS_ANY_INPUT:
- stream->Add("(A)");
- break;
case LUnallocated::ANY:
stream->Add("(-)");
break;
@@ -834,6 +830,13 @@
} 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);
}
@@ -937,6 +940,9 @@
curr_position.InstructionEnd());
}
}
+ }
+
+ if (summary->IsCall() || summary->IsSaveDoubles()) {
for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; ++i) {
if (output == NULL || !output->IsDoubleRegister() ||
output->index() != i) {
@@ -1036,6 +1042,7 @@
void LAllocator::MeetRegisterConstraints() {
HPhase phase("Register constraints", chunk());
+ first_artificial_register_ = next_virtual_register_;
const ZoneList<HBasicBlock*>* blocks = graph()->blocks();
for (int i = 0; i < blocks->length(); ++i) {
HBasicBlock* block = blocks->at(i);
@@ -1564,19 +1571,50 @@
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;
}
void LAllocator::MarkAsCall() {
- current_summary()->MarkAsCall();
+ // Call instructions can use only fixed registers as
+ // temporaries and outputs because all registers
+ // are blocked by the calling convention.
+ // Inputs can use either fixed register or have a short lifetime (be
+ // used at start of the instruction).
+ InstructionSummary* summary = current_summary();
+#ifdef DEBUG
+ ASSERT(summary->Output() == NULL ||
+ LUnallocated::cast(summary->Output())->HasFixedPolicy() ||
+ !LUnallocated::cast(summary->Output())->HasRegisterPolicy());
+ for (int i = 0; i < summary->InputCount(); i++) {
+ ASSERT(LUnallocated::cast(summary->InputAt(i))->HasFixedPolicy() ||
+ LUnallocated::cast(summary->InputAt(i))->IsUsedAtStart() ||
+ !LUnallocated::cast(summary->InputAt(i))->HasRegisterPolicy());
+ }
+ for (int i = 0; i < summary->TempCount(); i++) {
+ ASSERT(LUnallocated::cast(summary->TempAt(i))->HasFixedPolicy() ||
+ !LUnallocated::cast(summary->TempAt(i))->HasRegisterPolicy());
+ }
+#endif
+ summary->MarkAsCall();
}
+void LAllocator::MarkAsSaveDoubles() {
+ current_summary()->MarkAsSaveDoubles();
+}
+
+
void LAllocator::RecordDefinition(HInstruction* instr, LUnallocated* operand) {
operand->set_virtual_register(instr->id());
current_summary()->SetOutput(operand);
« no previous file with comments | « src/lithium-allocator.h ('k') | src/liveedit.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698