[heap] Move {hidden_string} into the root list.

R=hpayer@chromium.org

Review URL: https://codereview.chromium.org/1292963006

Cr-Commit-Position: refs/heads/master@{#30272}
This commit is contained in:
mstarzinger 2015-08-20 07:08:38 -07:00 committed by Commit bot
parent 6d67f7db37
commit 05e843443a
4 changed files with 5 additions and 19 deletions

View File

@ -625,10 +625,6 @@ class Factory final {
isolate()->heap()->set_weak_stack_trace_list(*list);
}
Handle<String> hidden_string() {
return Handle<String>(&isolate()->heap()->hidden_string_);
}
// Allocates a new SharedFunctionInfo object.
Handle<SharedFunctionInfo> NewSharedFunctionInfo(
Handle<String> name, int number_of_literals, FunctionKind kind,

View File

@ -96,7 +96,6 @@ Heap::Heap()
optimize_for_memory_usage_(false),
inline_allocation_disabled_(false),
store_buffer_rebuilder_(store_buffer()),
hidden_string_(NULL),
total_regexp_code_generated_(0),
tracer_(this),
high_survival_rate_period_length_(0),
@ -3227,14 +3226,16 @@ void Heap::CreateInitialObjects() {
roots_[constant_string_table[i].index] = *str;
}
// The {hidden_string} is special because it is an empty string, but does not
// match any string (even the {empty_string}) when looked up in properties.
// Allocate the hidden string which is used to identify the hidden properties
// in JSObjects. The hash code has a special value so that it will not match
// the empty string when searching for the property. It cannot be part of the
// loop above because it needs to be allocated manually with the special
// hash code in place. The hash code for the hidden_string is zero to ensure
// that it will always be at the first entry in property descriptors.
hidden_string_ = *factory->NewOneByteInternalizedString(
OneByteVector("", 0), String::kEmptyStringHash);
set_hidden_string(*factory->NewOneByteInternalizedString(
OneByteVector("", 0), String::kEmptyStringHash));
// Create the code_stubs dictionary. The initial size is set to avoid
// expanding the dictionary during bootstrapping.
@ -5255,9 +5256,6 @@ void Heap::IterateStrongRoots(ObjectVisitor* v, VisitMode mode) {
v->VisitPointers(&roots_[0], &roots_[kStrongRootListLength]);
v->Synchronize(VisitorSynchronization::kStrongRootList);
v->VisitPointer(bit_cast<Object**>(&hidden_string_));
v->Synchronize(VisitorSynchronization::kInternalizedString);
isolate_->bootstrapper()->Iterate(v);
v->Synchronize(VisitorSynchronization::kBootstrapper);
isolate_->Iterate(v);

View File

@ -38,6 +38,7 @@ namespace internal {
V(Oddball, true_value, TrueValue) \
V(Oddball, false_value, FalseValue) \
V(String, empty_string, empty_string) \
V(String, hidden_string, hidden_string) \
V(Oddball, uninitialized_value, UninitializedValue) \
V(Map, cell_map, CellMap) \
V(Map, global_property_cell_map, GlobalPropertyCellMap) \
@ -922,10 +923,6 @@ class Heap {
PUBLIC_SYMBOL_LIST(SYMBOL_ACCESSOR)
#undef SYMBOL_ACCESSOR
// The hidden_string is special because it is the empty string, but does
// not match the empty string.
String* hidden_string() { return hidden_string_; }
void set_native_contexts_list(Object* object) {
native_contexts_list_ = object;
}
@ -1808,10 +1805,6 @@ class Heap {
static const ConstantStringTable constant_string_table[];
static const StructTable struct_table[];
// The special hidden string which is an empty string, but does not match
// any string when looked up in properties.
String* hidden_string_;
void AddPrivateGlobalSymbols(Handle<Object> private_intern_table);
struct GCCallbackPair {

View File

@ -10113,7 +10113,6 @@ class BreakPointInfo: public Struct {
V(kExternalStringsTable, "external_strings_table", "(External strings)") \
V(kStrongRootList, "strong_root_list", "(Strong roots)") \
V(kSmiRootList, "smi_root_list", "(Smi roots)") \
V(kInternalizedString, "internalized_string", "(Internal string)") \
V(kBootstrapper, "bootstrapper", "(Bootstrapper)") \
V(kTop, "top", "(Isolate)") \
V(kRelocatable, "relocatable", "(Relocatable)") \