| 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 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1041 INLINE(bool IsException() const); | 1041 INLINE(bool IsException() const); |
| 1042 INLINE(bool IsUninitialized() const); | 1042 INLINE(bool IsUninitialized() const); |
| 1043 INLINE(bool IsTrue() const); | 1043 INLINE(bool IsTrue() const); |
| 1044 INLINE(bool IsFalse() const); | 1044 INLINE(bool IsFalse() const); |
| 1045 INLINE(bool IsArgumentsMarker() const); | 1045 INLINE(bool IsArgumentsMarker() const); |
| 1046 | 1046 |
| 1047 // Filler objects (fillers and free space objects). | 1047 // Filler objects (fillers and free space objects). |
| 1048 INLINE(bool IsFiller() const); | 1048 INLINE(bool IsFiller() const); |
| 1049 | 1049 |
| 1050 // Extract the number. | 1050 // Extract the number. |
| 1051 inline double Number(); | 1051 inline double Number() const; |
| 1052 INLINE(bool IsNaN() const); | 1052 INLINE(bool IsNaN() const); |
| 1053 INLINE(bool IsMinusZero() const); | 1053 INLINE(bool IsMinusZero() const); |
| 1054 bool ToInt32(int32_t* value); | 1054 bool ToInt32(int32_t* value); |
| 1055 bool ToUint32(uint32_t* value); | 1055 bool ToUint32(uint32_t* value); |
| 1056 | 1056 |
| 1057 inline Representation OptimalRepresentation(); | 1057 inline Representation OptimalRepresentation(); |
| 1058 | 1058 |
| 1059 inline ElementsKind OptimalElementsKind(); | 1059 inline ElementsKind OptimalElementsKind(); |
| 1060 | 1060 |
| 1061 inline bool FitsRepresentation(Representation representation); | 1061 inline bool FitsRepresentation(Representation representation); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1076 Representation representation); | 1076 Representation representation); |
| 1077 | 1077 |
| 1078 // Returns true if the object is of the correct type to be used as a | 1078 // Returns true if the object is of the correct type to be used as a |
| 1079 // implementation of a JSObject's elements. | 1079 // implementation of a JSObject's elements. |
| 1080 inline bool HasValidElements(); | 1080 inline bool HasValidElements(); |
| 1081 | 1081 |
| 1082 inline bool HasSpecificClassOf(String* name); | 1082 inline bool HasSpecificClassOf(String* name); |
| 1083 | 1083 |
| 1084 bool BooleanValue(); // ECMA-262 9.2. | 1084 bool BooleanValue(); // ECMA-262 9.2. |
| 1085 | 1085 |
| 1086 // ES6 section 7.2.12 Abstract Equality Comparison |
| 1087 MUST_USE_RESULT static Maybe<bool> Equals(Handle<Object> x, Handle<Object> y); |
| 1088 |
| 1086 // ES6 section 7.2.13 Strict Equality Comparison | 1089 // ES6 section 7.2.13 Strict Equality Comparison |
| 1087 bool StrictEquals(Object* that); | 1090 bool StrictEquals(Object* that); |
| 1088 | 1091 |
| 1089 // Convert to a JSObject if needed. | 1092 // Convert to a JSObject if needed. |
| 1090 // native_context is used when creating wrapper object. | 1093 // native_context is used when creating wrapper object. |
| 1091 static inline MaybeHandle<JSReceiver> ToObject(Isolate* isolate, | 1094 static inline MaybeHandle<JSReceiver> ToObject(Isolate* isolate, |
| 1092 Handle<Object> object); | 1095 Handle<Object> object); |
| 1093 MUST_USE_RESULT static MaybeHandle<JSReceiver> ToObject( | 1096 MUST_USE_RESULT static MaybeHandle<JSReceiver> ToObject( |
| 1094 Isolate* isolate, Handle<Object> object, Handle<Context> context); | 1097 Isolate* isolate, Handle<Object> object, Handle<Context> context); |
| 1095 | 1098 |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1650 public: | 1653 public: |
| 1651 DECLARE_CAST(Simd128Value) | 1654 DECLARE_CAST(Simd128Value) |
| 1652 | 1655 |
| 1653 DECLARE_PRINTER(Simd128Value) | 1656 DECLARE_PRINTER(Simd128Value) |
| 1654 DECLARE_VERIFIER(Simd128Value) | 1657 DECLARE_VERIFIER(Simd128Value) |
| 1655 | 1658 |
| 1656 static Handle<String> ToString(Handle<Simd128Value> input); | 1659 static Handle<String> ToString(Handle<Simd128Value> input); |
| 1657 | 1660 |
| 1658 // Equality operations. | 1661 // Equality operations. |
| 1659 inline bool Equals(Simd128Value* that); | 1662 inline bool Equals(Simd128Value* that); |
| 1663 static inline bool Equals(Handle<Simd128Value> one, Handle<Simd128Value> two); |
| 1660 | 1664 |
| 1661 // Checks that another instance is bit-wise equal. | 1665 // Checks that another instance is bit-wise equal. |
| 1662 bool BitwiseEquals(const Simd128Value* other) const; | 1666 bool BitwiseEquals(const Simd128Value* other) const; |
| 1663 // Computes a hash from the 128 bit value, viewed as 4 32-bit integers. | 1667 // Computes a hash from the 128 bit value, viewed as 4 32-bit integers. |
| 1664 uint32_t Hash() const; | 1668 uint32_t Hash() const; |
| 1665 // Copies the 16 bytes of SIMD data to the destination address. | 1669 // Copies the 16 bytes of SIMD data to the destination address. |
| 1666 void CopyBits(void* destination) const; | 1670 void CopyBits(void* destination) const; |
| 1667 | 1671 |
| 1668 // Layout description. | 1672 // Layout description. |
| 1669 static const int kValueOffset = HeapObject::kHeaderSize; | 1673 static const int kValueOffset = HeapObject::kHeaderSize; |
| (...skipping 7425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9095 | 9099 |
| 9096 // [to_number]: Cached to_number computed at startup. | 9100 // [to_number]: Cached to_number computed at startup. |
| 9097 DECL_ACCESSORS(to_number, Object) | 9101 DECL_ACCESSORS(to_number, Object) |
| 9098 | 9102 |
| 9099 // [typeof]: Cached type_of computed at startup. | 9103 // [typeof]: Cached type_of computed at startup. |
| 9100 DECL_ACCESSORS(type_of, String) | 9104 DECL_ACCESSORS(type_of, String) |
| 9101 | 9105 |
| 9102 inline byte kind() const; | 9106 inline byte kind() const; |
| 9103 inline void set_kind(byte kind); | 9107 inline void set_kind(byte kind); |
| 9104 | 9108 |
| 9109 // ES6 section 7.1.3 ToNumber for Boolean, Null, Undefined. |
| 9110 MUST_USE_RESULT static inline Handle<Object> ToNumber(Handle<Oddball> input); |
| 9111 |
| 9105 DECLARE_CAST(Oddball) | 9112 DECLARE_CAST(Oddball) |
| 9106 | 9113 |
| 9107 // Dispatched behavior. | 9114 // Dispatched behavior. |
| 9108 DECLARE_VERIFIER(Oddball) | 9115 DECLARE_VERIFIER(Oddball) |
| 9109 | 9116 |
| 9110 // Initialize the fields. | 9117 // Initialize the fields. |
| 9111 static void Initialize(Isolate* isolate, Handle<Oddball> oddball, | 9118 static void Initialize(Isolate* isolate, Handle<Oddball> oddball, |
| 9112 const char* to_string, Handle<Object> to_number, | 9119 const char* to_string, Handle<Object> to_number, |
| 9113 const char* type_of, byte kind); | 9120 const char* type_of, byte kind); |
| 9114 | 9121 |
| (...skipping 1351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10466 } else { | 10473 } else { |
| 10467 value &= ~(1 << bit_position); | 10474 value &= ~(1 << bit_position); |
| 10468 } | 10475 } |
| 10469 return value; | 10476 return value; |
| 10470 } | 10477 } |
| 10471 }; | 10478 }; |
| 10472 | 10479 |
| 10473 } } // namespace v8::internal | 10480 } } // namespace v8::internal |
| 10474 | 10481 |
| 10475 #endif // V8_OBJECTS_H_ | 10482 #endif // V8_OBJECTS_H_ |
| OLD | NEW |