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

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

Issue 1632913003: [heap] Move to page lookups for SemiSpace, NewSpace, and Heap containment methods (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix arm Created 4 years, 10 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 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 bool HasBeenSetUp(); 880 bool HasBeenSetUp();
881 881
882 // =========================================================================== 882 // ===========================================================================
883 // Getters for spaces. ======================================================= 883 // Getters for spaces. =======================================================
884 // =========================================================================== 884 // ===========================================================================
885 885
886 // Return the starting address and a mask for the new space. And-masking an 886 // Return the starting address and a mask for the new space. And-masking an
887 // address with the mask will result in the start address of the new space 887 // address with the mask will result in the start address of the new space
888 // for all addresses in either semispace. 888 // for all addresses in either semispace.
889 Address NewSpaceStart() { return new_space_.start(); } 889 Address NewSpaceStart() { return new_space_.start(); }
890 uintptr_t NewSpaceMask() { return new_space_.mask(); }
891 Address NewSpaceTop() { return new_space_.top(); } 890 Address NewSpaceTop() { return new_space_.top(); }
892 891
893 NewSpace* new_space() { return &new_space_; } 892 NewSpace* new_space() { return &new_space_; }
894 OldSpace* old_space() { return old_space_; } 893 OldSpace* old_space() { return old_space_; }
895 OldSpace* code_space() { return code_space_; } 894 OldSpace* code_space() { return code_space_; }
896 MapSpace* map_space() { return map_space_; } 895 MapSpace* map_space() { return map_space_; }
897 LargeObjectSpace* lo_space() { return lo_space_; } 896 LargeObjectSpace* lo_space() { return lo_space_; }
898 897
899 PagedSpace* paged_space(int idx) { 898 PagedSpace* paged_space(int idx) {
900 switch (idx) { 899 switch (idx) {
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 1076
1078 void IterateAndMarkPointersToFromSpace(HeapObject* object, Address start, 1077 void IterateAndMarkPointersToFromSpace(HeapObject* object, Address start,
1079 Address end, bool record_slots, 1078 Address end, bool record_slots,
1080 ObjectSlotCallback callback); 1079 ObjectSlotCallback callback);
1081 1080
1082 // =========================================================================== 1081 // ===========================================================================
1083 // Store buffer API. ========================================================= 1082 // Store buffer API. =========================================================
1084 // =========================================================================== 1083 // ===========================================================================
1085 1084
1086 // Write barrier support for address[offset] = o. 1085 // Write barrier support for address[offset] = o.
1087 INLINE(void RecordWrite(Address address, int offset)); 1086 inline void RecordWriteSlow(Address address, int offset);
Hannes Payer (out of office) 2016/02/08 16:05:40 As discussed offline, this one should become Objec
Michael Lippautz 2016/02/08 18:00:38 The only remaining interface now is // Write bar
1088 1087
1089 // Write barrier support for address[start : start + len[ = o. 1088 // Write barrier support for object[offset] = o;
1090 INLINE(void RecordWrites(Address address, int start, int len)); 1089 inline void RecordWrite(Object* object, int offset);
1091 1090
1092 Address* store_buffer_top_address() { 1091 Address* store_buffer_top_address() {
1093 return reinterpret_cast<Address*>(&roots_[kStoreBufferTopRootIndex]); 1092 return reinterpret_cast<Address*>(&roots_[kStoreBufferTopRootIndex]);
1094 } 1093 }
1095 1094
1096 // =========================================================================== 1095 // ===========================================================================
1097 // Incremental marking API. ================================================== 1096 // Incremental marking API. ==================================================
1098 // =========================================================================== 1097 // ===========================================================================
1099 1098
1100 // Start incremental marking and ensure that idle time handler can perform 1099 // Start incremental marking and ensure that idle time handler can perform
(...skipping 23 matching lines...) Expand all
1124 // Finalizes an external string by deleting the associated external 1123 // Finalizes an external string by deleting the associated external
1125 // data and clearing the resource pointer. 1124 // data and clearing the resource pointer.
1126 inline void FinalizeExternalString(String* string); 1125 inline void FinalizeExternalString(String* string);
1127 1126
1128 // =========================================================================== 1127 // ===========================================================================
1129 // Methods checking/returning the space of a given object/address. =========== 1128 // Methods checking/returning the space of a given object/address. ===========
1130 // =========================================================================== 1129 // ===========================================================================
1131 1130
1132 // Returns whether the object resides in new space. 1131 // Returns whether the object resides in new space.
1133 inline bool InNewSpace(Object* object); 1132 inline bool InNewSpace(Object* object);
1134 inline bool InNewSpace(Address address);
1135 inline bool InNewSpacePage(Address address);
1136 inline bool InFromSpace(Object* object); 1133 inline bool InFromSpace(Object* object);
1137 inline bool InToSpace(Object* object); 1134 inline bool InToSpace(Object* object);
1135 inline bool InNewSpaceSlow(Address address);
Hannes Payer (out of office) 2016/02/08 16:05:40 InNewSpaceSlow seems to be not necessary anymore.
Michael Lippautz 2016/02/08 18:00:38 Unfortunately I think this one needs to stay right
Hannes Payer (out of office) 2016/02/08 21:33:51 I think you mentioned this already last week: if y
Michael Lippautz 2016/02/09 08:03:06 Done. The live object check is quite expensive (al
1138 1136
1139 // Returns whether the object resides in old space. 1137 // Returns whether the object resides in old space.
1140 inline bool InOldSpace(Address address); 1138 inline bool InOldSpace(Address address);
1141 inline bool InOldSpace(Object* object); 1139 inline bool InOldSpace(Object* object);
1142 1140
1143 // Checks whether an address/object in the heap (including auxiliary 1141 // Checks whether an address/object in the heap (including auxiliary
1144 // area and unused area). 1142 // area and unused area).
1145 bool Contains(Address addr); 1143 bool Contains(Address addr);
Hannes Payer (out of office) 2016/02/08 16:05:40 Can we delete Contains(Address addr)? It seems lik
Michael Lippautz 2016/02/08 18:00:38 "Done." See general description above.
1146 bool Contains(HeapObject* value); 1144 bool Contains(HeapObject* value);
1147 1145
1148 // Checks whether an address/object in a space. 1146 // Checks whether an address/object in a space.
1149 // Currently used by tests, serialization and heap verification only. 1147 // Currently used by tests, serialization and heap verification only.
1150 bool InSpace(Address addr, AllocationSpace space); 1148 bool InSpace(Address addr, AllocationSpace space);
1151 bool InSpace(HeapObject* value, AllocationSpace space); 1149 bool InSpace(HeapObject* value, AllocationSpace space);
1152 1150
1153 // =========================================================================== 1151 // ===========================================================================
1154 // Object statistics tracking. =============================================== 1152 // Object statistics tracking. ===============================================
1155 // =========================================================================== 1153 // ===========================================================================
(...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after
2654 2652
2655 private: 2653 private:
2656 friend class NewSpace; 2654 friend class NewSpace;
2657 DISALLOW_COPY_AND_ASSIGN(InlineAllocationObserver); 2655 DISALLOW_COPY_AND_ASSIGN(InlineAllocationObserver);
2658 }; 2656 };
2659 2657
2660 } // namespace internal 2658 } // namespace internal
2661 } // namespace v8 2659 } // namespace v8
2662 2660
2663 #endif // V8_HEAP_HEAP_H_ 2661 #endif // V8_HEAP_HEAP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698