Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 | 30 |
| 31 #include "allocation.h" | 31 #include "allocation.h" |
| 32 #include "checks.h" | 32 #include "checks.h" |
| 33 #include "globals.h" | 33 #include "globals.h" |
| 34 #include "platform.h" | 34 #include "platform.h" |
| 35 #include "v8globals.h" | 35 #include "v8globals.h" |
| 36 | 36 |
| 37 namespace v8 { | 37 namespace v8 { |
| 38 namespace internal { | 38 namespace internal { |
| 39 | 39 |
| 40 class StoreBuffer; | |
| 40 | 41 |
| 41 typedef void (*ObjectSlotCallback)(HeapObject** from, HeapObject* to); | 42 typedef void (*ObjectSlotCallback)(HeapObject** from, HeapObject* to); |
| 42 | 43 |
| 44 typedef void (StoreBuffer::*RegionCallback)( | |
| 45 Address start, Address end, ObjectSlotCallback slot_callback); | |
| 43 | 46 |
| 44 // Used to implement the write barrier by collecting addresses of pointers | 47 // Used to implement the write barrier by collecting addresses of pointers |
| 45 // between spaces. | 48 // between spaces. |
| 46 class StoreBuffer { | 49 class StoreBuffer { |
| 47 public: | 50 public: |
| 48 explicit StoreBuffer(Heap* heap); | 51 explicit StoreBuffer(Heap* heap); |
| 49 | 52 |
| 50 static void StoreBufferOverflow(Isolate* isolate); | 53 static void StoreBufferOverflow(Isolate* isolate); |
| 51 | 54 |
| 52 inline Address TopAddress(); | 55 inline Address TopAddress(); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 143 uintptr_t* hash_map_1_; | 146 uintptr_t* hash_map_1_; |
| 144 uintptr_t* hash_map_2_; | 147 uintptr_t* hash_map_2_; |
| 145 | 148 |
| 146 void CheckForFullBuffer(); | 149 void CheckForFullBuffer(); |
| 147 void Uniq(); | 150 void Uniq(); |
| 148 void ZapHashTables(); | 151 void ZapHashTables(); |
| 149 bool HashTablesAreZapped(); | 152 bool HashTablesAreZapped(); |
| 150 void FilterScanOnScavengeEntries(); | 153 void FilterScanOnScavengeEntries(); |
| 151 void ExemptPopularPages(int prime_sample_step, int threshold); | 154 void ExemptPopularPages(int prime_sample_step, int threshold); |
| 152 | 155 |
| 156 void FindPointersToNewSpaceInRegion(Address start, | |
| 157 Address end, | |
| 158 ObjectSlotCallback slot_callback); | |
| 159 | |
| 160 // For each region of pointers on a page in use from an old space call | |
| 161 // visit_pointer_region callback. | |
| 162 // If either visit_pointer_region or callback can cause an allocation | |
| 163 // in old space and changes in allocation watermark then | |
| 164 // can_preallocate_during_iteration should be set to true. | |
| 165 // All pages will be marked as having invalid watermark upon | |
|
Erik Corry
2011/06/13 08:16:39
Given that we don't have watermarks any more, this
| |
| 166 // iteration completion. | |
| 167 void IteratePointersOnPage( | |
| 168 PagedSpace* space, | |
| 169 Page* page, | |
| 170 RegionCallback region_callback, | |
| 171 ObjectSlotCallback slot_callback); | |
| 172 | |
| 173 void FindPointersToNewSpaceInMaps( | |
| 174 Address start, | |
| 175 Address end, | |
| 176 ObjectSlotCallback slot_callback); | |
| 177 | |
| 178 void FindPointersToNewSpaceInMapsRegion( | |
| 179 Address start, | |
| 180 Address end, | |
| 181 ObjectSlotCallback slot_callback); | |
| 182 | |
| 183 void FindPointersToNewSpaceOnPage( | |
| 184 PagedSpace* space, | |
| 185 Page* page, | |
| 186 RegionCallback region_callback, | |
| 187 ObjectSlotCallback slot_callback); | |
| 188 | |
| 189 #ifdef DEBUG | |
| 190 void VerifyPointers(PagedSpace* space, RegionCallback region_callback); | |
| 191 void VerifyPointers(LargeObjectSpace* space); | |
| 192 #endif | |
| 193 | |
| 153 friend class StoreBufferRebuildScope; | 194 friend class StoreBufferRebuildScope; |
| 154 friend class DontMoveStoreBufferEntriesScope; | 195 friend class DontMoveStoreBufferEntriesScope; |
| 155 }; | 196 }; |
| 156 | 197 |
| 157 | 198 |
| 158 class StoreBufferRebuildScope { | 199 class StoreBufferRebuildScope { |
| 159 public: | 200 public: |
| 160 explicit StoreBufferRebuildScope(Heap* heap, | 201 explicit StoreBufferRebuildScope(Heap* heap, |
| 161 StoreBuffer* store_buffer, | 202 StoreBuffer* store_buffer, |
| 162 StoreBufferCallback callback) | 203 StoreBufferCallback callback) |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 } | 237 } |
| 197 | 238 |
| 198 private: | 239 private: |
| 199 StoreBuffer* store_buffer_; | 240 StoreBuffer* store_buffer_; |
| 200 bool stored_state_; | 241 bool stored_state_; |
| 201 }; | 242 }; |
| 202 | 243 |
| 203 } } // namespace v8::internal | 244 } } // namespace v8::internal |
| 204 | 245 |
| 205 #endif // V8_STORE_BUFFER_H_ | 246 #endif // V8_STORE_BUFFER_H_ |
| OLD | NEW |