| 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 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 // An object should be promoted if the object has survived a | 771 // An object should be promoted if the object has survived a |
| 772 // scavenge operation. | 772 // scavenge operation. |
| 773 inline bool ShouldBePromoted(Address old_address, int object_size); | 773 inline bool ShouldBePromoted(Address old_address, int object_size); |
| 774 | 774 |
| 775 void ClearNormalizedMapCaches(); | 775 void ClearNormalizedMapCaches(); |
| 776 | 776 |
| 777 void IncrementDeferredCount(v8::Isolate::UseCounterFeature feature); | 777 void IncrementDeferredCount(v8::Isolate::UseCounterFeature feature); |
| 778 | 778 |
| 779 inline bool OldGenerationAllocationLimitReached(); | 779 inline bool OldGenerationAllocationLimitReached(); |
| 780 | 780 |
| 781 void QueueMemoryChunkForFree(MemoryChunk* chunk); | |
| 782 void FreeQueuedChunks(MemoryChunk* list_head); | |
| 783 void FreeQueuedChunks(); | |
| 784 void WaitUntilUnmappingOfFreeChunksCompleted(); | |
| 785 | |
| 786 // Completely clear the Instanceof cache (to stop it keeping objects alive | 781 // Completely clear the Instanceof cache (to stop it keeping objects alive |
| 787 // around a GC). | 782 // around a GC). |
| 788 inline void CompletelyClearInstanceofCache(); | 783 inline void CompletelyClearInstanceofCache(); |
| 789 | 784 |
| 790 inline uint32_t HashSeed(); | 785 inline uint32_t HashSeed(); |
| 791 | 786 |
| 792 inline int NextScriptId(); | 787 inline int NextScriptId(); |
| 793 | 788 |
| 794 inline void SetArgumentsAdaptorDeoptPCOffset(int pc_offset); | 789 inline void SetArgumentsAdaptorDeoptPCOffset(int pc_offset); |
| 795 inline void SetConstructStubDeoptPCOffset(int pc_offset); | 790 inline void SetConstructStubDeoptPCOffset(int pc_offset); |
| (...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1383 // Report heap statistics. | 1378 // Report heap statistics. |
| 1384 void ReportHeapStatistics(const char* title); | 1379 void ReportHeapStatistics(const char* title); |
| 1385 void ReportCodeStatistics(const char* title); | 1380 void ReportCodeStatistics(const char* title); |
| 1386 #endif | 1381 #endif |
| 1387 #ifdef ENABLE_SLOW_DCHECKS | 1382 #ifdef ENABLE_SLOW_DCHECKS |
| 1388 int CountHandlesForObject(Object* object); | 1383 int CountHandlesForObject(Object* object); |
| 1389 #endif | 1384 #endif |
| 1390 | 1385 |
| 1391 private: | 1386 private: |
| 1392 class PretenuringScope; | 1387 class PretenuringScope; |
| 1393 class UnmapFreeMemoryTask; | |
| 1394 | 1388 |
| 1395 // External strings table is a place where all external strings are | 1389 // External strings table is a place where all external strings are |
| 1396 // registered. We need to keep track of such strings to properly | 1390 // registered. We need to keep track of such strings to properly |
| 1397 // finalize them. | 1391 // finalize them. |
| 1398 class ExternalStringTable { | 1392 class ExternalStringTable { |
| 1399 public: | 1393 public: |
| 1400 // Registers an external string. | 1394 // Registers an external string. |
| 1401 inline void AddString(String* string); | 1395 inline void AddString(String* string); |
| 1402 | 1396 |
| 1403 inline void Iterate(ObjectVisitor* v); | 1397 inline void Iterate(ObjectVisitor* v); |
| (...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2201 | 2195 |
| 2202 // Currently set GC flags that are respected by all GC components. | 2196 // Currently set GC flags that are respected by all GC components. |
| 2203 int current_gc_flags_; | 2197 int current_gc_flags_; |
| 2204 | 2198 |
| 2205 // Currently set GC callback flags that are used to pass information between | 2199 // Currently set GC callback flags that are used to pass information between |
| 2206 // the embedder and V8's GC. | 2200 // the embedder and V8's GC. |
| 2207 GCCallbackFlags current_gc_callback_flags_; | 2201 GCCallbackFlags current_gc_callback_flags_; |
| 2208 | 2202 |
| 2209 ExternalStringTable external_string_table_; | 2203 ExternalStringTable external_string_table_; |
| 2210 | 2204 |
| 2211 MemoryChunk* chunks_queued_for_free_; | |
| 2212 | |
| 2213 size_t concurrent_unmapping_tasks_active_; | |
| 2214 | |
| 2215 base::Semaphore pending_unmapping_tasks_semaphore_; | |
| 2216 | |
| 2217 base::Mutex relocation_mutex_; | 2205 base::Mutex relocation_mutex_; |
| 2218 | 2206 |
| 2219 int gc_callbacks_depth_; | 2207 int gc_callbacks_depth_; |
| 2220 | 2208 |
| 2221 bool deserialization_complete_; | 2209 bool deserialization_complete_; |
| 2222 | 2210 |
| 2223 StrongRootsList* strong_roots_list_; | 2211 StrongRootsList* strong_roots_list_; |
| 2224 | 2212 |
| 2225 ArrayBufferTracker* array_buffer_tracker_; | 2213 ArrayBufferTracker* array_buffer_tracker_; |
| 2226 | 2214 |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2649 friend class LargeObjectSpace; | 2637 friend class LargeObjectSpace; |
| 2650 friend class NewSpace; | 2638 friend class NewSpace; |
| 2651 friend class PagedSpace; | 2639 friend class PagedSpace; |
| 2652 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2640 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
| 2653 }; | 2641 }; |
| 2654 | 2642 |
| 2655 } // namespace internal | 2643 } // namespace internal |
| 2656 } // namespace v8 | 2644 } // namespace v8 |
| 2657 | 2645 |
| 2658 #endif // V8_HEAP_HEAP_H_ | 2646 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |