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

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

Issue 2702303002: [heap] Notify GC on potentially unsafe object layout changes. (Closed)
Patch Set: NULL -> nullptr Created 3 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
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | src/heap/heap.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after
1220 1220
1221 void FinalizeIncrementalMarkingIfComplete(GarbageCollectionReason gc_reason); 1221 void FinalizeIncrementalMarkingIfComplete(GarbageCollectionReason gc_reason);
1222 1222
1223 bool TryFinalizeIdleIncrementalMarking(double idle_time_in_ms, 1223 bool TryFinalizeIdleIncrementalMarking(double idle_time_in_ms,
1224 GarbageCollectionReason gc_reason); 1224 GarbageCollectionReason gc_reason);
1225 1225
1226 void RegisterReservationsForBlackAllocation(Reservation* reservations); 1226 void RegisterReservationsForBlackAllocation(Reservation* reservations);
1227 1227
1228 IncrementalMarking* incremental_marking() { return incremental_marking_; } 1228 IncrementalMarking* incremental_marking() { return incremental_marking_; }
1229 1229
1230 // The runtime uses this function to notify potentially unsafe object layout
1231 // changes that require special synchronization with the concurrent marker.
1232 // A layout change is unsafe if
1233 // - it removes a tagged in-object field.
1234 // - it replaces a tagged in-objects field with an untagged in-object field.
1235 void NotifyObjectLayoutChange(HeapObject* object,
1236 const DisallowHeapAllocation&);
1237 #ifdef VERIFY_HEAP
1238 // This function checks that either
1239 // - the map transition is safe,
1240 // - or it was communicated to GC using NotifyObjectLayoutChange.
1241 void VerifyObjectLayoutChange(HeapObject* object, Map* new_map);
1242 #endif
1243
1230 // =========================================================================== 1244 // ===========================================================================
1231 // Embedder heap tracer support. ============================================= 1245 // Embedder heap tracer support. =============================================
1232 // =========================================================================== 1246 // ===========================================================================
1233 1247
1234 LocalEmbedderHeapTracer* local_embedder_heap_tracer() { 1248 LocalEmbedderHeapTracer* local_embedder_heap_tracer() {
1235 return local_embedder_heap_tracer_; 1249 return local_embedder_heap_tracer_;
1236 } 1250 }
1237 void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer); 1251 void SetEmbedderHeapTracer(EmbedderHeapTracer* tracer);
1238 void TracePossibleWrapper(JSObject* js_object); 1252 void TracePossibleWrapper(JSObject* js_object);
1239 void RegisterExternallyReferencedObject(Object** object); 1253 void RegisterExternallyReferencedObject(Object** object);
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after
2337 int heap_iterator_depth_; 2351 int heap_iterator_depth_;
2338 2352
2339 LocalEmbedderHeapTracer* local_embedder_heap_tracer_; 2353 LocalEmbedderHeapTracer* local_embedder_heap_tracer_;
2340 2354
2341 bool fast_promotion_mode_; 2355 bool fast_promotion_mode_;
2342 2356
2343 // Used for testing purposes. 2357 // Used for testing purposes.
2344 bool force_oom_; 2358 bool force_oom_;
2345 bool delay_sweeper_tasks_for_testing_; 2359 bool delay_sweeper_tasks_for_testing_;
2346 2360
2361 HeapObject* pending_layout_change_object_;
2362
2347 // Classes in "heap" can be friends. 2363 // Classes in "heap" can be friends.
2348 friend class AlwaysAllocateScope; 2364 friend class AlwaysAllocateScope;
2349 friend class GCCallbacksScope; 2365 friend class GCCallbacksScope;
2350 friend class GCTracer; 2366 friend class GCTracer;
2351 friend class HeapIterator; 2367 friend class HeapIterator;
2352 friend class IdleScavengeObserver; 2368 friend class IdleScavengeObserver;
2353 friend class IncrementalMarking; 2369 friend class IncrementalMarking;
2354 friend class IncrementalMarkingJob; 2370 friend class IncrementalMarkingJob;
2355 friend class LargeObjectSpace; 2371 friend class LargeObjectSpace;
2356 friend class MarkCompactCollector; 2372 friend class MarkCompactCollector;
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
2648 friend class LargeObjectSpace; 2664 friend class LargeObjectSpace;
2649 friend class NewSpace; 2665 friend class NewSpace;
2650 friend class PagedSpace; 2666 friend class PagedSpace;
2651 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); 2667 DISALLOW_COPY_AND_ASSIGN(AllocationObserver);
2652 }; 2668 };
2653 2669
2654 } // namespace internal 2670 } // namespace internal
2655 } // namespace v8 2671 } // namespace v8
2656 2672
2657 #endif // V8_HEAP_HEAP_H_ 2673 #endif // V8_HEAP_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | src/heap/heap.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698