| 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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 static inline void CopyBlock(Address dst, Address src, int byte_size); | 598 static inline void CopyBlock(Address dst, Address src, int byte_size); |
| 599 | 599 |
| 600 // Determines a static visitor id based on the given {map} that can then be | 600 // Determines a static visitor id based on the given {map} that can then be |
| 601 // stored on the map to facilitate fast dispatch for {StaticVisitorBase}. | 601 // stored on the map to facilitate fast dispatch for {StaticVisitorBase}. |
| 602 static int GetStaticVisitorIdForMap(Map* map); | 602 static int GetStaticVisitorIdForMap(Map* map); |
| 603 | 603 |
| 604 // Notifies the heap that is ok to start marking or other activities that | 604 // Notifies the heap that is ok to start marking or other activities that |
| 605 // should not happen during deserialization. | 605 // should not happen during deserialization. |
| 606 void NotifyDeserializationComplete(); | 606 void NotifyDeserializationComplete(); |
| 607 | 607 |
| 608 void AddObjectToMarkingDeque(Object** object); |
| 609 |
| 608 intptr_t old_generation_allocation_limit() const { | 610 intptr_t old_generation_allocation_limit() const { |
| 609 return old_generation_allocation_limit_; | 611 return old_generation_allocation_limit_; |
| 610 } | 612 } |
| 611 | 613 |
| 612 bool always_allocate() { return always_allocate_scope_count_.Value() != 0; } | 614 bool always_allocate() { return always_allocate_scope_count_.Value() != 0; } |
| 613 | 615 |
| 614 Address* NewSpaceAllocationTopAddress() { | 616 Address* NewSpaceAllocationTopAddress() { |
| 615 return new_space_.allocation_top_address(); | 617 return new_space_.allocation_top_address(); |
| 616 } | 618 } |
| 617 Address* NewSpaceAllocationLimitAddress() { | 619 Address* NewSpaceAllocationLimitAddress() { |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 } | 918 } |
| 917 | 919 |
| 918 // Returns name of the space. | 920 // Returns name of the space. |
| 919 const char* GetSpaceName(int idx); | 921 const char* GetSpaceName(int idx); |
| 920 | 922 |
| 921 // =========================================================================== | 923 // =========================================================================== |
| 922 // Getters to other components. ============================================== | 924 // Getters to other components. ============================================== |
| 923 // =========================================================================== | 925 // =========================================================================== |
| 924 | 926 |
| 925 GCTracer* tracer() { return tracer_; } | 927 GCTracer* tracer() { return tracer_; } |
| 928 EmbedderHeapTracer* embedder_heap_tracer() { return embedder_heap_tracer_; } |
| 926 | 929 |
| 927 PromotionQueue* promotion_queue() { return &promotion_queue_; } | 930 PromotionQueue* promotion_queue() { return &promotion_queue_; } |
| 928 | 931 |
| 929 inline Isolate* isolate(); | 932 inline Isolate* isolate(); |
| 930 | 933 |
| 931 MarkCompactCollector* mark_compact_collector() { | 934 MarkCompactCollector* mark_compact_collector() { |
| 932 return mark_compact_collector_; | 935 return mark_compact_collector_; |
| 933 } | 936 } |
| 934 | 937 |
| 935 // =========================================================================== | 938 // =========================================================================== |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1313 GCType gc_type_filter, bool pass_isolate = true); | 1316 GCType gc_type_filter, bool pass_isolate = true); |
| 1314 void RemoveGCPrologueCallback(v8::Isolate::GCCallback callback); | 1317 void RemoveGCPrologueCallback(v8::Isolate::GCCallback callback); |
| 1315 | 1318 |
| 1316 void AddGCEpilogueCallback(v8::Isolate::GCCallback callback, | 1319 void AddGCEpilogueCallback(v8::Isolate::GCCallback callback, |
| 1317 GCType gc_type_filter, bool pass_isolate = true); | 1320 GCType gc_type_filter, bool pass_isolate = true); |
| 1318 void RemoveGCEpilogueCallback(v8::Isolate::GCCallback callback); | 1321 void RemoveGCEpilogueCallback(v8::Isolate::GCCallback callback); |
| 1319 | 1322 |
| 1320 void CallGCPrologueCallbacks(GCType gc_type, GCCallbackFlags flags); | 1323 void CallGCPrologueCallbacks(GCType gc_type, GCCallbackFlags flags); |
| 1321 void CallGCEpilogueCallbacks(GCType gc_type, GCCallbackFlags flags); | 1324 void CallGCEpilogueCallbacks(GCType gc_type, GCCallbackFlags flags); |
| 1322 | 1325 |
| 1326 void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer); |
| 1327 |
| 1323 // =========================================================================== | 1328 // =========================================================================== |
| 1324 // Allocation methods. ======================================================= | 1329 // Allocation methods. ======================================================= |
| 1325 // =========================================================================== | 1330 // =========================================================================== |
| 1326 | 1331 |
| 1327 // Creates a filler object and returns a heap object immediately after it. | 1332 // Creates a filler object and returns a heap object immediately after it. |
| 1328 MUST_USE_RESULT HeapObject* PrecedeWithFiller(HeapObject* object, | 1333 MUST_USE_RESULT HeapObject* PrecedeWithFiller(HeapObject* object, |
| 1329 int filler_size); | 1334 int filler_size); |
| 1330 | 1335 |
| 1331 // Creates a filler object if needed for alignment and returns a heap object | 1336 // Creates a filler object if needed for alignment and returns a heap object |
| 1332 // immediately after it. If any space is left after the returned object, | 1337 // immediately after it. If any space is left after the returned object, |
| (...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2095 | 2100 |
| 2096 List<GCCallbackPair> gc_epilogue_callbacks_; | 2101 List<GCCallbackPair> gc_epilogue_callbacks_; |
| 2097 List<GCCallbackPair> gc_prologue_callbacks_; | 2102 List<GCCallbackPair> gc_prologue_callbacks_; |
| 2098 | 2103 |
| 2099 // Total RegExp code ever generated | 2104 // Total RegExp code ever generated |
| 2100 double total_regexp_code_generated_; | 2105 double total_regexp_code_generated_; |
| 2101 | 2106 |
| 2102 int deferred_counters_[v8::Isolate::kUseCounterFeatureCount]; | 2107 int deferred_counters_[v8::Isolate::kUseCounterFeatureCount]; |
| 2103 | 2108 |
| 2104 GCTracer* tracer_; | 2109 GCTracer* tracer_; |
| 2110 EmbedderHeapTracer* embedder_heap_tracer_; |
| 2105 | 2111 |
| 2106 int high_survival_rate_period_length_; | 2112 int high_survival_rate_period_length_; |
| 2107 intptr_t promoted_objects_size_; | 2113 intptr_t promoted_objects_size_; |
| 2108 double promotion_ratio_; | 2114 double promotion_ratio_; |
| 2109 double promotion_rate_; | 2115 double promotion_rate_; |
| 2110 intptr_t semi_space_copied_object_size_; | 2116 intptr_t semi_space_copied_object_size_; |
| 2111 intptr_t previous_semi_space_copied_object_size_; | 2117 intptr_t previous_semi_space_copied_object_size_; |
| 2112 double semi_space_copied_rate_; | 2118 double semi_space_copied_rate_; |
| 2113 int nodes_died_in_new_space_; | 2119 int nodes_died_in_new_space_; |
| 2114 int nodes_copied_in_new_space_; | 2120 int nodes_copied_in_new_space_; |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2654 friend class LargeObjectSpace; | 2660 friend class LargeObjectSpace; |
| 2655 friend class NewSpace; | 2661 friend class NewSpace; |
| 2656 friend class PagedSpace; | 2662 friend class PagedSpace; |
| 2657 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2663 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
| 2658 }; | 2664 }; |
| 2659 | 2665 |
| 2660 } // namespace internal | 2666 } // namespace internal |
| 2661 } // namespace v8 | 2667 } // namespace v8 |
| 2662 | 2668 |
| 2663 #endif // V8_HEAP_HEAP_H_ | 2669 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |