Chromium Code Reviews| Index: src/heap.cc |
| diff --git a/src/heap.cc b/src/heap.cc |
| index d2986682782a71303c9d1060315ef2e57afb2150..735493abc6496b86a3040f2f6cd054c050a7538a 100644 |
| --- a/src/heap.cc |
| +++ b/src/heap.cc |
| @@ -92,6 +92,7 @@ Heap::Heap() |
| always_allocate_scope_depth_(0), |
| linear_allocation_scope_depth_(0), |
| contexts_disposed_(0), |
| + global_context_disposed_count_(0), |
| scan_on_scavenge_pages_(0), |
| new_space_(this), |
| old_pointer_space_(NULL), |
| @@ -2897,6 +2898,7 @@ MaybeObject* Heap::AllocateSharedFunctionInfo(Object* name) { |
| share->set_initial_map(undefined_value(), SKIP_WRITE_BARRIER); |
| share->set_this_property_assignments(undefined_value(), SKIP_WRITE_BARRIER); |
| share->set_deopt_counter(FLAG_deopt_every_n_times); |
| + share->set_context_disposed_count(0); |
| share->set_profiler_ticks(0); |
| share->set_ast_node_count(0); |
| @@ -3393,6 +3395,7 @@ MaybeObject* Heap::CreateCode(const CodeDesc& desc, |
| code->set_type_feedback_info(undefined_value(), SKIP_WRITE_BARRIER); |
| code->set_handler_table(empty_fixed_array(), SKIP_WRITE_BARRIER); |
| code->set_gc_metadata(Smi::FromInt(0)); |
| + code->set_context_disposed_count(global_context_disposed_count_); |
| // Allow self references to created code object by patching the handle to |
| // point to the newly allocated Code object. |
| if (!self_reference.is_null()) { |
| @@ -4838,7 +4841,8 @@ void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) { |
| bool Heap::IdleNotification(int hint) { |
| - intptr_t size_factor = Min(Max(hint, 30), 1000) / 10; |
| + const int kMaxHint = 1000; |
| + intptr_t size_factor = Min(Max(hint, 30), kMaxHint) / 10; |
| // The size factor is in range [3..100]. |
| intptr_t step_size = size_factor * IncrementalMarking::kAllocatedThreshold; |
| @@ -4846,8 +4850,15 @@ bool Heap::IdleNotification(int hint) { |
| int mark_sweep_time = Min(TimeMarkSweepWouldTakeInMs(), 1000); |
| if (hint >= mark_sweep_time && !FLAG_expose_gc) { |
| HistogramTimerScope scope(isolate_->counters()->gc_context()); |
| - CollectAllGarbage(kReduceMemoryFootprintMask, |
| - "idle notification: contexts disposed"); |
| + if (hint == kMaxHint) { |
| + NotifyGlobalContextDisposed(); |
|
Vyacheslav Egorov (Chromium)
2012/03/22 14:47:05
Why do we signal context disposal here and abort i
ulan
2012/03/23 10:47:13
Removed aborting of incremental marking and added
|
| + CollectAllGarbage(kReduceMemoryFootprintMask | |
| + kAbortIncrementalMarkingMask, |
| + "idle notification: global contexts disposed"); |
| + } else { |
| + CollectAllGarbage(kReduceMemoryFootprintMask, |
| + "idle notification: contexts disposed"); |
| + } |
| } else { |
| AdvanceIdleIncrementalMarking(step_size); |
| contexts_disposed_ = 0; |