| 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 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1604 | 1604 |
| 1605 Bounds Typer::Visitor::TypeChangeFloat64ToTagged(Node* node) { | 1605 Bounds Typer::Visitor::TypeChangeFloat64ToTagged(Node* node) { |
| 1606 Bounds arg = Operand(node, 0); | 1606 Bounds arg = Operand(node, 0); |
| 1607 // TODO(neis): CHECK(arg.upper->Is(Type::Number())); | 1607 // TODO(neis): CHECK(arg.upper->Is(Type::Number())); |
| 1608 return Bounds( | 1608 return Bounds( |
| 1609 ChangeRepresentation(arg.lower, Type::Tagged(), zone()), | 1609 ChangeRepresentation(arg.lower, Type::Tagged(), zone()), |
| 1610 ChangeRepresentation(arg.upper, Type::Tagged(), zone())); | 1610 ChangeRepresentation(arg.upper, Type::Tagged(), zone())); |
| 1611 } | 1611 } |
| 1612 | 1612 |
| 1613 | 1613 |
| 1614 Bounds Typer::Visitor::TypeChangeBitToBool(Node* node) { | |
| 1615 Bounds arg = Operand(node, 0); | |
| 1616 // TODO(neis): DCHECK(arg.upper->Is(Type::Boolean())); | |
| 1617 return Bounds(ChangeRepresentation(arg.lower, Type::TaggedPointer(), zone()), | |
| 1618 ChangeRepresentation(arg.upper, Type::TaggedPointer(), zone())); | |
| 1619 } | |
| 1620 | |
| 1621 | |
| 1622 Bounds Typer::Visitor::TypeChangeBoolToBit(Node* node) { | 1614 Bounds Typer::Visitor::TypeChangeBoolToBit(Node* node) { |
| 1623 Bounds arg = Operand(node, 0); | 1615 Bounds arg = Operand(node, 0); |
| 1624 // TODO(neis): DCHECK(arg.upper->Is(Type::Boolean())); | 1616 // TODO(neis): DCHECK(arg.upper->Is(Type::Boolean())); |
| 1625 return Bounds( | 1617 return Bounds( |
| 1626 ChangeRepresentation(arg.lower, Type::UntaggedBit(), zone()), | 1618 ChangeRepresentation(arg.lower, Type::UntaggedBit(), zone()), |
| 1627 ChangeRepresentation(arg.upper, Type::UntaggedBit(), zone())); | 1619 ChangeRepresentation(arg.upper, Type::UntaggedBit(), zone())); |
| 1628 } | 1620 } |
| 1629 | 1621 |
| 1630 | 1622 |
| 1631 Bounds Typer::Visitor::TypeChangeWord32ToBit(Node* node) { | 1623 Bounds Typer::Visitor::TypeChangeBitToBool(Node* node) { |
| 1632 return Bounds( | 1624 Bounds arg = Operand(node, 0); |
| 1633 ChangeRepresentation(Type::Boolean(), Type::UntaggedBit(), zone())); | 1625 // TODO(neis): DCHECK(arg.upper->Is(Type::Boolean())); |
| 1626 return Bounds(ChangeRepresentation(arg.lower, Type::TaggedPointer(), zone()), |
| 1627 ChangeRepresentation(arg.upper, Type::TaggedPointer(), zone())); |
| 1634 } | 1628 } |
| 1635 | 1629 |
| 1636 | 1630 |
| 1637 Bounds Typer::Visitor::TypeChangeWord64ToBit(Node* node) { | |
| 1638 return Bounds( | |
| 1639 ChangeRepresentation(Type::Boolean(), Type::UntaggedBit(), zone())); | |
| 1640 } | |
| 1641 | |
| 1642 | |
| 1643 Bounds Typer::Visitor::TypeLoadField(Node* node) { | 1631 Bounds Typer::Visitor::TypeLoadField(Node* node) { |
| 1644 return Bounds(FieldAccessOf(node->op()).type); | 1632 return Bounds(FieldAccessOf(node->op()).type); |
| 1645 } | 1633 } |
| 1646 | 1634 |
| 1647 | 1635 |
| 1648 Bounds Typer::Visitor::TypeLoadBuffer(Node* node) { | 1636 Bounds Typer::Visitor::TypeLoadBuffer(Node* node) { |
| 1649 // TODO(bmeurer): This typing is not yet correct. Since we can still access | 1637 // TODO(bmeurer): This typing is not yet correct. Since we can still access |
| 1650 // out of bounds, the type in the general case has to include Undefined. | 1638 // out of bounds, the type in the general case has to include Undefined. |
| 1651 switch (BufferAccessOf(node->op()).external_array_type()) { | 1639 switch (BufferAccessOf(node->op()).external_array_type()) { |
| 1652 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ | 1640 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2126 TYPED_ARRAYS(TYPED_ARRAY_CASE) | 2114 TYPED_ARRAYS(TYPED_ARRAY_CASE) |
| 2127 #undef TYPED_ARRAY_CASE | 2115 #undef TYPED_ARRAY_CASE |
| 2128 } | 2116 } |
| 2129 } | 2117 } |
| 2130 return Type::Constant(value, zone()); | 2118 return Type::Constant(value, zone()); |
| 2131 } | 2119 } |
| 2132 | 2120 |
| 2133 } // namespace compiler | 2121 } // namespace compiler |
| 2134 } // namespace internal | 2122 } // namespace internal |
| 2135 } // namespace v8 | 2123 } // namespace v8 |
| OLD | NEW |