Commit 8a2637fb authored by erik.corry@gmail.com's avatar erik.corry@gmail.com

Get rid of LoadAndSpill on ARM since Load() knows whether it is

in a spilled scope or not.  Also get rid of some spilled scopes
that we don't need any more.  The generators for the %_ functions,
CodeGenerator::Generate*, are now not spilled by default.  Some
of them (IsObject and related) have been converted to register
allocated operation.
Review URL: http://codereview.chromium.org/2368001

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@4749 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 1be589d8
This diff is collapsed.
...@@ -304,11 +304,6 @@ class CodeGenerator: public AstVisitor { ...@@ -304,11 +304,6 @@ class CodeGenerator: public AstVisitor {
void LoadGlobal(); void LoadGlobal();
void LoadGlobalReceiver(Register scratch); void LoadGlobalReceiver(Register scratch);
// Generate code to push the value of an expression on top of the frame
// and then spill the frame fully to memory. This function is used
// temporarily while the code generator is being transformed.
inline void LoadAndSpill(Expression* expression);
// Call LoadCondition and then spill the virtual frame unless control flow // Call LoadCondition and then spill the virtual frame unless control flow
// cannot reach the end of the expression (ie, by emitting only // cannot reach the end of the expression (ie, by emitting only
// unconditional jumps to the control targets). // unconditional jumps to the control targets).
......
...@@ -119,7 +119,7 @@ class MacroAssembler: public Assembler { ...@@ -119,7 +119,7 @@ class MacroAssembler: public Assembler {
// For the page containing |object| mark the region covering [object+offset] // For the page containing |object| mark the region covering [object+offset]
// dirty. The object address must be in the first 8K of an allocated page. // dirty. The object address must be in the first 8K of an allocated page.
void RecordWriteHelper(Register object, Register offset, Register scracth); void RecordWriteHelper(Register object, Register offset, Register scratch);
// For the page containing |object| mark the region covering [object+offset] // For the page containing |object| mark the region covering [object+offset]
// dirty. The object address must be in the first 8K of an allocated page. // dirty. The object address must be in the first 8K of an allocated page.
......
...@@ -40,10 +40,8 @@ namespace internal { ...@@ -40,10 +40,8 @@ namespace internal {
#define __ ACCESS_MASM(masm()) #define __ ACCESS_MASM(masm())
void VirtualFrame::PopToR1R0() { void VirtualFrame::PopToR1R0() {
VirtualFrame where_to_go = *this;
// Shuffle things around so the top of stack is in r0 and r1. // Shuffle things around so the top of stack is in r0 and r1.
where_to_go.top_of_stack_state_ = R0_R1_TOS; MergeTOSTo(R0_R1_TOS);
MergeTo(&where_to_go);
// Pop the two registers off the stack so they are detached from the frame. // Pop the two registers off the stack so they are detached from the frame.
element_count_ -= 2; element_count_ -= 2;
top_of_stack_state_ = NO_TOS_REGISTERS; top_of_stack_state_ = NO_TOS_REGISTERS;
...@@ -51,10 +49,8 @@ void VirtualFrame::PopToR1R0() { ...@@ -51,10 +49,8 @@ void VirtualFrame::PopToR1R0() {
void VirtualFrame::PopToR1() { void VirtualFrame::PopToR1() {
VirtualFrame where_to_go = *this;
// Shuffle things around so the top of stack is only in r1. // Shuffle things around so the top of stack is only in r1.
where_to_go.top_of_stack_state_ = R1_TOS; MergeTOSTo(R1_TOS);
MergeTo(&where_to_go);
// Pop the register off the stack so it is detached from the frame. // Pop the register off the stack so it is detached from the frame.
element_count_ -= 1; element_count_ -= 1;
top_of_stack_state_ = NO_TOS_REGISTERS; top_of_stack_state_ = NO_TOS_REGISTERS;
...@@ -62,10 +58,8 @@ void VirtualFrame::PopToR1() { ...@@ -62,10 +58,8 @@ void VirtualFrame::PopToR1() {
void VirtualFrame::PopToR0() { void VirtualFrame::PopToR0() {
VirtualFrame where_to_go = *this;
// Shuffle things around so the top of stack only in r0. // Shuffle things around so the top of stack only in r0.
where_to_go.top_of_stack_state_ = R0_TOS; MergeTOSTo(R0_TOS);
MergeTo(&where_to_go);
// Pop the register off the stack so it is detached from the frame. // Pop the register off the stack so it is detached from the frame.
element_count_ -= 1; element_count_ -= 1;
top_of_stack_state_ = NO_TOS_REGISTERS; top_of_stack_state_ = NO_TOS_REGISTERS;
...@@ -273,7 +267,8 @@ void VirtualFrame::PushTryHandler(HandlerType type) { ...@@ -273,7 +267,8 @@ void VirtualFrame::PushTryHandler(HandlerType type) {
void VirtualFrame::CallJSFunction(int arg_count) { void VirtualFrame::CallJSFunction(int arg_count) {
// InvokeFunction requires function in r1. // InvokeFunction requires function in r1.
EmitPop(r1); PopToR1();
SpillAll();
// +1 for receiver. // +1 for receiver.
Forget(arg_count + 1); Forget(arg_count + 1);
...@@ -286,7 +281,7 @@ void VirtualFrame::CallJSFunction(int arg_count) { ...@@ -286,7 +281,7 @@ void VirtualFrame::CallJSFunction(int arg_count) {
void VirtualFrame::CallRuntime(Runtime::Function* f, int arg_count) { void VirtualFrame::CallRuntime(Runtime::Function* f, int arg_count) {
ASSERT(SpilledScope::is_spilled()); SpillAll();
Forget(arg_count); Forget(arg_count);
ASSERT(cgen()->HasValidEntryRegisters()); ASSERT(cgen()->HasValidEntryRegisters());
__ CallRuntime(f, arg_count); __ CallRuntime(f, arg_count);
...@@ -294,6 +289,7 @@ void VirtualFrame::CallRuntime(Runtime::Function* f, int arg_count) { ...@@ -294,6 +289,7 @@ void VirtualFrame::CallRuntime(Runtime::Function* f, int arg_count) {
void VirtualFrame::CallRuntime(Runtime::FunctionId id, int arg_count) { void VirtualFrame::CallRuntime(Runtime::FunctionId id, int arg_count) {
SpillAll();
Forget(arg_count); Forget(arg_count);
ASSERT(cgen()->HasValidEntryRegisters()); ASSERT(cgen()->HasValidEntryRegisters());
__ CallRuntime(id, arg_count); __ CallRuntime(id, arg_count);
...@@ -631,7 +627,17 @@ void VirtualFrame::EnsureOneFreeTOSRegister() { ...@@ -631,7 +627,17 @@ void VirtualFrame::EnsureOneFreeTOSRegister() {
void VirtualFrame::EmitPush(Register reg) { void VirtualFrame::EmitPush(Register reg) {
element_count_++; 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()) { if (SpilledScope::is_spilled()) {
ASSERT(top_of_stack_state_ == NO_TOS_REGISTERS);
__ push(reg); __ push(reg);
return; return;
} }
......
...@@ -469,7 +469,7 @@ class VirtualFrame : public ZoneObject { ...@@ -469,7 +469,7 @@ class VirtualFrame : public ZoneObject {
// Emit instructions to get the top of stack state from where we are to where // Emit instructions to get the top of stack state from where we are to where
// we want to be. // we want to be.
void MergeTOSTo(TopOfStack expected_state, Condition cond); void MergeTOSTo(TopOfStack expected_state, Condition cond = al);
inline bool Equals(const VirtualFrame* other); inline bool Equals(const VirtualFrame* other);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment