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

Unified Diff: src/ia32/full-codegen-ia32.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
« no previous file with comments | « src/arm64/full-codegen-arm64.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/full-codegen-ia32.cc
diff --git a/src/ia32/full-codegen-ia32.cc b/src/ia32/full-codegen-ia32.cc
index 4b603ddabc20ab10de126c4f04bbfcac3943e086..61795cf356e68b5d9c0f863bf4f2f273f892323d 100644
--- a/src/ia32/full-codegen-ia32.cc
+++ b/src/ia32/full-codegen-ia32.cc
@@ -3150,15 +3150,6 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
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();
@@ -3194,6 +3185,16 @@ void FullCodeGenerator::EmitSuperConstructorCall(Call* expr) {
RecordJSReturnSite(expr);
+ 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);
+
+
arv (Not doing code reviews) 2015/02/11 19:36:24 remove one empty line
Dmitry Lomov (no reviews) 2015/02/11 19:55:56 Done.
EmitVariableAssignment(this_var, Token::INIT_CONST);
context()->Plug(eax);
}
« no previous file with comments | « src/arm64/full-codegen-arm64.cc ('k') | src/x64/full-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698