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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
642 | 642 |
643 VisitDeclarations(scope->declarations()); | 643 VisitDeclarations(scope->declarations()); |
644 VisitStatements(node->body()); | 644 VisitStatements(node->body()); |
645 | 645 |
646 node->set_ast_properties(&properties_); | 646 node->set_ast_properties(&properties_); |
647 node->set_dont_optimize_reason(dont_optimize_reason()); | 647 node->set_dont_optimize_reason(dont_optimize_reason()); |
648 node->set_yield_count(yield_count_); | 648 node->set_yield_count(yield_count_); |
649 | 649 |
650 if (FLAG_trace_opt) { | 650 if (FLAG_trace_opt) { |
651 if (disable_crankshaft_reason_ != kNoReason) { | 651 if (disable_crankshaft_reason_ != kNoReason) { |
| 652 // TODO(leszeks): This is a quick'n'dirty fix to allow the debug name of |
| 653 // the function to be accessed in the below print. This DCHECK will fail |
| 654 // if we move ast numbering off the main thread, but that won't be before |
| 655 // we remove FCG, in which case this entire check isn't necessary anyway. |
| 656 AllowHandleDereference allow_deref; |
| 657 DCHECK(!node->debug_name().is_null()); |
| 658 |
652 PrintF("[enforcing Ignition and TurboFan for %s because: %s\n", | 659 PrintF("[enforcing Ignition and TurboFan for %s because: %s\n", |
653 node->debug_name()->ToCString().get(), | 660 node->debug_name()->ToCString().get(), |
654 GetBailoutReason(disable_crankshaft_reason_)); | 661 GetBailoutReason(disable_crankshaft_reason_)); |
655 } | 662 } |
656 } | 663 } |
657 | 664 |
658 return !HasStackOverflow(); | 665 return !HasStackOverflow(); |
659 } | 666 } |
660 | 667 |
661 bool AstNumbering::Renumber( | 668 bool AstNumbering::Renumber( |
662 uintptr_t stack_limit, Zone* zone, FunctionLiteral* function, | 669 uintptr_t stack_limit, Zone* zone, FunctionLiteral* function, |
663 Compiler::EagerInnerFunctionLiterals* eager_literals) { | 670 Compiler::EagerInnerFunctionLiterals* eager_literals) { |
664 DisallowHeapAllocation no_allocation; | 671 DisallowHeapAllocation no_allocation; |
665 DisallowHandleAllocation no_handles; | 672 DisallowHandleAllocation no_handles; |
666 DisallowHandleDereference no_deref; | 673 DisallowHandleDereference no_deref; |
667 | 674 |
668 AstNumberingVisitor visitor(stack_limit, zone, eager_literals); | 675 AstNumberingVisitor visitor(stack_limit, zone, eager_literals); |
669 return visitor.Renumber(function); | 676 return visitor.Renumber(function); |
670 } | 677 } |
671 } // namespace internal | 678 } // namespace internal |
672 } // namespace v8 | 679 } // namespace v8 |
OLD | NEW |