| 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/hash_map.h" | 10 #include "vm/hash_map.h" |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 | 650 |
| 651 if (recognized_kind == MethodRecognizer::kGrowableArrayCapacity) { | 651 if (recognized_kind == MethodRecognizer::kGrowableArrayCapacity) { |
| 652 // Check receiver class. | 652 // Check receiver class. |
| 653 AddCheckClass(call, call->ArgumentAt(0)->value()->Copy()); | 653 AddCheckClass(call, call->ArgumentAt(0)->value()->Copy()); |
| 654 | 654 |
| 655 // TODO(srdjan): type of load should be GrowableObjectArrayType. | 655 // TODO(srdjan): type of load should be GrowableObjectArrayType. |
| 656 LoadVMFieldInstr* data_load = new LoadVMFieldInstr( | 656 LoadVMFieldInstr* data_load = new LoadVMFieldInstr( |
| 657 call->ArgumentAt(0)->value(), | 657 call->ArgumentAt(0)->value(), |
| 658 Array::data_offset(), | 658 Array::data_offset(), |
| 659 Type::ZoneHandle(Type::DynamicType())); | 659 Type::ZoneHandle(Type::DynamicType())); |
| 660 data_load->set_result_cid(kGrowableObjectArrayCid); | 660 data_load->set_result_cid(kArrayCid); |
| 661 InsertBefore(call, data_load, NULL, Definition::kValue); | 661 InsertBefore(call, data_load, NULL, Definition::kValue); |
| 662 | 662 |
| 663 LoadVMFieldInstr* length_load = new LoadVMFieldInstr( | 663 LoadVMFieldInstr* length_load = new LoadVMFieldInstr( |
| 664 new Value(data_load), | 664 new Value(data_load), |
| 665 Array::length_offset(), | 665 Array::length_offset(), |
| 666 Type::ZoneHandle(Type::SmiType())); | 666 Type::ZoneHandle(Type::SmiType())); |
| 667 length_load->set_result_cid(kSmiCid); | 667 length_load->set_result_cid(kSmiCid); |
| 668 | 668 |
| 669 call->ReplaceWith(length_load, current_iterator()); | 669 call->ReplaceWith(length_load, current_iterator()); |
| 670 RemovePushArguments(call); | 670 RemovePushArguments(call); |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1378 DirectChainedHashMap<Definition*> child_map(*map); // Copy map. | 1378 DirectChainedHashMap<Definition*> child_map(*map); // Copy map. |
| 1379 OptimizeRecursive(child, &child_map); | 1379 OptimizeRecursive(child, &child_map); |
| 1380 } else { | 1380 } else { |
| 1381 OptimizeRecursive(child, map); // Reuse map for the last child. | 1381 OptimizeRecursive(child, map); // Reuse map for the last child. |
| 1382 } | 1382 } |
| 1383 } | 1383 } |
| 1384 } | 1384 } |
| 1385 | 1385 |
| 1386 | 1386 |
| 1387 } // namespace dart | 1387 } // namespace dart |
| OLD | NEW |