Reviewers: Hannes Payer,
Description:
[heap] Move {hidden_string} into the root list.
[email protected]
Please review this at https://codereview.chromium.org/1292963006/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+5, -19 lines):
M src/factory.h
M src/heap/heap.h
M src/heap/heap.cc
M src/objects.h
Index: src/factory.h
diff --git a/src/factory.h b/src/factory.h
index
2c3d687786fe6d2b53c1ecbbe6baf3ce9c3add20..0828e81db5177e02b909eaf3c40e1e2cde36acfe
100644
--- a/src/factory.h
+++ b/src/factory.h
@@ -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,
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);
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index
040144d4d61c3b9eec755ce77d1fe3b29f354daa..d4248079e72dbb1bc57f1c3af8b644ca86ea1900
100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -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 {
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index
2dd3fa13c2e97d17258e59902500c16efa4f936f..c106a784e30b2cff742266cfc6c36aa28a1d94d4
100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -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)")
\
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.