Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(323)

Side by Side Diff: src/heap/heap.h

Issue 2045263002: [heap] Avoid the use of cells to point from code to new-space objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 206
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 amount_of_external_allocated_memory_freed_.Value(); 836 amount_of_external_allocated_memory_freed_.Value();
832 amount_of_external_allocated_memory_freed_.SetValue(0); 837 amount_of_external_allocated_memory_freed_.SetValue(0);
833 } 838 }
834 839
835 void DeoptMarkedAllocationSites(); 840 void DeoptMarkedAllocationSites();
836 841
837 bool DeoptMaybeTenuredAllocationSites() { 842 bool DeoptMaybeTenuredAllocationSites() {
838 return new_space_.IsAtMaximumCapacity() && maximum_size_scavenges_ == 0; 843 return new_space_.IsAtMaximumCapacity() && maximum_size_scavenges_ == 0;
839 } 844 }
840 845
846 void AddWeakNewSpaceObjectToCodeDependency(Handle<HeapObject> obj,
847 Handle<WeakCell> code);
848
841 void AddWeakObjectToCodeDependency(Handle<HeapObject> obj, 849 void AddWeakObjectToCodeDependency(Handle<HeapObject> obj,
842 Handle<DependentCode> dep); 850 Handle<DependentCode> dep);
843 851
844 DependentCode* LookupWeakObjectToCodeDependency(Handle<HeapObject> obj); 852 DependentCode* LookupWeakObjectToCodeDependency(Handle<HeapObject> obj);
845 853
846 void AddRetainedMap(Handle<Map> map); 854 void AddRetainedMap(Handle<Map> map);
847 855
848 // This event is triggered after successful allocation of a new object made 856 // This event is triggered after successful allocation of a new object made
849 // by runtime. Allocations of target space for object evacuation do not 857 // by runtime. Allocations of target space for object evacuation do not
850 // trigger the event. In order to track ALL allocations one must turn off 858 // trigger the event. In order to track ALL allocations one must turn off
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 void IteratePromotedObjectPointers(HeapObject* object, Address start, 1097 void IteratePromotedObjectPointers(HeapObject* object, Address start,
1090 Address end, bool record_slots, 1098 Address end, bool record_slots,
1091 ObjectSlotCallback callback); 1099 ObjectSlotCallback callback);
1092 1100
1093 // =========================================================================== 1101 // ===========================================================================
1094 // Store buffer API. ========================================================= 1102 // Store buffer API. =========================================================
1095 // =========================================================================== 1103 // ===========================================================================
1096 1104
1097 // Write barrier support for object[offset] = o; 1105 // Write barrier support for object[offset] = o;
1098 inline void RecordWrite(Object* object, int offset, Object* o); 1106 inline void RecordWrite(Object* object, int offset, Object* o);
1107 inline void RecordWriteIntoCode(Code* host, RelocInfo* rinfo, Object* target);
1108 void RecordWriteIntoCodeSlow(Code* host, RelocInfo* rinfo, Object* target);
1099 inline void RecordFixedArrayElements(FixedArray* array, int offset, 1109 inline void RecordFixedArrayElements(FixedArray* array, int offset,
1100 int length); 1110 int length);
1101 1111
1102 Address* store_buffer_top_address() { return store_buffer()->top_address(); } 1112 Address* store_buffer_top_address() { return store_buffer()->top_address(); }
1103 1113
1104 void ClearRecordedSlot(HeapObject* object, Object** slot); 1114 void ClearRecordedSlot(HeapObject* object, Object** slot);
1105 void ClearRecordedSlotRange(Address start, Address end); 1115 void ClearRecordedSlotRange(Address start, Address end);
1106 1116
1107 // =========================================================================== 1117 // ===========================================================================
1108 // Incremental marking API. ================================================== 1118 // Incremental marking API. ==================================================
(...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after
2668 friend class LargeObjectSpace; 2678 friend class LargeObjectSpace;
2669 friend class NewSpace; 2679 friend class NewSpace;
2670 friend class PagedSpace; 2680 friend class PagedSpace;
2671 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); 2681 DISALLOW_COPY_AND_ASSIGN(AllocationObserver);
2672 }; 2682 };
2673 2683
2674 } // namespace internal 2684 } // namespace internal
2675 } // namespace v8 2685 } // namespace v8
2676 2686
2677 #endif // V8_HEAP_HEAP_H_ 2687 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « src/compiler.cc ('k') | src/heap/heap.cc » ('j') | src/heap/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698