| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 V(Map, int8x16_map, Int8x16Map) \ | 54 V(Map, int8x16_map, Int8x16Map) \ |
| 55 V(Map, uint8x16_map, Uint8x16Map) \ | 55 V(Map, uint8x16_map, Uint8x16Map) \ |
| 56 V(Map, bool8x16_map, Bool8x16Map) \ | 56 V(Map, bool8x16_map, Bool8x16Map) \ |
| 57 V(Map, native_context_map, NativeContextMap) \ | 57 V(Map, native_context_map, NativeContextMap) \ |
| 58 V(Map, fixed_array_map, FixedArrayMap) \ | 58 V(Map, fixed_array_map, FixedArrayMap) \ |
| 59 V(Map, code_map, CodeMap) \ | 59 V(Map, code_map, CodeMap) \ |
| 60 V(Map, scope_info_map, ScopeInfoMap) \ | 60 V(Map, scope_info_map, ScopeInfoMap) \ |
| 61 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \ | 61 V(Map, fixed_cow_array_map, FixedCOWArrayMap) \ |
| 62 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \ | 62 V(Map, fixed_double_array_map, FixedDoubleArrayMap) \ |
| 63 V(Map, weak_cell_map, WeakCellMap) \ | 63 V(Map, weak_cell_map, WeakCellMap) \ |
| 64 V(Map, transition_array_map, TransitionArrayMap) \ | |
| 65 V(Map, one_byte_string_map, OneByteStringMap) \ | 64 V(Map, one_byte_string_map, OneByteStringMap) \ |
| 66 V(Map, one_byte_internalized_string_map, OneByteInternalizedStringMap) \ | 65 V(Map, one_byte_internalized_string_map, OneByteInternalizedStringMap) \ |
| 67 V(Map, function_context_map, FunctionContextMap) \ | 66 V(Map, function_context_map, FunctionContextMap) \ |
| 68 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ | 67 V(FixedArray, empty_fixed_array, EmptyFixedArray) \ |
| 69 V(ByteArray, empty_byte_array, EmptyByteArray) \ | 68 V(ByteArray, empty_byte_array, EmptyByteArray) \ |
| 70 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \ | 69 V(DescriptorArray, empty_descriptor_array, EmptyDescriptorArray) \ |
| 71 /* The roots above this line should be boring from a GC point of view. */ \ | 70 /* The roots above this line should be boring from a GC point of view. */ \ |
| 72 /* This means they are never in new space and never on a page that is */ \ | 71 /* This means they are never in new space and never on a page that is */ \ |
| 73 /* being compacted. */ \ | 72 /* being compacted. */ \ |
| 74 V(Oddball, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \ | 73 V(Oddball, no_interceptor_result_sentinel, NoInterceptorResultSentinel) \ |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 V(Int8x16Map) \ | 416 V(Int8x16Map) \ |
| 418 V(Uint8x16Map) \ | 417 V(Uint8x16Map) \ |
| 419 V(Bool8x16Map) \ | 418 V(Bool8x16Map) \ |
| 420 V(NativeContextMap) \ | 419 V(NativeContextMap) \ |
| 421 V(FixedArrayMap) \ | 420 V(FixedArrayMap) \ |
| 422 V(CodeMap) \ | 421 V(CodeMap) \ |
| 423 V(ScopeInfoMap) \ | 422 V(ScopeInfoMap) \ |
| 424 V(FixedCOWArrayMap) \ | 423 V(FixedCOWArrayMap) \ |
| 425 V(FixedDoubleArrayMap) \ | 424 V(FixedDoubleArrayMap) \ |
| 426 V(WeakCellMap) \ | 425 V(WeakCellMap) \ |
| 427 V(TransitionArrayMap) \ | |
| 428 V(NoInterceptorResultSentinel) \ | 426 V(NoInterceptorResultSentinel) \ |
| 429 V(HashTableMap) \ | 427 V(HashTableMap) \ |
| 430 V(OrderedHashTableMap) \ | 428 V(OrderedHashTableMap) \ |
| 431 V(EmptyFixedArray) \ | 429 V(EmptyFixedArray) \ |
| 432 V(EmptyByteArray) \ | 430 V(EmptyByteArray) \ |
| 433 V(EmptyBytecodeArray) \ | 431 V(EmptyBytecodeArray) \ |
| 434 V(EmptyDescriptorArray) \ | 432 V(EmptyDescriptorArray) \ |
| 435 V(ArgumentsMarker) \ | 433 V(ArgumentsMarker) \ |
| 436 V(SymbolMap) \ | 434 V(SymbolMap) \ |
| 437 V(SloppyArgumentsElementsMap) \ | 435 V(SloppyArgumentsElementsMap) \ |
| (...skipping 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 } | 875 } |
| 878 Object* encountered_weak_collections() const { | 876 Object* encountered_weak_collections() const { |
| 879 return encountered_weak_collections_; | 877 return encountered_weak_collections_; |
| 880 } | 878 } |
| 881 | 879 |
| 882 void set_encountered_weak_cells(Object* weak_cell) { | 880 void set_encountered_weak_cells(Object* weak_cell) { |
| 883 encountered_weak_cells_ = weak_cell; | 881 encountered_weak_cells_ = weak_cell; |
| 884 } | 882 } |
| 885 Object* encountered_weak_cells() const { return encountered_weak_cells_; } | 883 Object* encountered_weak_cells() const { return encountered_weak_cells_; } |
| 886 | 884 |
| 887 void set_encountered_transition_arrays(Object* transition_array) { | |
| 888 encountered_transition_arrays_ = transition_array; | |
| 889 } | |
| 890 Object* encountered_transition_arrays() const { | |
| 891 return encountered_transition_arrays_; | |
| 892 } | |
| 893 | |
| 894 // Number of mark-sweeps. | 885 // Number of mark-sweeps. |
| 895 int ms_count() const { return ms_count_; } | 886 int ms_count() const { return ms_count_; } |
| 896 | 887 |
| 897 // Checks whether the given object is allowed to be migrated from it's | 888 // Checks whether the given object is allowed to be migrated from it's |
| 898 // current space into the given destination space. Used for debugging. | 889 // current space into the given destination space. Used for debugging. |
| 899 inline bool AllowedToBeMigrated(HeapObject* object, AllocationSpace dest); | 890 inline bool AllowedToBeMigrated(HeapObject* object, AllocationSpace dest); |
| 900 | 891 |
| 901 void CheckHandleCount(); | 892 void CheckHandleCount(); |
| 902 | 893 |
| 903 // Number of "runtime allocations" done so far. | 894 // Number of "runtime allocations" done so far. |
| (...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2097 AllocateEmptyFixedTypedArray(ExternalArrayType array_type); | 2088 AllocateEmptyFixedTypedArray(ExternalArrayType array_type); |
| 2098 | 2089 |
| 2099 // Allocate a tenured simple cell. | 2090 // Allocate a tenured simple cell. |
| 2100 MUST_USE_RESULT AllocationResult AllocateCell(Object* value); | 2091 MUST_USE_RESULT AllocationResult AllocateCell(Object* value); |
| 2101 | 2092 |
| 2102 // Allocate a tenured JS global property cell initialized with the hole. | 2093 // Allocate a tenured JS global property cell initialized with the hole. |
| 2103 MUST_USE_RESULT AllocationResult AllocatePropertyCell(); | 2094 MUST_USE_RESULT AllocationResult AllocatePropertyCell(); |
| 2104 | 2095 |
| 2105 MUST_USE_RESULT AllocationResult AllocateWeakCell(HeapObject* value); | 2096 MUST_USE_RESULT AllocationResult AllocateWeakCell(HeapObject* value); |
| 2106 | 2097 |
| 2107 MUST_USE_RESULT AllocationResult AllocateTransitionArray(int capacity); | |
| 2108 | |
| 2109 // Allocates a new utility object in the old generation. | 2098 // Allocates a new utility object in the old generation. |
| 2110 MUST_USE_RESULT AllocationResult AllocateStruct(InstanceType type); | 2099 MUST_USE_RESULT AllocationResult AllocateStruct(InstanceType type); |
| 2111 | 2100 |
| 2112 // Allocates a new foreign object. | 2101 // Allocates a new foreign object. |
| 2113 MUST_USE_RESULT AllocationResult | 2102 MUST_USE_RESULT AllocationResult |
| 2114 AllocateForeign(Address address, PretenureFlag pretenure = NOT_TENURED); | 2103 AllocateForeign(Address address, PretenureFlag pretenure = NOT_TENURED); |
| 2115 | 2104 |
| 2116 MUST_USE_RESULT AllocationResult | 2105 MUST_USE_RESULT AllocationResult |
| 2117 AllocateCode(int object_size, bool immovable); | 2106 AllocateCode(int object_size, bool immovable); |
| 2118 | 2107 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2225 Object* native_contexts_list_; | 2214 Object* native_contexts_list_; |
| 2226 Object* allocation_sites_list_; | 2215 Object* allocation_sites_list_; |
| 2227 | 2216 |
| 2228 // List of encountered weak collections (JSWeakMap and JSWeakSet) during | 2217 // List of encountered weak collections (JSWeakMap and JSWeakSet) during |
| 2229 // marking. It is initialized during marking, destroyed after marking and | 2218 // marking. It is initialized during marking, destroyed after marking and |
| 2230 // contains Smi(0) while marking is not active. | 2219 // contains Smi(0) while marking is not active. |
| 2231 Object* encountered_weak_collections_; | 2220 Object* encountered_weak_collections_; |
| 2232 | 2221 |
| 2233 Object* encountered_weak_cells_; | 2222 Object* encountered_weak_cells_; |
| 2234 | 2223 |
| 2235 Object* encountered_transition_arrays_; | |
| 2236 | |
| 2237 StoreBufferRebuilder store_buffer_rebuilder_; | 2224 StoreBufferRebuilder store_buffer_rebuilder_; |
| 2238 | 2225 |
| 2239 List<GCCallbackPair> gc_epilogue_callbacks_; | 2226 List<GCCallbackPair> gc_epilogue_callbacks_; |
| 2240 List<GCCallbackPair> gc_prologue_callbacks_; | 2227 List<GCCallbackPair> gc_prologue_callbacks_; |
| 2241 | 2228 |
| 2242 // Total RegExp code ever generated | 2229 // Total RegExp code ever generated |
| 2243 double total_regexp_code_generated_; | 2230 double total_regexp_code_generated_; |
| 2244 | 2231 |
| 2245 int deferred_counters_[v8::Isolate::kUseCounterFeatureCount]; | 2232 int deferred_counters_[v8::Isolate::kUseCounterFeatureCount]; |
| 2246 | 2233 |
| (...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2742 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2729 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
| 2743 | 2730 |
| 2744 private: | 2731 private: |
| 2745 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2732 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2746 }; | 2733 }; |
| 2747 #endif // DEBUG | 2734 #endif // DEBUG |
| 2748 } // namespace internal | 2735 } // namespace internal |
| 2749 } // namespace v8 | 2736 } // namespace v8 |
| 2750 | 2737 |
| 2751 #endif // V8_HEAP_HEAP_H_ | 2738 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |