Chromium Code Reviews| Index: src/heap/heap.cc |
| diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
| index a60b510492ab1762c59e538ebd56402428fd2082..2cc690366813c979256a17f04f6529fcaff79a7a 100644 |
| --- a/src/heap/heap.cc |
| +++ b/src/heap/heap.cc |
| @@ -159,7 +159,8 @@ Heap::Heap() |
| local_embedder_heap_tracer_(nullptr), |
| fast_promotion_mode_(false), |
| force_oom_(false), |
| - delay_sweeper_tasks_for_testing_(false) { |
| + delay_sweeper_tasks_for_testing_(false), |
| + pending_layout_change_object_(nullptr) { |
| // Allow build-time customization of the max semispace size. Building |
| // V8 with snapshots and a non-default max semispace size is much |
| // easier if you can define it as part of the build environment. |
| @@ -4292,6 +4293,27 @@ void Heap::RegisterReservationsForBlackAllocation(Reservation* reservations) { |
| } |
| } |
| +void Heap::NotifyObjectLayoutChange(HeapObject* object, |
|
Igor Sheludko
2017/02/21 10:22:25
WDYT about putting this to heap-inl.h?
|
| + const DisallowHeapAllocation&) { |
| +// TODO(ulan): Add synchronization with the concurrent marker. |
| +#ifdef VERIFY_HEAP |
| + DCHECK(pending_layout_change_object_ == nullptr); |
| + pending_layout_change_object_ = object; |
| +#endif |
| +} |
| + |
| +#ifdef VERIFY_HEAP |
| +void Heap::VerifyObjectLayoutChange(HeapObject* object, Map* new_map) { |
| + if (pending_layout_change_object_ == nullptr) { |
| + DCHECK(!object->IsJSObject() || |
| + !object->map()->TransitionRequiresSynchronizationWithGC(new_map)); |
| + } else { |
| + DCHECK_EQ(pending_layout_change_object_, object); |
| + pending_layout_change_object_ = nullptr; |
| + } |
| +} |
| +#endif |
| + |
| GCIdleTimeHeapState Heap::ComputeHeapState() { |
| GCIdleTimeHeapState heap_state; |
| heap_state.contexts_disposed = contexts_disposed_; |