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/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
6 | 6 |
7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/cpu.h" |
9 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
10 #include "vm/flow_graph_builder.h" | 11 #include "vm/flow_graph_builder.h" |
11 #include "vm/flow_graph_compiler.h" | 12 #include "vm/flow_graph_compiler.h" |
12 #include "vm/hash_map.h" | 13 #include "vm/hash_map.h" |
13 #include "vm/il_printer.h" | 14 #include "vm/il_printer.h" |
14 #include "vm/intermediate_language.h" | 15 #include "vm/intermediate_language.h" |
15 #include "vm/object_store.h" | 16 #include "vm/object_store.h" |
16 #include "vm/parser.h" | 17 #include "vm/parser.h" |
17 #include "vm/resolver.h" | 18 #include "vm/resolver.h" |
18 #include "vm/scopes.h" | 19 #include "vm/scopes.h" |
(...skipping 26 matching lines...) Expand all Loading... |
45 "Ratio of getter/setter usage used for double field unboxing heuristics"); | 46 "Ratio of getter/setter usage used for double field unboxing heuristics"); |
46 DECLARE_FLAG(bool, eliminate_type_checks); | 47 DECLARE_FLAG(bool, eliminate_type_checks); |
47 DECLARE_FLAG(bool, enable_type_checks); | 48 DECLARE_FLAG(bool, enable_type_checks); |
48 DECLARE_FLAG(bool, trace_type_check_elimination); | 49 DECLARE_FLAG(bool, trace_type_check_elimination); |
49 | 50 |
50 | 51 |
51 static bool ShouldInlineSimd() { | 52 static bool ShouldInlineSimd() { |
52 #if defined(TARGET_ARCH_MIPS) | 53 #if defined(TARGET_ARCH_MIPS) |
53 return false; | 54 return false; |
54 #elif defined(TARGET_ARCH_ARM) | 55 #elif defined(TARGET_ARCH_ARM) |
55 return CPUFeatures::neon_supported() && FLAG_enable_simd_inline; | 56 return TargetCPUFeatures::neon_supported() && FLAG_enable_simd_inline; |
56 #endif | 57 #endif |
57 return FLAG_enable_simd_inline; | 58 return FLAG_enable_simd_inline; |
58 } | 59 } |
59 | 60 |
60 | 61 |
61 // Optimize instance calls using ICData. | 62 // Optimize instance calls using ICData. |
62 void FlowGraphOptimizer::ApplyICData() { | 63 void FlowGraphOptimizer::ApplyICData() { |
63 VisitBlocks(); | 64 VisitBlocks(); |
64 } | 65 } |
65 | 66 |
(...skipping 2482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2548 ReplaceCall(call, d2i_instr); | 2549 ReplaceCall(call, d2i_instr); |
2549 return true; | 2550 return true; |
2550 } | 2551 } |
2551 case MethodRecognizer::kDoubleMod: | 2552 case MethodRecognizer::kDoubleMod: |
2552 case MethodRecognizer::kDoubleRound: | 2553 case MethodRecognizer::kDoubleRound: |
2553 ReplaceWithMathCFunction(call, recognized_kind); | 2554 ReplaceWithMathCFunction(call, recognized_kind); |
2554 return true; | 2555 return true; |
2555 case MethodRecognizer::kDoubleTruncate: | 2556 case MethodRecognizer::kDoubleTruncate: |
2556 case MethodRecognizer::kDoubleFloor: | 2557 case MethodRecognizer::kDoubleFloor: |
2557 case MethodRecognizer::kDoubleCeil: | 2558 case MethodRecognizer::kDoubleCeil: |
2558 if (!CPUFeatures::double_truncate_round_supported()) { | 2559 if (!TargetCPUFeatures::double_truncate_round_supported()) { |
2559 ReplaceWithMathCFunction(call, recognized_kind); | 2560 ReplaceWithMathCFunction(call, recognized_kind); |
2560 } else { | 2561 } else { |
2561 AddReceiverCheck(call); | 2562 AddReceiverCheck(call); |
2562 DoubleToDoubleInstr* d2d_instr = | 2563 DoubleToDoubleInstr* d2d_instr = |
2563 new DoubleToDoubleInstr(new Value(call->ArgumentAt(0)), | 2564 new DoubleToDoubleInstr(new Value(call->ArgumentAt(0)), |
2564 recognized_kind, call->deopt_id()); | 2565 recognized_kind, call->deopt_id()); |
2565 ReplaceCall(call, d2d_instr); | 2566 ReplaceCall(call, d2d_instr); |
2566 } | 2567 } |
2567 return true; | 2568 return true; |
2568 default: | 2569 default: |
(...skipping 5752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8321 } | 8322 } |
8322 | 8323 |
8323 // Insert materializations at environment uses. | 8324 // Insert materializations at environment uses. |
8324 for (intptr_t i = 0; i < exits.length(); i++) { | 8325 for (intptr_t i = 0; i < exits.length(); i++) { |
8325 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); | 8326 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *fields); |
8326 } | 8327 } |
8327 } | 8328 } |
8328 | 8329 |
8329 | 8330 |
8330 } // namespace dart | 8331 } // namespace dart |
OLD | NEW |