Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index 38eaa6696a498c68030de4490a615ed2f3610333..9796cf36ed23a46a192968e0a847a0d676ac6bf5 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -2828,6 +2828,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())); |
+ __ mov(vector, instr->hydrogen()->feedback_vector()); |
+ // No need to allocate this register. |
+ DCHECK(LoadIC::SlotRegister().is(eax)); |
+ __ mov(LoadIC::SlotRegister(), |
+ Immediate(Smi::FromInt(instr->hydrogen()->slot()))); |
+} |
+ |
+ |
void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
DCHECK(ToRegister(instr->context()).is(esi)); |
DCHECK(ToRegister(instr->global_object()).is(LoadIC::ReceiverRegister())); |
@@ -2835,13 +2848,7 @@ void LCodeGen::DoLoadGlobalGeneric(LLoadGlobalGeneric* instr) { |
__ mov(LoadIC::NameRegister(), 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(eax)); |
- __ mov(LoadIC::SlotRegister(), |
- Immediate(Smi::FromInt(instr->hydrogen()->slot()))); |
+ EmitVectorLoadICRegisters<LLoadGlobalGeneric>(instr); |
} |
ContextualMode mode = instr->for_typeof() ? NOT_CONTEXTUAL : CONTEXTUAL; |
Handle<Code> ic = LoadIC::initialize_stub(isolate(), mode); |
@@ -2978,13 +2985,7 @@ void LCodeGen::DoLoadNamedGeneric(LLoadNamedGeneric* instr) { |
__ mov(LoadIC::NameRegister(), 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(eax)); |
- __ mov(LoadIC::SlotRegister(), |
- Immediate(Smi::FromInt(instr->hydrogen()->slot()))); |
+ EmitVectorLoadICRegisters<LLoadNamedGeneric>(instr); |
} |
Handle<Code> ic = LoadIC::initialize_stub(isolate(), NOT_CONTEXTUAL); |
CallCode(ic, RelocInfo::CODE_TARGET, instr); |
@@ -3211,13 +3212,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())); |
- __ mov(vector, instr->hydrogen()->feedback_vector()); |
- // No need to allocate this register. |
- DCHECK(LoadIC::SlotRegister().is(eax)); |
- __ mov(LoadIC::SlotRegister(), |
- Immediate(Smi::FromInt(instr->hydrogen()->slot()))); |
+ EmitVectorLoadICRegisters<LLoadKeyedGeneric>(instr); |
} |
Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Initialize(); |