| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/heap/incremental-marking.h" | 7 #include "src/heap/incremental-marking.h" |
| 8 | 8 |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 heap_->isolate()->stack_guard()->ClearGC(); | 770 heap_->isolate()->stack_guard()->ClearGC(); |
| 771 } | 771 } |
| 772 | 772 |
| 773 | 773 |
| 774 void IncrementalMarking::OverApproximateWeakClosure() { | 774 void IncrementalMarking::OverApproximateWeakClosure() { |
| 775 DCHECK(FLAG_overapproximate_weak_closure); | 775 DCHECK(FLAG_overapproximate_weak_closure); |
| 776 DCHECK(!weak_closure_was_overapproximated_); | 776 DCHECK(!weak_closure_was_overapproximated_); |
| 777 if (FLAG_trace_incremental_marking) { | 777 if (FLAG_trace_incremental_marking) { |
| 778 PrintF("[IncrementalMarking] requesting weak closure overapproximation.\n"); | 778 PrintF("[IncrementalMarking] requesting weak closure overapproximation.\n"); |
| 779 } | 779 } |
| 780 set_should_hurry(true); | |
| 781 request_type_ = OVERAPPROXIMATION; | 780 request_type_ = OVERAPPROXIMATION; |
| 782 heap_->isolate()->stack_guard()->RequestGC(); | 781 heap_->isolate()->stack_guard()->RequestGC(); |
| 783 } | 782 } |
| 784 | 783 |
| 785 | 784 |
| 786 void IncrementalMarking::MarkingComplete(CompletionAction action) { | 785 void IncrementalMarking::MarkingComplete(CompletionAction action) { |
| 787 state_ = COMPLETE; | 786 state_ = COMPLETE; |
| 788 // We will set the stack guard to request a GC now. This will mean the rest | 787 // We will set the stack guard to request a GC now. This will mean the rest |
| 789 // of the GC gets performed as soon as possible (we can't do a GC here in a | 788 // of the GC gets performed as soon as possible (we can't do a GC here in a |
| 790 // record-write context). If a few things get allocated between now and then | 789 // record-write context). If a few things get allocated between now and then |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 993 int64_t IncrementalMarking::SpaceLeftInOldSpace() { | 992 int64_t IncrementalMarking::SpaceLeftInOldSpace() { |
| 994 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); | 993 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); |
| 995 } | 994 } |
| 996 | 995 |
| 997 | 996 |
| 998 bool IncrementalMarking::IsIdleMarkingDelayCounterLimitReached() { | 997 bool IncrementalMarking::IsIdleMarkingDelayCounterLimitReached() { |
| 999 return idle_marking_delay_counter_ > kMaxIdleMarkingDelayCounter; | 998 return idle_marking_delay_counter_ > kMaxIdleMarkingDelayCounter; |
| 1000 } | 999 } |
| 1001 | 1000 |
| 1002 | 1001 |
| 1002 ObjectVisitor* IncrementalMarking::CreateRootMarkingVisitor() { |
| 1003 return new IncrementalMarkingRootMarkingVisitor(this); |
| 1004 } |
| 1005 |
| 1006 |
| 1003 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1007 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
| 1004 idle_marking_delay_counter_++; | 1008 idle_marking_delay_counter_++; |
| 1005 } | 1009 } |
| 1006 | 1010 |
| 1007 | 1011 |
| 1008 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1012 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
| 1009 idle_marking_delay_counter_ = 0; | 1013 idle_marking_delay_counter_ = 0; |
| 1010 } | 1014 } |
| 1011 } | 1015 } |
| 1012 } // namespace v8::internal | 1016 } // namespace v8::internal |
| OLD | NEW |