| 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 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 } else if ((from == kTagged) && (to == kUnboxedDouble)) { | 632 } else if ((from == kTagged) && (to == kUnboxedDouble)) { |
| 633 ASSERT(CanUnboxDouble()); | 633 ASSERT(CanUnboxDouble()); |
| 634 ASSERT((deopt_target != NULL) || | 634 ASSERT((deopt_target != NULL) || |
| 635 (use->Type()->ToCid() == kDoubleCid)); | 635 (use->Type()->ToCid() == kDoubleCid)); |
| 636 const intptr_t deopt_id = (deopt_target != NULL) ? | 636 const intptr_t deopt_id = (deopt_target != NULL) ? |
| 637 deopt_target->DeoptimizationTarget() : Isolate::kNoDeoptId; | 637 deopt_target->DeoptimizationTarget() : Isolate::kNoDeoptId; |
| 638 ConstantInstr* constant = use->definition()->AsConstant(); | 638 ConstantInstr* constant = use->definition()->AsConstant(); |
| 639 if ((constant != NULL) && constant->value().IsSmi()) { | 639 if ((constant != NULL) && constant->value().IsSmi()) { |
| 640 const double dbl_val = Smi::Cast(constant->value()).AsDoubleValue(); | 640 const double dbl_val = Smi::Cast(constant->value()).AsDoubleValue(); |
| 641 const Double& dbl_obj = | 641 const Double& dbl_obj = |
| 642 Double::ZoneHandle(I, Double::New(dbl_val, Heap::kOld)); | 642 Double::ZoneHandle(I, Double::NewCanonical(dbl_val)); |
| 643 ConstantInstr* double_const = flow_graph()->GetConstant(dbl_obj); | 643 ConstantInstr* double_const = flow_graph()->GetConstant(dbl_obj); |
| 644 converted = new(I) UnboxDoubleInstr(new(I) Value(double_const), deopt_id); | 644 converted = new(I) UnboxDoubleInstr(new(I) Value(double_const), deopt_id); |
| 645 } else { | 645 } else { |
| 646 converted = new(I) UnboxDoubleInstr(use->CopyWithType(), deopt_id); | 646 converted = new(I) UnboxDoubleInstr(use->CopyWithType(), deopt_id); |
| 647 } | 647 } |
| 648 } else if ((from == kTagged) && (to == kUnboxedFloat32x4)) { | 648 } else if ((from == kTagged) && (to == kUnboxedFloat32x4)) { |
| 649 ASSERT((deopt_target != NULL) || | 649 ASSERT((deopt_target != NULL) || |
| 650 (use->Type()->ToCid() == kFloat32x4Cid)); | 650 (use->Type()->ToCid() == kFloat32x4Cid)); |
| 651 const intptr_t deopt_id = (deopt_target != NULL) ? | 651 const intptr_t deopt_id = (deopt_target != NULL) ? |
| 652 deopt_target->DeoptimizationTarget() : Isolate::kNoDeoptId; | 652 deopt_target->DeoptimizationTarget() : Isolate::kNoDeoptId; |
| (...skipping 9150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9803 } | 9803 } |
| 9804 | 9804 |
| 9805 // Insert materializations at environment uses. | 9805 // Insert materializations at environment uses. |
| 9806 for (intptr_t i = 0; i < exits.length(); i++) { | 9806 for (intptr_t i = 0; i < exits.length(); i++) { |
| 9807 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *slots); | 9807 CreateMaterializationAt(exits[i], alloc, alloc->cls(), *slots); |
| 9808 } | 9808 } |
| 9809 } | 9809 } |
| 9810 | 9810 |
| 9811 | 9811 |
| 9812 } // namespace dart | 9812 } // namespace dart |
| OLD | NEW |