Commit fb812df5 authored by akos.palfi@imgtec.com's avatar akos.palfi@imgtec.com

MIPS: Use the same registers for StoreIC and KeyedStoreIC.

Port r22387 (ff76c666)

BUG=
R=mvstanton@chromium.org

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

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@22397 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d6fcb81a
......@@ -221,14 +221,6 @@ void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
}
void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { a0, a3, a1, a2 };
descriptor->Initialize(ARRAY_SIZE(registers), registers,
FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss));
}
void BinaryOpICStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { a1, a0 };
......
......@@ -510,8 +510,6 @@ void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) {
Register receiver = ReceiverRegister();
Register key = NameRegister();
Register value = ValueRegister();
ASSERT(receiver.is(a2));
ASSERT(key.is(a1));
ASSERT(value.is(a0));
Label slow, notin;
......@@ -568,9 +566,24 @@ const Register StoreIC::NameRegister() { return a2; }
const Register StoreIC::ValueRegister() { return a0; }
const Register KeyedStoreIC::ReceiverRegister() { return a2; }
const Register KeyedStoreIC::NameRegister() { return a1; }
const Register KeyedStoreIC::ValueRegister() { return a0; }
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 a3;
}
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
......@@ -980,8 +993,6 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
Register value = ValueRegister();
Register key = NameRegister();
Register receiver = ReceiverRegister();
ASSERT(receiver.is(a2));
ASSERT(key.is(a1));
ASSERT(value.is(a0));
Register receiver_map = a3;
Register elements_map = t2;
......
......@@ -1284,10 +1284,11 @@ Register* StoreStubCompiler::registers() {
Register* KeyedStoreStubCompiler::registers() {
// receiver, name, scratch1, scratch2, scratch3.
// receiver, name, scratch1/map, scratch2, scratch3.
Register receiver = KeyedStoreIC::ReceiverRegister();
Register name = KeyedStoreIC::NameRegister();
static Register registers[] = { receiver, name, a3, t0, t1 };
Register map = KeyedStoreIC::MapRegister();
static Register registers[] = { receiver, name, map, t0, t1 };
return registers;
}
......@@ -1387,7 +1388,10 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
__ JumpIfSmi(receiver(), smi_target, match); // Reg match is 0 if Smi.
// Polymorphic keyed stores may use the map register
Register map_reg = scratch2();
ASSERT(kind() != Code::KEYED_STORE_IC ||
map_reg.is(KeyedStoreIC::MapRegister()));
int receiver_count = types->length();
int number_of_handled_maps = 0;
......
......@@ -221,14 +221,6 @@ void InternalArrayNArgumentsConstructorStub::InitializeInterfaceDescriptor(
}
void ElementsTransitionAndStoreStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { a0, a3, a1, a2 };
descriptor->Initialize(ARRAY_SIZE(registers), registers,
FUNCTION_ADDR(ElementsTransitionAndStoreIC_Miss));
}
void BinaryOpICStub::InitializeInterfaceDescriptor(
CodeStubInterfaceDescriptor* descriptor) {
Register registers[] = { a1, a0 };
......
......@@ -510,8 +510,6 @@ void KeyedStoreIC::GenerateSloppyArguments(MacroAssembler* masm) {
Register receiver = ReceiverRegister();
Register key = NameRegister();
Register value = ValueRegister();
ASSERT(receiver.is(a2));
ASSERT(key.is(a1));
ASSERT(value.is(a0));
Label slow, notin;
......@@ -568,9 +566,24 @@ const Register StoreIC::NameRegister() { return a2; }
const Register StoreIC::ValueRegister() { return a0; }
const Register KeyedStoreIC::ReceiverRegister() { return a2; }
const Register KeyedStoreIC::NameRegister() { return a1; }
const Register KeyedStoreIC::ValueRegister() { return a0; }
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 a3;
}
void KeyedLoadIC::GenerateRuntimeGetProperty(MacroAssembler* masm) {
......@@ -991,8 +1004,6 @@ void KeyedStoreIC::GenerateGeneric(MacroAssembler* masm,
Register value = ValueRegister();
Register key = NameRegister();
Register receiver = ReceiverRegister();
ASSERT(receiver.is(a2));
ASSERT(key.is(a1));
ASSERT(value.is(a0));
Register receiver_map = a3;
Register elements_map = a6;
......
......@@ -1284,10 +1284,11 @@ Register* StoreStubCompiler::registers() {
Register* KeyedStoreStubCompiler::registers() {
// receiver, name, scratch1, scratch2, scratch3.
// receiver, name, scratch1/map, scratch2, scratch3.
Register receiver = KeyedStoreIC::ReceiverRegister();
Register name = KeyedStoreIC::NameRegister();
static Register registers[] = { receiver, name, a3, a4, a5 };
Register map = KeyedStoreIC::MapRegister();
static Register registers[] = { receiver, name, map, a4, a5 };
return registers;
}
......@@ -1387,7 +1388,10 @@ Handle<Code> BaseLoadStoreStubCompiler::CompilePolymorphicIC(
Label* smi_target = IncludesNumberType(types) ? &number_case : &miss;
__ JumpIfSmi(receiver(), smi_target, match); // Reg match is 0 if Smi.
// Polymorphic keyed stores may use the map register
Register map_reg = scratch2();
ASSERT(kind() != Code::KEYED_STORE_IC ||
map_reg.is(KeyedStoreIC::MapRegister()));
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