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

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

Issue 913383002: X87: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x87/full-codegen-x87.cc
diff --git a/src/x87/full-codegen-x87.cc b/src/x87/full-codegen-x87.cc
index b45f20dcd7b6153b18e41716dc37045bb219a9fd..ff009fd0a38339d7677c68fac4a765afa5df7a8b 100644
--- a/src/x87/full-codegen-x87.cc
+++ b/src/x87/full-codegen-x87.cc
@@ -3133,19 +3133,9 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
GetVar(eax, new_target_var);
__ push(eax);
- SuperReference* super_ref = expr->expression()->AsSuperReference();
EmitLoadSuperConstructor();
__ push(result_register());
- Variable* this_var = super_ref->this_var()->var();
- GetVar(eax, this_var);
- __ cmp(eax, isolate()->factory()->the_hole_value());
- Label uninitialized_this;
- __ j(equal, &uninitialized_this);
- __ push(Immediate(this_var->name()));
- __ 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();
@@ -3181,6 +3171,16 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
RecordJSReturnSite(expr);
+ SuperReference* super_ref = expr->expression()->AsSuperReference();
+ Variable* this_var = super_ref->this_var()->var();
+ GetVar(ecx, this_var);
+ __ cmp(ecx, isolate()->factory()->the_hole_value());
+ Label uninitialized_this;
+ __ j(equal, &uninitialized_this);
+ __ push(Immediate(this_var->name()));
+ __ CallRuntime(Runtime::kThrowReferenceError, 1);
+ __ bind(&uninitialized_this);
+
EmitVariableAssignment(this_var, Token::INIT_CONST);
context()->Plug(eax);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698