Index: src/full-codegen/mips/full-codegen-mips.cc |
diff --git a/src/full-codegen/mips/full-codegen-mips.cc b/src/full-codegen/mips/full-codegen-mips.cc |
index a7f359788cb1ee4f728d1940a341ea7e3b339105..2b0aee108153e785b172dca7a2bd76cd48ae0515 100644 |
--- a/src/full-codegen/mips/full-codegen-mips.cc |
+++ b/src/full-codegen/mips/full-codegen-mips.cc |
@@ -124,22 +124,13 @@ void FullCodeGenerator::Generate() { |
} |
#endif |
- // Sloppy mode functions and builtins need to replace the receiver with the |
- // global proxy when called as functions (without an explicit receiver |
- // object). |
- if (info->MustReplaceUndefinedReceiverWithGlobalProxy()) { |
- Label ok; |
+ if (FLAG_debug_code && info->ExpectsJSReceiverAsReceiver()) { |
int receiver_offset = info->scope()->num_parameters() * kPointerSize; |
- __ lw(at, MemOperand(sp, receiver_offset)); |
- __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); |
- __ Branch(&ok, ne, a2, Operand(at)); |
- |
- __ lw(a2, GlobalObjectOperand()); |
- __ lw(a2, FieldMemOperand(a2, JSGlobalObject::kGlobalProxyOffset)); |
- |
- __ sw(a2, MemOperand(sp, receiver_offset)); |
- |
- __ bind(&ok); |
+ __ lw(a2, MemOperand(sp, receiver_offset)); |
+ __ AssertNotSmi(a2); |
+ __ GetObjectType(a2, a2, a2); |
+ __ Check(ge, kSloppyFunctionExpectsJSReceiverReceiver, a2, |
+ Operand(FIRST_SPEC_OBJECT_TYPE)); |
} |
// Open a frame scope to indicate that there is a frame on the stack. The |