| 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_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/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1008 load->set_result_cid(kSmiCid); | 1008 load->set_result_cid(kSmiCid); |
| 1009 return load; | 1009 return load; |
| 1010 } | 1010 } |
| 1011 | 1011 |
| 1012 | 1012 |
| 1013 void FlowGraphOptimizer::InlineStringLengthGetter(InstanceCallInstr* call) { | 1013 void FlowGraphOptimizer::InlineStringLengthGetter(InstanceCallInstr* call) { |
| 1014 // Check receiver class. | 1014 // Check receiver class. |
| 1015 AddCheckClass(call, call->ArgumentAt(0)->value()->Copy()); | 1015 AddCheckClass(call, call->ArgumentAt(0)->value()->Copy()); |
| 1016 | 1016 |
| 1017 LoadFieldInstr* load = BuildLoadStringLength(call->ArgumentAt(0)->value()); | 1017 LoadFieldInstr* load = BuildLoadStringLength(call->ArgumentAt(0)->value()); |
| 1018 load->set_recognized_kind(MethodRecognizer::kStringBaseLength); |
| 1018 call->ReplaceWith(load, current_iterator()); | 1019 call->ReplaceWith(load, current_iterator()); |
| 1019 RemovePushArguments(call); | 1020 RemovePushArguments(call); |
| 1020 } | 1021 } |
| 1021 | 1022 |
| 1022 | 1023 |
| 1023 void FlowGraphOptimizer::InlineStringIsEmptyGetter(InstanceCallInstr* call) { | 1024 void FlowGraphOptimizer::InlineStringIsEmptyGetter(InstanceCallInstr* call) { |
| 1024 // Check receiver class. | 1025 // Check receiver class. |
| 1025 AddCheckClass(call, call->ArgumentAt(0)->value()->Copy()); | 1026 AddCheckClass(call, call->ArgumentAt(0)->value()->Copy()); |
| 1026 | 1027 |
| 1027 LoadFieldInstr* load = BuildLoadStringLength(call->ArgumentAt(0)->value()); | 1028 LoadFieldInstr* load = BuildLoadStringLength(call->ArgumentAt(0)->value()); |
| (...skipping 2876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3904 | 3905 |
| 3905 if (FLAG_trace_constant_propagation) { | 3906 if (FLAG_trace_constant_propagation) { |
| 3906 OS::Print("\n==== After constant propagation ====\n"); | 3907 OS::Print("\n==== After constant propagation ====\n"); |
| 3907 FlowGraphPrinter printer(*graph_); | 3908 FlowGraphPrinter printer(*graph_); |
| 3908 printer.PrintBlocks(); | 3909 printer.PrintBlocks(); |
| 3909 } | 3910 } |
| 3910 } | 3911 } |
| 3911 | 3912 |
| 3912 | 3913 |
| 3913 } // namespace dart | 3914 } // namespace dart |
| OLD | NEW |