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 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 inline bool IsInGCPostProcessing() { return gc_post_processing_depth_ > 0; } | 718 inline bool IsInGCPostProcessing() { return gc_post_processing_depth_ > 0; } |
719 | 719 |
720 // If an object has an AllocationMemento trailing it, return it, otherwise | 720 // If an object has an AllocationMemento trailing it, return it, otherwise |
721 // return NULL; | 721 // return NULL; |
722 template <FindMementoMode mode> | 722 template <FindMementoMode mode> |
723 inline AllocationMemento* FindAllocationMemento(HeapObject* object); | 723 inline AllocationMemento* FindAllocationMemento(HeapObject* object); |
724 | 724 |
725 // Returns false if not able to reserve. | 725 // Returns false if not able to reserve. |
726 bool ReserveSpace(Reservation* reservations); | 726 bool ReserveSpace(Reservation* reservations); |
727 | 727 |
| 728 void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer); |
| 729 |
| 730 bool UsingEmbedderHeapTracer(); |
| 731 |
| 732 void TracePossibleWrapper(JSObject* js_object); |
| 733 |
| 734 void RegisterExternallyReferencedObject(Object** object); |
| 735 |
728 // | 736 // |
729 // Support for the API. | 737 // Support for the API. |
730 // | 738 // |
731 | 739 |
732 void CreateApiObjects(); | 740 void CreateApiObjects(); |
733 | 741 |
734 // Implements the corresponding V8 API function. | 742 // Implements the corresponding V8 API function. |
735 bool IdleNotification(double deadline_in_seconds); | 743 bool IdleNotification(double deadline_in_seconds); |
736 bool IdleNotification(int idle_time_in_ms); | 744 bool IdleNotification(int idle_time_in_ms); |
737 | 745 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 return lo_space(); | 912 return lo_space(); |
905 default: | 913 default: |
906 return paged_space(idx); | 914 return paged_space(idx); |
907 } | 915 } |
908 } | 916 } |
909 | 917 |
910 // Returns name of the space. | 918 // Returns name of the space. |
911 const char* GetSpaceName(int idx); | 919 const char* GetSpaceName(int idx); |
912 | 920 |
913 // =========================================================================== | 921 // =========================================================================== |
914 // API. ====================================================================== | |
915 // =========================================================================== | |
916 | |
917 void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer); | |
918 | |
919 void RegisterExternallyReferencedObject(Object** object); | |
920 | |
921 // =========================================================================== | |
922 // Getters to other components. ============================================== | 922 // Getters to other components. ============================================== |
923 // =========================================================================== | 923 // =========================================================================== |
924 | 924 |
925 GCTracer* tracer() { return tracer_; } | 925 GCTracer* tracer() { return tracer_; } |
926 | 926 |
927 MemoryAllocator* memory_allocator() { return memory_allocator_; } | 927 MemoryAllocator* memory_allocator() { return memory_allocator_; } |
928 | 928 |
929 EmbedderHeapTracer* embedder_heap_tracer() { return embedder_heap_tracer_; } | |
930 | |
931 PromotionQueue* promotion_queue() { return &promotion_queue_; } | 929 PromotionQueue* promotion_queue() { return &promotion_queue_; } |
932 | 930 |
933 inline Isolate* isolate(); | 931 inline Isolate* isolate(); |
934 | 932 |
935 MarkCompactCollector* mark_compact_collector() { | 933 MarkCompactCollector* mark_compact_collector() { |
936 return mark_compact_collector_; | 934 return mark_compact_collector_; |
937 } | 935 } |
938 | 936 |
939 // =========================================================================== | 937 // =========================================================================== |
940 // Root set access. ========================================================== | 938 // Root set access. ========================================================== |
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2092 | 2090 |
2093 List<GCCallbackPair> gc_epilogue_callbacks_; | 2091 List<GCCallbackPair> gc_epilogue_callbacks_; |
2094 List<GCCallbackPair> gc_prologue_callbacks_; | 2092 List<GCCallbackPair> gc_prologue_callbacks_; |
2095 | 2093 |
2096 // Total RegExp code ever generated | 2094 // Total RegExp code ever generated |
2097 double total_regexp_code_generated_; | 2095 double total_regexp_code_generated_; |
2098 | 2096 |
2099 int deferred_counters_[v8::Isolate::kUseCounterFeatureCount]; | 2097 int deferred_counters_[v8::Isolate::kUseCounterFeatureCount]; |
2100 | 2098 |
2101 GCTracer* tracer_; | 2099 GCTracer* tracer_; |
2102 EmbedderHeapTracer* embedder_heap_tracer_; | |
2103 | 2100 |
2104 int high_survival_rate_period_length_; | 2101 int high_survival_rate_period_length_; |
2105 intptr_t promoted_objects_size_; | 2102 intptr_t promoted_objects_size_; |
2106 double promotion_ratio_; | 2103 double promotion_ratio_; |
2107 double promotion_rate_; | 2104 double promotion_rate_; |
2108 intptr_t semi_space_copied_object_size_; | 2105 intptr_t semi_space_copied_object_size_; |
2109 intptr_t previous_semi_space_copied_object_size_; | 2106 intptr_t previous_semi_space_copied_object_size_; |
2110 double semi_space_copied_rate_; | 2107 double semi_space_copied_rate_; |
2111 int nodes_died_in_new_space_; | 2108 int nodes_died_in_new_space_; |
2112 int nodes_copied_in_new_space_; | 2109 int nodes_copied_in_new_space_; |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2655 friend class LargeObjectSpace; | 2652 friend class LargeObjectSpace; |
2656 friend class NewSpace; | 2653 friend class NewSpace; |
2657 friend class PagedSpace; | 2654 friend class PagedSpace; |
2658 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2655 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2659 }; | 2656 }; |
2660 | 2657 |
2661 } // namespace internal | 2658 } // namespace internal |
2662 } // namespace v8 | 2659 } // namespace v8 |
2663 | 2660 |
2664 #endif // V8_HEAP_HEAP_H_ | 2661 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |