| Index: src/heap.cc
|
| diff --git a/src/heap.cc b/src/heap.cc
|
| index 70440f6961272544a585e0d3885f8e43439e5fd8..9ecbaf09d45277bc23671ab747ab13d2f668ca46 100644
|
| --- a/src/heap.cc
|
| +++ b/src/heap.cc
|
| @@ -114,6 +114,7 @@ Heap::Heap()
|
| amount_of_external_allocated_memory_(0),
|
| amount_of_external_allocated_memory_at_last_global_gc_(0),
|
| old_gen_exhausted_(false),
|
| + inline_allocation_disabled_(false),
|
| store_buffer_rebuilder_(store_buffer()),
|
| hidden_string_(NULL),
|
| gc_safe_size_of_old_object_(NULL),
|
| @@ -938,6 +939,8 @@ void Heap::ClearNormalizedMapCaches() {
|
|
|
|
|
| void Heap::UpdateSurvivalRateTrend(int start_new_space_size) {
|
| + if (start_new_space_size == 0) return;
|
| +
|
| double survival_rate =
|
| (static_cast<double>(young_survivors_after_last_gc_) * 100) /
|
| start_new_space_size;
|
| @@ -3120,6 +3123,12 @@ void Heap::CreateFixedStubs() {
|
| }
|
|
|
|
|
| +void Heap::CreateStubsRequiringBuiltins() {
|
| + HandleScope scope(isolate());
|
| + CodeStub::GenerateStubsRequiringBuiltinsAheadOfTime(isolate());
|
| +}
|
| +
|
| +
|
| bool Heap::CreateInitialObjects() {
|
| Object* obj;
|
|
|
| @@ -3316,11 +3325,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);
|
| @@ -3332,6 +3343,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.
|
| @@ -4600,8 +4612,7 @@ MaybeObject* Heap::AllocateJSObjectWithAllocationSite(JSFunction* constructor,
|
| // advice
|
| Map* initial_map = constructor->initial_map();
|
|
|
| - Smi* smi = Smi::cast(allocation_site->transition_info());
|
| - ElementsKind to_kind = static_cast<ElementsKind>(smi->value());
|
| + ElementsKind to_kind = allocation_site->GetElementsKind();
|
| AllocationSiteMode mode = TRACK_ALLOCATION_SITE;
|
| if (to_kind != initial_map->elements_kind()) {
|
| MaybeObject* maybe_new_map = initial_map->AsElementsKind(to_kind);
|
| @@ -5521,12 +5532,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 =
|
| @@ -6573,6 +6594,32 @@ intptr_t Heap::PromotedExternalMemorySize() {
|
| }
|
|
|
|
|
| +void Heap::EnableInlineAllocation() {
|
| + ASSERT(inline_allocation_disabled_);
|
| + inline_allocation_disabled_ = false;
|
| +
|
| + // Update inline allocation limit for new space.
|
| + new_space()->UpdateInlineAllocationLimit(0);
|
| +}
|
| +
|
| +
|
| +void Heap::DisableInlineAllocation() {
|
| + ASSERT(!inline_allocation_disabled_);
|
| + inline_allocation_disabled_ = true;
|
| +
|
| + // Update inline allocation limit for new space.
|
| + new_space()->UpdateInlineAllocationLimit(0);
|
| +
|
| + // Update inline allocation limit for old spaces.
|
| + PagedSpaces spaces(this);
|
| + for (PagedSpace* space = spaces.next();
|
| + space != NULL;
|
| + space = spaces.next()) {
|
| + space->EmptyAllocationInfo();
|
| + }
|
| +}
|
| +
|
| +
|
| V8_DECLARE_ONCE(initialize_gc_once);
|
|
|
| static void InitializeGCOnce() {
|
|
|