| 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 842 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 853 | 853 |
| 854 // Converts the given boolean condition to JavaScript boolean value. | 854 // Converts the given boolean condition to JavaScript boolean value. |
| 855 inline Object* ToBoolean(bool condition); | 855 inline Object* ToBoolean(bool condition); |
| 856 | 856 |
| 857 // Check whether the heap is currently iterable. | 857 // Check whether the heap is currently iterable. |
| 858 bool IsHeapIterable(); | 858 bool IsHeapIterable(); |
| 859 | 859 |
| 860 // Notify the heap that a context has been disposed. | 860 // Notify the heap that a context has been disposed. |
| 861 int NotifyContextDisposed(bool dependant_context); | 861 int NotifyContextDisposed(bool dependant_context); |
| 862 | 862 |
| 863 inline void increment_scan_on_scavenge_pages() { | |
| 864 scan_on_scavenge_pages_++; | |
| 865 if (FLAG_gc_verbose) { | |
| 866 PrintF("Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_); | |
| 867 } | |
| 868 } | |
| 869 | |
| 870 inline void decrement_scan_on_scavenge_pages() { | |
| 871 scan_on_scavenge_pages_--; | |
| 872 if (FLAG_gc_verbose) { | |
| 873 PrintF("Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_); | |
| 874 } | |
| 875 } | |
| 876 | |
| 877 void set_native_contexts_list(Object* object) { | 863 void set_native_contexts_list(Object* object) { |
| 878 native_contexts_list_ = object; | 864 native_contexts_list_ = object; |
| 879 } | 865 } |
| 880 Object* native_contexts_list() const { return native_contexts_list_; } | 866 Object* native_contexts_list() const { return native_contexts_list_; } |
| 881 | 867 |
| 882 void set_allocation_sites_list(Object* object) { | 868 void set_allocation_sites_list(Object* object) { |
| 883 allocation_sites_list_ = object; | 869 allocation_sites_list_ = object; |
| 884 } | 870 } |
| 885 Object* allocation_sites_list() { return allocation_sites_list_; } | 871 Object* allocation_sites_list() { return allocation_sites_list_; } |
| 886 | 872 |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1689 static const int kMaxMarkCompactsInIdleRound = 7; | 1675 static const int kMaxMarkCompactsInIdleRound = 7; |
| 1690 static const int kIdleScavengeThreshold = 5; | 1676 static const int kIdleScavengeThreshold = 5; |
| 1691 | 1677 |
| 1692 static const int kInitialFeedbackCapacity = 256; | 1678 static const int kInitialFeedbackCapacity = 256; |
| 1693 | 1679 |
| 1694 Heap(); | 1680 Heap(); |
| 1695 | 1681 |
| 1696 static String* UpdateNewSpaceReferenceInExternalStringTableEntry( | 1682 static String* UpdateNewSpaceReferenceInExternalStringTableEntry( |
| 1697 Heap* heap, Object** pointer); | 1683 Heap* heap, Object** pointer); |
| 1698 | 1684 |
| 1699 static void ScavengeStoreBufferCallback(Heap* heap, MemoryChunk* page, | |
| 1700 StoreBufferEvent event); | |
| 1701 | |
| 1702 // Selects the proper allocation space based on the pretenuring decision. | 1685 // Selects the proper allocation space based on the pretenuring decision. |
| 1703 static AllocationSpace SelectSpace(PretenureFlag pretenure) { | 1686 static AllocationSpace SelectSpace(PretenureFlag pretenure) { |
| 1704 return (pretenure == TENURED) ? OLD_SPACE : NEW_SPACE; | 1687 return (pretenure == TENURED) ? OLD_SPACE : NEW_SPACE; |
| 1705 } | 1688 } |
| 1706 | 1689 |
| 1707 #define ROOT_ACCESSOR(type, name, camel_name) \ | 1690 #define ROOT_ACCESSOR(type, name, camel_name) \ |
| 1708 inline void set_##name(type* value); | 1691 inline void set_##name(type* value); |
| 1709 ROOT_LIST(ROOT_ACCESSOR) | 1692 ROOT_LIST(ROOT_ACCESSOR) |
| 1710 #undef ROOT_ACCESSOR | 1693 #undef ROOT_ACCESSOR |
| 1711 | 1694 |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2206 // For keeping track of context disposals. | 2189 // For keeping track of context disposals. |
| 2207 int contexts_disposed_; | 2190 int contexts_disposed_; |
| 2208 | 2191 |
| 2209 // The length of the retained_maps array at the time of context disposal. | 2192 // The length of the retained_maps array at the time of context disposal. |
| 2210 // This separates maps in the retained_maps array that were created before | 2193 // This separates maps in the retained_maps array that were created before |
| 2211 // and after context disposal. | 2194 // and after context disposal. |
| 2212 int number_of_disposed_maps_; | 2195 int number_of_disposed_maps_; |
| 2213 | 2196 |
| 2214 int global_ic_age_; | 2197 int global_ic_age_; |
| 2215 | 2198 |
| 2216 int scan_on_scavenge_pages_; | |
| 2217 | |
| 2218 NewSpace new_space_; | 2199 NewSpace new_space_; |
| 2219 OldSpace* old_space_; | 2200 OldSpace* old_space_; |
| 2220 OldSpace* code_space_; | 2201 OldSpace* code_space_; |
| 2221 MapSpace* map_space_; | 2202 MapSpace* map_space_; |
| 2222 LargeObjectSpace* lo_space_; | 2203 LargeObjectSpace* lo_space_; |
| 2223 HeapState gc_state_; | 2204 HeapState gc_state_; |
| 2224 int gc_post_processing_depth_; | 2205 int gc_post_processing_depth_; |
| 2225 Address new_space_top_after_last_gc_; | 2206 Address new_space_top_after_last_gc_; |
| 2226 | 2207 |
| 2227 // Returns the amount of external memory registered since last global gc. | 2208 // Returns the amount of external memory registered since last global gc. |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2275 | 2256 |
| 2276 // List of encountered weak collections (JSWeakMap and JSWeakSet) during | 2257 // List of encountered weak collections (JSWeakMap and JSWeakSet) during |
| 2277 // marking. It is initialized during marking, destroyed after marking and | 2258 // marking. It is initialized during marking, destroyed after marking and |
| 2278 // contains Smi(0) while marking is not active. | 2259 // contains Smi(0) while marking is not active. |
| 2279 Object* encountered_weak_collections_; | 2260 Object* encountered_weak_collections_; |
| 2280 | 2261 |
| 2281 Object* encountered_weak_cells_; | 2262 Object* encountered_weak_cells_; |
| 2282 | 2263 |
| 2283 Object* encountered_transition_arrays_; | 2264 Object* encountered_transition_arrays_; |
| 2284 | 2265 |
| 2285 StoreBufferRebuilder store_buffer_rebuilder_; | |
| 2286 | |
| 2287 List<GCCallbackPair> gc_epilogue_callbacks_; | 2266 List<GCCallbackPair> gc_epilogue_callbacks_; |
| 2288 List<GCCallbackPair> gc_prologue_callbacks_; | 2267 List<GCCallbackPair> gc_prologue_callbacks_; |
| 2289 | 2268 |
| 2290 // Total RegExp code ever generated | 2269 // Total RegExp code ever generated |
| 2291 double total_regexp_code_generated_; | 2270 double total_regexp_code_generated_; |
| 2292 | 2271 |
| 2293 int deferred_counters_[v8::Isolate::kUseCounterFeatureCount]; | 2272 int deferred_counters_[v8::Isolate::kUseCounterFeatureCount]; |
| 2294 | 2273 |
| 2295 GCTracer* tracer_; | 2274 GCTracer* tracer_; |
| 2296 | 2275 |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2799 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2778 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 2800 | 2779 |
| 2801 private: | 2780 private: |
| 2802 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2781 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2803 }; | 2782 }; |
| 2804 #endif // DEBUG | 2783 #endif // DEBUG |
| 2805 } // namespace internal | 2784 } // namespace internal |
| 2806 } // namespace v8 | 2785 } // namespace v8 |
| 2807 | 2786 |
| 2808 #endif // V8_HEAP_HEAP_H_ | 2787 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |