Commit 27361ec6 authored by chunyang.dai's avatar chunyang.dai Committed by Commit bot

X87: Use a trampoline stub to load the type feedback vector for CallICs

port 2a567faa (r26290)

original commit message:

  Use a trampoline stub to load the type feedback vector for CallICs.

BUG=

Review URL: https://codereview.chromium.org/905983002

Cr-Commit-Position: refs/heads/master@{#26502}
parent 3c56b026
...@@ -1879,12 +1879,11 @@ static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) { ...@@ -1879,12 +1879,11 @@ static void EmitLoadTypeFeedbackVector(MacroAssembler* masm, Register vector) {
void CallIC_ArrayStub::Generate(MacroAssembler* masm) { void CallIC_ArrayStub::Generate(MacroAssembler* masm) {
// edi - function // edi - function
// edx - slot id // edx - slot id
// ebx - vector
Label miss; Label miss;
int argc = arg_count(); int argc = arg_count();
ParameterCount actual(argc); ParameterCount actual(argc);
EmitLoadTypeFeedbackVector(masm, ebx);
__ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx); __ LoadGlobalFunction(Context::ARRAY_FUNCTION_INDEX, ecx);
__ cmp(edi, ecx); __ cmp(edi, ecx);
__ j(not_equal, &miss); __ j(not_equal, &miss);
...@@ -1920,6 +1919,7 @@ void CallIC_ArrayStub::Generate(MacroAssembler* masm) { ...@@ -1920,6 +1919,7 @@ void CallIC_ArrayStub::Generate(MacroAssembler* masm) {
void CallICStub::Generate(MacroAssembler* masm) { void CallICStub::Generate(MacroAssembler* masm) {
// edi - function // edi - function
// edx - slot id // edx - slot id
// ebx - vector
Isolate* isolate = masm->isolate(); Isolate* isolate = masm->isolate();
const int with_types_offset = const int with_types_offset =
FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex); FixedArray::OffsetOfElementAt(TypeFeedbackVector::kWithTypesIndex);
...@@ -1931,8 +1931,6 @@ void CallICStub::Generate(MacroAssembler* masm) { ...@@ -1931,8 +1931,6 @@ void CallICStub::Generate(MacroAssembler* masm) {
int argc = arg_count(); int argc = arg_count();
ParameterCount actual(argc); ParameterCount actual(argc);
EmitLoadTypeFeedbackVector(masm, ebx);
// The checks. First, does edi match the recorded monomorphic target? // The checks. First, does edi match the recorded monomorphic target?
__ cmp(edi, FieldOperand(ebx, edx, times_half_pointer_size, __ cmp(edi, FieldOperand(ebx, edx, times_half_pointer_size,
FixedArray::kHeaderSize)); FixedArray::kHeaderSize));
...@@ -3992,6 +3990,20 @@ void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) { ...@@ -3992,6 +3990,20 @@ void KeyedLoadICTrampolineStub::Generate(MacroAssembler* masm) {
} }
void CallICTrampolineStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, ebx);
CallICStub stub(isolate(), state());
__ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
}
void CallIC_ArrayTrampolineStub::Generate(MacroAssembler* masm) {
EmitLoadTypeFeedbackVector(masm, ebx);
CallIC_ArrayStub stub(isolate(), state());
__ jmp(stub.GetCode(), RelocInfo::CODE_TARGET);
}
void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) { void ProfileEntryHookStub::MaybeCallEntryHook(MacroAssembler* masm) {
if (masm->isolate()->function_entry_hook() != NULL) { if (masm->isolate()->function_entry_hook() != NULL) {
ProfileEntryHookStub stub(masm->isolate()); ProfileEntryHookStub stub(masm->isolate());
......
...@@ -2894,8 +2894,7 @@ void FullCodeGenerator::EmitCall(Call* expr, CallICState::CallType call_type) { ...@@ -2894,8 +2894,7 @@ void FullCodeGenerator::EmitCall(Call* expr, CallICState::CallType call_type) {
// Record source position of the IC call. // Record source position of the IC call.
SetSourcePosition(expr->position()); SetSourcePosition(expr->position());
Handle<Code> ic = CallIC::initialize_stub( Handle<Code> ic = CodeFactory::CallIC(isolate(), arg_count, call_type).code();
isolate(), arg_count, call_type);
__ Move(edx, Immediate(SmiFromSlot(expr->CallFeedbackSlot()))); __ Move(edx, Immediate(SmiFromSlot(expr->CallFeedbackSlot())));
__ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); __ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize));
// Don't assign a type feedback id to the IC, since type feedback is provided // Don't assign a type feedback id to the IC, since type feedback is provided
......
...@@ -128,6 +128,16 @@ void CallFunctionWithFeedbackDescriptor::Initialize( ...@@ -128,6 +128,16 @@ void CallFunctionWithFeedbackDescriptor::Initialize(
} }
void CallFunctionWithFeedbackAndVectorDescriptor::Initialize(
CallInterfaceDescriptorData* data) {
Register registers[] = {esi, edi, edx, ebx};
Representation representations[] = {
Representation::Tagged(), Representation::Tagged(), Representation::Smi(),
Representation::Tagged()};
data->Initialize(arraysize(registers), registers, representations);
}
void CallConstructDescriptor::Initialize(CallInterfaceDescriptorData* data) { void CallConstructDescriptor::Initialize(CallInterfaceDescriptorData* data) {
// eax : number of arguments // eax : number of arguments
// ebx : feedback vector // ebx : feedback vector
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment