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 |
8957 DECLARE_CAST(Name) | 8960 DECLARE_CAST(Name) |
8958 | 8961 |
8959 DECLARE_PRINTER(Name) | 8962 DECLARE_PRINTER(Name) |
8960 | 8963 |
8961 // Layout description. | 8964 // Layout description. |
8962 static const int kHashFieldOffset = HeapObject::kHeaderSize; | 8965 static const int kHashFieldOffset = HeapObject::kHeaderSize; |
8963 static const int kSize = kHashFieldOffset + kPointerSize; | 8966 static const int kSize = kHashFieldOffset + kPointerSize; |
8964 | 8967 |
8965 // Mask constant for checking if a name has a computed hash code | 8968 // Mask constant for checking if a name has a computed hash code |
8966 // and if it is a string that is an array index. The least significant bit | 8969 // 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... |
9022 class Symbol: public Name { | 9025 class Symbol: public Name { |
9023 public: | 9026 public: |
9024 // [name]: the print name of a symbol, or undefined if none. | 9027 // [name]: the print name of a symbol, or undefined if none. |
9025 DECL_ACCESSORS(name, Object) | 9028 DECL_ACCESSORS(name, Object) |
9026 | 9029 |
9027 DECL_ACCESSORS(flags, Smi) | 9030 DECL_ACCESSORS(flags, Smi) |
9028 | 9031 |
9029 // [is_private]: whether this is a private symbol. | 9032 // [is_private]: whether this is a private symbol. |
9030 DECL_BOOLEAN_ACCESSORS(is_private) | 9033 DECL_BOOLEAN_ACCESSORS(is_private) |
9031 | 9034 |
| 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 |
9032 DECLARE_CAST(Symbol) | 9039 DECLARE_CAST(Symbol) |
9033 | 9040 |
9034 // Dispatched behavior. | 9041 // Dispatched behavior. |
9035 DECLARE_PRINTER(Symbol) | 9042 DECLARE_PRINTER(Symbol) |
9036 DECLARE_VERIFIER(Symbol) | 9043 DECLARE_VERIFIER(Symbol) |
9037 | 9044 |
9038 // Layout description. | 9045 // Layout description. |
9039 static const int kNameOffset = Name::kSize; | 9046 static const int kNameOffset = Name::kSize; |
9040 static const int kFlagsOffset = kNameOffset + kPointerSize; | 9047 static const int kFlagsOffset = kNameOffset + kPointerSize; |
9041 static const int kSize = kFlagsOffset + kPointerSize; | 9048 static const int kSize = kFlagsOffset + kPointerSize; |
9042 | 9049 |
9043 typedef FixedBodyDescriptor<kNameOffset, kFlagsOffset, kSize> BodyDescriptor; | 9050 typedef FixedBodyDescriptor<kNameOffset, kFlagsOffset, kSize> BodyDescriptor; |
9044 | 9051 |
9045 private: | 9052 private: |
9046 static const int kPrivateBit = 0; | 9053 static const int kPrivateBit = 0; |
| 9054 static const int kOwnBit = 1; |
9047 | 9055 |
9048 DISALLOW_IMPLICIT_CONSTRUCTORS(Symbol); | 9056 DISALLOW_IMPLICIT_CONSTRUCTORS(Symbol); |
9049 }; | 9057 }; |
9050 | 9058 |
9051 | 9059 |
9052 class ConsString; | 9060 class ConsString; |
9053 | 9061 |
9054 // The String abstract class captures JavaScript string values: | 9062 // The String abstract class captures JavaScript string values: |
9055 // | 9063 // |
9056 // Ecma-262: | 9064 // Ecma-262: |
(...skipping 2208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
11265 } else { | 11273 } else { |
11266 value &= ~(1 << bit_position); | 11274 value &= ~(1 << bit_position); |
11267 } | 11275 } |
11268 return value; | 11276 return value; |
11269 } | 11277 } |
11270 }; | 11278 }; |
11271 | 11279 |
11272 } } // namespace v8::internal | 11280 } } // namespace v8::internal |
11273 | 11281 |
11274 #endif // V8_OBJECTS_H_ | 11282 #endif // V8_OBJECTS_H_ |
OLD | NEW |