OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 marking_deque_memory_(NULL), | 43 marking_deque_memory_(NULL), |
44 steps_count_(0), | 44 steps_count_(0), |
45 steps_took_(0), | 45 steps_took_(0), |
46 longest_step_(0.0), | 46 longest_step_(0.0), |
47 old_generation_space_available_at_start_of_incremental_(0), | 47 old_generation_space_available_at_start_of_incremental_(0), |
48 old_generation_space_used_at_start_of_incremental_(0), | 48 old_generation_space_used_at_start_of_incremental_(0), |
49 steps_count_since_last_gc_(0), | 49 steps_count_since_last_gc_(0), |
50 steps_took_since_last_gc_(0), | 50 steps_took_since_last_gc_(0), |
51 should_hurry_(false), | 51 should_hurry_(false), |
52 allocation_marking_factor_(0), | 52 allocation_marking_factor_(0), |
53 allocated_(0) { | 53 allocated_(0), |
| 54 no_marking_scope_depth_(0) { |
54 } | 55 } |
55 | 56 |
56 | 57 |
57 void IncrementalMarking::TearDown() { | 58 void IncrementalMarking::TearDown() { |
58 delete marking_deque_memory_; | 59 delete marking_deque_memory_; |
59 } | 60 } |
60 | 61 |
61 | 62 |
62 void IncrementalMarking::RecordWriteFromCode(HeapObject* obj, | 63 void IncrementalMarking::RecordWriteFromCode(HeapObject* obj, |
63 Object* value, | 64 Object* value, |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 !FLAG_incremental_marking || | 696 !FLAG_incremental_marking || |
696 !FLAG_incremental_marking_steps || | 697 !FLAG_incremental_marking_steps || |
697 (state_ != SWEEPING && state_ != MARKING)) { | 698 (state_ != SWEEPING && state_ != MARKING)) { |
698 return; | 699 return; |
699 } | 700 } |
700 | 701 |
701 allocated_ += allocated_bytes; | 702 allocated_ += allocated_bytes; |
702 | 703 |
703 if (allocated_ < kAllocatedThreshold) return; | 704 if (allocated_ < kAllocatedThreshold) return; |
704 | 705 |
| 706 if (state_ == MARKING && no_marking_scope_depth_ > 0) return; |
| 707 |
705 intptr_t bytes_to_process = allocated_ * allocation_marking_factor_; | 708 intptr_t bytes_to_process = allocated_ * allocation_marking_factor_; |
706 | 709 |
707 double start = 0; | 710 double start = 0; |
708 | 711 |
709 if (FLAG_trace_incremental_marking || FLAG_trace_gc) { | 712 if (FLAG_trace_incremental_marking || FLAG_trace_gc) { |
710 start = OS::TimeCurrentMillis(); | 713 start = OS::TimeCurrentMillis(); |
711 } | 714 } |
712 | 715 |
713 if (state_ == SWEEPING) { | 716 if (state_ == SWEEPING) { |
714 if (heap_->old_pointer_space()->AdvanceSweeper(bytes_to_process) && | 717 if (heap_->old_pointer_space()->AdvanceSweeper(bytes_to_process) && |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 bytes_rescanned_ = 0; | 822 bytes_rescanned_ = 0; |
820 allocation_marking_factor_ = kInitialAllocationMarkingFactor; | 823 allocation_marking_factor_ = kInitialAllocationMarkingFactor; |
821 } | 824 } |
822 | 825 |
823 | 826 |
824 int64_t IncrementalMarking::SpaceLeftInOldSpace() { | 827 int64_t IncrementalMarking::SpaceLeftInOldSpace() { |
825 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize(); | 828 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize(); |
826 } | 829 } |
827 | 830 |
828 } } // namespace v8::internal | 831 } } // namespace v8::internal |
OLD | NEW |