Index: src/full-codegen/arm/full-codegen-arm.cc |
diff --git a/src/full-codegen/arm/full-codegen-arm.cc b/src/full-codegen/arm/full-codegen-arm.cc |
index b6fd000d486f8f2efa9e1e33abfc38b94b0ef03d..5ca7a52af44e74ac23b6feded6d152353525dc95 100644 |
--- a/src/full-codegen/arm/full-codegen-arm.cc |
+++ b/src/full-codegen/arm/full-codegen-arm.cc |
@@ -2115,7 +2115,9 @@ void FullCodeGenerator::VisitYield(Yield* expr) { |
__ str(r1, MemOperand(sp, 2 * kPointerSize)); |
SetCallPosition(expr, 1); |
__ mov(r0, Operand(1)); |
- __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
+ __ Call( |
+ isolate()->builtins()->Call(ConvertReceiverMode::kNotNullOrUndefined), |
+ RelocInfo::CODE_TARGET); |
__ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
__ Drop(1); // The function is still on the stack; drop it. |
@@ -2808,6 +2810,7 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) { |
Expression* callee = expr->expression(); |
// Get the target function. |
+ ConvertReceiverMode convert_mode; |
if (callee->IsVariableProxy()) { |
{ StackValueContext context(this); |
EmitVariableLoad(callee->AsVariableProxy()); |
@@ -2817,6 +2820,7 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) { |
// is a sloppy mode method. |
__ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
__ push(ip); |
+ convert_mode = ConvertReceiverMode::kNullOrUndefined; |
} else { |
// Load the function from the receiver. |
DCHECK(callee->IsProperty()); |
@@ -2828,9 +2832,10 @@ void FullCodeGenerator::EmitCallWithLoadIC(Call* expr) { |
__ ldr(ip, MemOperand(sp, 0)); |
__ push(ip); |
__ str(r0, MemOperand(sp, kPointerSize)); |
+ convert_mode = ConvertReceiverMode::kNotNullOrUndefined; |
} |
- EmitCall(expr); |
+ EmitCall(expr, convert_mode); |
} |
@@ -2894,7 +2899,7 @@ void FullCodeGenerator::EmitKeyedCallWithLoadIC(Call* expr, |
__ push(ip); |
__ str(r0, MemOperand(sp, kPointerSize)); |
- EmitCall(expr); |
+ EmitCall(expr, ConvertReceiverMode::kNotNullOrUndefined); |
} |
@@ -2936,7 +2941,7 @@ void FullCodeGenerator::EmitKeyedSuperCallWithLoadIC(Call* expr) { |
} |
-void FullCodeGenerator::EmitCall(Call* expr) { |
+void FullCodeGenerator::EmitCall(Call* expr, ConvertReceiverMode mode) { |
// Load the arguments. |
ZoneList<Expression*>* args = expr->arguments(); |
int arg_count = args->length(); |
@@ -2946,7 +2951,7 @@ void FullCodeGenerator::EmitCall(Call* expr) { |
PrepareForBailoutForId(expr->CallId(), NO_REGISTERS); |
SetCallPosition(expr, arg_count); |
- Handle<Code> ic = CodeFactory::CallIC(isolate(), arg_count).code(); |
+ Handle<Code> ic = CodeFactory::CallIC(isolate(), arg_count, mode).code(); |
__ mov(r3, Operand(SmiFromSlot(expr->CallFeedbackICSlot()))); |
__ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
// Don't assign a type feedback id to the IC, since type feedback is provided |
@@ -4225,7 +4230,8 @@ void FullCodeGenerator::EmitCallJSRuntimeFunction(CallRuntime* expr) { |
SetCallPosition(expr, arg_count); |
__ ldr(r1, MemOperand(sp, (arg_count + 1) * kPointerSize)); |
__ mov(r0, Operand(arg_count)); |
- __ Call(isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); |
+ __ Call(isolate()->builtins()->Call(ConvertReceiverMode::kNullOrUndefined), |
+ RelocInfo::CODE_TARGET); |
} |