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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 EmptySlowElementDictionary) \ | 182 EmptySlowElementDictionary) \ |
183 V(FixedArray, materialized_objects, MaterializedObjects) \ | 183 V(FixedArray, materialized_objects, MaterializedObjects) \ |
184 V(FixedArray, microtask_queue, MicrotaskQueue) \ | 184 V(FixedArray, microtask_queue, MicrotaskQueue) \ |
185 V(TypeFeedbackVector, dummy_vector, DummyVector) \ | 185 V(TypeFeedbackVector, dummy_vector, DummyVector) \ |
186 V(FixedArray, empty_literals_array, EmptyLiteralsArray) \ | 186 V(FixedArray, empty_literals_array, EmptyLiteralsArray) \ |
187 V(FixedArray, empty_sloppy_arguments_elements, EmptySloppyArgumentsElements) \ | 187 V(FixedArray, empty_sloppy_arguments_elements, EmptySloppyArgumentsElements) \ |
188 V(FixedArray, cleared_optimized_code_map, ClearedOptimizedCodeMap) \ | 188 V(FixedArray, cleared_optimized_code_map, ClearedOptimizedCodeMap) \ |
189 V(FixedArray, detached_contexts, DetachedContexts) \ | 189 V(FixedArray, detached_contexts, DetachedContexts) \ |
190 V(ArrayList, retained_maps, RetainedMaps) \ | 190 V(ArrayList, retained_maps, RetainedMaps) \ |
191 V(WeakHashTable, weak_object_to_code_table, WeakObjectToCodeTable) \ | 191 V(WeakHashTable, weak_object_to_code_table, WeakObjectToCodeTable) \ |
| 192 /* weak_new_space_object_to_code_list is an array of weak cells, where */ \ |
| 193 /* slots with even indices refer to the weak object, and the subsequent */ \ |
| 194 /* slots refer to the code with the reference to the weak object. */ \ |
| 195 V(ArrayList, weak_new_space_object_to_code_list, \ |
| 196 WeakNewSpaceObjectToCodeList) \ |
192 V(PropertyCell, array_protector, ArrayProtector) \ | 197 V(PropertyCell, array_protector, ArrayProtector) \ |
193 V(Cell, is_concat_spreadable_protector, IsConcatSpreadableProtector) \ | 198 V(Cell, is_concat_spreadable_protector, IsConcatSpreadableProtector) \ |
194 V(PropertyCell, empty_property_cell, EmptyPropertyCell) \ | 199 V(PropertyCell, empty_property_cell, EmptyPropertyCell) \ |
195 V(Object, weak_stack_trace_list, WeakStackTraceList) \ | 200 V(Object, weak_stack_trace_list, WeakStackTraceList) \ |
196 V(Object, noscript_shared_function_infos, NoScriptSharedFunctionInfos) \ | 201 V(Object, noscript_shared_function_infos, NoScriptSharedFunctionInfos) \ |
197 V(Map, bytecode_array_map, BytecodeArrayMap) \ | 202 V(Map, bytecode_array_map, BytecodeArrayMap) \ |
198 V(WeakCell, empty_weak_cell, EmptyWeakCell) \ | 203 V(WeakCell, empty_weak_cell, EmptyWeakCell) \ |
199 V(PropertyCell, has_instance_protector, HasInstanceProtector) \ | 204 V(PropertyCell, has_instance_protector, HasInstanceProtector) \ |
200 V(Cell, species_protector, SpeciesProtector) \ | 205 V(Cell, species_protector, SpeciesProtector) \ |
201 V(FixedArray, serialized_templates, SerializedTemplates) | 206 V(FixedArray, serialized_templates, SerializedTemplates) |
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
832 external_memory_ -= external_memory_concurrently_freed_.Value(); | 837 external_memory_ -= external_memory_concurrently_freed_.Value(); |
833 external_memory_concurrently_freed_.SetValue(0); | 838 external_memory_concurrently_freed_.SetValue(0); |
834 } | 839 } |
835 | 840 |
836 void DeoptMarkedAllocationSites(); | 841 void DeoptMarkedAllocationSites(); |
837 | 842 |
838 bool DeoptMaybeTenuredAllocationSites() { | 843 bool DeoptMaybeTenuredAllocationSites() { |
839 return new_space_.IsAtMaximumCapacity() && maximum_size_scavenges_ == 0; | 844 return new_space_.IsAtMaximumCapacity() && maximum_size_scavenges_ == 0; |
840 } | 845 } |
841 | 846 |
| 847 void AddWeakNewSpaceObjectToCodeDependency(Handle<HeapObject> obj, |
| 848 Handle<WeakCell> code); |
| 849 |
842 void AddWeakObjectToCodeDependency(Handle<HeapObject> obj, | 850 void AddWeakObjectToCodeDependency(Handle<HeapObject> obj, |
843 Handle<DependentCode> dep); | 851 Handle<DependentCode> dep); |
844 | 852 |
845 DependentCode* LookupWeakObjectToCodeDependency(Handle<HeapObject> obj); | 853 DependentCode* LookupWeakObjectToCodeDependency(Handle<HeapObject> obj); |
846 | 854 |
847 void CompactWeakFixedArrays(); | 855 void CompactWeakFixedArrays(); |
848 | 856 |
849 void AddRetainedMap(Handle<Map> map); | 857 void AddRetainedMap(Handle<Map> map); |
850 | 858 |
851 // This event is triggered after successful allocation of a new object made | 859 // 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... |
1092 void IteratePromotedObjectPointers(HeapObject* object, Address start, | 1100 void IteratePromotedObjectPointers(HeapObject* object, Address start, |
1093 Address end, bool record_slots, | 1101 Address end, bool record_slots, |
1094 ObjectSlotCallback callback); | 1102 ObjectSlotCallback callback); |
1095 | 1103 |
1096 // =========================================================================== | 1104 // =========================================================================== |
1097 // Store buffer API. ========================================================= | 1105 // Store buffer API. ========================================================= |
1098 // =========================================================================== | 1106 // =========================================================================== |
1099 | 1107 |
1100 // Write barrier support for object[offset] = o; | 1108 // Write barrier support for object[offset] = o; |
1101 inline void RecordWrite(Object* object, int offset, Object* o); | 1109 inline void RecordWrite(Object* object, int offset, Object* o); |
| 1110 inline void RecordWriteIntoCode(Code* host, RelocInfo* rinfo, Object* target); |
| 1111 void RecordWriteIntoCodeSlow(Code* host, RelocInfo* rinfo, Object* target); |
1102 inline void RecordFixedArrayElements(FixedArray* array, int offset, | 1112 inline void RecordFixedArrayElements(FixedArray* array, int offset, |
1103 int length); | 1113 int length); |
1104 | 1114 |
1105 Address* store_buffer_top_address() { return store_buffer()->top_address(); } | 1115 Address* store_buffer_top_address() { return store_buffer()->top_address(); } |
1106 | 1116 |
1107 void ClearRecordedSlot(HeapObject* object, Object** slot); | 1117 void ClearRecordedSlot(HeapObject* object, Object** slot); |
1108 void ClearRecordedSlotRange(Address start, Address end); | 1118 void ClearRecordedSlotRange(Address start, Address end); |
1109 | 1119 |
1110 // =========================================================================== | 1120 // =========================================================================== |
1111 // Incremental marking API. ================================================== | 1121 // Incremental marking API. ================================================== |
(...skipping 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2666 friend class LargeObjectSpace; | 2676 friend class LargeObjectSpace; |
2667 friend class NewSpace; | 2677 friend class NewSpace; |
2668 friend class PagedSpace; | 2678 friend class PagedSpace; |
2669 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2679 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2670 }; | 2680 }; |
2671 | 2681 |
2672 } // namespace internal | 2682 } // namespace internal |
2673 } // namespace v8 | 2683 } // namespace v8 |
2674 | 2684 |
2675 #endif // V8_HEAP_HEAP_H_ | 2685 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |