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 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1435 | 1435 |
1436 inline Isolate* isolate(); | 1436 inline Isolate* isolate(); |
1437 | 1437 |
1438 void CallGCPrologueCallbacks(GCType gc_type, GCCallbackFlags flags); | 1438 void CallGCPrologueCallbacks(GCType gc_type, GCCallbackFlags flags); |
1439 void CallGCEpilogueCallbacks(GCType gc_type, GCCallbackFlags flags); | 1439 void CallGCEpilogueCallbacks(GCType gc_type, GCCallbackFlags flags); |
1440 | 1440 |
1441 inline bool OldGenerationAllocationLimitReached(); | 1441 inline bool OldGenerationAllocationLimitReached(); |
1442 | 1442 |
1443 void QueueMemoryChunkForFree(MemoryChunk* chunk); | 1443 void QueueMemoryChunkForFree(MemoryChunk* chunk); |
1444 void FilterStoreBufferEntriesOnAboutToBeFreedPages(); | 1444 void FilterStoreBufferEntriesOnAboutToBeFreedPages(); |
1445 void FreeQueuedChunks(MemoryChunk* list_head); | |
1446 void FreeQueuedChunks(); | 1445 void FreeQueuedChunks(); |
1447 void WaitUntilUnmappingOfFreeChunksCompleted(); | |
1448 | 1446 |
1449 int gc_count() const { return gc_count_; } | 1447 int gc_count() const { return gc_count_; } |
1450 | 1448 |
1451 bool RecentIdleNotificationHappened(); | 1449 bool RecentIdleNotificationHappened(); |
1452 | 1450 |
1453 // Completely clear the Instanceof cache (to stop it keeping objects alive | 1451 // Completely clear the Instanceof cache (to stop it keeping objects alive |
1454 // around a GC). | 1452 // around a GC). |
1455 inline void CompletelyClearInstanceofCache(); | 1453 inline void CompletelyClearInstanceofCache(); |
1456 | 1454 |
1457 // The roots that have an index less than this are always in old space. | 1455 // 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... |
1614 // An ArrayBuffer moved from new space to old space. | 1612 // An ArrayBuffer moved from new space to old space. |
1615 void PromoteArrayBuffer(Object* buffer); | 1613 void PromoteArrayBuffer(Object* buffer); |
1616 | 1614 |
1617 bool HasLowAllocationRate(); | 1615 bool HasLowAllocationRate(); |
1618 bool HasHighFragmentation(); | 1616 bool HasHighFragmentation(); |
1619 bool HasHighFragmentation(intptr_t used, intptr_t committed); | 1617 bool HasHighFragmentation(intptr_t used, intptr_t committed); |
1620 | 1618 |
1621 bool ShouldOptimizeForMemoryUsage() { return optimize_for_memory_usage_; } | 1619 bool ShouldOptimizeForMemoryUsage() { return optimize_for_memory_usage_; } |
1622 | 1620 |
1623 private: | 1621 private: |
1624 class UnmapFreeMemoryTask; | |
1625 | |
1626 static const int kInitialStringTableSize = 2048; | 1622 static const int kInitialStringTableSize = 2048; |
1627 static const int kInitialEvalCacheSize = 64; | 1623 static const int kInitialEvalCacheSize = 64; |
1628 static const int kInitialNumberStringCacheSize = 256; | 1624 static const int kInitialNumberStringCacheSize = 256; |
1629 | 1625 |
1630 Heap(); | 1626 Heap(); |
1631 | 1627 |
1632 int current_gc_flags() { return current_gc_flags_; } | 1628 int current_gc_flags() { return current_gc_flags_; } |
1633 void set_current_gc_flags(int flags) { | 1629 void set_current_gc_flags(int flags) { |
1634 current_gc_flags_ = flags; | 1630 current_gc_flags_ = flags; |
1635 DCHECK(!ShouldFinalizeIncrementalMarking() || | 1631 DCHECK(!ShouldFinalizeIncrementalMarking() || |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2293 | 2289 |
2294 // Currently set GC flags that are respected by all GC components. | 2290 // Currently set GC flags that are respected by all GC components. |
2295 int current_gc_flags_; | 2291 int current_gc_flags_; |
2296 | 2292 |
2297 ExternalStringTable external_string_table_; | 2293 ExternalStringTable external_string_table_; |
2298 | 2294 |
2299 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; | 2295 VisitorDispatchTable<ScavengingCallback> scavenging_visitors_table_; |
2300 | 2296 |
2301 MemoryChunk* chunks_queued_for_free_; | 2297 MemoryChunk* chunks_queued_for_free_; |
2302 | 2298 |
2303 base::Semaphore pending_unmap_job_semaphore_; | |
2304 | |
2305 base::Mutex relocation_mutex_; | 2299 base::Mutex relocation_mutex_; |
2306 | 2300 |
2307 int gc_callbacks_depth_; | 2301 int gc_callbacks_depth_; |
2308 | 2302 |
2309 bool deserialization_complete_; | 2303 bool deserialization_complete_; |
2310 | 2304 |
2311 bool concurrent_sweeping_enabled_; | 2305 bool concurrent_sweeping_enabled_; |
2312 | 2306 |
2313 // |live_array_buffers_| maps externally allocated memory used as backing | 2307 // |live_array_buffers_| maps externally allocated memory used as backing |
2314 // store for ArrayBuffers to the length of the respective memory blocks. | 2308 // store for ArrayBuffers to the length of the respective memory blocks. |
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2712 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2706 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2713 | 2707 |
2714 private: | 2708 private: |
2715 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2709 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2716 }; | 2710 }; |
2717 #endif // DEBUG | 2711 #endif // DEBUG |
2718 } | 2712 } |
2719 } // namespace v8::internal | 2713 } // namespace v8::internal |
2720 | 2714 |
2721 #endif // V8_HEAP_HEAP_H_ | 2715 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |