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