Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(906)

Unified Diff: src/heap/heap.cc

Issue 1292963006: [heap] Move {hidden_string} into the root list. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 19c668e5bfaf1e35f48d8e3cdc75d35297bf4d2b..3ae588f1dbadc7a58dd49c61b1f038092b8e4db6 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -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);
« no previous file with comments | « src/heap/heap.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698