| // Copyright 2019 the V8 project authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| @abstract |
| @generateCppClass |
| extern class Name extends PrimitiveHeapObject { |
| hash_field: NameHash; |
| } |
| |
| bitfield struct NameHash extends uint32 { |
| hash_not_commputed: bool: 1 bit; |
| is_not_integer_index_mask: bool: 1 bit; |
| array_index_value: uint32: 24 bit; |
| array_index_length: uint32: 6 bit; |
| } |
| |
| // This is the same as Name, but with the information that there are no other |
| // kinds of names. |
| type AnyName = PrivateSymbol|PublicSymbol|String; |
| |
| bitfield struct SymbolFlags extends uint32 { |
| is_private: bool: 1 bit; |
| is_well_known_symbol: bool: 1 bit; |
| is_in_public_symbol_table: bool: 1 bit; |
| is_interesting_symbol: bool: 1 bit; |
| is_private_name: bool: 1 bit; |
| is_private_brand: bool: 1 bit; |
| } |
| |
| @generateCppClass |
| extern class Symbol extends Name { |
| flags: SymbolFlags; |
| description: String|Undefined; |
| } |
| |
| type PublicSymbol extends Symbol; |
| type PrivateSymbol extends Symbol; |
| |
| const kNameEmptyHashField: NameHash = NameHash{ |
| hash_not_commputed: true, |
| is_not_integer_index_mask: true, |
| array_index_value: 0, |
| array_index_length: 0 |
| }; |
| |
| const kMaxCachedArrayIndexLength: constexpr uint32 |
| generates 'Name::kMaxCachedArrayIndexLength'; |