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

Side by Side Diff: src/full-codegen/full-codegen.cc

Issue 2176653003: Wrap ClassLiterals in DoExpressions instead of giving them BlockScopes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/full-codegen/full-codegen.h" 5 #include "src/full-codegen/full-codegen.h"
6 6
7 #include "src/ast/ast-numbering.h" 7 #include "src/ast/ast-numbering.h"
8 #include "src/ast/ast.h" 8 #include "src/ast/ast.h"
9 #include "src/ast/prettyprinter.h" 9 #include "src/ast/prettyprinter.h"
10 #include "src/ast/scopeinfo.h" 10 #include "src/ast/scopeinfo.h"
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after
1439 SetStackOverflow(); 1439 SetStackOverflow();
1440 return; 1440 return;
1441 } 1441 }
1442 EmitNewClosure(function_info, expr->pretenure()); 1442 EmitNewClosure(function_info, expr->pretenure());
1443 } 1443 }
1444 1444
1445 1445
1446 void FullCodeGenerator::VisitClassLiteral(ClassLiteral* lit) { 1446 void FullCodeGenerator::VisitClassLiteral(ClassLiteral* lit) {
1447 Comment cmnt(masm_, "[ ClassLiteral"); 1447 Comment cmnt(masm_, "[ ClassLiteral");
1448 1448
1449 { 1449 {
Michael Starzinger 2016/07/25 14:49:54 nit: This block looks like it was only introduced
bakkot 2016/07/25 18:52:04 Done.
1450 NestedClassLiteral nested_class_literal(this, lit);
1451 EnterBlockScopeIfNeeded block_scope_state(
1452 this, lit->scope(), lit->EntryId(), lit->DeclsId(), lit->ExitId());
1453
1454 if (lit->extends() != NULL) { 1450 if (lit->extends() != NULL) {
1455 VisitForStackValue(lit->extends()); 1451 VisitForStackValue(lit->extends());
1456 } else { 1452 } else {
1457 PushOperand(isolate()->factory()->the_hole_value()); 1453 PushOperand(isolate()->factory()->the_hole_value());
1458 } 1454 }
1459 1455
1460 VisitForStackValue(lit->constructor()); 1456 VisitForStackValue(lit->constructor());
1461 1457
1462 PushOperand(Smi::FromInt(lit->start_position())); 1458 PushOperand(Smi::FromInt(lit->start_position()));
1463 PushOperand(Smi::FromInt(lit->end_position())); 1459 PushOperand(Smi::FromInt(lit->end_position()));
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
1937 return var->scope()->is_nonlinear() || 1933 return var->scope()->is_nonlinear() ||
1938 var->initializer_position() >= proxy->position(); 1934 var->initializer_position() >= proxy->position();
1939 } 1935 }
1940 1936
1941 1937
1942 #undef __ 1938 #undef __
1943 1939
1944 1940
1945 } // namespace internal 1941 } // namespace internal
1946 } // namespace v8 1942 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698