| 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 class AllocationObserver; | 323 class AllocationObserver; |
| 324 class ArrayBufferTracker; | 324 class ArrayBufferTracker; |
| 325 class GCIdleTimeAction; | 325 class GCIdleTimeAction; |
| 326 class GCIdleTimeHandler; | 326 class GCIdleTimeHandler; |
| 327 class GCIdleTimeHeapState; | 327 class GCIdleTimeHeapState; |
| 328 class GCTracer; | 328 class GCTracer; |
| 329 class HeapObjectsFilter; | 329 class HeapObjectsFilter; |
| 330 class HeapStats; | 330 class HeapStats; |
| 331 class HistogramTimer; | 331 class HistogramTimer; |
| 332 class Isolate; | 332 class Isolate; |
| 333 class LocalEmbedderHeapTracer; |
| 333 class MemoryAllocator; | 334 class MemoryAllocator; |
| 334 class MemoryReducer; | 335 class MemoryReducer; |
| 335 class ObjectIterator; | 336 class ObjectIterator; |
| 336 class ObjectStats; | 337 class ObjectStats; |
| 337 class Page; | 338 class Page; |
| 338 class PagedSpace; | 339 class PagedSpace; |
| 339 class Scavenger; | 340 class Scavenger; |
| 340 class ScavengeJob; | 341 class ScavengeJob; |
| 341 class Space; | 342 class Space; |
| 342 class StoreBuffer; | 343 class StoreBuffer; |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1197 GarbageCollectionReason gc_reason); | 1198 GarbageCollectionReason gc_reason); |
| 1198 | 1199 |
| 1199 void RegisterReservationsForBlackAllocation(Reservation* reservations); | 1200 void RegisterReservationsForBlackAllocation(Reservation* reservations); |
| 1200 | 1201 |
| 1201 IncrementalMarking* incremental_marking() { return incremental_marking_; } | 1202 IncrementalMarking* incremental_marking() { return incremental_marking_; } |
| 1202 | 1203 |
| 1203 // =========================================================================== | 1204 // =========================================================================== |
| 1204 // Embedder heap tracer support. ============================================= | 1205 // Embedder heap tracer support. ============================================= |
| 1205 // =========================================================================== | 1206 // =========================================================================== |
| 1206 | 1207 |
| 1208 LocalEmbedderHeapTracer* local_embedder_heap_tracer() { |
| 1209 return local_embedder_heap_tracer_; |
| 1210 } |
| 1207 void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer); | 1211 void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer); |
| 1208 | |
| 1209 bool UsingEmbedderHeapTracer() { return embedder_heap_tracer() != nullptr; } | |
| 1210 | |
| 1211 void TracePossibleWrapper(JSObject* js_object); | 1212 void TracePossibleWrapper(JSObject* js_object); |
| 1212 | |
| 1213 void RegisterExternallyReferencedObject(Object** object); | 1213 void RegisterExternallyReferencedObject(Object** object); |
| 1214 | 1214 |
| 1215 void RegisterWrappersWithEmbedderHeapTracer(); | |
| 1216 | |
| 1217 // In order to avoid running out of memory we force tracing wrappers if there | |
| 1218 // are too many of them. | |
| 1219 bool RequiresImmediateWrapperProcessing(); | |
| 1220 | |
| 1221 EmbedderHeapTracer* embedder_heap_tracer() { return embedder_heap_tracer_; } | |
| 1222 | |
| 1223 size_t wrappers_to_trace() { return wrappers_to_trace_.size(); } | |
| 1224 void clear_wrappers_to_trace() { wrappers_to_trace_.clear(); } | |
| 1225 | |
| 1226 // =========================================================================== | 1215 // =========================================================================== |
| 1227 // External string table API. ================================================ | 1216 // External string table API. ================================================ |
| 1228 // =========================================================================== | 1217 // =========================================================================== |
| 1229 | 1218 |
| 1230 // Registers an external string. | 1219 // Registers an external string. |
| 1231 inline void RegisterExternalString(String* string); | 1220 inline void RegisterExternalString(String* string); |
| 1232 | 1221 |
| 1233 // Finalizes an external string by deleting the associated external | 1222 // Finalizes an external string by deleting the associated external |
| 1234 // data and clearing the resource pointer. | 1223 // data and clearing the resource pointer. |
| 1235 inline void FinalizeExternalString(String* string); | 1224 inline void FinalizeExternalString(String* string); |
| (...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2343 | 2332 |
| 2344 int gc_callbacks_depth_; | 2333 int gc_callbacks_depth_; |
| 2345 | 2334 |
| 2346 bool deserialization_complete_; | 2335 bool deserialization_complete_; |
| 2347 | 2336 |
| 2348 StrongRootsList* strong_roots_list_; | 2337 StrongRootsList* strong_roots_list_; |
| 2349 | 2338 |
| 2350 // The depth of HeapIterator nestings. | 2339 // The depth of HeapIterator nestings. |
| 2351 int heap_iterator_depth_; | 2340 int heap_iterator_depth_; |
| 2352 | 2341 |
| 2353 EmbedderHeapTracer* embedder_heap_tracer_; | 2342 LocalEmbedderHeapTracer* local_embedder_heap_tracer_; |
| 2354 std::vector<std::pair<void*, void*>> wrappers_to_trace_; | |
| 2355 | 2343 |
| 2356 // Used for testing purposes. | 2344 // Used for testing purposes. |
| 2357 bool force_oom_; | 2345 bool force_oom_; |
| 2358 bool delay_sweeper_tasks_for_testing_; | 2346 bool delay_sweeper_tasks_for_testing_; |
| 2359 | 2347 |
| 2360 // Classes in "heap" can be friends. | 2348 // Classes in "heap" can be friends. |
| 2361 friend class AlwaysAllocateScope; | 2349 friend class AlwaysAllocateScope; |
| 2362 friend class GCCallbacksScope; | 2350 friend class GCCallbacksScope; |
| 2363 friend class GCTracer; | 2351 friend class GCTracer; |
| 2364 friend class HeapIterator; | 2352 friend class HeapIterator; |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2670 friend class LargeObjectSpace; | 2658 friend class LargeObjectSpace; |
| 2671 friend class NewSpace; | 2659 friend class NewSpace; |
| 2672 friend class PagedSpace; | 2660 friend class PagedSpace; |
| 2673 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2661 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
| 2674 }; | 2662 }; |
| 2675 | 2663 |
| 2676 } // namespace internal | 2664 } // namespace internal |
| 2677 } // namespace v8 | 2665 } // namespace v8 |
| 2678 | 2666 |
| 2679 #endif // V8_HEAP_HEAP_H_ | 2667 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |