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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 261 |
262 | 262 |
263 bool FlowGraphCompiler::IsPotentialUnboxedField(const Field& field) { | 263 bool FlowGraphCompiler::IsPotentialUnboxedField(const Field& field) { |
264 return field.is_unboxing_candidate() && | 264 return field.is_unboxing_candidate() && |
265 (FlowGraphCompiler::IsUnboxedField(field) || | 265 (FlowGraphCompiler::IsUnboxedField(field) || |
266 (!field.is_final() && (field.guarded_cid() == kIllegalCid))); | 266 (!field.is_final() && (field.guarded_cid() == kIllegalCid))); |
267 } | 267 } |
268 | 268 |
269 | 269 |
270 void FlowGraphCompiler::InitCompiler() { | 270 void FlowGraphCompiler::InitCompiler() { |
| 271 #ifndef PRODUCT |
271 TimelineDurationScope tds(thread(), | 272 TimelineDurationScope tds(thread(), |
272 isolate()->GetCompilerStream(), | 273 isolate()->GetCompilerStream(), |
273 "InitCompiler"); | 274 "InitCompiler"); |
| 275 #endif // !PRODUCT |
274 pc_descriptors_list_ = new(zone()) DescriptorList(64); | 276 pc_descriptors_list_ = new(zone()) DescriptorList(64); |
275 exception_handlers_list_ = new(zone()) ExceptionHandlerList(); | 277 exception_handlers_list_ = new(zone()) ExceptionHandlerList(); |
276 block_info_.Clear(); | 278 block_info_.Clear(); |
277 // Conservative detection of leaf routines used to remove the stack check | 279 // Conservative detection of leaf routines used to remove the stack check |
278 // on function entry. | 280 // on function entry. |
279 bool is_leaf = !parsed_function().function().IsClosureFunction() | 281 bool is_leaf = !parsed_function().function().IsClosureFunction() |
280 && is_optimizing() | 282 && is_optimizing() |
281 && !flow_graph().IsCompiledForOsr(); | 283 && !flow_graph().IsCompiledForOsr(); |
282 // Initialize block info and search optimized (non-OSR) code for calls | 284 // Initialize block info and search optimized (non-OSR) code for calls |
283 // indicating a non-leaf routine and calls without IC data indicating | 285 // indicating a non-leaf routine and calls without IC data indicating |
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 GrowableArray<intptr_t> args; | 1276 GrowableArray<intptr_t> args; |
1275 args.Add(kArrayCid); | 1277 args.Add(kArrayCid); |
1276 args.Add(kGrowableObjectArrayCid); | 1278 args.Add(kGrowableObjectArrayCid); |
1277 args.Add(kImmutableArrayCid); | 1279 args.Add(kImmutableArrayCid); |
1278 CheckClassIds(kClassIdReg, args, is_instance_lbl, &unknown); | 1280 CheckClassIds(kClassIdReg, args, is_instance_lbl, &unknown); |
1279 assembler()->Bind(&unknown); | 1281 assembler()->Bind(&unknown); |
1280 } | 1282 } |
1281 | 1283 |
1282 | 1284 |
1283 void FlowGraphCompiler::EmitComment(Instruction* instr) { | 1285 void FlowGraphCompiler::EmitComment(Instruction* instr) { |
| 1286 if (!FLAG_support_il_printer || !FLAG_support_disassembler) { |
| 1287 return; |
| 1288 } |
| 1289 #ifndef PRODUCT |
1284 char buffer[256]; | 1290 char buffer[256]; |
1285 BufferFormatter f(buffer, sizeof(buffer)); | 1291 BufferFormatter f(buffer, sizeof(buffer)); |
1286 instr->PrintTo(&f); | 1292 instr->PrintTo(&f); |
1287 assembler()->Comment("%s", buffer); | 1293 assembler()->Comment("%s", buffer); |
| 1294 #endif |
1288 } | 1295 } |
1289 | 1296 |
1290 | 1297 |
1291 bool FlowGraphCompiler::NeedsEdgeCounter(TargetEntryInstr* block) { | 1298 bool FlowGraphCompiler::NeedsEdgeCounter(TargetEntryInstr* block) { |
1292 // Only emit an edge counter if there is not goto at the end of the block, | 1299 // Only emit an edge counter if there is not goto at the end of the block, |
1293 // except for the entry block. | 1300 // except for the entry block. |
1294 return (FLAG_emit_edge_counters | 1301 return (FLAG_emit_edge_counters |
1295 && (!block->last_instruction()->IsGoto() | 1302 && (!block->last_instruction()->IsGoto() |
1296 || (block == flow_graph().graph_entry()->normal_entry()))); | 1303 || (block == flow_graph().graph_entry()->normal_entry()))); |
1297 } | 1304 } |
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1877 | 1884 |
1878 | 1885 |
1879 void FlowGraphCompiler::FrameStateClear() { | 1886 void FlowGraphCompiler::FrameStateClear() { |
1880 ASSERT(!is_optimizing()); | 1887 ASSERT(!is_optimizing()); |
1881 frame_state_.TruncateTo(0); | 1888 frame_state_.TruncateTo(0); |
1882 } | 1889 } |
1883 #endif | 1890 #endif |
1884 | 1891 |
1885 | 1892 |
1886 } // namespace dart | 1893 } // namespace dart |
OLD | NEW |