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 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
906 } | 906 } |
907 | 907 |
908 // Returns name of the space. | 908 // Returns name of the space. |
909 const char* GetSpaceName(int idx); | 909 const char* GetSpaceName(int idx); |
910 | 910 |
911 // =========================================================================== | 911 // =========================================================================== |
912 // Getters to other components. ============================================== | 912 // Getters to other components. ============================================== |
913 // =========================================================================== | 913 // =========================================================================== |
914 | 914 |
915 GCTracer* tracer() { return tracer_; } | 915 GCTracer* tracer() { return tracer_; } |
| 916 EmbedderHeapTracer* embedder_heap_tracer() { return embedder_heap_tracer_; } |
916 | 917 |
917 PromotionQueue* promotion_queue() { return &promotion_queue_; } | 918 PromotionQueue* promotion_queue() { return &promotion_queue_; } |
918 | 919 |
919 inline Isolate* isolate(); | 920 inline Isolate* isolate(); |
920 | 921 |
921 MarkCompactCollector* mark_compact_collector() { | 922 MarkCompactCollector* mark_compact_collector() { |
922 return mark_compact_collector_; | 923 return mark_compact_collector_; |
923 } | 924 } |
924 | 925 |
925 // =========================================================================== | 926 // =========================================================================== |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1303 GCType gc_type_filter, bool pass_isolate = true); | 1304 GCType gc_type_filter, bool pass_isolate = true); |
1304 void RemoveGCPrologueCallback(v8::Isolate::GCCallback callback); | 1305 void RemoveGCPrologueCallback(v8::Isolate::GCCallback callback); |
1305 | 1306 |
1306 void AddGCEpilogueCallback(v8::Isolate::GCCallback callback, | 1307 void AddGCEpilogueCallback(v8::Isolate::GCCallback callback, |
1307 GCType gc_type_filter, bool pass_isolate = true); | 1308 GCType gc_type_filter, bool pass_isolate = true); |
1308 void RemoveGCEpilogueCallback(v8::Isolate::GCCallback callback); | 1309 void RemoveGCEpilogueCallback(v8::Isolate::GCCallback callback); |
1309 | 1310 |
1310 void CallGCPrologueCallbacks(GCType gc_type, GCCallbackFlags flags); | 1311 void CallGCPrologueCallbacks(GCType gc_type, GCCallbackFlags flags); |
1311 void CallGCEpilogueCallbacks(GCType gc_type, GCCallbackFlags flags); | 1312 void CallGCEpilogueCallbacks(GCType gc_type, GCCallbackFlags flags); |
1312 | 1313 |
| 1314 void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer); |
| 1315 void UnsetEmbedderHeapTracer(); |
| 1316 |
1313 // =========================================================================== | 1317 // =========================================================================== |
1314 // Allocation methods. ======================================================= | 1318 // Allocation methods. ======================================================= |
1315 // =========================================================================== | 1319 // =========================================================================== |
1316 | 1320 |
1317 // Creates a filler object and returns a heap object immediately after it. | 1321 // Creates a filler object and returns a heap object immediately after it. |
1318 MUST_USE_RESULT HeapObject* PrecedeWithFiller(HeapObject* object, | 1322 MUST_USE_RESULT HeapObject* PrecedeWithFiller(HeapObject* object, |
1319 int filler_size); | 1323 int filler_size); |
1320 | 1324 |
1321 // Creates a filler object if needed for alignment and returns a heap object | 1325 // Creates a filler object if needed for alignment and returns a heap object |
1322 // immediately after it. If any space is left after the returned object, | 1326 // immediately after it. If any space is left after the returned object, |
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2070 | 2074 |
2071 // List of encountered weak collections (JSWeakMap and JSWeakSet) during | 2075 // List of encountered weak collections (JSWeakMap and JSWeakSet) during |
2072 // marking. It is initialized during marking, destroyed after marking and | 2076 // marking. It is initialized during marking, destroyed after marking and |
2073 // contains Smi(0) while marking is not active. | 2077 // contains Smi(0) while marking is not active. |
2074 Object* encountered_weak_collections_; | 2078 Object* encountered_weak_collections_; |
2075 | 2079 |
2076 Object* encountered_weak_cells_; | 2080 Object* encountered_weak_cells_; |
2077 | 2081 |
2078 Object* encountered_transition_arrays_; | 2082 Object* encountered_transition_arrays_; |
2079 | 2083 |
| 2084 List<GCCallbackPair> gc_prologue_callbacks_; |
2080 List<GCCallbackPair> gc_epilogue_callbacks_; | 2085 List<GCCallbackPair> gc_epilogue_callbacks_; |
2081 List<GCCallbackPair> gc_prologue_callbacks_; | |
2082 | 2086 |
2083 // Total RegExp code ever generated | 2087 // Total RegExp code ever generated |
2084 double total_regexp_code_generated_; | 2088 double total_regexp_code_generated_; |
2085 | 2089 |
2086 int deferred_counters_[v8::Isolate::kUseCounterFeatureCount]; | 2090 int deferred_counters_[v8::Isolate::kUseCounterFeatureCount]; |
2087 | 2091 |
2088 GCTracer* tracer_; | 2092 GCTracer* tracer_; |
| 2093 EmbedderHeapTracer* embedder_heap_tracer_; |
2089 | 2094 |
2090 int high_survival_rate_period_length_; | 2095 int high_survival_rate_period_length_; |
2091 intptr_t promoted_objects_size_; | 2096 intptr_t promoted_objects_size_; |
2092 double promotion_ratio_; | 2097 double promotion_ratio_; |
2093 double promotion_rate_; | 2098 double promotion_rate_; |
2094 intptr_t semi_space_copied_object_size_; | 2099 intptr_t semi_space_copied_object_size_; |
2095 intptr_t previous_semi_space_copied_object_size_; | 2100 intptr_t previous_semi_space_copied_object_size_; |
2096 double semi_space_copied_rate_; | 2101 double semi_space_copied_rate_; |
2097 int nodes_died_in_new_space_; | 2102 int nodes_died_in_new_space_; |
2098 int nodes_copied_in_new_space_; | 2103 int nodes_copied_in_new_space_; |
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2638 friend class LargeObjectSpace; | 2643 friend class LargeObjectSpace; |
2639 friend class NewSpace; | 2644 friend class NewSpace; |
2640 friend class PagedSpace; | 2645 friend class PagedSpace; |
2641 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2646 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2642 }; | 2647 }; |
2643 | 2648 |
2644 } // namespace internal | 2649 } // namespace internal |
2645 } // namespace v8 | 2650 } // namespace v8 |
2646 | 2651 |
2647 #endif // V8_HEAP_HEAP_H_ | 2652 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |