[objects] Rename is_public bit on Symbol

The is_public name is misleading now that we have private
symbols. It's only used to know if the symbol is stored in the global
symbol registry.

This patch renames it to a more suitable name.

Change-Id: I78f31cb5438416d07b78a9038c3526c9dfb96c6e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1738849
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Tobias Tebbi <tebbi@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63092}
This commit is contained in:
Sathya Gunasekaran 2019-08-06 12:06:11 +01:00 committed by Commit Bot
parent db9e542662
commit b319a99b16
4 changed files with 13 additions and 11 deletions

View File

@ -54,7 +54,7 @@ BUILTIN(SymbolKeyFor) {
Handle<Symbol> symbol = Handle<Symbol>::cast(obj);
DisallowHeapAllocation no_gc;
Object result;
if (symbol->is_public()) {
if (symbol->is_in_public_symbol_table()) {
result = symbol->name();
DCHECK(result.IsString());
} else {

View File

@ -4190,7 +4190,7 @@ Handle<Symbol> Isolate::SymbolFor(RootIndex dictionary_index,
PropertyDetails::Empty(), &entry);
switch (dictionary_index) {
case RootIndex::kPublicSymbolTable:
symbol->set_is_public(true);
symbol->set_is_in_public_symbol_table(true);
heap()->set_public_symbol_table(*dictionary);
break;
case RootIndex::kApiSymbolTable:

View File

@ -22,7 +22,8 @@ TQ_OBJECT_CONSTRUCTORS_IMPL(Symbol)
BIT_FIELD_ACCESSORS(Symbol, flags, is_private, Symbol::IsPrivateBit)
BIT_FIELD_ACCESSORS(Symbol, flags, is_well_known_symbol,
Symbol::IsWellKnownSymbolBit)
BIT_FIELD_ACCESSORS(Symbol, flags, is_public, Symbol::IsPublicBit)
BIT_FIELD_ACCESSORS(Symbol, flags, is_in_public_symbol_table,
Symbol::IsInPublicSymbolTableBit)
BIT_FIELD_ACCESSORS(Symbol, flags, is_interesting_symbol,
Symbol::IsInterestingSymbolBit)

View File

@ -146,9 +146,10 @@ class Symbol : public TorqueGeneratedSymbol<Symbol, Name> {
// for a detailed description.
DECL_BOOLEAN_ACCESSORS(is_interesting_symbol)
// [is_public]: Whether this is a symbol created by Symbol.for. Calling
// Symbol.keyFor on such a symbol simply needs to return the attached name.
DECL_BOOLEAN_ACCESSORS(is_public)
// [is_in_public_symbol_table]: Whether this is a symbol created by
// Symbol.for. Calling Symbol.keyFor on such a symbol simply needs
// to return the attached name.
DECL_BOOLEAN_ACCESSORS(is_in_public_symbol_table)
// [is_private_name]: Whether this is a private name. Private names
// are the same as private symbols except they throw on missing
@ -163,11 +164,11 @@ class Symbol : public TorqueGeneratedSymbol<Symbol, Name> {
DECL_VERIFIER(Symbol)
// Flags layout.
#define FLAGS_BIT_FIELDS(V, _) \
V(IsPrivateBit, bool, 1, _) \
V(IsWellKnownSymbolBit, bool, 1, _) \
V(IsPublicBit, bool, 1, _) \
V(IsInterestingSymbolBit, bool, 1, _) \
#define FLAGS_BIT_FIELDS(V, _) \
V(IsPrivateBit, bool, 1, _) \
V(IsWellKnownSymbolBit, bool, 1, _) \
V(IsInPublicSymbolTableBit, bool, 1, _) \
V(IsInterestingSymbolBit, bool, 1, _) \
V(IsPrivateNameBit, bool, 1, _)
DEFINE_BIT_FIELDS(FLAGS_BIT_FIELDS)