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

Unified Diff: runtime/vm/flow_graph_compiler_x64.cc

Issue 9616005: Turn CopyTemp and SetTemp into instructions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 9 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 | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3f2a1529539004e989e06460ab57e415294fc37e..cd0580c12eddcfc2914cb5a654553215baa11e69 100644
--- a/runtime/vm/flow_graph_compiler_x64.cc
+++ b/runtime/vm/flow_graph_compiler_x64.cc
@@ -69,21 +69,6 @@ void FlowGraphCompiler::VisitConstant(ConstantVal* val) {
}
-void FlowGraphCompiler::VisitCopyTemp(CopyTempComp* comp) {
- // Index is a stack index. Semantics is to produce a duplicate of the
- // temp at index.
- __ movq(RAX, Address(RSP, comp->index() * (-kWordSize)));
-}
-
-
-void FlowGraphCompiler::VisitSetTemp(SetTempComp* comp) {
- // Index is a stack index. Semantics is to store a (copy of) the TOS in
- // the temp at index.
- __ movq(RAX, Address(RSP, 0));
- __ movq(Address(RSP, comp->index() * (-kWordSize)), RAX);
-}
-
-
void FlowGraphCompiler::VisitAssertAssignable(AssertAssignableComp* comp) {
Bailout("AssertAssignableComp");
}
@@ -285,6 +270,28 @@ void FlowGraphCompiler::VisitTargetEntry(TargetEntryInstr* instr) {
}
+void FlowGraphCompiler::VisitPickTemp(PickTempInstr* instr) {
+ // Semantics is to copy a stack-allocated temporary to the top of stack.
+ // 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;
+ ASSERT(offset >= 0);
+ __ pushq(Address(RSP, offset * kWordSize));
+}
+
+
+void FlowGraphCompiler::VisitTuckTemp(TuckTempInstr* instr) {
+ // Semantics is to assign to a stack-allocated temporary a copy of the top
+ // of stack. Source index s is assumed the top of stack, s-d is the
+ // offset to destination index d.
+ intptr_t offset = instr->source() - instr->destination();
+ ASSERT(offset >= 0);
+ __ movq(RAX, Address(RSP, 0));
+ __ movq(Address(RSP, offset * kWordSize), RAX);
+}
+
+
void FlowGraphCompiler::VisitDo(DoInstr* instr) {
instr->computation()->Accept(this);
}
« no previous file with comments | « runtime/vm/flow_graph_builder.cc ('k') | runtime/vm/intermediate_language.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698