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 #ifndef V8_HEAP_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
7 | 7 |
8 #include <cmath> | 8 #include <cmath> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1389 // =========================================================================== | 1389 // =========================================================================== |
1390 // Incremental marking API. ================================================== | 1390 // Incremental marking API. ================================================== |
1391 // =========================================================================== | 1391 // =========================================================================== |
1392 | 1392 |
1393 // Start incremental marking and ensure that idle time handler can perform | 1393 // Start incremental marking and ensure that idle time handler can perform |
1394 // incremental steps. | 1394 // incremental steps. |
1395 void StartIdleIncrementalMarking(); | 1395 void StartIdleIncrementalMarking(); |
1396 | 1396 |
1397 // Starts incremental marking assuming incremental marking is currently | 1397 // Starts incremental marking assuming incremental marking is currently |
1398 // stopped. | 1398 // stopped. |
1399 void StartIncrementalMarking(int gc_flags, | 1399 void StartIncrementalMarking(int gc_flags, |
Hannes Payer (out of office)
2015/08/25 08:35:27
Can we make change the int gc_flags to an enum, yo
Michael Lippautz
2015/08/25 08:54:17
Acknowledged and Done.
| |
1400 const GCCallbackFlags gc_callback_flags, | 1400 const GCCallbackFlags gc_callback_flags = |
1401 GCCallbackFlags::kNoGCCallbackFlags, | |
1401 const char* reason = nullptr); | 1402 const char* reason = nullptr); |
1402 | 1403 |
1403 // Performs incremental marking steps of step_size_in_bytes as long as | 1404 // Performs incremental marking steps of step_size_in_bytes as long as |
1404 // deadline_ins_ms is not reached. step_size_in_bytes can be 0 to compute | 1405 // deadline_ins_ms is not reached. step_size_in_bytes can be 0 to compute |
1405 // an estimate increment. Returns the remaining time that cannot be used | 1406 // an estimate increment. Returns the remaining time that cannot be used |
1406 // for incremental marking anymore because a single step would exceed the | 1407 // for incremental marking anymore because a single step would exceed the |
1407 // deadline. | 1408 // deadline. |
1408 double AdvanceIncrementalMarking( | 1409 double AdvanceIncrementalMarking( |
1409 intptr_t step_size_in_bytes, double deadline_in_ms, | 1410 intptr_t step_size_in_bytes, double deadline_in_ms, |
1410 IncrementalMarking::StepActions step_actions); | 1411 IncrementalMarking::StepActions step_actions); |
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1728 } | 1729 } |
1729 | 1730 |
1730 int current_gc_flags() { return current_gc_flags_; } | 1731 int current_gc_flags() { return current_gc_flags_; } |
1731 | 1732 |
1732 void set_current_gc_flags(int flags) { | 1733 void set_current_gc_flags(int flags) { |
1733 current_gc_flags_ = flags; | 1734 current_gc_flags_ = flags; |
1734 DCHECK(!ShouldFinalizeIncrementalMarking() || | 1735 DCHECK(!ShouldFinalizeIncrementalMarking() || |
1735 !ShouldAbortIncrementalMarking()); | 1736 !ShouldAbortIncrementalMarking()); |
1736 } | 1737 } |
1737 | 1738 |
1739 GCCallbackFlags current_gc_callback_flags() { | |
1740 return current_gc_callback_flags_; | |
1741 } | |
1742 | |
1743 void set_current_gc_callback_flags(GCCallbackFlags callback_flags) { | |
1744 current_gc_callback_flags_ = callback_flags; | |
1745 } | |
1746 | |
1738 inline bool ShouldReduceMemory() const { | 1747 inline bool ShouldReduceMemory() const { |
1739 return current_gc_flags_ & kReduceMemoryFootprintMask; | 1748 return current_gc_flags_ & kReduceMemoryFootprintMask; |
1740 } | 1749 } |
1741 | 1750 |
1742 inline bool ShouldAbortIncrementalMarking() const { | 1751 inline bool ShouldAbortIncrementalMarking() const { |
1743 return current_gc_flags_ & kAbortIncrementalMarkingMask; | 1752 return current_gc_flags_ & kAbortIncrementalMarkingMask; |
1744 } | 1753 } |
1745 | 1754 |
1746 inline bool ShouldFinalizeIncrementalMarking() const { | 1755 inline bool ShouldFinalizeIncrementalMarking() const { |
1747 return current_gc_flags_ & kFinalizeIncrementalMarkingMask; | 1756 return current_gc_flags_ & kFinalizeIncrementalMarkingMask; |
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2328 // Shared state read by the scavenge collector and set by ScavengeObject. | 2337 // Shared state read by the scavenge collector and set by ScavengeObject. |
2329 PromotionQueue promotion_queue_; | 2338 PromotionQueue promotion_queue_; |
2330 | 2339 |
2331 // Flag is set when the heap has been configured. The heap can be repeatedly | 2340 // Flag is set when the heap has been configured. The heap can be repeatedly |
2332 // configured through the API until it is set up. | 2341 // configured through the API until it is set up. |
2333 bool configured_; | 2342 bool configured_; |
2334 | 2343 |
2335 // Currently set GC flags that are respected by all GC components. | 2344 // Currently set GC flags that are respected by all GC components. |
2336 int current_gc_flags_; | 2345 int current_gc_flags_; |
2337 | 2346 |
2347 GCCallbackFlags current_gc_callback_flags_; | |
Hannes Payer (out of office)
2015/08/25 08:35:27
Describe what these flags are doing.
Michael Lippautz
2015/08/25 08:54:17
Done.
| |
2348 | |
2338 ExternalStringTable external_string_table_; | 2349 ExternalStringTable external_string_table_; |
2339 | 2350 |
2340 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; | 2351 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; |
2341 | 2352 |
2342 MemoryChunk* chunks_queued_for_free_; | 2353 MemoryChunk* chunks_queued_for_free_; |
2343 | 2354 |
2344 base::Semaphore pending_unmap_job_semaphore_; | 2355 base::Semaphore pending_unmap_job_semaphore_; |
2345 | 2356 |
2346 base::Mutex relocation_mutex_; | 2357 base::Mutex relocation_mutex_; |
2347 | 2358 |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2752 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2763 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2753 | 2764 |
2754 private: | 2765 private: |
2755 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2766 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2756 }; | 2767 }; |
2757 #endif // DEBUG | 2768 #endif // DEBUG |
2758 } | 2769 } |
2759 } // namespace v8::internal | 2770 } // namespace v8::internal |
2760 | 2771 |
2761 #endif // V8_HEAP_HEAP_H_ | 2772 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |