Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |