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

Unified Diff: runtime/vm/flow_graph_compiler_x64.cc

Issue 11791051: Support immediate and memory operands for PushArgumentInstr in optimized code. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: really handle constant operands Created 7 years, 11 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_compiler_ia32.cc ('k') | runtime/vm/intermediate_language.cc » ('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
===================================================================
--- runtime/vm/flow_graph_compiler_x64.cc (revision 16802)
+++ runtime/vm/flow_graph_compiler_x64.cc (working copy)
@@ -1340,19 +1340,6 @@
#define __ compiler_->assembler()->
-static Address ToStackSlotAddress(Location loc) {
- const intptr_t index = loc.stack_index();
- if (index < 0) {
- const intptr_t offset = (1 - index) * kWordSize;
- return Address(RBP, offset);
- } else {
- const intptr_t offset =
- (ParsedFunction::kFirstLocalSlotIndex - index) * kWordSize;
- return Address(RBP, offset);
- }
-}
-
-
void ParallelMoveResolver::EmitMove(int index) {
MoveOperands* move = moves_[index];
const Location source = move->src();
@@ -1363,15 +1350,15 @@
__ movq(destination.reg(), source.reg());
} else {
ASSERT(destination.IsStackSlot());
- __ movq(ToStackSlotAddress(destination), source.reg());
+ __ movq(destination.ToStackSlotAddress(), source.reg());
}
} else if (source.IsStackSlot()) {
if (destination.IsRegister()) {
- __ movq(destination.reg(), ToStackSlotAddress(source));
+ __ movq(destination.reg(), source.ToStackSlotAddress());
} else {
ASSERT(destination.IsStackSlot());
- MoveMemoryToMemory(ToStackSlotAddress(destination),
- ToStackSlotAddress(source));
+ MoveMemoryToMemory(destination.ToStackSlotAddress(),
+ source.ToStackSlotAddress());
}
} else if (source.IsXmmRegister()) {
if (destination.IsXmmRegister()) {
@@ -1380,15 +1367,15 @@
__ movaps(destination.xmm_reg(), source.xmm_reg());
} else {
ASSERT(destination.IsDoubleStackSlot());
- __ movsd(ToStackSlotAddress(destination), source.xmm_reg());
+ __ movsd(destination.ToStackSlotAddress(), source.xmm_reg());
}
} else if (source.IsDoubleStackSlot()) {
if (destination.IsXmmRegister()) {
- __ movsd(destination.xmm_reg(), ToStackSlotAddress(source));
+ __ movsd(destination.xmm_reg(), source.ToStackSlotAddress());
} else {
ASSERT(destination.IsDoubleStackSlot());
- __ movsd(XMM0, ToStackSlotAddress(source));
- __ movsd(ToStackSlotAddress(destination), XMM0);
+ __ movsd(XMM0, source.ToStackSlotAddress());
+ __ movsd(destination.ToStackSlotAddress(), XMM0);
}
} else {
ASSERT(source.IsConstant());
@@ -1401,7 +1388,7 @@
}
} else {
ASSERT(destination.IsStackSlot());
- StoreObject(ToStackSlotAddress(destination), source.constant());
+ StoreObject(destination.ToStackSlotAddress(), source.constant());
}
}
@@ -1417,11 +1404,11 @@
if (source.IsRegister() && destination.IsRegister()) {
__ xchgq(destination.reg(), source.reg());
} else if (source.IsRegister() && destination.IsStackSlot()) {
- Exchange(source.reg(), ToStackSlotAddress(destination));
+ Exchange(source.reg(), destination.ToStackSlotAddress());
} else if (source.IsStackSlot() && destination.IsRegister()) {
- Exchange(destination.reg(), ToStackSlotAddress(source));
+ Exchange(destination.reg(), source.ToStackSlotAddress());
} else if (source.IsStackSlot() && destination.IsStackSlot()) {
- Exchange(ToStackSlotAddress(destination), ToStackSlotAddress(source));
+ Exchange(destination.ToStackSlotAddress(), source.ToStackSlotAddress());
} else if (source.IsXmmRegister() && destination.IsXmmRegister()) {
__ movaps(XMM0, source.xmm_reg());
__ movaps(source.xmm_reg(), destination.xmm_reg());
@@ -1430,8 +1417,9 @@
ASSERT(destination.IsDoubleStackSlot() || source.IsDoubleStackSlot());
XmmRegister reg = source.IsXmmRegister() ? source.xmm_reg()
: destination.xmm_reg();
- Address slot_address =
- ToStackSlotAddress(source.IsXmmRegister() ? destination : source);
+ Address slot_address = source.IsXmmRegister()
+ ? destination.ToStackSlotAddress()
+ : source.ToStackSlotAddress();
__ movsd(XMM0, slot_address);
__ movsd(slot_address, reg);
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698