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

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

Issue 1413903002: Always give class literals a block scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: TurboFan cleanup Created 5 years, 2 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
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/parser.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.h" 7 #include "src/ast.h"
8 #include "src/ast-numbering.h" 8 #include "src/ast-numbering.h"
9 #include "src/code-factory.h" 9 #include "src/code-factory.h"
10 #include "src/codegen.h" 10 #include "src/codegen.h"
(...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after
1266 VisitForStackValue(lit->constructor()); 1266 VisitForStackValue(lit->constructor());
1267 1267
1268 __ Push(Smi::FromInt(lit->start_position())); 1268 __ Push(Smi::FromInt(lit->start_position()));
1269 __ Push(Smi::FromInt(lit->end_position())); 1269 __ Push(Smi::FromInt(lit->end_position()));
1270 1270
1271 __ CallRuntime(Runtime::kDefineClass, 5); 1271 __ CallRuntime(Runtime::kDefineClass, 5);
1272 PrepareForBailoutForId(lit->CreateLiteralId(), TOS_REG); 1272 PrepareForBailoutForId(lit->CreateLiteralId(), TOS_REG);
1273 1273
1274 EmitClassDefineProperties(lit); 1274 EmitClassDefineProperties(lit);
1275 1275
1276 if (lit->scope() != NULL) { 1276 if (lit->class_variable_proxy() != nullptr) {
1277 DCHECK_NOT_NULL(lit->class_variable_proxy());
1278 EmitVariableAssignment(lit->class_variable_proxy()->var(), 1277 EmitVariableAssignment(lit->class_variable_proxy()->var(),
1279 Token::INIT_CONST, lit->ProxySlot()); 1278 Token::INIT_CONST, lit->ProxySlot());
1280 } 1279 }
1281 } 1280 }
1282 1281
1283 context()->Plug(result_register()); 1282 context()->Plug(result_register());
1284 } 1283 }
1285 1284
1286 1285
1287 void FullCodeGenerator::VisitNativeFunctionLiteral( 1286 void FullCodeGenerator::VisitNativeFunctionLiteral(
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
1608 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || 1607 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() ||
1609 var->initializer_position() >= proxy->position(); 1608 var->initializer_position() >= proxy->position();
1610 } 1609 }
1611 1610
1612 1611
1613 #undef __ 1612 #undef __
1614 1613
1615 1614
1616 } // namespace internal 1615 } // namespace internal
1617 } // namespace v8 1616 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/ast-graph-builder.cc ('k') | src/parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698