Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index 09c677330ae01fa6cbebea4d061efbfe871e85d8..cb0277e96d0bc582efff8a95b21364cbcbf910fb 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -2990,6 +2990,19 @@ void LCodeGen::DoLoadGlobalCell(LLoadGlobalCell* instr) { |
} |
+template <class T> |
+void LCodeGen::EmitVectorLoadICRegisters(T* instr) { |
+ DCHECK(FLAG_vector_ics); |
+ Register vector = ToRegister(instr->temp_vector()); |
+ DCHECK(vector.is(LoadIC::VectorRegister())); |
+ __ Move(vector, instr->hydrogen()->feedback_vector()); |
+ // No need to allocate this register. |
+ DCHECK(LoadIC::SlotRegister().is(r0)); |
+ __ mov(LoadIC::SlotRegister(), |
+ Operand(Smi::FromInt(instr->hydrogen()->slot()))); |
+} |
+ |
+ |
void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
DCHECK(ToRegister(instr->context()).is(cp)); |
DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); |
@@ -2997,13 +3010,7 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
__ mov(LoadIC::NameRegister(), Operand(instr->name())); |
if (FLAG_vector_ics) { |
- Register vector = ToRegister(instr->temp_vector()); |
- DCHECK(vector.is(LoadIC::VectorRegister())); |
- __ Move(vector, instr->hydrogen()->feedback_vector()); |
- // No need to allocate this register. |
- DCHECK(LoadIC::SlotRegister().is(r0)); |
- __ mov(LoadIC::SlotRegister(), |
- Operand(Smi::FromInt(instr->hydrogen()->slot()))); |
+ EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
} |
ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); |
@@ -3126,13 +3133,7 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
// Name is always in r2. |
__ mov(LoadIC::NameRegister(), Operand(instr->name())); |
if (FLAG_vector_ics) { |
- Register vector = ToRegister(instr->temp_vector()); |
- DCHECK(vector.is(LoadIC::VectorRegister())); |
- __ Move(vector, instr->hydrogen()->feedback_vector()); |
- // No need to allocate this register. |
- DCHECK(LoadIC::SlotRegister().is(r0)); |
- __ mov(LoadIC::SlotRegister(), |
- Operand(Smi::FromInt(instr->hydrogen()->slot()))); |
+ EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
} |
Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); |
CallCode(ic, RelocInfo::CODE_TARGET, instr, NEVER_INLINE_TARGET_ADDRESS); |
@@ -3422,13 +3423,7 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister())); |
if (FLAG_vector_ics) { |
- Register vector = ToRegister(instr->temp_vector()); |
- DCHECK(vector.is(LoadIC::VectorRegister())); |
- __ Move(vector, instr->hydrogen()->feedback_vector()); |
- // No need to allocate this register. |
- DCHECK(LoadIC::SlotRegister().is(r0)); |
- __ mov(LoadIC::SlotRegister(), |
- Operand(Smi::FromInt(instr->hydrogen()->slot()))); |
+ EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
} |
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |