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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 V(NameDictionary, intrinsic_function_names, IntrinsicFunctionNames) \ | 187 V(NameDictionary, intrinsic_function_names, IntrinsicFunctionNames) \ |
188 V(NameDictionary, empty_properties_dictionary, EmptyPropertiesDictionary) \ | 188 V(NameDictionary, empty_properties_dictionary, EmptyPropertiesDictionary) \ |
189 V(Object, symbol_registry, SymbolRegistry) \ | 189 V(Object, symbol_registry, SymbolRegistry) \ |
190 V(Object, script_list, ScriptList) \ | 190 V(Object, script_list, ScriptList) \ |
191 V(UnseededNumberDictionary, code_stubs, CodeStubs) \ | 191 V(UnseededNumberDictionary, code_stubs, CodeStubs) \ |
192 V(FixedArray, materialized_objects, MaterializedObjects) \ | 192 V(FixedArray, materialized_objects, MaterializedObjects) \ |
193 V(FixedArray, microtask_queue, MicrotaskQueue) \ | 193 V(FixedArray, microtask_queue, MicrotaskQueue) \ |
194 V(FixedArray, detached_contexts, DetachedContexts) \ | 194 V(FixedArray, detached_contexts, DetachedContexts) \ |
195 V(ArrayList, retained_maps, RetainedMaps) \ | 195 V(ArrayList, retained_maps, RetainedMaps) \ |
196 V(WeakHashTable, weak_object_to_code_table, WeakObjectToCodeTable) \ | 196 V(WeakHashTable, weak_object_to_code_table, WeakObjectToCodeTable) \ |
| 197 /* weak_new_space_object_to_code_list is an array of weak cells, where */ \ |
| 198 /* slots with even indices refer to the weak object, and the subsequent */ \ |
| 199 /* slots refer to the code with the reference to the weak object. */ \ |
| 200 V(ArrayList, weak_new_space_object_to_code_list, \ |
| 201 WeakNewSpaceObjectToCodeList) \ |
197 V(Object, weak_stack_trace_list, WeakStackTraceList) \ | 202 V(Object, weak_stack_trace_list, WeakStackTraceList) \ |
198 V(Object, noscript_shared_function_infos, NoScriptSharedFunctionInfos) \ | 203 V(Object, noscript_shared_function_infos, NoScriptSharedFunctionInfos) \ |
199 V(FixedArray, serialized_templates, SerializedTemplates) \ | 204 V(FixedArray, serialized_templates, SerializedTemplates) \ |
200 /* Configured values */ \ | 205 /* Configured values */ \ |
201 V(JSObject, message_listeners, MessageListeners) \ | 206 V(JSObject, message_listeners, MessageListeners) \ |
202 V(Code, js_entry_code, JsEntryCode) \ | 207 V(Code, js_entry_code, JsEntryCode) \ |
203 V(Code, js_construct_entry_code, JsConstructEntryCode) \ | 208 V(Code, js_construct_entry_code, JsConstructEntryCode) \ |
204 /* Oddball maps */ \ | 209 /* Oddball maps */ \ |
205 V(Map, undefined_map, UndefinedMap) \ | 210 V(Map, undefined_map, UndefinedMap) \ |
206 V(Map, the_hole_map, TheHoleMap) \ | 211 V(Map, the_hole_map, TheHoleMap) \ |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 external_memory_ -= external_memory_concurrently_freed_.Value(); | 858 external_memory_ -= external_memory_concurrently_freed_.Value(); |
854 external_memory_concurrently_freed_.SetValue(0); | 859 external_memory_concurrently_freed_.SetValue(0); |
855 } | 860 } |
856 | 861 |
857 void DeoptMarkedAllocationSites(); | 862 void DeoptMarkedAllocationSites(); |
858 | 863 |
859 bool DeoptMaybeTenuredAllocationSites() { | 864 bool DeoptMaybeTenuredAllocationSites() { |
860 return new_space_.IsAtMaximumCapacity() && maximum_size_scavenges_ == 0; | 865 return new_space_.IsAtMaximumCapacity() && maximum_size_scavenges_ == 0; |
861 } | 866 } |
862 | 867 |
| 868 void AddWeakNewSpaceObjectToCodeDependency(Handle<HeapObject> obj, |
| 869 Handle<WeakCell> code); |
| 870 |
863 void AddWeakObjectToCodeDependency(Handle<HeapObject> obj, | 871 void AddWeakObjectToCodeDependency(Handle<HeapObject> obj, |
864 Handle<DependentCode> dep); | 872 Handle<DependentCode> dep); |
865 | 873 |
866 DependentCode* LookupWeakObjectToCodeDependency(Handle<HeapObject> obj); | 874 DependentCode* LookupWeakObjectToCodeDependency(Handle<HeapObject> obj); |
867 | 875 |
868 void CompactWeakFixedArrays(); | 876 void CompactWeakFixedArrays(); |
869 | 877 |
870 void AddRetainedMap(Handle<Map> map); | 878 void AddRetainedMap(Handle<Map> map); |
871 | 879 |
872 // This event is triggered after successful allocation of a new object made | 880 // This event is triggered after successful allocation of a new object made |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 void IteratePromotedObjectPointers(HeapObject* object, Address start, | 1121 void IteratePromotedObjectPointers(HeapObject* object, Address start, |
1114 Address end, bool record_slots, | 1122 Address end, bool record_slots, |
1115 ObjectSlotCallback callback); | 1123 ObjectSlotCallback callback); |
1116 | 1124 |
1117 // =========================================================================== | 1125 // =========================================================================== |
1118 // Store buffer API. ========================================================= | 1126 // Store buffer API. ========================================================= |
1119 // =========================================================================== | 1127 // =========================================================================== |
1120 | 1128 |
1121 // Write barrier support for object[offset] = o; | 1129 // Write barrier support for object[offset] = o; |
1122 inline void RecordWrite(Object* object, int offset, Object* o); | 1130 inline void RecordWrite(Object* object, int offset, Object* o); |
| 1131 inline void RecordWriteIntoCode(Code* host, RelocInfo* rinfo, Object* target); |
| 1132 void RecordWriteIntoCodeSlow(Code* host, RelocInfo* rinfo, Object* target); |
1123 inline void RecordFixedArrayElements(FixedArray* array, int offset, | 1133 inline void RecordFixedArrayElements(FixedArray* array, int offset, |
1124 int length); | 1134 int length); |
1125 | 1135 |
1126 Address* store_buffer_top_address() { return store_buffer()->top_address(); } | 1136 Address* store_buffer_top_address() { return store_buffer()->top_address(); } |
1127 | 1137 |
1128 void ClearRecordedSlot(HeapObject* object, Object** slot); | 1138 void ClearRecordedSlot(HeapObject* object, Object** slot); |
1129 void ClearRecordedSlotRange(Address start, Address end); | 1139 void ClearRecordedSlotRange(Address start, Address end); |
1130 | 1140 |
1131 // =========================================================================== | 1141 // =========================================================================== |
1132 // Incremental marking API. ================================================== | 1142 // Incremental marking API. ================================================== |
(...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2687 friend class LargeObjectSpace; | 2697 friend class LargeObjectSpace; |
2688 friend class NewSpace; | 2698 friend class NewSpace; |
2689 friend class PagedSpace; | 2699 friend class PagedSpace; |
2690 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2700 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2691 }; | 2701 }; |
2692 | 2702 |
2693 } // namespace internal | 2703 } // namespace internal |
2694 } // namespace v8 | 2704 } // namespace v8 |
2695 | 2705 |
2696 #endif // V8_HEAP_HEAP_H_ | 2706 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |