OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
6 #include "src/compiler/graph-inl.h" | 6 #include "src/compiler/graph-inl.h" |
7 #include "src/compiler/graph-reducer.h" | 7 #include "src/compiler/graph-reducer.h" |
8 #include "src/compiler/js-operator.h" | 8 #include "src/compiler/js-operator.h" |
9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
10 #include "src/compiler/node-properties-inl.h" | 10 #include "src/compiler/node-properties-inl.h" |
(...skipping 1578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1589 | 1589 |
1590 Bounds Typer::Visitor::TypeChangeFloat64ToTagged(Node* node) { | 1590 Bounds Typer::Visitor::TypeChangeFloat64ToTagged(Node* node) { |
1591 Bounds arg = Operand(node, 0); | 1591 Bounds arg = Operand(node, 0); |
1592 // TODO(neis): CHECK(arg.upper->Is(Type::Number())); | 1592 // TODO(neis): CHECK(arg.upper->Is(Type::Number())); |
1593 return Bounds( | 1593 return Bounds( |
1594 ChangeRepresentation(arg.lower, Type::Tagged(), zone()), | 1594 ChangeRepresentation(arg.lower, Type::Tagged(), zone()), |
1595 ChangeRepresentation(arg.upper, Type::Tagged(), zone())); | 1595 ChangeRepresentation(arg.upper, Type::Tagged(), zone())); |
1596 } | 1596 } |
1597 | 1597 |
1598 | 1598 |
| 1599 Bounds Typer::Visitor::TypeChangeBitToBool(Node* node) { |
| 1600 Bounds arg = Operand(node, 0); |
| 1601 // TODO(neis): DCHECK(arg.upper->Is(Type::Boolean())); |
| 1602 return Bounds(ChangeRepresentation(arg.lower, Type::TaggedPointer(), zone()), |
| 1603 ChangeRepresentation(arg.upper, Type::TaggedPointer(), zone())); |
| 1604 } |
| 1605 |
| 1606 |
1599 Bounds Typer::Visitor::TypeChangeBoolToBit(Node* node) { | 1607 Bounds Typer::Visitor::TypeChangeBoolToBit(Node* node) { |
1600 Bounds arg = Operand(node, 0); | 1608 Bounds arg = Operand(node, 0); |
1601 // TODO(neis): DCHECK(arg.upper->Is(Type::Boolean())); | 1609 // TODO(neis): DCHECK(arg.upper->Is(Type::Boolean())); |
1602 return Bounds( | 1610 return Bounds( |
1603 ChangeRepresentation(arg.lower, Type::UntaggedBit(), zone()), | 1611 ChangeRepresentation(arg.lower, Type::UntaggedBit(), zone()), |
1604 ChangeRepresentation(arg.upper, Type::UntaggedBit(), zone())); | 1612 ChangeRepresentation(arg.upper, Type::UntaggedBit(), zone())); |
1605 } | 1613 } |
1606 | 1614 |
1607 | 1615 |
1608 Bounds Typer::Visitor::TypeChangeBitToBool(Node* node) { | 1616 Bounds Typer::Visitor::TypeChangeWord32ToBit(Node* node) { |
1609 Bounds arg = Operand(node, 0); | |
1610 // TODO(neis): DCHECK(arg.upper->Is(Type::Boolean())); | |
1611 return Bounds( | 1617 return Bounds( |
1612 ChangeRepresentation(arg.lower, Type::TaggedPointer(), zone()), | 1618 ChangeRepresentation(Type::Boolean(), Type::UntaggedBit(), zone())); |
1613 ChangeRepresentation(arg.upper, Type::TaggedPointer(), zone())); | |
1614 } | 1619 } |
1615 | 1620 |
1616 | 1621 |
| 1622 Bounds Typer::Visitor::TypeChangeWord64ToBit(Node* node) { |
| 1623 return Bounds( |
| 1624 ChangeRepresentation(Type::Boolean(), Type::UntaggedBit(), zone())); |
| 1625 } |
| 1626 |
| 1627 |
1617 Bounds Typer::Visitor::TypeLoadField(Node* node) { | 1628 Bounds Typer::Visitor::TypeLoadField(Node* node) { |
1618 return Bounds(FieldAccessOf(node->op()).type); | 1629 return Bounds(FieldAccessOf(node->op()).type); |
1619 } | 1630 } |
1620 | 1631 |
1621 | 1632 |
1622 Bounds Typer::Visitor::TypeLoadBuffer(Node* node) { | 1633 Bounds Typer::Visitor::TypeLoadBuffer(Node* node) { |
1623 // TODO(bmeurer): This typing is not yet correct. Since we can still access | 1634 // TODO(bmeurer): This typing is not yet correct. Since we can still access |
1624 // out of bounds, the type in the general case has to include Undefined. | 1635 // out of bounds, the type in the general case has to include Undefined. |
1625 switch (BufferAccessOf(node->op()).external_array_type()) { | 1636 switch (BufferAccessOf(node->op()).external_array_type()) { |
1626 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ | 1637 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2100 TYPED_ARRAYS(TYPED_ARRAY_CASE) | 2111 TYPED_ARRAYS(TYPED_ARRAY_CASE) |
2101 #undef TYPED_ARRAY_CASE | 2112 #undef TYPED_ARRAY_CASE |
2102 } | 2113 } |
2103 } | 2114 } |
2104 return Type::Constant(value, zone()); | 2115 return Type::Constant(value, zone()); |
2105 } | 2116 } |
2106 | 2117 |
2107 } // namespace compiler | 2118 } // namespace compiler |
2108 } // namespace internal | 2119 } // namespace internal |
2109 } // namespace v8 | 2120 } // namespace v8 |
OLD | NEW |