| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/flow_graph_allocator.h" | 10 #include "vm/flow_graph_allocator.h" |
| (...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1565 } | 1565 } |
| 1566 | 1566 |
| 1567 | 1567 |
| 1568 Definition* UnboxFloat32x4Instr::Canonicalize(FlowGraph* flow_graph) { | 1568 Definition* UnboxFloat32x4Instr::Canonicalize(FlowGraph* flow_graph) { |
| 1569 // Fold away UnboxFloat32x4(BoxFloat32x4(v)). | 1569 // Fold away UnboxFloat32x4(BoxFloat32x4(v)). |
| 1570 BoxFloat32x4Instr* defn = value()->definition()->AsBoxFloat32x4(); | 1570 BoxFloat32x4Instr* defn = value()->definition()->AsBoxFloat32x4(); |
| 1571 return (defn != NULL) ? defn->value()->definition() : this; | 1571 return (defn != NULL) ? defn->value()->definition() : this; |
| 1572 } | 1572 } |
| 1573 | 1573 |
| 1574 | 1574 |
| 1575 Definition* BoxFloat64x2Instr::Canonicalize(FlowGraph* flow_graph) { |
| 1576 if (input_use_list() == NULL) { |
| 1577 // Environments can accomodate any representation. No need to box. |
| 1578 return value()->definition(); |
| 1579 } |
| 1580 |
| 1581 // Fold away BoxFloat64x2(UnboxFloat64x2(v)). |
| 1582 UnboxFloat64x2Instr* defn = value()->definition()->AsUnboxFloat64x2(); |
| 1583 if ((defn != NULL) && (defn->value()->Type()->ToCid() == kFloat64x2Cid)) { |
| 1584 return defn->value()->definition(); |
| 1585 } |
| 1586 |
| 1587 return this; |
| 1588 } |
| 1589 |
| 1590 |
| 1591 Definition* UnboxFloat64x2Instr::Canonicalize(FlowGraph* flow_graph) { |
| 1592 // Fold away UnboxFloat64x2(BoxFloat64x2(v)). |
| 1593 BoxFloat64x2Instr* defn = value()->definition()->AsBoxFloat64x2(); |
| 1594 return (defn != NULL) ? defn->value()->definition() : this; |
| 1595 } |
| 1596 |
| 1597 |
| 1598 |
| 1575 Definition* BoxInt32x4Instr::Canonicalize(FlowGraph* flow_graph) { | 1599 Definition* BoxInt32x4Instr::Canonicalize(FlowGraph* flow_graph) { |
| 1576 if (input_use_list() == NULL) { | 1600 if (input_use_list() == NULL) { |
| 1577 // Environments can accomodate any representation. No need to box. | 1601 // Environments can accomodate any representation. No need to box. |
| 1578 return value()->definition(); | 1602 return value()->definition(); |
| 1579 } | 1603 } |
| 1580 | 1604 |
| 1581 // Fold away BoxInt32x4(UnboxInt32x4(v)). | 1605 // Fold away BoxInt32x4(UnboxInt32x4(v)). |
| 1582 UnboxInt32x4Instr* defn = value()->definition()->AsUnboxInt32x4(); | 1606 UnboxInt32x4Instr* defn = value()->definition()->AsUnboxInt32x4(); |
| 1583 if ((defn != NULL) && (defn->value()->Type()->ToCid() == kInt32x4Cid)) { | 1607 if ((defn != NULL) && (defn->value()->Type()->ToCid() == kInt32x4Cid)) { |
| 1584 return defn->value()->definition(); | 1608 return defn->value()->definition(); |
| (...skipping 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3150 case Token::kTRUNCDIV: return 0; | 3174 case Token::kTRUNCDIV: return 0; |
| 3151 case Token::kMOD: return 1; | 3175 case Token::kMOD: return 1; |
| 3152 default: UNIMPLEMENTED(); return -1; | 3176 default: UNIMPLEMENTED(); return -1; |
| 3153 } | 3177 } |
| 3154 } | 3178 } |
| 3155 | 3179 |
| 3156 | 3180 |
| 3157 #undef __ | 3181 #undef __ |
| 3158 | 3182 |
| 3159 } // namespace dart | 3183 } // namespace dart |
| OLD | NEW |