| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/flow_graph_builder.h" | 5 #include "vm/flow_graph_builder.h" |
| 6 | 6 |
| 7 #include "vm/ast_printer.h" | 7 #include "vm/ast_printer.h" |
| 8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
| 9 #include "vm/code_descriptors.h" | 9 #include "vm/code_descriptors.h" |
| 10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
| 11 #include "vm/flags.h" | 11 #include "vm/flags.h" |
| 12 #include "vm/il_printer.h" | 12 #include "vm/il_printer.h" |
| 13 #include "vm/intermediate_language.h" | 13 #include "vm/intermediate_language.h" |
| 14 #include "vm/longjump.h" | 14 #include "vm/longjump.h" |
| 15 #include "vm/object_store.h" | 15 #include "vm/object_store.h" |
| 16 #include "vm/os.h" | 16 #include "vm/os.h" |
| 17 #include "vm/parser.h" | 17 #include "vm/parser.h" |
| 18 #include "vm/resolver.h" | 18 #include "vm/resolver.h" |
| 19 #include "vm/stub_code.h" | 19 #include "vm/stub_code.h" |
| 20 | 20 |
| 21 namespace dart { | 21 namespace dart { |
| 22 | 22 |
| 23 DEFINE_FLAG(bool, eliminate_type_checks, true, | 23 DEFINE_FLAG(bool, eliminate_type_checks, true, |
| 24 "Eliminate type checks when allowed by static type analysis"); | 24 "Eliminate type checks when allowed by static type analysis"); |
| 25 DEFINE_FLAG(bool, print_ast, false, "Print abstract syntax tree."); | 25 DEFINE_FLAG(bool, print_ast, false, "Print abstract syntax tree."); |
| 26 DEFINE_FLAG(bool, print_flow_graph, false, "Print the IR flow graph."); | 26 DEFINE_FLAG(bool, print_flow_graph, false, "Print the IR flow graph."); |
| 27 #if defined(TARGET_ARCH_X64) |
| 28 DEFINE_FLAG(bool, use_ssa, true, "Use SSA form"); |
| 29 #else |
| 27 DEFINE_FLAG(bool, use_ssa, false, "Use SSA form"); | 30 DEFINE_FLAG(bool, use_ssa, false, "Use SSA form"); |
| 31 #endif |
| 28 DECLARE_FLAG(bool, enable_type_checks); | 32 DECLARE_FLAG(bool, enable_type_checks); |
| 29 | 33 |
| 30 | 34 |
| 31 FlowGraphBuilder::FlowGraphBuilder(const ParsedFunction& parsed_function) | 35 FlowGraphBuilder::FlowGraphBuilder(const ParsedFunction& parsed_function) |
| 32 : parsed_function_(parsed_function), | 36 : parsed_function_(parsed_function), |
| 33 preorder_block_entries_(), | 37 preorder_block_entries_(), |
| 34 postorder_block_entries_(), | 38 postorder_block_entries_(), |
| 35 context_level_(0), | 39 context_level_(0), |
| 36 last_used_try_index_(CatchClauseNode::kInvalidTryIndex), | 40 last_used_try_index_(CatchClauseNode::kInvalidTryIndex), |
| 37 try_index_(CatchClauseNode::kInvalidTryIndex), | 41 try_index_(CatchClauseNode::kInvalidTryIndex), |
| (...skipping 2729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2767 char* chars = reinterpret_cast<char*>( | 2771 char* chars = reinterpret_cast<char*>( |
| 2768 Isolate::Current()->current_zone()->Allocate(len)); | 2772 Isolate::Current()->current_zone()->Allocate(len)); |
| 2769 OS::SNPrint(chars, len, kFormat, function_name, reason); | 2773 OS::SNPrint(chars, len, kFormat, function_name, reason); |
| 2770 const Error& error = Error::Handle( | 2774 const Error& error = Error::Handle( |
| 2771 LanguageError::New(String::Handle(String::New(chars)))); | 2775 LanguageError::New(String::Handle(String::New(chars)))); |
| 2772 Isolate::Current()->long_jump_base()->Jump(1, error); | 2776 Isolate::Current()->long_jump_base()->Jump(1, error); |
| 2773 } | 2777 } |
| 2774 | 2778 |
| 2775 | 2779 |
| 2776 } // namespace dart | 2780 } // namespace dart |
| OLD | NEW |