Commit b64565e5 authored by ishell's avatar ishell Committed by Commit bot

[ic] Move KeyedStoreIC::GenerateSlow() to ic-XXX.cc to avoid code duplication.

Review-Url: https://codereview.chromium.org/2343813002
Cr-Commit-Position: refs/heads/master@{#39445}
parent b848716c
...@@ -49,7 +49,7 @@ void Builtins::Generate_KeyedStoreIC_Miss(MacroAssembler* masm) { ...@@ -49,7 +49,7 @@ void Builtins::Generate_KeyedStoreIC_Miss(MacroAssembler* masm) {
} }
void Builtins::Generate_KeyedStoreIC_Slow(MacroAssembler* masm) { void Builtins::Generate_KeyedStoreIC_Slow(MacroAssembler* masm) {
ElementHandlerCompiler::GenerateStoreSlow(masm); KeyedStoreIC::GenerateSlow(masm);
} }
void Builtins::Generate_LoadGlobalIC_Miss(CodeStubAssembler* assembler) { void Builtins::Generate_LoadGlobalIC_Miss(CodeStubAssembler* assembler) {
......
...@@ -5670,7 +5670,7 @@ void CreateWeakCellStub::GenerateAheadOfTime(Isolate* isolate) { ...@@ -5670,7 +5670,7 @@ void CreateWeakCellStub::GenerateAheadOfTime(Isolate* isolate) {
void StoreElementStub::Generate(MacroAssembler* masm) { void StoreElementStub::Generate(MacroAssembler* masm) {
DCHECK_EQ(DICTIONARY_ELEMENTS, elements_kind()); DCHECK_EQ(DICTIONARY_ELEMENTS, elements_kind());
ElementHandlerCompiler::GenerateStoreSlow(masm); KeyedStoreIC::GenerateSlow(masm);
} }
void StoreFastElementStub::GenerateAssembly( void StoreFastElementStub::GenerateAssembly(
......
...@@ -330,24 +330,6 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( ...@@ -330,24 +330,6 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ TailCallStub(&stub); __ TailCallStub(&stub);
} }
static void StoreIC_PushArgs(MacroAssembler* masm) {
__ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
StoreDescriptor::ValueRegister(),
StoreWithVectorDescriptor::SlotRegister(),
StoreWithVectorDescriptor::VectorRegister());
}
void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
StoreIC_PushArgs(masm);
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
#undef __ #undef __
#define __ ACCESS_MASM(masm()) #define __ ACCESS_MASM(masm())
......
...@@ -454,6 +454,13 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { ...@@ -454,6 +454,13 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedStoreIC_Miss); __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss);
} }
void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
StoreIC_PushArgs(masm);
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
static void KeyedStoreGenerateMegamorphicHelper( static void KeyedStoreGenerateMegamorphicHelper(
MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow,
......
...@@ -323,25 +323,6 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter( ...@@ -323,25 +323,6 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
__ Ret(); __ Ret();
} }
static void StoreIC_PushArgs(MacroAssembler* masm) {
__ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
StoreDescriptor::ValueRegister(),
StoreWithVectorDescriptor::SlotRegister(),
StoreWithVectorDescriptor::VectorRegister());
}
void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
ASM_LOCATION("ElementHandlerCompiler::GenerateStoreSlow");
StoreIC_PushArgs(masm);
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
#undef __ #undef __
#define __ ACCESS_MASM(masm()) #define __ ACCESS_MASM(masm())
......
...@@ -458,6 +458,14 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { ...@@ -458,6 +458,14 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedStoreIC_Miss); __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss);
} }
void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
ASM_LOCATION("KeyedStoreIC::GenerateSlow");
StoreIC_PushArgs(masm);
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
static void KeyedStoreGenerateMegamorphicHelper( static void KeyedStoreGenerateMegamorphicHelper(
MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow,
......
...@@ -283,8 +283,6 @@ class ElementHandlerCompiler : public PropertyHandlerCompiler { ...@@ -283,8 +283,6 @@ class ElementHandlerCompiler : public PropertyHandlerCompiler {
Isolate* isolate); Isolate* isolate);
void CompileElementHandlers(MapHandleList* receiver_maps, void CompileElementHandlers(MapHandleList* receiver_maps,
List<Handle<Object>>* handlers); List<Handle<Object>>* handlers);
static void GenerateStoreSlow(MacroAssembler* masm);
}; };
} // namespace internal } // namespace internal
} // namespace v8 } // namespace v8
......
...@@ -316,32 +316,6 @@ static void CompileCallLoadPropertyWithInterceptor( ...@@ -316,32 +316,6 @@ static void CompileCallLoadPropertyWithInterceptor(
__ CallRuntime(id); __ CallRuntime(id);
} }
static void StoreIC_PushArgs(MacroAssembler* masm) {
Register receiver = StoreDescriptor::ReceiverRegister();
Register name = StoreDescriptor::NameRegister();
Register value = StoreDescriptor::ValueRegister();
Register slot = StoreWithVectorDescriptor::SlotRegister();
Register vector = StoreWithVectorDescriptor::VectorRegister();
__ xchg(receiver, Operand(esp, 0));
__ push(name);
__ push(value);
__ push(slot);
__ push(vector);
__ push(receiver); // which contains the return address.
}
void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
// Return address is on the stack.
StoreIC_PushArgs(masm);
// Do tail-call to runtime routine.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
#undef __ #undef __
#define __ ACCESS_MASM(masm()) #define __ ACCESS_MASM(masm())
......
...@@ -770,6 +770,13 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { ...@@ -770,6 +770,13 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedStoreIC_Miss); __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss);
} }
void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
// Return address is on the stack.
StoreIC_PushArgs(masm);
// Do tail-call to runtime routine.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
#undef __ #undef __
......
...@@ -317,24 +317,6 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( ...@@ -317,24 +317,6 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ TailCallStub(&stub); __ TailCallStub(&stub);
} }
static void StoreIC_PushArgs(MacroAssembler* masm) {
__ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
StoreDescriptor::ValueRegister(),
StoreWithVectorDescriptor::SlotRegister(),
StoreWithVectorDescriptor::VectorRegister());
}
void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
StoreIC_PushArgs(masm);
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
#undef __ #undef __
#define __ ACCESS_MASM(masm()) #define __ ACCESS_MASM(masm())
......
...@@ -723,6 +723,14 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { ...@@ -723,6 +723,14 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedStoreIC_Miss); __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss);
} }
void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
StoreIC_PushArgs(masm);
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
void StoreIC::GenerateMiss(MacroAssembler* masm) { void StoreIC::GenerateMiss(MacroAssembler* masm) {
StoreIC_PushArgs(masm); StoreIC_PushArgs(masm);
......
...@@ -317,24 +317,6 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( ...@@ -317,24 +317,6 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ TailCallStub(&stub); __ TailCallStub(&stub);
} }
static void StoreIC_PushArgs(MacroAssembler* masm) {
__ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
StoreDescriptor::ValueRegister(),
StoreWithVectorDescriptor::SlotRegister(),
StoreWithVectorDescriptor::VectorRegister());
}
void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
StoreIC_PushArgs(masm);
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
#undef __ #undef __
#define __ ACCESS_MASM(masm()) #define __ ACCESS_MASM(masm())
......
...@@ -727,6 +727,14 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { ...@@ -727,6 +727,14 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedStoreIC_Miss); __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss);
} }
void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
StoreIC_PushArgs(masm);
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
void StoreIC::GenerateMiss(MacroAssembler* masm) { void StoreIC::GenerateMiss(MacroAssembler* masm) {
StoreIC_PushArgs(masm); StoreIC_PushArgs(masm);
......
...@@ -325,24 +325,6 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( ...@@ -325,24 +325,6 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ TailCallStub(&stub); __ TailCallStub(&stub);
} }
static void StoreIC_PushArgs(MacroAssembler* masm) {
__ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
StoreDescriptor::ValueRegister(),
StoreWithVectorDescriptor::SlotRegister(),
StoreWithVectorDescriptor::VectorRegister());
}
void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
StoreIC_PushArgs(masm);
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
#undef __ #undef __
#define __ ACCESS_MASM(masm()) #define __ ACCESS_MASM(masm())
......
...@@ -464,6 +464,13 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { ...@@ -464,6 +464,13 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedStoreIC_Miss); __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss);
} }
void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
StoreIC_PushArgs(masm);
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
static void KeyedStoreGenerateMegamorphicHelper( static void KeyedStoreGenerateMegamorphicHelper(
MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow,
......
...@@ -310,21 +310,6 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall( ...@@ -310,21 +310,6 @@ void PropertyHandlerCompiler::GenerateApiAccessorCall(
__ TailCallStub(&stub); __ TailCallStub(&stub);
} }
static void StoreIC_PushArgs(MacroAssembler* masm) {
__ Push(StoreDescriptor::ReceiverRegister(), StoreDescriptor::NameRegister(),
StoreDescriptor::ValueRegister(),
StoreWithVectorDescriptor::SlotRegister(),
StoreWithVectorDescriptor::VectorRegister());
}
void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
StoreIC_PushArgs(masm);
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
#undef __ #undef __
#define __ ACCESS_MASM(masm()) #define __ ACCESS_MASM(masm())
......
...@@ -449,6 +449,14 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { ...@@ -449,6 +449,14 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedStoreIC_Miss); __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss);
} }
void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
StoreIC_PushArgs(masm);
// The slow case calls into the runtime to complete the store without causing
// an IC miss that would otherwise cause a transition to the generic stub.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
static void KeyedStoreGenerateMegamorphicHelper( static void KeyedStoreGenerateMegamorphicHelper(
MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow, MacroAssembler* masm, Label* fast_object, Label* fast_double, Label* slow,
KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length, KeyedStoreCheckMap check_map, KeyedStoreIncrementLength increment_length,
......
...@@ -321,34 +321,6 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter( ...@@ -321,34 +321,6 @@ void NamedLoadHandlerCompiler::GenerateLoadViaGetter(
__ ret(0); __ ret(0);
} }
static void StoreIC_PushArgs(MacroAssembler* masm) {
Register receiver = StoreDescriptor::ReceiverRegister();
Register name = StoreDescriptor::NameRegister();
Register value = StoreDescriptor::ValueRegister();
Register slot = StoreWithVectorDescriptor::SlotRegister();
Register vector = StoreWithVectorDescriptor::VectorRegister();
__ PopReturnAddressTo(r11);
__ Push(receiver);
__ Push(name);
__ Push(value);
__ Push(slot);
__ Push(vector);
__ PushReturnAddressFrom(r11);
}
void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
// Return address is on the stack.
StoreIC_PushArgs(masm);
// Do tail-call to runtime routine.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
#undef __ #undef __
#define __ ACCESS_MASM((masm())) #define __ ACCESS_MASM((masm()))
......
...@@ -764,6 +764,13 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { ...@@ -764,6 +764,13 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedStoreIC_Miss); __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss);
} }
void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
// Return address is on the stack.
StoreIC_PushArgs(masm);
// Do tail-call to runtime routine.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
#undef __ #undef __
......
...@@ -316,32 +316,6 @@ static void CompileCallLoadPropertyWithInterceptor( ...@@ -316,32 +316,6 @@ static void CompileCallLoadPropertyWithInterceptor(
__ CallRuntime(id); __ CallRuntime(id);
} }
static void StoreIC_PushArgs(MacroAssembler* masm) {
Register receiver = StoreDescriptor::ReceiverRegister();
Register name = StoreDescriptor::NameRegister();
Register value = StoreDescriptor::ValueRegister();
Register slot = StoreWithVectorDescriptor::SlotRegister();
Register vector = StoreWithVectorDescriptor::VectorRegister();
__ xchg(receiver, Operand(esp, 0));
__ push(name);
__ push(value);
__ push(slot);
__ push(vector);
__ push(receiver); // which contains the return address.
}
void ElementHandlerCompiler::GenerateStoreSlow(MacroAssembler* masm) {
// Return address is on the stack.
StoreIC_PushArgs(masm);
// Do tail-call to runtime routine.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
#undef __ #undef __
#define __ ACCESS_MASM(masm()) #define __ ACCESS_MASM(masm())
......
...@@ -770,6 +770,13 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) { ...@@ -770,6 +770,13 @@ void KeyedStoreIC::GenerateMiss(MacroAssembler* masm) {
__ TailCallRuntime(Runtime::kKeyedStoreIC_Miss); __ TailCallRuntime(Runtime::kKeyedStoreIC_Miss);
} }
void KeyedStoreIC::GenerateSlow(MacroAssembler* masm) {
// Return address is on the stack.
StoreIC_PushArgs(masm);
// Do tail-call to runtime routine.
__ TailCallRuntime(Runtime::kKeyedStoreIC_Slow);
}
#undef __ #undef __
......
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