Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: src/arm64/full-codegen-arm64.cc

Issue 918603004: new classes: implement correct check for uninitialized this in 'super()' (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/arm64/full-codegen-arm64.cc
diff --git a/src/arm64/full-codegen-arm64.cc b/src/arm64/full-codegen-arm64.cc
index c1615c985c5e382dd844b3f1eb5b5139dc8e7bbd..169c3040d3638c6120af49af7caa49b1e066c22e 100644
--- a/src/arm64/full-codegen-arm64.cc
+++ b/src/arm64/full-codegen-arm64.cc
@@ -2960,16 +2960,6 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
EmitLoadSuperConstructor();
__ 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();
@@ -3005,6 +2995,15 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
RecordJSReturnSite(expr);
+ Variable* this_var = super_ref->this_var()->var();
+ GetVar(x1, this_var);
+ Label uninitialized_this;
+ __ JumpIfRoot(x1, Heap::kTheHoleValueRootIndex, &uninitialized_this);
+ __ Mov(x0, Operand(this_var->name()));
+ __ Push(x0);
+ __ CallRuntime(Runtime::kThrowReferenceError, 1);
+ __ bind(&uninitialized_this);
+
EmitVariableAssignment(this_var, Token::INIT_CONST);
context()->Plug(x0);
}

Powered by Google App Engine
This is Rietveld 408576698