Index: src/x87/lithium-codegen-x87.cc |
diff --git a/src/x87/lithium-codegen-x87.cc b/src/x87/lithium-codegen-x87.cc |
index 833768995f5022e4e404156f8d06c8358cfb3a51..6a3936a87fa0f73d85c6e6bc16ed37b427bd87f2 100644 |
--- a/src/x87/lithium-codegen-x87.cc |
+++ b/src/x87/lithium-codegen-x87.cc |
@@ -4364,8 +4364,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); |
+ } |
} |