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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 | 141 |
142 void AstNumberingVisitor::VisitRegExpLiteral(RegExpLiteral* node) { | 142 void AstNumberingVisitor::VisitRegExpLiteral(RegExpLiteral* node) { |
143 IncrementNodeCount(); | 143 IncrementNodeCount(); |
144 node->set_base_id(ReserveIdRange(RegExpLiteral::num_ids())); | 144 node->set_base_id(ReserveIdRange(RegExpLiteral::num_ids())); |
145 } | 145 } |
146 | 146 |
147 | 147 |
148 void AstNumberingVisitor::VisitVariableProxyReference(VariableProxy* node) { | 148 void AstNumberingVisitor::VisitVariableProxyReference(VariableProxy* node) { |
149 IncrementNodeCount(); | 149 IncrementNodeCount(); |
150 if (node->var()->IsLookupSlot()) { | 150 switch (node->var()->location()) { |
151 DisableCrankshaft(kReferenceToAVariableWhichRequiresDynamicLookup); | 151 case VariableLocation::LOOKUP: |
| 152 DisableCrankshaft(kReferenceToAVariableWhichRequiresDynamicLookup); |
| 153 break; |
| 154 case VariableLocation::MODULE: |
| 155 DisableCrankshaft(kReferenceToModuleVariable); |
| 156 break; |
| 157 default: |
| 158 break; |
152 } | 159 } |
153 node->set_base_id(ReserveIdRange(VariableProxy::num_ids())); | 160 node->set_base_id(ReserveIdRange(VariableProxy::num_ids())); |
154 } | 161 } |
155 | 162 |
156 | 163 |
157 void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node) { | 164 void AstNumberingVisitor::VisitVariableProxy(VariableProxy* node) { |
158 VisitVariableProxyReference(node); | 165 VisitVariableProxyReference(node); |
159 ReserveFeedbackSlots(node); | 166 ReserveFeedbackSlots(node); |
160 } | 167 } |
161 | 168 |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 } | 616 } |
610 | 617 |
611 | 618 |
612 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, | 619 bool AstNumbering::Renumber(Isolate* isolate, Zone* zone, |
613 FunctionLiteral* function) { | 620 FunctionLiteral* function) { |
614 AstNumberingVisitor visitor(isolate, zone); | 621 AstNumberingVisitor visitor(isolate, zone); |
615 return visitor.Renumber(function); | 622 return visitor.Renumber(function); |
616 } | 623 } |
617 } // namespace internal | 624 } // namespace internal |
618 } // namespace v8 | 625 } // namespace v8 |
OLD | NEW |