OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef V8_OBJECTS_H_ | 5 #ifndef V8_OBJECTS_H_ |
6 #define V8_OBJECTS_H_ | 6 #define V8_OBJECTS_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1615 DCHECK_EQ(result, value >= kMinValue && value <= kMaxValue); | 1615 DCHECK_EQ(result, value >= kMinValue && value <= kMaxValue); |
1616 return result; | 1616 return result; |
1617 } | 1617 } |
1618 | 1618 |
1619 DECLARE_CAST(Smi) | 1619 DECLARE_CAST(Smi) |
1620 | 1620 |
1621 // Dispatched behavior. | 1621 // Dispatched behavior. |
1622 V8_EXPORT_PRIVATE void SmiPrint(std::ostream& os) const; // NOLINT | 1622 V8_EXPORT_PRIVATE void SmiPrint(std::ostream& os) const; // NOLINT |
1623 DECLARE_VERIFIER(Smi) | 1623 DECLARE_VERIFIER(Smi) |
1624 | 1624 |
1625 V8_EXPORT_PRIVATE static Smi* const kZero; | 1625 static constexpr Smi* const kZero = nullptr; |
1626 static const int kMinValue = | 1626 static const int kMinValue = |
1627 (static_cast<unsigned int>(-1)) << (kSmiValueSize - 1); | 1627 (static_cast<unsigned int>(-1)) << (kSmiValueSize - 1); |
1628 static const int kMaxValue = -(kMinValue + 1); | 1628 static const int kMaxValue = -(kMinValue + 1); |
1629 | 1629 |
1630 private: | 1630 private: |
1631 DISALLOW_IMPLICIT_CONSTRUCTORS(Smi); | 1631 DISALLOW_IMPLICIT_CONSTRUCTORS(Smi); |
1632 }; | 1632 }; |
1633 | 1633 |
1634 | 1634 |
1635 // Heap objects typically have a map pointer in their first word. However, | 1635 // Heap objects typically have a map pointer in their first word. However, |
(...skipping 10276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11912 } | 11912 } |
11913 return value; | 11913 return value; |
11914 } | 11914 } |
11915 }; | 11915 }; |
11916 | 11916 |
11917 | 11917 |
11918 } // NOLINT, false-positive due to second-order macros. | 11918 } // NOLINT, false-positive due to second-order macros. |
11919 } // NOLINT, false-positive due to second-order macros. | 11919 } // NOLINT, false-positive due to second-order macros. |
11920 | 11920 |
11921 #endif // V8_OBJECTS_H_ | 11921 #endif // V8_OBJECTS_H_ |
OLD | NEW |