Revert "Use the same registers for StoreIC and KeyedStoreIC."

This reverts commit r22358 due to release mode arm64 test failures.

TBR=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/385073007

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22359 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8a0267f9
......@@ -221,6 +221,14 @@ void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
}
void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { r0, r3, r1, r2 };
descriptor->Initialize(ARRAY_SIZE(registers), registers,
FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss));
}
void BinaryOpICStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { r1, r0 };
......
......@@ -500,8 +500,8 @@ void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) {
Register receiver = ReceiverRegister();
Register key = NameRegister();
Register value = ValueRegister();
ASSERT(receiver.is(r1));
ASSERT(key.is(r2));
ASSERT(receiver.is(r2));
ASSERT(key.is(r1));
ASSERT(value.is(r0));
Label slow, notin;
......@@ -552,24 +552,9 @@ const Register StoreIC::NameRegister() { return r2; }
const Register StoreIC::ValueRegister() { return r0; }
const Register KeyedStoreIC::ReceiverRegister() {
return StoreIC::ReceiverRegister();
}
const Register KeyedStoreIC::NameRegister() {
return StoreIC::NameRegister();
}
const Register KeyedStoreIC::ValueRegister() {
return StoreIC::ValueRegister();
}
const Register KeyedStoreIC::MapRegister() {
return r3;
}
const Register KeyedStoreIC::ReceiverRegister() { return r2; }
const Register KeyedStoreIC::NameRegister() { return r1; }
const Register KeyedStoreIC::ValueRegister() { return r0; }
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
......@@ -1043,8 +1028,8 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
Register value = ValueRegister();
Register key = NameRegister();
Register receiver = ReceiverRegister();
ASSERT(receiver.is(r1));
ASSERT(key.is(r2));
ASSERT(receiver.is(r2));
ASSERT(key.is(r1));
ASSERT(value.is(r0));
Register receiver_map = r3;
Register elements_map = r6;
......
......@@ -1294,11 +1294,10 @@ Register* StoreStubCompiler::registers() {
Register* KeyedStoreStubCompiler::registers() {
// receiver, name, scratch1/map, scratch2, scratch3.
// receiver, name, scratch1, scratch2, scratch3.
Register receiver = KeyedStoreIC::ReceiverRegister();
Register name = KeyedStoreIC::NameRegister();
Register map = KeyedStoreIC::MapRegister();
static Register registers[] = { receiver, name, map, r4, r5 };
static Register registers[] = { receiver, name, r3, r4, r5 };
return registers;
}
......@@ -1398,10 +1397,7 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
__ JumpIfSmi(receiver(), smi_target);
// Polymorphic keyed stores may use the map register
Register map_reg = scratch1();
ASSERT(kind() != Code::KEYED_STORE_IC ||
map_reg.is(KeyedStoreIC::MapRegister()));
int receiver_count = types->length();
int number_of_handled_maps = 0;
......
......@@ -238,6 +238,18 @@ void ToBooleanStub::InitializeInterfaceDescriptor(
}
void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
// x0: value
// x3: target map
// x1: key
// x2: receiver
Register registers[] = { x0, x3, x1, x2 };
descriptor->Initialize(ARRAY_SIZE(registers), registers,
FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss));
}
void BinaryOpICStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
// x1: left operand
......
......@@ -506,8 +506,8 @@ void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) {
Register value = ValueRegister();
Register key = NameRegister();
Register receiver = ReceiverRegister();
ASSERT(receiver.is(x1));
ASSERT(key.is(x2));
ASSERT(receiver.is(x2));
ASSERT(key.is(x1));
ASSERT(value.is(x0));
Register map = x3;
......@@ -574,24 +574,9 @@ const Register StoreIC::NameRegister() { return x2; }
const Register StoreIC::ValueRegister() { return x0; }
const Register KeyedStoreIC::ReceiverRegister() {
return StoreIC::ReceiverRegister();
}
const Register KeyedStoreIC::NameRegister() {
return StoreIC::NameRegister();
}
const Register KeyedStoreIC::ValueRegister() {
return StoreIC::ValueRegister();
}
const Register KeyedStoreIC::MapRegister() {
return x3;
}
const Register KeyedStoreIC::ReceiverRegister() { return x2; }
const Register KeyedStoreIC::NameRegister() { return x1; }
const Register KeyedStoreIC::ValueRegister() { return x0; }
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
......@@ -1082,8 +1067,8 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
Register value = ValueRegister();
Register key = NameRegister();
Register receiver = ReceiverRegister();
ASSERT(receiver.is(x1));
ASSERT(key.is(x2));
ASSERT(receiver.is(x2));
ASSERT(key.is(x1));
ASSERT(value.is(x0));
Register receiver_map = x3;
......
......@@ -1276,11 +1276,10 @@ Register* StoreStubCompiler::registers() {
Register* KeyedStoreStubCompiler::registers() {
// receiver, name, scratch1/map, scratch2, scratch3.
// receiver, name, scratch1, scratch2, scratch3.
Register receiver = KeyedStoreIC::ReceiverRegister();
Register name = KeyedStoreIC::NameRegister();
Register map = KeyedStoreIC::MapRegister();
static Register registers[] = { receiver, name, map, x4, x5 };
static Register registers[] = { receiver, name, x3, x4, x5 };
return registers;
}
......@@ -1371,10 +1370,7 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
__ JumpIfSmi(receiver(), smi_target);
// Polymorphic keyed stores may use the map register
Register map_reg = scratch1();
ASSERT(kind() != Code::KEYED_STORE_IC ||
map_reg.is(KeyedStoreIC::MapRegister()));
__ Ldr(map_reg, FieldMemOperand(receiver(), HeapObject::kMapOffset));
int receiver_count = types->length();
int number_of_handled_maps = 0;
......
......@@ -1077,10 +1077,10 @@ Handle<Code> StoreGlobalStub::GenerateCode() {
template<>
HValue* CodeStubGraphBuilder<ElementsTransitionAndStoreStub>::BuildCodeStub() {
HValue* value = GetParameter(ElementsTransitionAndStoreStub::kValueIndex);
HValue* map = GetParameter(ElementsTransitionAndStoreStub::kMapIndex);
HValue* key = GetParameter(ElementsTransitionAndStoreStub::kKeyIndex);
HValue* object = GetParameter(ElementsTransitionAndStoreStub::kObjectIndex);
HValue* value = GetParameter(0);
HValue* map = GetParameter(1);
HValue* key = GetParameter(2);
HValue* object = GetParameter(3);
if (FLAG_trace_elements_transitions) {
// Tracing elements transitions is the job of the runtime.
......
......@@ -644,17 +644,6 @@ void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
}
void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { ValueRegister(),
MapRegister(),
KeyRegister(),
ObjectRegister() };
descriptor->Initialize(ARRAY_SIZE(registers), registers,
FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss));
}
void StoreGlobalStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { StoreIC::ReceiverRegister(),
......
......@@ -2455,24 +2455,6 @@ class ElementsTransitionAndStoreStub : public HydrogenCodeStub {
virtual void InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) V8_OVERRIDE;
// Parameters accessed via CodeStubGraphBuilder::GetParameter()
enum RegisterInfo {
kValueIndex,
kMapIndex,
kKeyIndex,
kObjectIndex,
kRegisterArgumentCount
};
static const Register ValueRegister() {
return KeyedStoreIC::ValueRegister();
}
static const Register MapRegister() { return KeyedStoreIC::MapRegister(); }
static const Register KeyRegister() { return KeyedStoreIC::NameRegister(); }
static const Register ObjectRegister() {
return KeyedStoreIC::ReceiverRegister();
}
private:
class FromBits: public BitField<ElementsKind, 0, 8> {};
class ToBits: public BitField<ElementsKind, 8, 8> {};
......
......@@ -225,6 +225,14 @@ void ToBooleanStub::InitializeInterfaceDescriptor(
}
void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { eax, ebx, ecx, edx };
descriptor->Initialize(ARRAY_SIZE(registers), registers,
FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss));
}
void BinaryOpICStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { edx, eax };
......
......@@ -1039,11 +1039,6 @@ const Register KeyedStoreIC::ValueRegister() {
}
const Register KeyedStoreIC::MapRegister() {
return ebx;
}
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// Return address is on the stack.
LoadIC_PushArgs(masm);
......
......@@ -1314,11 +1314,10 @@ Register* StoreStubCompiler::registers() {
Register* KeyedStoreStubCompiler::registers() {
// receiver, name, scratch1/map, scratch2, scratch3.
// receiver, name, scratch1, scratch2, scratch3.
Register receiver = KeyedStoreIC::ReceiverRegister();
Register name = KeyedStoreIC::NameRegister();
Register map = KeyedStoreIC::MapRegister();
static Register registers[] = { receiver, name, map, edi, no_reg };
static Register registers[] = { receiver, name, ebx, edi, no_reg };
return registers;
}
......@@ -1419,10 +1418,7 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
__ JumpIfSmi(receiver(), smi_target);
// Polymorphic keyed stores may use the map register
Register map_reg = scratch1();
ASSERT(kind() != Code::KEYED_STORE_IC ||
map_reg.is(KeyedStoreIC::MapRegister()));
__ mov(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset));
int receiver_count = types->length();
int number_of_handled_maps = 0;
......
......@@ -705,11 +705,6 @@ class KeyedStoreIC: public StoreIC {
static const Register NameRegister();
static const Register ValueRegister();
// The map register isn't part of the normal call specification, but
// ElementsTransitionAndStoreStub, used in polymorphic keyed store
// stub implementations requires it to be initialized.
static const Register MapRegister();
KeyedStoreIC(FrameDepth depth, Isolate* isolate)
: StoreIC(depth, isolate) {
ASSERT(target()->is_keyed_store_stub());
......
......@@ -222,6 +222,14 @@ void ToBooleanStub::InitializeInterfaceDescriptor(
}
void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { rax, rbx, rcx, rdx };
descriptor->Initialize(ARRAY_SIZE(registers), registers,
FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss));
}
void BinaryOpICStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { rdx, rax };
......
......@@ -1065,11 +1065,6 @@ const Register KeyedStoreIC::ValueRegister() {
}
const Register KeyedStoreIC::MapRegister() {
return rbx;
}
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
// The return address is on the stack.
......
......@@ -1253,11 +1253,10 @@ Register* StoreStubCompiler::registers() {
Register* KeyedStoreStubCompiler::registers() {
// receiver, name, scratch1/map, scratch2, scratch3.
// receiver, name, scratch1, scratch2, scratch3.
Register receiver = KeyedStoreIC::ReceiverRegister();
Register name = KeyedStoreIC::NameRegister();
Register map = KeyedStoreIC::MapRegister();
static Register registers[] = { receiver, name, map, rdi, r8 };
static Register registers[] = { receiver, name, rbx, rdi, r8 };
return registers;
}
......@@ -1362,10 +1361,7 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
__ JumpIfSmi(receiver(), smi_target);
// Polymorphic keyed stores may use the map register
Register map_reg = scratch1();
ASSERT(kind() != Code::KEYED_STORE_IC ||
map_reg.is(KeyedStoreIC::MapRegister()));
__ movp(map_reg, FieldOperand(receiver(), HeapObject::kMapOffset));
int receiver_count = types->length();
int number_of_handled_maps = 0;
......
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