| 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/globals.h" // Needed here to get TARGET_ARCH_XXX. | 5 #include "vm/globals.h" // Needed here to get TARGET_ARCH_XXX. |
| 6 | 6 |
| 7 #include "vm/flow_graph_compiler.h" | 7 #include "vm/flow_graph_compiler.h" |
| 8 | 8 |
| 9 #include "vm/debugger.h" | 9 #include "vm/debugger.h" |
| 10 #include "vm/il_printer.h" | 10 #include "vm/il_printer.h" |
| 11 #include "vm/intrinsifier.h" | 11 #include "vm/intrinsifier.h" |
| 12 #include "vm/longjump.h" | 12 #include "vm/longjump.h" |
| 13 #include "vm/object_store.h" |
| 13 #include "vm/parser.h" | 14 #include "vm/parser.h" |
| 14 #include "vm/stub_code.h" | 15 #include "vm/stub_code.h" |
| 15 | 16 |
| 16 namespace dart { | 17 namespace dart { |
| 17 | 18 |
| 18 DECLARE_FLAG(bool, code_comments); | 19 DECLARE_FLAG(bool, code_comments); |
| 19 DECLARE_FLAG(bool, enable_type_checks); | 20 DECLARE_FLAG(bool, enable_type_checks); |
| 20 DECLARE_FLAG(bool, intrinsify); | 21 DECLARE_FLAG(bool, intrinsify); |
| 21 DECLARE_FLAG(bool, report_usage_count); | 22 DECLARE_FLAG(bool, report_usage_count); |
| 22 DECLARE_FLAG(bool, trace_functions); | 23 DECLARE_FLAG(bool, trace_functions); |
| 23 DECLARE_FLAG(int, optimization_counter_threshold); | 24 DECLARE_FLAG(int, optimization_counter_threshold); |
| 24 | 25 |
| 25 | 26 |
| 26 FlowGraphCompiler::FlowGraphCompiler( | 27 FlowGraphCompiler::FlowGraphCompiler( |
| 27 Assembler* assembler, | 28 Assembler* assembler, |
| 28 const ParsedFunction& parsed_function, | 29 const ParsedFunction& parsed_function, |
| 29 const GrowableArray<BlockEntryInstr*>& block_order, | 30 const GrowableArray<BlockEntryInstr*>& block_order, |
| 30 bool is_optimizing) | 31 bool is_optimizing) |
| 31 : assembler_(assembler), | 32 : assembler_(assembler), |
| 32 parsed_function_(parsed_function), | 33 parsed_function_(parsed_function), |
| 33 block_order_(block_order), | 34 block_order_(block_order), |
| 34 current_block_(NULL), | 35 current_block_(NULL), |
| 35 exception_handlers_list_(NULL), | 36 exception_handlers_list_(NULL), |
| 36 pc_descriptors_list_(NULL), | 37 pc_descriptors_list_(NULL), |
| 37 stackmap_builder_(NULL), | 38 stackmap_builder_(NULL), |
| 38 block_info_(block_order.length()), | 39 block_info_(block_order.length()), |
| 39 deopt_stubs_(), | 40 deopt_stubs_(), |
| 40 is_optimizing_(is_optimizing), | 41 is_optimizing_(is_optimizing), |
| 41 bool_true_(Bool::ZoneHandle(Bool::True())), | 42 bool_true_(Bool::ZoneHandle(Bool::True())), |
| 42 bool_false_(Bool::ZoneHandle(Bool::False())) { | 43 bool_false_(Bool::ZoneHandle(Bool::False())), |
| 44 double_class_(Class::ZoneHandle( |
| 45 Isolate::Current()->object_store()->double_class())) { |
| 43 ASSERT(assembler != NULL); | 46 ASSERT(assembler != NULL); |
| 44 } | 47 } |
| 45 | 48 |
| 46 | 49 |
| 47 FlowGraphCompiler::~FlowGraphCompiler() { | 50 FlowGraphCompiler::~FlowGraphCompiler() { |
| 48 // BlockInfos are zone-allocated, so their destructors are not called. | 51 // BlockInfos are zone-allocated, so their destructors are not called. |
| 49 // Verify the labels explicitly here. | 52 // Verify the labels explicitly here. |
| 50 for (int i = 0; i < block_info_.length(); ++i) { | 53 for (int i = 0; i < block_info_.length(); ++i) { |
| 51 ASSERT(!block_info_[i]->label.IsLinked()); | 54 ASSERT(!block_info_[i]->label.IsLinked()); |
| 52 ASSERT(!block_info_[i]->label.HasNear()); | 55 ASSERT(!block_info_[i]->label.HasNear()); |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 function_name, | 389 function_name, |
| 387 kNumArguments, | 390 kNumArguments, |
| 388 Array::ZoneHandle(), // No optional arguments. | 391 Array::ZoneHandle(), // No optional arguments. |
| 389 kNumArgsChecked); | 392 kNumArgsChecked); |
| 390 } | 393 } |
| 391 | 394 |
| 392 | 395 |
| 393 | 396 |
| 394 | 397 |
| 395 } // namespace dart | 398 } // namespace dart |
| OLD | NEW |