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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | src/heap/heap.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index dc86608b79326954d8119bbe039d10e5b4a44856..0bbdb6bc2d3a9986bfd914ee5c29b2d45d8f5b97 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -1227,6 +1227,20 @@ class Heap {
IncrementalMarking* incremental_marking() { return incremental_marking_; }
+ // The runtime uses this function to notify potentially unsafe object layout
+ // changes that require special synchronization with the concurrent marker.
+ // A layout change is unsafe if
+ // - it removes a tagged in-object field.
+ // - it replaces a tagged in-objects field with an untagged in-object field.
+ void NotifyObjectLayoutChange(HeapObject* object,
+ const DisallowHeapAllocation&);
+#ifdef VERIFY_HEAP
+ // This function checks that either
+ // - the map transition is safe,
+ // - or it was communicated to GC using NotifyObjectLayoutChange.
+ void VerifyObjectLayoutChange(HeapObject* object, Map* new_map);
+#endif
+
// ===========================================================================
// Embedder heap tracer support. =============================================
// ===========================================================================
@@ -2344,6 +2358,8 @@ class Heap {
bool force_oom_;
bool delay_sweeper_tasks_for_testing_;
+ HeapObject* pending_layout_change_object_;
+
// Classes in "heap" can be friends.
friend class AlwaysAllocateScope;
friend class GCCallbacksScope;
« 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