OLD | NEW |
1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 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_NAME_H_ | 5 #ifndef V8_OBJECTS_NAME_H_ |
6 #define V8_OBJECTS_NAME_H_ | 6 #define V8_OBJECTS_NAME_H_ |
7 | 7 |
8 #include "src/objects.h" | 8 #include "src/objects.h" |
9 | 9 |
10 // Has to be the last include (doesn't have include guards): | 10 // Has to be the last include (doesn't have include guards): |
(...skipping 29 matching lines...) Expand all Loading... |
40 inline bool IsUniqueName() const; | 40 inline bool IsUniqueName() const; |
41 | 41 |
42 static inline bool ContainsCachedArrayIndex(uint32_t hash); | 42 static inline bool ContainsCachedArrayIndex(uint32_t hash); |
43 | 43 |
44 // Return a string version of this name that is converted according to the | 44 // Return a string version of this name that is converted according to the |
45 // rules described in ES6 section 9.2.11. | 45 // rules described in ES6 section 9.2.11. |
46 MUST_USE_RESULT static MaybeHandle<String> ToFunctionName(Handle<Name> name); | 46 MUST_USE_RESULT static MaybeHandle<String> ToFunctionName(Handle<Name> name); |
47 MUST_USE_RESULT static MaybeHandle<String> ToFunctionName( | 47 MUST_USE_RESULT static MaybeHandle<String> ToFunctionName( |
48 Handle<Name> name, Handle<String> prefix); | 48 Handle<Name> name, Handle<String> prefix); |
49 | 49 |
50 DECLARE_CAST(Name) | 50 DECL_CAST(Name) |
51 | 51 |
52 DECLARE_PRINTER(Name) | 52 DECL_PRINTER(Name) |
53 #if V8_TRACE_MAPS | 53 #if V8_TRACE_MAPS |
54 void NameShortPrint(); | 54 void NameShortPrint(); |
55 int NameShortPrint(Vector<char> str); | 55 int NameShortPrint(Vector<char> str); |
56 #endif | 56 #endif |
57 | 57 |
58 // Layout description. | 58 // Layout description. |
59 static const int kHashFieldSlot = HeapObject::kHeaderSize; | 59 static const int kHashFieldSlot = HeapObject::kHeaderSize; |
60 #if V8_TARGET_LITTLE_ENDIAN || !V8_HOST_ARCH_64_BIT | 60 #if V8_TARGET_LITTLE_ENDIAN || !V8_HOST_ARCH_64_BIT |
61 static const int kHashFieldOffset = kHashFieldSlot; | 61 static const int kHashFieldOffset = kHashFieldSlot; |
62 #else | 62 #else |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 | 141 |
142 // [is_well_known_symbol]: Whether this is a spec-defined well-known symbol, | 142 // [is_well_known_symbol]: Whether this is a spec-defined well-known symbol, |
143 // or not. Well-known symbols do not throw when an access check fails during | 143 // or not. Well-known symbols do not throw when an access check fails during |
144 // a load. | 144 // a load. |
145 DECL_BOOLEAN_ACCESSORS(is_well_known_symbol) | 145 DECL_BOOLEAN_ACCESSORS(is_well_known_symbol) |
146 | 146 |
147 // [is_public]: Whether this is a symbol created by Symbol.for. Calling | 147 // [is_public]: Whether this is a symbol created by Symbol.for. Calling |
148 // Symbol.keyFor on such a symbol simply needs to return the attached name. | 148 // Symbol.keyFor on such a symbol simply needs to return the attached name. |
149 DECL_BOOLEAN_ACCESSORS(is_public) | 149 DECL_BOOLEAN_ACCESSORS(is_public) |
150 | 150 |
151 DECLARE_CAST(Symbol) | 151 DECL_CAST(Symbol) |
152 | 152 |
153 // Dispatched behavior. | 153 // Dispatched behavior. |
154 DECLARE_PRINTER(Symbol) | 154 DECL_PRINTER(Symbol) |
155 DECLARE_VERIFIER(Symbol) | 155 DECL_VERIFIER(Symbol) |
156 | 156 |
157 // Layout description. | 157 // Layout description. |
158 static const int kNameOffset = Name::kSize; | 158 static const int kNameOffset = Name::kSize; |
159 static const int kFlagsOffset = kNameOffset + kPointerSize; | 159 static const int kFlagsOffset = kNameOffset + kPointerSize; |
160 static const int kSize = kFlagsOffset + kPointerSize; | 160 static const int kSize = kFlagsOffset + kPointerSize; |
161 | 161 |
162 // Flags layout. | 162 // Flags layout. |
163 static const int kPrivateBit = 0; | 163 static const int kPrivateBit = 0; |
164 static const int kWellKnownSymbolBit = 1; | 164 static const int kWellKnownSymbolBit = 1; |
165 static const int kPublicBit = 2; | 165 static const int kPublicBit = 2; |
(...skipping 13 matching lines...) Expand all Loading... |
179 | 179 |
180 DISALLOW_IMPLICIT_CONSTRUCTORS(Symbol); | 180 DISALLOW_IMPLICIT_CONSTRUCTORS(Symbol); |
181 }; | 181 }; |
182 | 182 |
183 } // namespace internal | 183 } // namespace internal |
184 } // namespace v8 | 184 } // namespace v8 |
185 | 185 |
186 #include "src/objects/object-macros-undef.h" | 186 #include "src/objects/object-macros-undef.h" |
187 | 187 |
188 #endif // V8_OBJECTS_NAME_H_ | 188 #endif // V8_OBJECTS_NAME_H_ |
OLD | NEW |