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 216 matching lines...) Loading... |
227 | 227 |
228 void AstNumberingVisitor::VisitExpressionStatement(ExpressionStatement* node) { | 228 void AstNumberingVisitor::VisitExpressionStatement(ExpressionStatement* node) { |
229 IncrementNodeCount(); | 229 IncrementNodeCount(); |
230 Visit(node->expression()); | 230 Visit(node->expression()); |
231 } | 231 } |
232 | 232 |
233 | 233 |
234 void AstNumberingVisitor::VisitReturnStatement(ReturnStatement* node) { | 234 void AstNumberingVisitor::VisitReturnStatement(ReturnStatement* node) { |
235 IncrementNodeCount(); | 235 IncrementNodeCount(); |
236 Visit(node->expression()); | 236 Visit(node->expression()); |
| 237 |
| 238 DCHECK(!node->is_async_return() || |
| 239 properties_.flags() & AstProperties::kMustUseIgnitionTurbo); |
237 } | 240 } |
238 | 241 |
239 | 242 |
240 void AstNumberingVisitor::VisitYield(Yield* node) { | 243 void AstNumberingVisitor::VisitYield(Yield* node) { |
241 node->set_yield_id(yield_count_); | 244 node->set_yield_id(yield_count_); |
242 yield_count_++; | 245 yield_count_++; |
243 IncrementNodeCount(); | 246 IncrementNodeCount(); |
244 node->set_base_id(ReserveIdRange(Yield::num_ids())); | 247 node->set_base_id(ReserveIdRange(Yield::num_ids())); |
245 Visit(node->generator_object()); | 248 Visit(node->generator_object()); |
246 Visit(node->expression()); | 249 Visit(node->expression()); |
(...skipping 465 matching lines...) Loading... |
712 Compiler::EagerInnerFunctionLiterals* eager_literals) { | 715 Compiler::EagerInnerFunctionLiterals* eager_literals) { |
713 DisallowHeapAllocation no_allocation; | 716 DisallowHeapAllocation no_allocation; |
714 DisallowHandleAllocation no_handles; | 717 DisallowHandleAllocation no_handles; |
715 DisallowHandleDereference no_deref; | 718 DisallowHandleDereference no_deref; |
716 | 719 |
717 AstNumberingVisitor visitor(stack_limit, zone, eager_literals); | 720 AstNumberingVisitor visitor(stack_limit, zone, eager_literals); |
718 return visitor.Renumber(function); | 721 return visitor.Renumber(function); |
719 } | 722 } |
720 } // namespace internal | 723 } // namespace internal |
721 } // namespace v8 | 724 } // namespace v8 |
OLD | NEW |