| 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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 | 687 |
| 688 LanguageModeScope language_mode_scope(this, node->language_mode()); | 688 LanguageModeScope language_mode_scope(this, node->language_mode()); |
| 689 | 689 |
| 690 VisitDeclarations(scope->declarations()); | 690 VisitDeclarations(scope->declarations()); |
| 691 VisitStatements(node->body()); | 691 VisitStatements(node->body()); |
| 692 | 692 |
| 693 node->set_ast_properties(&properties_); | 693 node->set_ast_properties(&properties_); |
| 694 node->set_dont_optimize_reason(dont_optimize_reason()); | 694 node->set_dont_optimize_reason(dont_optimize_reason()); |
| 695 node->set_yield_count(yield_count_); | 695 node->set_yield_count(yield_count_); |
| 696 | 696 |
| 697 if (FLAG_trace_opt) { | 697 if (FLAG_trace_opt && !FLAG_turbo) { |
| 698 if (disable_crankshaft_reason_ != kNoReason) { | 698 if (disable_crankshaft_reason_ != kNoReason) { |
| 699 // TODO(leszeks): This is a quick'n'dirty fix to allow the debug name of | 699 // TODO(leszeks): This is a quick'n'dirty fix to allow the debug name of |
| 700 // the function to be accessed in the below print. This DCHECK will fail | 700 // the function to be accessed in the below print. This DCHECK will fail |
| 701 // if we move ast numbering off the main thread, but that won't be before | 701 // if we move ast numbering off the main thread, but that won't be before |
| 702 // we remove FCG, in which case this entire check isn't necessary anyway. | 702 // we remove FCG, in which case this entire check isn't necessary anyway. |
| 703 AllowHandleDereference allow_deref; | 703 AllowHandleDereference allow_deref; |
| 704 DCHECK(!node->debug_name().is_null()); | 704 DCHECK(!node->debug_name().is_null()); |
| 705 | 705 |
| 706 PrintF("[enforcing Ignition and TurboFan for %s because: %s\n", | 706 PrintF("[enforcing Ignition and TurboFan for %s because: %s\n", |
| 707 node->debug_name()->ToCString().get(), | 707 node->debug_name()->ToCString().get(), |
| 708 GetBailoutReason(disable_crankshaft_reason_)); | 708 GetBailoutReason(disable_crankshaft_reason_)); |
| 709 } | 709 } |
| 710 } | 710 } |
| 711 | 711 |
| 712 return !HasStackOverflow(); | 712 return !HasStackOverflow(); |
| 713 } | 713 } |
| 714 | 714 |
| 715 bool AstNumbering::Renumber( | 715 bool AstNumbering::Renumber( |
| 716 uintptr_t stack_limit, Zone* zone, FunctionLiteral* function, | 716 uintptr_t stack_limit, Zone* zone, FunctionLiteral* function, |
| 717 Compiler::EagerInnerFunctionLiterals* eager_literals) { | 717 Compiler::EagerInnerFunctionLiterals* eager_literals) { |
| 718 DisallowHeapAllocation no_allocation; | 718 DisallowHeapAllocation no_allocation; |
| 719 DisallowHandleAllocation no_handles; | 719 DisallowHandleAllocation no_handles; |
| 720 DisallowHandleDereference no_deref; | 720 DisallowHandleDereference no_deref; |
| 721 | 721 |
| 722 AstNumberingVisitor visitor(stack_limit, zone, eager_literals); | 722 AstNumberingVisitor visitor(stack_limit, zone, eager_literals); |
| 723 return visitor.Renumber(function); | 723 return visitor.Renumber(function); |
| 724 } | 724 } |
| 725 } // namespace internal | 725 } // namespace internal |
| 726 } // namespace v8 | 726 } // namespace v8 |
| OLD | NEW |