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

Side by Side Diff: src/ast/ast-numbering.cc

Issue 2556663002: [compiler] Improve let+const decision in AstNumbering. (Closed)
Patch Set: Add comment. Created 4 years 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 | « no previous file | test/mjsunit/regress/regress-v8-5666.js » ('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/ast/ast-numbering.h" 5 #include "src/ast/ast-numbering.h"
6 6
7 #include "src/ast/ast.h" 7 #include "src/ast/ast.h"
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 case VariableLocation::LOOKUP: 154 case VariableLocation::LOOKUP:
155 DisableFullCodegenAndCrankshaft( 155 DisableFullCodegenAndCrankshaft(
156 kReferenceToAVariableWhichRequiresDynamicLookup); 156 kReferenceToAVariableWhichRequiresDynamicLookup);
157 break; 157 break;
158 case VariableLocation::MODULE: 158 case VariableLocation::MODULE:
159 DisableFullCodegenAndCrankshaft(kReferenceToModuleVariable); 159 DisableFullCodegenAndCrankshaft(kReferenceToModuleVariable);
160 break; 160 break;
161 default: 161 default:
162 break; 162 break;
163 } 163 }
164 if (IsLexicalVariableMode(node->var()->mode())) { 164 if (node->var()->binding_needs_init()) {
165 // Disable FCG+CS for all variable bindings that need explicit
166 // initialization, i.e. ES2015 stylt const and let, but not
Yang 2016/12/06 05:48:14 Is 'stylt' a typo?
167 // named function expressions.
165 DisableFullCodegenAndCrankshaft(kReferenceToLetOrConstVariable); 168 DisableFullCodegenAndCrankshaft(kReferenceToLetOrConstVariable);
166 } 169 }
167 node->set_base_id(ReserveIdRange(VariableProxy::num_ids())); 170 node->set_base_id(ReserveIdRange(VariableProxy::num_ids()));
168 } 171 }
169 172
170 173
171 void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node) { 174 void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node) {
172 VisitVariableProxyReference(node); 175 VisitVariableProxyReference(node);
173 ReserveFeedbackSlots(node); 176 ReserveFeedbackSlots(node);
174 } 177 }
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
639 } 642 }
640 643
641 644
642 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, 645 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone,
643 FunctionLiteral* function) { 646 FunctionLiteral* function) {
644 AstNumberingVisitor visitor(isolate, zone); 647 AstNumberingVisitor visitor(isolate, zone);
645 return visitor.Renumber(function); 648 return visitor.Renumber(function);
646 } 649 }
647 } // namespace internal 650 } // namespace internal
648 } // namespace v8 651 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-v8-5666.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698