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

Unified Diff: runtime/vm/flow_graph_compiler_x64.cc

Issue 10201017: Introduce Definition and Use types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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
Index: runtime/vm/flow_graph_compiler_x64.cc
diff --git a/runtime/vm/flow_graph_compiler_x64.cc b/runtime/vm/flow_graph_compiler_x64.cc
index d2be1673bcb61dbe446ba136372ec25bbaeae7f1..1a1cfe68d8a6547d8e8d30ef984f7412ab513475 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -377,7 +377,7 @@ void FlowGraphCompiler::LoadValue(Register dst, Value* value) {
__ LoadObject(dst, value->AsConstant()->value());
}
} else {
- ASSERT(value->IsTemp());
+ ASSERT(value->IsTemp() || value->IsUse());
__ popq(dst);
}
}
@@ -388,6 +388,11 @@ void FlowGraphCompiler::VisitTemp(TempVal* val) {
}
+void FlowGraphCompiler::VisitUse(UseVal* val) {
+ LoadValue(RAX, val);
+}
+
+
void FlowGraphCompiler::VisitConstant(ConstantVal* val) {
LoadValue(RAX, val);
}
@@ -441,11 +446,14 @@ template <typename T> static bool VerifyCallComputation(T* comp) {
intptr_t previous = -1;
for (int i = 0; i < comp->ArgumentCount(); ++i) {
TempVal* temp = comp->ArgumentAt(i)->AsTemp();
- if (temp == NULL) return false;
+ UseVal* use = comp->ArgumentAt(i)->AsUse();
+ if (temp == NULL && use == NULL) return false;
srdjan 2012/04/24 22:02:18 Use parenthesis
Kevin Millikin (Google) 2012/04/25 08:50:51 Done. Thanks for the reminder.
+ intptr_t current =
+ (temp != NULL) ? temp->index() : use->definition()->temp_index();
if (i != 0) {
- if (temp->index() != previous + 1) return false;
+ if (current != previous + 1) return false;
srdjan 2012/04/24 22:02:18 ditto
Kevin Millikin (Google) 2012/04/25 08:50:51 Done.
}
- previous = temp->index();
+ previous = current;
}
return true;
}
@@ -1187,7 +1195,7 @@ void FlowGraphCompiler::VisitPickTemp(PickTempInstr* instr) {
// Destination index d is assumed the new top of stack after the
// operation, so d-1 is the current top of stack and so d-s-1 is the
// offset to source index s.
- intptr_t offset = instr->destination() - instr->source() - 1;
+ intptr_t offset = instr->temp_index() - instr->source() - 1;
ASSERT(offset >= 0);
__ pushq(Address(RSP, offset * kWordSize));
}

Powered by Google App Engine
This is Rietveld 408576698