| Index: src/mips/lithium-codegen-mips.cc
|
| diff --git a/src/mips/lithium-codegen-mips.cc b/src/mips/lithium-codegen-mips.cc
|
| index 4029e8ed985a1d2ca2e49262515b88a5fadbde14..4fcc8a3b7686b7dcdd8d348cd5bb50690068ad96 100644
|
| --- a/src/mips/lithium-codegen-mips.cc
|
| +++ b/src/mips/lithium-codegen-mips.cc
|
| @@ -143,8 +143,8 @@ bool LCodeGen::GeneratePrologue() {
|
| // Sloppy mode functions and builtins need to replace the receiver with the
|
| // global proxy when called as functions (without an explicit receiver
|
| // object).
|
| - if (is_sloppy(info_->language_mode()) && info()->MayUseThis() &&
|
| - !info_->is_native()) {
|
| + if (is_sloppy(info()->language_mode()) && info()->MayUseThis() &&
|
| + !info()->is_native() && info()->scope()->has_this_declaration()) {
|
| Label ok;
|
| int receiver_offset = info_->scope()->num_parameters() * kPointerSize;
|
| __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
|
| @@ -217,8 +217,9 @@ bool LCodeGen::GeneratePrologue() {
|
| __ sw(v0, MemOperand(fp, StandardFrameConstants::kContextOffset));
|
| // Copy any necessary parameters into the context.
|
| int num_parameters = scope()->num_parameters();
|
| - for (int i = 0; i < num_parameters; i++) {
|
| - Variable* var = scope()->parameter(i);
|
| + int first_parameter = scope()->has_this_declaration() ? -1 : 0;
|
| + for (int i = first_parameter; i < num_parameters; i++) {
|
| + Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i);
|
| if (var->IsContextSlot()) {
|
| int parameter_offset = StandardFrameConstants::kCallerSPOffset +
|
| (num_parameters - 1 - i) * kPointerSize;
|
|
|