| 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 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 return true; | 1177 return true; |
| 1178 } | 1178 } |
| 1179 if ((recognized_kind == MethodRecognizer::kStringBaseCharAt) && | 1179 if ((recognized_kind == MethodRecognizer::kStringBaseCharAt) && |
| 1180 (ic_data.NumberOfChecks() == 1) && | 1180 (ic_data.NumberOfChecks() == 1) && |
| 1181 (class_ids[0] == kOneByteStringCid)) { | 1181 (class_ids[0] == kOneByteStringCid)) { |
| 1182 // TODO(fschneider): Handle TwoByteString. | 1182 // TODO(fschneider): Handle TwoByteString. |
| 1183 StringCharCodeAtInstr* load_char_code = | 1183 StringCharCodeAtInstr* load_char_code = |
| 1184 BuildStringCharCodeAt(call, class_ids[0]); | 1184 BuildStringCharCodeAt(call, class_ids[0]); |
| 1185 InsertBefore(call, load_char_code, NULL, Definition::kValue); | 1185 InsertBefore(call, load_char_code, NULL, Definition::kValue); |
| 1186 StringFromCharCodeInstr* char_at = | 1186 StringFromCharCodeInstr* char_at = |
| 1187 new StringFromCharCodeInstr(new Value(load_char_code)); | 1187 new StringFromCharCodeInstr(new Value(load_char_code), |
| 1188 kOneByteStringCid); |
| 1188 call->ReplaceWith(char_at, current_iterator()); | 1189 call->ReplaceWith(char_at, current_iterator()); |
| 1189 RemovePushArguments(call); | 1190 RemovePushArguments(call); |
| 1190 return true; | 1191 return true; |
| 1191 } | 1192 } |
| 1192 | 1193 |
| 1193 if ((recognized_kind == MethodRecognizer::kIntegerToDouble) && | 1194 if ((recognized_kind == MethodRecognizer::kIntegerToDouble) && |
| 1194 (class_ids[0] == kSmiCid)) { | 1195 (class_ids[0] == kSmiCid)) { |
| 1195 SmiToDoubleInstr* s2d_instr = new SmiToDoubleInstr(call); | 1196 SmiToDoubleInstr* s2d_instr = new SmiToDoubleInstr(call); |
| 1196 call->ReplaceWith(s2d_instr, current_iterator()); | 1197 call->ReplaceWith(s2d_instr, current_iterator()); |
| 1197 // Pushed arguments are not removed because SmiToDouble is implemented | 1198 // Pushed arguments are not removed because SmiToDouble is implemented |
| (...skipping 2707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3905 | 3906 |
| 3906 if (FLAG_trace_constant_propagation) { | 3907 if (FLAG_trace_constant_propagation) { |
| 3907 OS::Print("\n==== After constant propagation ====\n"); | 3908 OS::Print("\n==== After constant propagation ====\n"); |
| 3908 FlowGraphPrinter printer(*graph_); | 3909 FlowGraphPrinter printer(*graph_); |
| 3909 printer.PrintBlocks(); | 3910 printer.PrintBlocks(); |
| 3910 } | 3911 } |
| 3911 } | 3912 } |
| 3912 | 3913 |
| 3913 | 3914 |
| 3914 } // namespace dart | 3915 } // namespace dart |
| OLD | NEW |