| Index: src/arm/full-codegen-arm.cc
|
| diff --git a/src/arm/full-codegen-arm.cc b/src/arm/full-codegen-arm.cc
|
| index e5b25e3eaa1c40d762684491aa36c8866ff281d7..264124e687205c6a20b5e70f10e28d50aaa0e9a9 100644
|
| --- a/src/arm/full-codegen-arm.cc
|
| +++ b/src/arm/full-codegen-arm.cc
|
| @@ -1537,6 +1537,9 @@ void FullCodeGenerator::EmitVariableLoad(VariableProxy* proxy) {
|
| bool skip_init_check;
|
| if (var->scope()->DeclarationScope() != scope()->DeclarationScope()) {
|
| skip_init_check = false;
|
| + } else if (var->is_this()) {
|
| + // 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);
|
| @@ -3254,6 +3257,17 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
|
| EmitLoadSuperConstructor(super_ref);
|
| __ push(result_register());
|
|
|
| + Variable* this_var = super_ref->this_var()->var();
|
| +
|
| + GetVar(r0, this_var);
|
| + __ CompareRoot(r0, Heap::kTheHoleValueRootIndex);
|
| + Label uninitialized_this;
|
| + __ b(eq, &uninitialized_this);
|
| + __ mov(r0, Operand(this_var->name()));
|
| + __ Push(r0);
|
| + __ 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();
|
| @@ -3288,8 +3302,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(r0);
|
| }
|
|
|
|
|