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

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

Issue 1418433002: Always give class literals a block scope (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix vector stores 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 1312 matching lines...) Expand 10 before | Expand all | Expand 10 after
1323 VisitForStackValue(lit->constructor()); 1323 VisitForStackValue(lit->constructor());
1324 1324
1325 __ Push(Smi::FromInt(lit->start_position())); 1325 __ Push(Smi::FromInt(lit->start_position()));
1326 __ Push(Smi::FromInt(lit->end_position())); 1326 __ Push(Smi::FromInt(lit->end_position()));
1327 1327
1328 __ CallRuntime(Runtime::kDefineClass, 5); 1328 __ CallRuntime(Runtime::kDefineClass, 5);
1329 PrepareForBailoutForId(lit->CreateLiteralId(), TOS_REG); 1329 PrepareForBailoutForId(lit->CreateLiteralId(), TOS_REG);
1330 1330
1331 EmitClassDefineProperties(lit); 1331 EmitClassDefineProperties(lit);
1332 1332
1333 if (lit->scope() != NULL) { 1333 if (lit->class_variable_proxy() != nullptr) {
1334 DCHECK_NOT_NULL(lit->class_variable_proxy());
1335 EmitVariableAssignment(lit->class_variable_proxy()->var(), 1334 EmitVariableAssignment(lit->class_variable_proxy()->var(),
1336 Token::INIT_CONST, lit->ProxySlot()); 1335 Token::INIT_CONST, lit->ProxySlot());
1337 } 1336 }
1338 } 1337 }
1339 1338
1340 context()->Plug(result_register()); 1339 context()->Plug(result_register());
1341 } 1340 }
1342 1341
1343 1342
1344 void FullCodeGenerator::VisitNativeFunctionLiteral( 1343 void FullCodeGenerator::VisitNativeFunctionLiteral(
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
1665 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() || 1664 return var->mode() == CONST_LEGACY || var->scope()->is_nonlinear() ||
1666 var->initializer_position() >= proxy->position(); 1665 var->initializer_position() >= proxy->position();
1667 } 1666 }
1668 1667
1669 1668
1670 #undef __ 1669 #undef __
1671 1670
1672 1671
1673 } // namespace internal 1672 } // namespace internal
1674 } // namespace v8 1673 } // 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