OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 | 9 |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 Representation representation); | 1081 Representation representation); |
1082 | 1082 |
1083 // Returns true if the object is of the correct type to be used as a | 1083 // Returns true if the object is of the correct type to be used as a |
1084 // implementation of a JSObject's elements. | 1084 // implementation of a JSObject's elements. |
1085 inline bool HasValidElements(); | 1085 inline bool HasValidElements(); |
1086 | 1086 |
1087 inline bool HasSpecificClassOf(String* name); | 1087 inline bool HasSpecificClassOf(String* name); |
1088 | 1088 |
1089 bool BooleanValue(); // ECMA-262 9.2. | 1089 bool BooleanValue(); // ECMA-262 9.2. |
1090 | 1090 |
| 1091 // ES6 section 7.2.13 Strict Equality Comparison |
| 1092 bool StrictEquals(Object* that); |
| 1093 |
1091 // Convert to a JSObject if needed. | 1094 // Convert to a JSObject if needed. |
1092 // native_context is used when creating wrapper object. | 1095 // native_context is used when creating wrapper object. |
1093 static inline MaybeHandle<JSReceiver> ToObject(Isolate* isolate, | 1096 static inline MaybeHandle<JSReceiver> ToObject(Isolate* isolate, |
1094 Handle<Object> object); | 1097 Handle<Object> object); |
1095 static MaybeHandle<JSReceiver> ToObject(Isolate* isolate, | 1098 static MaybeHandle<JSReceiver> ToObject(Isolate* isolate, |
1096 Handle<Object> object, | 1099 Handle<Object> object, |
1097 Handle<Context> context); | 1100 Handle<Context> context); |
1098 | 1101 |
1099 MUST_USE_RESULT static MaybeHandle<Object> GetProperty( | 1102 MUST_USE_RESULT static MaybeHandle<Object> GetProperty( |
1100 LookupIterator* it, LanguageMode language_mode = SLOPPY); | 1103 LookupIterator* it, LanguageMode language_mode = SLOPPY); |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1586 | 1589 |
1587 | 1590 |
1588 // The Simd128Value class describes heap allocated 128 bit SIMD values. | 1591 // The Simd128Value class describes heap allocated 128 bit SIMD values. |
1589 class Simd128Value : public HeapObject { | 1592 class Simd128Value : public HeapObject { |
1590 public: | 1593 public: |
1591 DECLARE_CAST(Simd128Value) | 1594 DECLARE_CAST(Simd128Value) |
1592 | 1595 |
1593 DECLARE_PRINTER(Simd128Value) | 1596 DECLARE_PRINTER(Simd128Value) |
1594 DECLARE_VERIFIER(Simd128Value) | 1597 DECLARE_VERIFIER(Simd128Value) |
1595 | 1598 |
| 1599 // Equality operations. |
| 1600 inline bool Equals(Simd128Value* that); |
| 1601 |
1596 // Checks that another instance is bit-wise equal. | 1602 // Checks that another instance is bit-wise equal. |
1597 bool BitwiseEquals(const Simd128Value* other) const; | 1603 bool BitwiseEquals(const Simd128Value* other) const; |
1598 // Computes a hash from the 128 bit value, viewed as 4 32-bit integers. | 1604 // Computes a hash from the 128 bit value, viewed as 4 32-bit integers. |
1599 uint32_t Hash() const; | 1605 uint32_t Hash() const; |
1600 // Copies the 16 bytes of SIMD data to the destination address. | 1606 // Copies the 16 bytes of SIMD data to the destination address. |
1601 void CopyBits(void* destination) const; | 1607 void CopyBits(void* destination) const; |
1602 | 1608 |
1603 // Layout description. | 1609 // Layout description. |
1604 static const int kValueOffset = HeapObject::kHeaderSize; | 1610 static const int kValueOffset = HeapObject::kHeaderSize; |
1605 static const int kSize = kValueOffset + kSimd128Size; | 1611 static const int kSize = kValueOffset + kSimd128Size; |
(...skipping 16 matching lines...) Expand all Loading... |
1622 #define SIMD128_VALUE_CLASS(TYPE, Type, type, lane_count, lane_type) \ | 1628 #define SIMD128_VALUE_CLASS(TYPE, Type, type, lane_count, lane_type) \ |
1623 class Type final : public Simd128Value { \ | 1629 class Type final : public Simd128Value { \ |
1624 public: \ | 1630 public: \ |
1625 inline lane_type get_lane(int lane) const; \ | 1631 inline lane_type get_lane(int lane) const; \ |
1626 inline void set_lane(int lane, lane_type value); \ | 1632 inline void set_lane(int lane, lane_type value); \ |
1627 \ | 1633 \ |
1628 DECLARE_CAST(Type) \ | 1634 DECLARE_CAST(Type) \ |
1629 \ | 1635 \ |
1630 DECLARE_PRINTER(Type) \ | 1636 DECLARE_PRINTER(Type) \ |
1631 \ | 1637 \ |
| 1638 inline bool Equals(Type* that); \ |
| 1639 \ |
1632 private: \ | 1640 private: \ |
1633 DISALLOW_IMPLICIT_CONSTRUCTORS(Type); \ | 1641 DISALLOW_IMPLICIT_CONSTRUCTORS(Type); \ |
1634 }; | 1642 }; |
1635 SIMD128_TYPES(SIMD128_VALUE_CLASS) | 1643 SIMD128_TYPES(SIMD128_VALUE_CLASS) |
1636 #undef SIMD128_VALUE_CLASS | 1644 #undef SIMD128_VALUE_CLASS |
1637 | 1645 |
1638 | 1646 |
1639 enum EnsureElementsMode { | 1647 enum EnsureElementsMode { |
1640 DONT_ALLOW_DOUBLE_ELEMENTS, | 1648 DONT_ALLOW_DOUBLE_ELEMENTS, |
1641 ALLOW_COPIED_DOUBLE_ELEMENTS, | 1649 ALLOW_COPIED_DOUBLE_ELEMENTS, |
(...skipping 8605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10247 } else { | 10255 } else { |
10248 value &= ~(1 << bit_position); | 10256 value &= ~(1 << bit_position); |
10249 } | 10257 } |
10250 return value; | 10258 return value; |
10251 } | 10259 } |
10252 }; | 10260 }; |
10253 | 10261 |
10254 } } // namespace v8::internal | 10262 } } // namespace v8::internal |
10255 | 10263 |
10256 #endif // V8_OBJECTS_H_ | 10264 #endif // V8_OBJECTS_H_ |
OLD | NEW |