Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index a5b1cfccd27004a3a5b8b542fa90bca742e8a079..928b874ba04146a86c96033921ee2a33846d9d30 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -2846,6 +2846,18 @@ 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(rax)); |
+ __ Move(LoadIC::SlotRegister(), Smi::FromInt(instr->hydrogen()->slot())); |
+} |
+ |
+ |
void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
DCHECK(ToRegister(instr->context()).is(rsi)); |
DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); |
@@ -2853,12 +2865,7 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
__ Move(LoadIC::NameRegister(), 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(rax)); |
- __ Move(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); |
@@ -3001,12 +3008,7 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
__ Move(LoadIC::NameRegister(), 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(rax)); |
- __ Move(LoadIC::SlotRegister(), Smi::FromInt(instr->hydrogen()->slot())); |
+ EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
} |
Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); |
CallCode(ic, RelocInfo::CODE_TARGET, instr); |
@@ -3289,12 +3291,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(rax)); |
- __ Move(LoadIC::SlotRegister(), Smi::FromInt(instr->hydrogen()->slot())); |
+ EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
} |
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |