| 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 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 case VariableLocation::LOOKUP: | 159 case VariableLocation::LOOKUP: |
| 160 DisableFullCodegenAndCrankshaft( | 160 DisableFullCodegenAndCrankshaft( |
| 161 kReferenceToAVariableWhichRequiresDynamicLookup); | 161 kReferenceToAVariableWhichRequiresDynamicLookup); |
| 162 break; | 162 break; |
| 163 case VariableLocation::MODULE: | 163 case VariableLocation::MODULE: |
| 164 DisableFullCodegenAndCrankshaft(kReferenceToModuleVariable); | 164 DisableFullCodegenAndCrankshaft(kReferenceToModuleVariable); |
| 165 break; | 165 break; |
| 166 default: | 166 default: |
| 167 break; | 167 break; |
| 168 } | 168 } |
| 169 if (node->var()->binding_needs_init()) { | |
| 170 // Disable FCG+CS for all variable bindings that need explicit | |
| 171 // initialization, i.e. ES2015 style const and let, but not | |
| 172 // named function expressions. | |
| 173 DisableFullCodegenAndCrankshaft(kReferenceToLetOrConstVariable); | |
| 174 } | |
| 175 node->set_base_id(ReserveIdRange(VariableProxy::num_ids())); | 169 node->set_base_id(ReserveIdRange(VariableProxy::num_ids())); |
| 176 } | 170 } |
| 177 | 171 |
| 178 | 172 |
| 179 void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node) { | 173 void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node) { |
| 180 VisitVariableProxyReference(node); | 174 VisitVariableProxyReference(node); |
| 181 ReserveFeedbackSlots(node); | 175 ReserveFeedbackSlots(node); |
| 182 } | 176 } |
| 183 | 177 |
| 184 | 178 |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 Compiler::EagerInnerFunctionLiterals* eager_literals) { | 657 Compiler::EagerInnerFunctionLiterals* eager_literals) { |
| 664 DisallowHeapAllocation no_allocation; | 658 DisallowHeapAllocation no_allocation; |
| 665 DisallowHandleAllocation no_handles; | 659 DisallowHandleAllocation no_handles; |
| 666 DisallowHandleDereference no_deref; | 660 DisallowHandleDereference no_deref; |
| 667 | 661 |
| 668 AstNumberingVisitor visitor(stack_limit, zone, eager_literals); | 662 AstNumberingVisitor visitor(stack_limit, zone, eager_literals); |
| 669 return visitor.Renumber(function); | 663 return visitor.Renumber(function); |
| 670 } | 664 } |
| 671 } // namespace internal | 665 } // namespace internal |
| 672 } // namespace v8 | 666 } // namespace v8 |
| OLD | NEW |