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 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1416 | 1416 |
1417 inline Isolate* isolate(); | 1417 inline Isolate* isolate(); |
1418 | 1418 |
1419 void CallGCPrologueCallbacks(GCType gc_type, GCCallbackFlags flags); | 1419 void CallGCPrologueCallbacks(GCType gc_type, GCCallbackFlags flags); |
1420 void CallGCEpilogueCallbacks(GCType gc_type, GCCallbackFlags flags); | 1420 void CallGCEpilogueCallbacks(GCType gc_type, GCCallbackFlags flags); |
1421 | 1421 |
1422 inline bool OldGenerationAllocationLimitReached(); | 1422 inline bool OldGenerationAllocationLimitReached(); |
1423 | 1423 |
1424 void QueueMemoryChunkForFree(MemoryChunk* chunk); | 1424 void QueueMemoryChunkForFree(MemoryChunk* chunk); |
1425 void FilterStoreBufferEntriesOnAboutToBeFreedPages(); | 1425 void FilterStoreBufferEntriesOnAboutToBeFreedPages(); |
| 1426 void FreeQueuedChunks(MemoryChunk* list_head); |
1426 void FreeQueuedChunks(); | 1427 void FreeQueuedChunks(); |
| 1428 void WaitUntilUnmappingOfFreeChunksCompleted(); |
1427 | 1429 |
1428 int gc_count() const { return gc_count_; } | 1430 int gc_count() const { return gc_count_; } |
1429 | 1431 |
1430 bool RecentIdleNotificationHappened(); | 1432 bool RecentIdleNotificationHappened(); |
1431 | 1433 |
1432 // Completely clear the Instanceof cache (to stop it keeping objects alive | 1434 // Completely clear the Instanceof cache (to stop it keeping objects alive |
1433 // around a GC). | 1435 // around a GC). |
1434 inline void CompletelyClearInstanceofCache(); | 1436 inline void CompletelyClearInstanceofCache(); |
1435 | 1437 |
1436 // The roots that have an index less than this are always in old space. | 1438 // The roots that have an index less than this are always in old space. |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1593 // An ArrayBuffer moved from new space to old space. | 1595 // An ArrayBuffer moved from new space to old space. |
1594 void PromoteArrayBuffer(Object* buffer); | 1596 void PromoteArrayBuffer(Object* buffer); |
1595 | 1597 |
1596 bool HasLowAllocationRate(); | 1598 bool HasLowAllocationRate(); |
1597 bool HasHighFragmentation(); | 1599 bool HasHighFragmentation(); |
1598 bool HasHighFragmentation(intptr_t used, intptr_t committed); | 1600 bool HasHighFragmentation(intptr_t used, intptr_t committed); |
1599 | 1601 |
1600 bool ShouldOptimizeForMemoryUsage() { return optimize_for_memory_usage_; } | 1602 bool ShouldOptimizeForMemoryUsage() { return optimize_for_memory_usage_; } |
1601 | 1603 |
1602 private: | 1604 private: |
| 1605 class UnmapFreeMemoryTask; |
| 1606 |
1603 static const int kInitialStringTableSize = 2048; | 1607 static const int kInitialStringTableSize = 2048; |
1604 static const int kInitialEvalCacheSize = 64; | 1608 static const int kInitialEvalCacheSize = 64; |
1605 static const int kInitialNumberStringCacheSize = 256; | 1609 static const int kInitialNumberStringCacheSize = 256; |
1606 | 1610 |
1607 Heap(); | 1611 Heap(); |
1608 | 1612 |
1609 int current_gc_flags() { return current_gc_flags_; } | 1613 int current_gc_flags() { return current_gc_flags_; } |
1610 void set_current_gc_flags(int flags) { | 1614 void set_current_gc_flags(int flags) { |
1611 current_gc_flags_ = flags; | 1615 current_gc_flags_ = flags; |
1612 DCHECK(!ShouldFinalizeIncrementalMarking() || | 1616 DCHECK(!ShouldFinalizeIncrementalMarking() || |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2270 | 2274 |
2271 // Currently set GC flags that are respected by all GC components. | 2275 // Currently set GC flags that are respected by all GC components. |
2272 int current_gc_flags_; | 2276 int current_gc_flags_; |
2273 | 2277 |
2274 ExternalStringTable external_string_table_; | 2278 ExternalStringTable external_string_table_; |
2275 | 2279 |
2276 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; | 2280 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; |
2277 | 2281 |
2278 MemoryChunk* chunks_queued_for_free_; | 2282 MemoryChunk* chunks_queued_for_free_; |
2279 | 2283 |
| 2284 base::Semaphore pending_unmap_job_semaphore_; |
| 2285 |
2280 base::Mutex relocation_mutex_; | 2286 base::Mutex relocation_mutex_; |
2281 | 2287 |
2282 int gc_callbacks_depth_; | 2288 int gc_callbacks_depth_; |
2283 | 2289 |
2284 bool deserialization_complete_; | 2290 bool deserialization_complete_; |
2285 | 2291 |
2286 bool concurrent_sweeping_enabled_; | 2292 bool concurrent_sweeping_enabled_; |
2287 | 2293 |
2288 // |live_array_buffers_| maps externally allocated memory used as backing | 2294 // |live_array_buffers_| maps externally allocated memory used as backing |
2289 // store for ArrayBuffers to the length of the respective memory blocks. | 2295 // store for ArrayBuffers to the length of the respective memory blocks. |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2687 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2693 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2688 | 2694 |
2689 private: | 2695 private: |
2690 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2696 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2691 }; | 2697 }; |
2692 #endif // DEBUG | 2698 #endif // DEBUG |
2693 } | 2699 } |
2694 } // namespace v8::internal | 2700 } // namespace v8::internal |
2695 | 2701 |
2696 #endif // V8_HEAP_HEAP_H_ | 2702 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |