Index: src/arm64/lithium-codegen-arm64.cc |
diff --git a/src/arm64/lithium-codegen-arm64.cc b/src/arm64/lithium-codegen-arm64.cc |
index 195d99dc7b77c42dd32ea84a69b3d59759909203..b5fef7e966a0a907387247d2ebd893132a955621 100644 |
--- a/src/arm64/lithium-codegen-arm64.cc |
+++ b/src/arm64/lithium-codegen-arm64.cc |
@@ -3344,19 +3344,25 @@ 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())); |
+ __ Mov(vector, instr->hydrogen()->feedback_vector()); |
+ // No need to allocate this register. |
+ DCHECK(LoadIC::SlotRegister().is(x0)); |
+ __ Mov(LoadIC::SlotRegister(), Smi::FromInt(instr->hydrogen()->slot())); |
+} |
+ |
+ |
void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
DCHECK(ToRegister(instr->context()).is(cp)); |
DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); |
DCHECK(ToRegister(instr->result()).Is(x0)); |
__ Mov(LoadIC::NameRegister(), Operand(instr->name())); |
if (FLAG_vector_ics) { |
- Register vector = ToRegister(instr->temp_vector()); |
- DCHECK(vector.is(LoadIC::VectorRegister())); |
- __ Mov(vector, instr->hydrogen()->feedback_vector()); |
- // No need to allocate this register. |
- DCHECK(LoadIC::SlotRegister().is(x0)); |
- __ Mov(LoadIC::SlotRegister(), |
- Smi::FromInt(instr->hydrogen()->slot())); |
+ EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
} |
ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); |
@@ -3611,13 +3617,7 @@ void LCodeGen::DoLoadKeyedGeneric(LLoadKeyedGeneric* instr) { |
DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); |
DCHECK(ToRegister(instr->key()).is(LoadIC::NameRegister())); |
if (FLAG_vector_ics) { |
- Register vector = ToRegister(instr->temp_vector()); |
- DCHECK(vector.is(LoadIC::VectorRegister())); |
- __ Mov(vector, instr->hydrogen()->feedback_vector()); |
- // No need to allocate this register. |
- DCHECK(LoadIC::SlotRegister().is(x0)); |
- __ Mov(LoadIC::SlotRegister(), |
- Smi::FromInt(instr->hydrogen()->slot())); |
+ EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
} |
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |
@@ -3673,13 +3673,7 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
DCHECK(ToRegister(instr->object()).is(LoadIC::ReceiverRegister())); |
__ Mov(LoadIC::NameRegister(), Operand(instr->name())); |
if (FLAG_vector_ics) { |
- Register vector = ToRegister(instr->temp_vector()); |
- DCHECK(vector.is(LoadIC::VectorRegister())); |
- __ Mov(vector, instr->hydrogen()->feedback_vector()); |
- // No need to allocate this register. |
- DCHECK(LoadIC::SlotRegister().is(x0)); |
- __ Mov(LoadIC::SlotRegister(), |
- Smi::FromInt(instr->hydrogen()->slot())); |
+ EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
} |
Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); |