| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/bit_vector.h" | 9 #include "vm/bit_vector.h" |
| 10 #include "vm/cha.h" | 10 #include "vm/cha.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 | 81 |
| 82 | 82 |
| 83 FlowGraphCompiler::FlowGraphCompiler(Assembler* assembler, | 83 FlowGraphCompiler::FlowGraphCompiler(Assembler* assembler, |
| 84 FlowGraph* flow_graph, | 84 FlowGraph* flow_graph, |
| 85 bool is_optimizing) | 85 bool is_optimizing) |
| 86 : isolate_(Isolate::Current()), | 86 : isolate_(Isolate::Current()), |
| 87 assembler_(assembler), | 87 assembler_(assembler), |
| 88 parsed_function_(flow_graph->parsed_function()), | 88 parsed_function_(*flow_graph->parsed_function()), |
| 89 flow_graph_(*flow_graph), | 89 flow_graph_(*flow_graph), |
| 90 block_order_(*flow_graph->CodegenBlockOrder(is_optimizing)), | 90 block_order_(*flow_graph->CodegenBlockOrder(is_optimizing)), |
| 91 current_block_(NULL), | 91 current_block_(NULL), |
| 92 exception_handlers_list_(NULL), | 92 exception_handlers_list_(NULL), |
| 93 pc_descriptors_list_(NULL), | 93 pc_descriptors_list_(NULL), |
| 94 stackmap_table_builder_( | 94 stackmap_table_builder_( |
| 95 is_optimizing ? new StackmapTableBuilder() : NULL), | 95 is_optimizing ? new StackmapTableBuilder() : NULL), |
| 96 block_info_(block_order_.length()), | 96 block_info_(block_order_.length()), |
| 97 deopt_infos_(), | 97 deopt_infos_(), |
| 98 static_calls_target_table_(GrowableObjectArray::ZoneHandle( | 98 static_calls_target_table_(GrowableObjectArray::ZoneHandle( |
| (...skipping 20 matching lines...) Expand all Loading... |
| 119 patch_code_pc_offset_(Code::kInvalidPc), | 119 patch_code_pc_offset_(Code::kInvalidPc), |
| 120 lazy_deopt_pc_offset_(Code::kInvalidPc) { | 120 lazy_deopt_pc_offset_(Code::kInvalidPc) { |
| 121 if (!is_optimizing) { | 121 if (!is_optimizing) { |
| 122 const intptr_t len = isolate()->deopt_id(); | 122 const intptr_t len = isolate()->deopt_id(); |
| 123 deopt_id_to_ic_data_ = new(isolate()) ZoneGrowableArray<const ICData*>(len); | 123 deopt_id_to_ic_data_ = new(isolate()) ZoneGrowableArray<const ICData*>(len); |
| 124 deopt_id_to_ic_data_->SetLength(len); | 124 deopt_id_to_ic_data_->SetLength(len); |
| 125 for (intptr_t i = 0; i < len; i++) { | 125 for (intptr_t i = 0; i < len; i++) { |
| 126 (*deopt_id_to_ic_data_)[i] = NULL; | 126 (*deopt_id_to_ic_data_)[i] = NULL; |
| 127 } | 127 } |
| 128 const Array& old_saved_icdata = Array::Handle(isolate(), | 128 const Array& old_saved_icdata = Array::Handle(isolate(), |
| 129 flow_graph->parsed_function().function().ic_data_array()); | 129 flow_graph->parsed_function()->function().ic_data_array()); |
| 130 const intptr_t saved_len = | 130 const intptr_t saved_len = |
| 131 old_saved_icdata.IsNull() ? 0 : old_saved_icdata.Length(); | 131 old_saved_icdata.IsNull() ? 0 : old_saved_icdata.Length(); |
| 132 for (intptr_t i = 0; i < saved_len; i++) { | 132 for (intptr_t i = 0; i < saved_len; i++) { |
| 133 ICData& icd = ICData::ZoneHandle(isolate()); | 133 ICData& icd = ICData::ZoneHandle(isolate()); |
| 134 icd ^= old_saved_icdata.At(i); | 134 icd ^= old_saved_icdata.At(i); |
| 135 (*deopt_id_to_ic_data_)[icd.deopt_id()] = &icd; | 135 (*deopt_id_to_ic_data_)[icd.deopt_id()] = &icd; |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 ASSERT(assembler != NULL); | 138 ASSERT(assembler != NULL); |
| 139 ASSERT(!list_class_.IsNull()); | 139 ASSERT(!list_class_.IsNull()); |
| (...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1526 case kUnboxedMint: | 1526 case kUnboxedMint: |
| 1527 return mint_class(); | 1527 return mint_class(); |
| 1528 default: | 1528 default: |
| 1529 UNREACHABLE(); | 1529 UNREACHABLE(); |
| 1530 return Class::ZoneHandle(); | 1530 return Class::ZoneHandle(); |
| 1531 } | 1531 } |
| 1532 } | 1532 } |
| 1533 | 1533 |
| 1534 | 1534 |
| 1535 } // namespace dart | 1535 } // namespace dart |
| OLD | NEW |