| Index: src/arm64/full-codegen-arm64.cc
|
| diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc
|
| index 72bd507c9aa5cc739e59e7abdafd8b8083fea30b..3a4733634175f8c954d072693cbcd2fcd019539c 100644
|
| --- a/src/arm64/full-codegen-arm64.cc
|
| +++ b/src/arm64/full-codegen-arm64.cc
|
| @@ -1517,6 +1517,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);
|
| @@ -2943,6 +2946,16 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
|
| EmitLoadSuperConstructor(super_ref);
|
| __ push(result_register());
|
|
|
| + Variable* this_var = super_ref->this_var()->var();
|
| +
|
| + GetVar(x0, this_var);
|
| + Label uninitialized_this;
|
| + __ JumpIfRoot(x0, Heap::kTheHoleValueRootIndex, &uninitialized_this);
|
| + __ Mov(x0, Operand(this_var->name()));
|
| + __ Push(x0);
|
| + __ 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();
|
| @@ -2977,8 +2990,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(x0);
|
| }
|
|
|
|
|