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/cpu.h" |
10 #include "vm/dart_entry.h" | 10 #include "vm/dart_entry.h" |
(...skipping 4844 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4855 BinarySmiOpInstr* smi_op = defn->AsBinarySmiOp(); | 4855 BinarySmiOpInstr* smi_op = defn->AsBinarySmiOp(); |
4856 BinaryInt32OpInstr* int32_op = new(I) BinaryInt32OpInstr( | 4856 BinaryInt32OpInstr* int32_op = new(I) BinaryInt32OpInstr( |
4857 smi_op->op_kind(), | 4857 smi_op->op_kind(), |
4858 smi_op->left()->CopyWithType(), | 4858 smi_op->left()->CopyWithType(), |
4859 smi_op->right()->CopyWithType(), | 4859 smi_op->right()->CopyWithType(), |
4860 smi_op->DeoptimizationTarget()); | 4860 smi_op->DeoptimizationTarget()); |
4861 | 4861 |
4862 smi_op->ReplaceWith(int32_op, NULL); | 4862 smi_op->ReplaceWith(int32_op, NULL); |
4863 } else if (defn->IsPhi()) { | 4863 } else if (defn->IsPhi()) { |
4864 defn->AsPhi()->set_representation(kUnboxedInt32); | 4864 defn->AsPhi()->set_representation(kUnboxedInt32); |
| 4865 ASSERT(defn->Type()->IsInt()); |
4865 } | 4866 } |
4866 } | 4867 } |
4867 } | 4868 } |
4868 } | 4869 } |
4869 } | 4870 } |
4870 #else | 4871 #else |
4871 void FlowGraphOptimizer::WidenSmiToInt32() { | 4872 void FlowGraphOptimizer::WidenSmiToInt32() { |
4872 // TODO(vegorov) ideally on 64-bit platforms we would like to narrow smi | 4873 // TODO(vegorov) ideally on 64-bit platforms we would like to narrow smi |
4873 // operations to 32-bit where it saves tagging and untagging and allows | 4874 // operations to 32-bit where it saves tagging and untagging and allows |
4874 // to use shorted (and faster) instructions. But we currently don't | 4875 // to use shorted (and faster) instructions. But we currently don't |
(...skipping 5052 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9927 | 9928 |
9928 // Insert materializations at environment uses. | 9929 // Insert materializations at environment uses. |
9929 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { | 9930 for (intptr_t i = 0; i < exits_collector_.exits().length(); i++) { |
9930 CreateMaterializationAt( | 9931 CreateMaterializationAt( |
9931 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); | 9932 exits_collector_.exits()[i], alloc, alloc->cls(), *slots); |
9932 } | 9933 } |
9933 } | 9934 } |
9934 | 9935 |
9935 | 9936 |
9936 } // namespace dart | 9937 } // namespace dart |
OLD | NEW |