| 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/base/flags.h" | 5 #include "src/base/flags.h" |
| 6 #include "src/bootstrapper.h" | 6 #include "src/bootstrapper.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.h" | 10 #include "src/compiler/node-properties.h" |
| (...skipping 1651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1662 Bounds Typer::Visitor::TypeNumberToInt32(Node* node) { | 1662 Bounds Typer::Visitor::TypeNumberToInt32(Node* node) { |
| 1663 return TypeUnaryOp(node, NumberToInt32); | 1663 return TypeUnaryOp(node, NumberToInt32); |
| 1664 } | 1664 } |
| 1665 | 1665 |
| 1666 | 1666 |
| 1667 Bounds Typer::Visitor::TypeNumberToUint32(Node* node) { | 1667 Bounds Typer::Visitor::TypeNumberToUint32(Node* node) { |
| 1668 return TypeUnaryOp(node, NumberToUint32); | 1668 return TypeUnaryOp(node, NumberToUint32); |
| 1669 } | 1669 } |
| 1670 | 1670 |
| 1671 | 1671 |
| 1672 Bounds Typer::Visitor::TypePlainPrimitiveToNumber(Node* node) { | |
| 1673 return TypeUnaryOp(node, ToNumber); | |
| 1674 } | |
| 1675 | |
| 1676 | |
| 1677 Bounds Typer::Visitor::TypeReferenceEqual(Node* node) { | 1672 Bounds Typer::Visitor::TypeReferenceEqual(Node* node) { |
| 1678 return Bounds(Type::None(zone()), Type::Boolean(zone())); | 1673 return Bounds(Type::None(zone()), Type::Boolean(zone())); |
| 1679 } | 1674 } |
| 1680 | 1675 |
| 1681 | 1676 |
| 1682 Bounds Typer::Visitor::TypeStringEqual(Node* node) { | 1677 Bounds Typer::Visitor::TypeStringEqual(Node* node) { |
| 1683 return Bounds(Type::None(zone()), Type::Boolean(zone())); | 1678 return Bounds(Type::None(zone()), Type::Boolean(zone())); |
| 1684 } | 1679 } |
| 1685 | 1680 |
| 1686 | 1681 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1787 return Bounds(Type::TaggedPointer()); | 1782 return Bounds(Type::TaggedPointer()); |
| 1788 } | 1783 } |
| 1789 | 1784 |
| 1790 | 1785 |
| 1791 Bounds Typer::Visitor::TypeLoadField(Node* node) { | 1786 Bounds Typer::Visitor::TypeLoadField(Node* node) { |
| 1792 return Bounds(FieldAccessOf(node->op()).type); | 1787 return Bounds(FieldAccessOf(node->op()).type); |
| 1793 } | 1788 } |
| 1794 | 1789 |
| 1795 | 1790 |
| 1796 Bounds Typer::Visitor::TypeLoadBuffer(Node* node) { | 1791 Bounds Typer::Visitor::TypeLoadBuffer(Node* node) { |
| 1797 // TODO(bmeurer): This typing is not yet correct. Since we can still access | |
| 1798 // out of bounds, the type in the general case has to include Undefined. | |
| 1799 switch (BufferAccessOf(node->op()).external_array_type()) { | 1792 switch (BufferAccessOf(node->op()).external_array_type()) { |
| 1800 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ | 1793 #define TYPED_ARRAY_CASE(Type, type, TYPE, ctype, size) \ |
| 1801 case kExternal##Type##Array: \ | 1794 case kExternal##Type##Array: \ |
| 1802 return Bounds(typer_->cache_->Get(k##Type)); | 1795 return Bounds(typer_->cache_->Get(k##Type)); |
| 1803 TYPED_ARRAYS(TYPED_ARRAY_CASE) | 1796 TYPED_ARRAYS(TYPED_ARRAY_CASE) |
| 1804 #undef TYPED_ARRAY_CASE | 1797 #undef TYPED_ARRAY_CASE |
| 1805 } | 1798 } |
| 1806 UNREACHABLE(); | 1799 UNREACHABLE(); |
| 1807 return Bounds(); | 1800 return Bounds(); |
| 1808 } | 1801 } |
| (...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2365 TYPED_ARRAYS(TYPED_ARRAY_CASE) | 2358 TYPED_ARRAYS(TYPED_ARRAY_CASE) |
| 2366 #undef TYPED_ARRAY_CASE | 2359 #undef TYPED_ARRAY_CASE |
| 2367 } | 2360 } |
| 2368 } | 2361 } |
| 2369 return Type::Constant(value, zone()); | 2362 return Type::Constant(value, zone()); |
| 2370 } | 2363 } |
| 2371 | 2364 |
| 2372 } // namespace compiler | 2365 } // namespace compiler |
| 2373 } // namespace internal | 2366 } // namespace internal |
| 2374 } // namespace v8 | 2367 } // namespace v8 |
| OLD | NEW |