Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index fa358c53929127218fbd4fd719d5bec8d3bab3b0..9c7c8483f7b7527496de6810f08b3164aff4a9d8 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -3282,11 +3282,13 @@ bool Heap::CreateInitialObjects() { |
{ MaybeObject* maybe_obj = AllocateSymbol(); |
if (!maybe_obj->ToObject(&obj)) return false; |
} |
+ Symbol::cast(obj)->set_is_private(true); |
set_frozen_symbol(Symbol::cast(obj)); |
{ MaybeObject* maybe_obj = AllocateSymbol(); |
if (!maybe_obj->ToObject(&obj)) return false; |
} |
+ Symbol::cast(obj)->set_is_private(true); |
set_elements_transition_symbol(Symbol::cast(obj)); |
{ MaybeObject* maybe_obj = SeededNumberDictionary::Allocate(this, 0, TENURED); |
@@ -3298,6 +3300,7 @@ bool Heap::CreateInitialObjects() { |
{ MaybeObject* maybe_obj = AllocateSymbol(); |
if (!maybe_obj->ToObject(&obj)) return false; |
} |
+ Symbol::cast(obj)->set_is_private(true); |
set_observed_symbol(Symbol::cast(obj)); |
// Handling of script id generation is in Factory::NewScript. |
@@ -5595,12 +5598,22 @@ MaybeObject* Heap::AllocateSymbol() { |
Symbol::cast(result)->set_hash_field( |
Name::kIsNotArrayIndexMask | (hash << Name::kHashShift)); |
Symbol::cast(result)->set_name(undefined_value()); |
+ Symbol::cast(result)->set_flags(Smi::FromInt(0)); |
- ASSERT(result->IsSymbol()); |
+ ASSERT(!Symbol::cast(result)->is_private()); |
return result; |
} |
+MaybeObject* Heap::AllocatePrivateSymbol() { |
+ MaybeObject* maybe = AllocateSymbol(); |
+ Symbol* symbol; |
+ if (!maybe->To(&symbol)) return maybe; |
+ symbol->set_is_private(true); |
+ return symbol; |
+} |
+ |
+ |
MaybeObject* Heap::AllocateNativeContext() { |
Object* result; |
{ MaybeObject* maybe_result = |