Commit b319a99b authored by Sathya Gunasekaran's avatar Sathya Gunasekaran Committed by Commit Bot

[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/+/1738849Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Sathya Gunasekaran  <gsathya@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63092}
parent db9e5426
......@@ -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 {
......
......@@ -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:
......
......@@ -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)
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment