Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index 0fcb000aa69e41c64245a389e441107cc245b158..357928193cb548529a128f574fb987ba90ece558 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -3964,8 +3964,30 @@ void LCodeGen::DoCallFunction(LCallFunction* instr) { |
DCHECK(ToRegister(instr->result()).is(eax)); |
int arity = instr->arity(); |
- CallFunctionStub stub(isolate(), arity, instr->hydrogen()->function_flags()); |
- CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
+ CallFunctionFlags flags = instr->hydrogen()->function_flags(); |
+ if (instr->hydrogen()->HasVectorAndSlot()) { |
+ Register slot_register = ToRegister(instr->temp_slot()); |
+ Register vector_register = ToRegister(instr->temp_vector()); |
+ DCHECK(slot_register.is(edx)); |
+ DCHECK(vector_register.is(ebx)); |
+ |
+ AllowDeferredHandleDereference vector_structure_check; |
+ Handle<TypeFeedbackVector> vector = instr->hydrogen()->feedback_vector(); |
+ int index = vector->GetIndex(instr->hydrogen()->slot()); |
+ |
+ __ mov(vector_register, vector); |
+ __ mov(slot_register, Immediate(Smi::FromInt(index))); |
+ |
+ CallICState::CallType call_type = |
+ (flags & CALL_AS_METHOD) ? CallICState::METHOD : CallICState::FUNCTION; |
+ |
+ Handle<Code> ic = |
+ CodeFactory::CallICInOptimizedCode(isolate(), arity, call_type).code(); |
+ CallCode(ic, RelocInfo::CODE_TARGET, instr); |
+ } else { |
+ CallFunctionStub stub(isolate(), arity, flags); |
+ CallCode(stub.GetCode(), RelocInfo::CODE_TARGET, instr); |
+ } |
} |