| 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 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1492 } | 1492 } |
| 1493 | 1493 |
| 1494 | 1494 |
| 1495 Definition* UnboxFloat32x4Instr::Canonicalize(FlowGraph* flow_graph) { | 1495 Definition* UnboxFloat32x4Instr::Canonicalize(FlowGraph* flow_graph) { |
| 1496 // Fold away UnboxFloat32x4(BoxFloat32x4(v)). | 1496 // Fold away UnboxFloat32x4(BoxFloat32x4(v)). |
| 1497 BoxFloat32x4Instr* defn = value()->definition()->AsBoxFloat32x4(); | 1497 BoxFloat32x4Instr* defn = value()->definition()->AsBoxFloat32x4(); |
| 1498 return (defn != NULL) ? defn->value()->definition() : this; | 1498 return (defn != NULL) ? defn->value()->definition() : this; |
| 1499 } | 1499 } |
| 1500 | 1500 |
| 1501 | 1501 |
| 1502 Definition* BoxUint32x4Instr::Canonicalize(FlowGraph* flow_graph) { | 1502 Definition* BoxInt32x4Instr::Canonicalize(FlowGraph* flow_graph) { |
| 1503 if (input_use_list() == NULL) { | 1503 if (input_use_list() == NULL) { |
| 1504 // Environments can accomodate any representation. No need to box. | 1504 // Environments can accomodate any representation. No need to box. |
| 1505 return value()->definition(); | 1505 return value()->definition(); |
| 1506 } | 1506 } |
| 1507 | 1507 |
| 1508 // Fold away BoxUint32x4(UnboxUint32x4(v)). | 1508 // Fold away BoxInt32x4(UnboxInt32x4(v)). |
| 1509 UnboxUint32x4Instr* defn = value()->definition()->AsUnboxUint32x4(); | 1509 UnboxInt32x4Instr* defn = value()->definition()->AsUnboxInt32x4(); |
| 1510 if ((defn != NULL) && (defn->value()->Type()->ToCid() == kUint32x4Cid)) { | 1510 if ((defn != NULL) && (defn->value()->Type()->ToCid() == kInt32x4Cid)) { |
| 1511 return defn->value()->definition(); | 1511 return defn->value()->definition(); |
| 1512 } | 1512 } |
| 1513 | 1513 |
| 1514 return this; | 1514 return this; |
| 1515 } | 1515 } |
| 1516 | 1516 |
| 1517 | 1517 |
| 1518 Definition* UnboxUint32x4Instr::Canonicalize(FlowGraph* flow_graph) { | 1518 Definition* UnboxInt32x4Instr::Canonicalize(FlowGraph* flow_graph) { |
| 1519 // Fold away UnboxUint32x4(BoxUint32x4(v)). | 1519 // Fold away UnboxInt32x4(BoxInt32x4(v)). |
| 1520 BoxUint32x4Instr* defn = value()->definition()->AsBoxUint32x4(); | 1520 BoxInt32x4Instr* defn = value()->definition()->AsBoxInt32x4(); |
| 1521 return (defn != NULL) ? defn->value()->definition() : this; | 1521 return (defn != NULL) ? defn->value()->definition() : this; |
| 1522 } | 1522 } |
| 1523 | 1523 |
| 1524 | 1524 |
| 1525 Definition* BooleanNegateInstr::Canonicalize(FlowGraph* flow_graph) { | 1525 Definition* BooleanNegateInstr::Canonicalize(FlowGraph* flow_graph) { |
| 1526 Definition* defn = value()->definition(); | 1526 Definition* defn = value()->definition(); |
| 1527 if (defn->IsComparison() && defn->HasOnlyUse(value())) { | 1527 if (defn->IsComparison() && defn->HasOnlyUse(value())) { |
| 1528 // Comparisons always have a bool result. | 1528 // Comparisons always have a bool result. |
| 1529 ASSERT(value()->Type()->ToCid() == kBoolCid); | 1529 ASSERT(value()->Type()->ToCid() == kBoolCid); |
| 1530 defn->AsComparison()->NegateComparison(); | 1530 defn->AsComparison()->NegateComparison(); |
| (...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2877 return kCosRuntimeEntry; | 2877 return kCosRuntimeEntry; |
| 2878 default: | 2878 default: |
| 2879 UNREACHABLE(); | 2879 UNREACHABLE(); |
| 2880 } | 2880 } |
| 2881 return kSinRuntimeEntry; | 2881 return kSinRuntimeEntry; |
| 2882 } | 2882 } |
| 2883 | 2883 |
| 2884 #undef __ | 2884 #undef __ |
| 2885 | 2885 |
| 2886 } // namespace dart | 2886 } // namespace dart |
| OLD | NEW |