| Index: src/mips/full-codegen-mips.cc
|
| diff --git a/src/mips/full-codegen-mips.cc b/src/mips/full-codegen-mips.cc
|
| index 6488db9ec3fb8ec0a5cbccd151b52568408dae93..914fdfbfed3cf47893100202a37fc70dfdf5ee49 100644
|
| --- a/src/mips/full-codegen-mips.cc
|
| +++ b/src/mips/full-codegen-mips.cc
|
| @@ -1521,6 +1521,10 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) {
|
| bool skip_init_check;
|
| if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) {
|
| skip_init_check = false;
|
| + } else if (var->is_this()) {
|
| + CHECK((info_->shared_info()->kind() & kSubclassConstructor) != 0);
|
| + // TODO(dslomov): implement 'this' hole check elimination.
|
| + skip_init_check = false;
|
| } else {
|
| // Check that we always have valid source position.
|
| DCHECK(var->initializer_position() != RelocInfo::kNoPosition);
|
| @@ -3222,6 +3226,17 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
|
| EmitLoadSuperConstructor(super_ref);
|
| __ push(result_register());
|
|
|
| + Variable* this_var = super_ref->this_var()->var();
|
| +
|
| + GetVar(a0, this_var);
|
| + __ LoadRoot(at, Heap::kTheHoleValueRootIndex);
|
| + Label uninitialized_this;
|
| + __ Branch(&uninitialized_this, eq, a0, Operand(at));
|
| + __ li(a0, Operand(this_var->name()));
|
| + __ Push(a0);
|
| + __ CallRuntime(Runtime::kThrowReferenceError, 1);
|
| + __ bind(&uninitialized_this);
|
| +
|
| // Push the arguments ("left-to-right") on the stack.
|
| ZoneList<Expression*>* args = expr->arguments();
|
| int arg_count = args->length();
|
| @@ -3256,8 +3271,7 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
|
|
|
| RecordJSReturnSite(expr);
|
|
|
| - // TODO(dslomov): implement TDZ for `this`.
|
| - EmitVariableAssignment(super_ref->this_var()->var(), Token::ASSIGN);
|
| + EmitVariableAssignment(this_var, Token::INIT_CONST);
|
| context()->Plug(v0);
|
| }
|
|
|
|
|