Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 497 if (FLAG_trace_incremental_marking) { | 497 if (FLAG_trace_incremental_marking) { |
| 498 PrintF("[IncrementalMarking] Scavenge during marking.\n"); | 498 PrintF("[IncrementalMarking] Scavenge during marking.\n"); |
| 499 } | 499 } |
| 500 } | 500 } |
| 501 | 501 |
| 502 if (collector == MARK_COMPACTOR && | 502 if (collector == MARK_COMPACTOR && |
| 503 !mark_compact_collector()->abort_incremental_marking_ && | 503 !mark_compact_collector()->abort_incremental_marking_ && |
| 504 !incremental_marking()->IsStopped() && | 504 !incremental_marking()->IsStopped() && |
| 505 !incremental_marking()->should_hurry() && | 505 !incremental_marking()->should_hurry() && |
| 506 FLAG_incremental_marking_steps) { | 506 FLAG_incremental_marking_steps) { |
| 507 if (FLAG_trace_incremental_marking) { | 507 // Make progress in incremental marking. |
| 508 PrintF("[IncrementalMarking] Delaying MarkSweep.\n"); | 508 const intptr_t kStepSizeWhenDelayedByScavenge = 1 * MB; |
| 509 incremental_marking()->Step(kStepSizeWhenDelayedByScavenge, | |
| 510 IncrementalMarking::NO_GC_VIA_STACK_GUARD); | |
| 511 if (!incremental_marking()->IsComplete()) { | |
| 512 if (FLAG_trace_incremental_marking) { | |
| 513 PrintF("[IncrementalMarking] Delaying MarkSweep.\n"); | |
| 514 } | |
| 515 collector = SCAVENGER; | |
| 516 collector_reason = "incremental marking delaying mark-sweep"; | |
| 509 } | 517 } |
| 510 collector = SCAVENGER; | |
| 511 collector_reason = "incremental marking delaying mark-sweep"; | |
| 512 } | 518 } |
| 513 | 519 |
| 514 bool next_gc_likely_to_collect_more = false; | 520 bool next_gc_likely_to_collect_more = false; |
| 515 | 521 |
| 516 { GCTracer tracer(this, gc_reason, collector_reason); | 522 { GCTracer tracer(this, gc_reason, collector_reason); |
| 517 GarbageCollectionPrologue(); | 523 GarbageCollectionPrologue(); |
| 518 // The GC count was incremented in the prologue. Tell the tracer about | 524 // The GC count was incremented in the prologue. Tell the tracer about |
| 519 // it. | 525 // it. |
| 520 tracer.set_gc_count(gc_count_); | 526 tracer.set_gc_count(gc_count_); |
| 521 | 527 |
| (...skipping 4288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4810 void Heap::EnsureHeapIsIterable() { | 4816 void Heap::EnsureHeapIsIterable() { |
| 4811 ASSERT(IsAllocationAllowed()); | 4817 ASSERT(IsAllocationAllowed()); |
| 4812 if (!IsHeapIterable()) { | 4818 if (!IsHeapIterable()) { |
| 4813 CollectAllGarbage(kMakeHeapIterableMask, "Heap::EnsureHeapIsIterable"); | 4819 CollectAllGarbage(kMakeHeapIterableMask, "Heap::EnsureHeapIsIterable"); |
| 4814 } | 4820 } |
| 4815 ASSERT(IsHeapIterable()); | 4821 ASSERT(IsHeapIterable()); |
| 4816 } | 4822 } |
| 4817 | 4823 |
| 4818 | 4824 |
| 4819 void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) { | 4825 void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) { |
| 4820 // This flag prevents incremental marking from requesting GC via stack guard | 4826 incremental_marking()->Step(step_size, |
| 4821 idle_notification_will_schedule_next_gc_ = true; | 4827 IncrementalMarking::NO_GC_VIA_STACK_GUARD); |
|
Michael Starzinger
2012/04/02 09:01:46
This was the last site that changed the above flag
ulan
2012/04/02 09:42:24
Done.
| |
| 4822 incremental_marking()->Step(step_size); | |
| 4823 idle_notification_will_schedule_next_gc_ = false; | |
| 4824 | 4828 |
| 4825 if (incremental_marking()->IsComplete()) { | 4829 if (incremental_marking()->IsComplete()) { |
| 4826 bool uncommit = false; | 4830 bool uncommit = false; |
| 4827 if (gc_count_at_last_idle_gc_ == gc_count_) { | 4831 if (gc_count_at_last_idle_gc_ == gc_count_) { |
| 4828 // No GC since the last full GC, the mutator is probably not active. | 4832 // No GC since the last full GC, the mutator is probably not active. |
| 4829 isolate_->compilation_cache()->Clear(); | 4833 isolate_->compilation_cache()->Clear(); |
| 4830 uncommit = true; | 4834 uncommit = true; |
| 4831 } | 4835 } |
| 4832 CollectAllGarbage(kNoGCFlags, "idle notification: finalize incremental"); | 4836 CollectAllGarbage(kNoGCFlags, "idle notification: finalize incremental"); |
| 4833 gc_count_at_last_idle_gc_ = gc_count_; | 4837 gc_count_at_last_idle_gc_ = gc_count_; |
| (...skipping 2143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6977 } else { | 6981 } else { |
| 6978 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died. | 6982 p ^= 0x1d1ed & (Page::kPageSize - 1); // I died. |
| 6979 } | 6983 } |
| 6980 remembered_unmapped_pages_[remembered_unmapped_pages_index_] = | 6984 remembered_unmapped_pages_[remembered_unmapped_pages_index_] = |
| 6981 reinterpret_cast<Address>(p); | 6985 reinterpret_cast<Address>(p); |
| 6982 remembered_unmapped_pages_index_++; | 6986 remembered_unmapped_pages_index_++; |
| 6983 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages; | 6987 remembered_unmapped_pages_index_ %= kRememberedUnmappedPages; |
| 6984 } | 6988 } |
| 6985 | 6989 |
| 6986 } } // namespace v8::internal | 6990 } } // namespace v8::internal |
| OLD | NEW |