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

Unified Diff: src/arm/virtual-frame-arm.cc

Issue 2368001: Get rid of LoadAndSpill on ARM since Load() knows whether it is... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years, 7 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/arm/codegen-arm.cc ('K') | « src/arm/virtual-frame-arm.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/arm/virtual-frame-arm.cc
===================================================================
--- src/arm/virtual-frame-arm.cc (revision 4747)
+++ src/arm/virtual-frame-arm.cc (working copy)
@@ -40,10 +40,8 @@
#define __ ACCESS_MASM(masm())
void VirtualFrame::PopToR1R0() {
- VirtualFrame where_to_go = *this;
// Shuffle things around so the top of stack is in r0 and r1.
- where_to_go.top_of_stack_state_ = R0_R1_TOS;
- MergeTo(&where_to_go);
+ MergeTOSTo(R0_R1_TOS);
// Pop the two registers off the stack so they are detached from the frame.
element_count_ -= 2;
top_of_stack_state_ = NO_TOS_REGISTERS;
@@ -51,10 +49,8 @@
void VirtualFrame::PopToR1() {
- VirtualFrame where_to_go = *this;
// Shuffle things around so the top of stack is only in r1.
- where_to_go.top_of_stack_state_ = R1_TOS;
- MergeTo(&where_to_go);
+ MergeTOSTo(R1_TOS);
// Pop the register off the stack so it is detached from the frame.
element_count_ -= 1;
top_of_stack_state_ = NO_TOS_REGISTERS;
@@ -62,10 +58,8 @@
void VirtualFrame::PopToR0() {
- VirtualFrame where_to_go = *this;
// Shuffle things around so the top of stack only in r0.
- where_to_go.top_of_stack_state_ = R0_TOS;
- MergeTo(&where_to_go);
+ MergeTOSTo(R0_TOS);
// Pop the register off the stack so it is detached from the frame.
element_count_ -= 1;
top_of_stack_state_ = NO_TOS_REGISTERS;
@@ -273,7 +267,8 @@
void VirtualFrame::CallJSFunction(int arg_count) {
// InvokeFunction requires function in r1.
- EmitPop(r1);
+ PopToR1();
+ SpillAll();
// +1 for receiver.
Forget(arg_count + 1);
@@ -631,7 +626,17 @@
void VirtualFrame::EmitPush(Register reg) {
element_count_++;
+ if (reg.is(cp)) {
+ // If we are pushing cp then we are about to make a call and things have to
+ // be pushed to the physical stack. There's nothing to be gained my moving
+ // to a TOS register and then pushing that, we might as well push to the
+ // physical stack immediately.
+ MergeTOSTo(NO_TOS_REGISTERS);
+ __ push(reg);
+ return;
+ }
if (SpilledScope::is_spilled()) {
+ ASSERT(top_of_stack_state_ == NO_TOS_REGISTERS);
__ push(reg);
return;
}
« src/arm/codegen-arm.cc ('K') | « src/arm/virtual-frame-arm.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698