Index: src/mips/full-codegen-mips.cc |
diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc |
index cb3a059f13fbecc246481a18ee19c8a58a3f3604..ceffb40dd50dc029a27a96a06c9e3fe145f20b95 100644 |
--- a/src/mips/full-codegen-mips.cc |
+++ b/src/mips/full-codegen-mips.cc |
@@ -135,7 +135,7 @@ void FullCodeGenerator::Generate() { |
// global proxy when called as functions (without an explicit receiver |
// object). |
if (is_sloppy(info->language_mode()) && !info->is_native() && |
- info->MayUseThis() && info->scope()->has_this_declaration()) { |
+ info->MayUseThis()) { |
Label ok; |
int receiver_offset = info->scope()->num_parameters() * kPointerSize; |
__ lw(at, MemOperand(sp, receiver_offset)); |
@@ -225,9 +225,8 @@ void FullCodeGenerator::Generate() { |
__ sw(v0, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
// Copy any necessary parameters into the context. |
int num_parameters = info->scope()->num_parameters(); |
- int first_parameter = info->scope()->has_this_declaration() ? -1 : 0; |
- for (int i = first_parameter; i < num_parameters; i++) { |
- Variable* var = (i == -1) ? scope()->receiver() : scope()->parameter(i); |
+ for (int i = 0; i < num_parameters; i++) { |
+ Variable* var = scope()->parameter(i); |
if (var->IsContextSlot()) { |
int parameter_offset = StandardFrameConstants::kCallerSPOffset + |
(num_parameters - 1 - i) * kPointerSize; |
@@ -3039,9 +3038,8 @@ void FullCodeGenerator::EmitResolvePossiblyDirectEval(int arg_count) { |
__ lw(t2, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
// t1: the receiver of the enclosing function. |
- Variable* this_var = scope()->LookupThis(); |
- DCHECK_NOT_NULL(this_var); |
- __ lw(t1, VarOperand(this_var, t1)); |
+ int receiver_offset = 2 + info_->scope()->num_parameters(); |
+ __ lw(t1, MemOperand(fp, receiver_offset * kPointerSize)); |
// t0: the language mode. |
__ li(t0, Operand(Smi::FromInt(language_mode()))); |