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