Index: src/ia32/full-codegen-ia32.cc |
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc |
index 452cd08ee300b9809e303413cb39dccd8997573f..c0c83659ecd0195e0f8f1a49d3e87dd2295e188a 100644 |
--- a/src/ia32/full-codegen-ia32.cc |
+++ b/src/ia32/full-codegen-ia32.cc |
@@ -2568,9 +2568,9 @@ void FullCodeGenerator::EmitCallWithIC(Call* expr) { |
ZoneList<Expression*>* args = expr->arguments(); |
int arg_count = args->length(); |
- CallFunctionFlags flags; |
+ bool call_as_method = !callee->IsVariableProxy(); |
// Get the target function. |
- if (callee->IsVariableProxy()) { |
+ if (!call_as_method) { |
{ StackValueContext context(this); |
EmitVariableLoad(callee->AsVariableProxy()); |
PrepareForBailout(callee, NO_REGISTERS); |
@@ -2578,7 +2578,6 @@ void FullCodeGenerator::EmitCallWithIC(Call* expr) { |
// Push undefined as receiver. This is patched in the method prologue if it |
// is a classic mode method. |
__ push(Immediate(isolate()->factory()->undefined_value())); |
- flags = NO_CALL_FUNCTION_FLAGS; |
} else { |
// Load the function from the receiver. |
ASSERT(callee->IsProperty()); |
@@ -2588,7 +2587,6 @@ void FullCodeGenerator::EmitCallWithIC(Call* expr) { |
// Push the target function under the receiver. |
__ push(Operand(esp, 0)); |
__ mov(Operand(esp, kPointerSize), eax); |
- flags = CALL_AS_METHOD; |
} |
// Load the arguments. |
@@ -2600,9 +2598,16 @@ void FullCodeGenerator::EmitCallWithIC(Call* expr) { |
// Record source position of the IC call. |
SetSourcePosition(expr->position()); |
- CallFunctionStub stub(arg_count, flags); |
+ Handle<Code> ic = CallIC::initialize_stub(isolate(), arg_count, |
+ call_as_method); |
+ Handle<Object> uninitialized = |
+ TypeFeedbackInfo::UninitializedSentinel(isolate()); |
+ StoreFeedbackVectorSlot(expr->CallFeedbackSlot(), uninitialized); |
+ __ LoadHeapObject(ebx, FeedbackVector()); |
+ __ mov(edx, Immediate(Smi::FromInt(expr->CallFeedbackSlot()))); |
__ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); |
- __ CallStub(&stub); |
+ CallIC(ic); // NOTE: no type feedback id. |
Toon Verwaest
2014/03/10 13:50:44
What about something like:
// Don't assign a type
mvstanton
2014/03/20 15:51:53
Done.
|
+ |
RecordJSReturnSite(expr); |
// Restore context register. |
@@ -2643,9 +2648,17 @@ void FullCodeGenerator::EmitKeyedCallWithIC(Call* expr, |
// Record source position of the IC call. |
SetSourcePosition(expr->position()); |
- CallFunctionStub stub(arg_count, CALL_AS_METHOD); |
+ |
+ Handle<Code> ic = CallIC::initialize_stub(isolate(), arg_count, |
Toon Verwaest
2014/03/10 13:50:44
Doesn't this fit on one line? Otherwise
... CallI
mvstanton
2014/03/20 15:51:53
Done.
|
+ true); |
+ Handle<Object> uninitialized = |
+ TypeFeedbackInfo::UninitializedSentinel(isolate()); |
+ StoreFeedbackVectorSlot(expr->CallFeedbackSlot(), uninitialized); |
+ __ LoadHeapObject(ebx, FeedbackVector()); |
+ __ mov(edx, Immediate(Smi::FromInt(expr->CallFeedbackSlot()))); |
__ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); |
- __ CallStub(&stub); |
+ CallIC(ic); // NOTE: no type feedback id. |
+ |
RecordJSReturnSite(expr); |
// Restore context register. |
@@ -2674,9 +2687,10 @@ void FullCodeGenerator::EmitCallWithStub(Call* expr) { |
__ mov(edx, Immediate(Smi::FromInt(expr->CallFeedbackSlot()))); |
// Record call targets in unoptimized code. |
- CallFunctionStub stub(arg_count, RECORD_CALL_TARGET); |
+ Handle<Code> ic = CallIC::initialize_stub(isolate(), arg_count, |
+ false); |
__ mov(edi, Operand(esp, (arg_count + 1) * kPointerSize)); |
- __ CallStub(&stub); |
+ CallIC(ic); // NOTE: no type feedback id. |
RecordJSReturnSite(expr); |
// Restore context register. |