| 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 "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/assert-scope.h" | 9 #include "src/assert-scope.h" |
| 10 #include "src/builtins.h" | 10 #include "src/builtins.h" |
| (...skipping 8936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8947 // Returns a hash value used for the property table | 8947 // Returns a hash value used for the property table |
| 8948 inline uint32_t Hash(); | 8948 inline uint32_t Hash(); |
| 8949 | 8949 |
| 8950 // Equality operations. | 8950 // Equality operations. |
| 8951 inline bool Equals(Name* other); | 8951 inline bool Equals(Name* other); |
| 8952 inline static bool Equals(Handle<Name> one, Handle<Name> two); | 8952 inline static bool Equals(Handle<Name> one, Handle<Name> two); |
| 8953 | 8953 |
| 8954 // Conversion. | 8954 // Conversion. |
| 8955 inline bool AsArrayIndex(uint32_t* index); | 8955 inline bool AsArrayIndex(uint32_t* index); |
| 8956 | 8956 |
| 8957 // Whether name can only name own properties. | |
| 8958 inline bool IsOwn(); | |
| 8959 | |
| 8960 DECLARE_CAST(Name) | 8957 DECLARE_CAST(Name) |
| 8961 | 8958 |
| 8962 DECLARE_PRINTER(Name) | 8959 DECLARE_PRINTER(Name) |
| 8963 | 8960 |
| 8964 // Layout description. | 8961 // Layout description. |
| 8965 static const int kHashFieldOffset = HeapObject::kHeaderSize; | 8962 static const int kHashFieldOffset = HeapObject::kHeaderSize; |
| 8966 static const int kSize = kHashFieldOffset + kPointerSize; | 8963 static const int kSize = kHashFieldOffset + kPointerSize; |
| 8967 | 8964 |
| 8968 // Mask constant for checking if a name has a computed hash code | 8965 // Mask constant for checking if a name has a computed hash code |
| 8969 // and if it is a string that is an array index. The least significant bit | 8966 // and if it is a string that is an array index. The least significant bit |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9025 class Symbol: public Name { | 9022 class Symbol: public Name { |
| 9026 public: | 9023 public: |
| 9027 // [name]: the print name of a symbol, or undefined if none. | 9024 // [name]: the print name of a symbol, or undefined if none. |
| 9028 DECL_ACCESSORS(name, Object) | 9025 DECL_ACCESSORS(name, Object) |
| 9029 | 9026 |
| 9030 DECL_ACCESSORS(flags, Smi) | 9027 DECL_ACCESSORS(flags, Smi) |
| 9031 | 9028 |
| 9032 // [is_private]: whether this is a private symbol. | 9029 // [is_private]: whether this is a private symbol. |
| 9033 DECL_BOOLEAN_ACCESSORS(is_private) | 9030 DECL_BOOLEAN_ACCESSORS(is_private) |
| 9034 | 9031 |
| 9035 // [is_own]: whether this is an own symbol, that is, only used to designate | |
| 9036 // own properties of objects. | |
| 9037 DECL_BOOLEAN_ACCESSORS(is_own) | |
| 9038 | |
| 9039 DECLARE_CAST(Symbol) | 9032 DECLARE_CAST(Symbol) |
| 9040 | 9033 |
| 9041 // Dispatched behavior. | 9034 // Dispatched behavior. |
| 9042 DECLARE_PRINTER(Symbol) | 9035 DECLARE_PRINTER(Symbol) |
| 9043 DECLARE_VERIFIER(Symbol) | 9036 DECLARE_VERIFIER(Symbol) |
| 9044 | 9037 |
| 9045 // Layout description. | 9038 // Layout description. |
| 9046 static const int kNameOffset = Name::kSize; | 9039 static const int kNameOffset = Name::kSize; |
| 9047 static const int kFlagsOffset = kNameOffset + kPointerSize; | 9040 static const int kFlagsOffset = kNameOffset + kPointerSize; |
| 9048 static const int kSize = kFlagsOffset + kPointerSize; | 9041 static const int kSize = kFlagsOffset + kPointerSize; |
| 9049 | 9042 |
| 9050 typedef FixedBodyDescriptor<kNameOffset, kFlagsOffset, kSize> BodyDescriptor; | 9043 typedef FixedBodyDescriptor<kNameOffset, kFlagsOffset, kSize> BodyDescriptor; |
| 9051 | 9044 |
| 9052 private: | 9045 private: |
| 9053 static const int kPrivateBit = 0; | 9046 static const int kPrivateBit = 0; |
| 9054 static const int kOwnBit = 1; | |
| 9055 | 9047 |
| 9056 DISALLOW_IMPLICIT_CONSTRUCTORS(Symbol); | 9048 DISALLOW_IMPLICIT_CONSTRUCTORS(Symbol); |
| 9057 }; | 9049 }; |
| 9058 | 9050 |
| 9059 | 9051 |
| 9060 class ConsString; | 9052 class ConsString; |
| 9061 | 9053 |
| 9062 // The String abstract class captures JavaScript string values: | 9054 // The String abstract class captures JavaScript string values: |
| 9063 // | 9055 // |
| 9064 // Ecma-262: | 9056 // Ecma-262: |
| (...skipping 2207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11272 } else { | 11264 } else { |
| 11273 value &= ~(1 << bit_position); | 11265 value &= ~(1 << bit_position); |
| 11274 } | 11266 } |
| 11275 return value; | 11267 return value; |
| 11276 } | 11268 } |
| 11277 }; | 11269 }; |
| 11278 | 11270 |
| 11279 } } // namespace v8::internal | 11271 } } // namespace v8::internal |
| 11280 | 11272 |
| 11281 #endif // V8_OBJECTS_H_ | 11273 #endif // V8_OBJECTS_H_ |
| OLD | NEW |