From 1eeb41692a7887bd9b6ae16208db7633f067bf80 Mon Sep 17 00:00:00 2001 From: hpayer Date: Thu, 17 Sep 2015 01:44:06 -0700 Subject: [PATCH] [heap] Inline record slot methods. BUG=chromium:532784 LOG=n Review URL: https://codereview.chromium.org/1347363002 Cr-Commit-Position: refs/heads/master@{#30789} --- src/heap/mark-compact-inl.h | 27 +++++++++++++++++++++++++++ src/heap/mark-compact.cc | 26 -------------------------- src/heap/mark-compact.h | 5 +++-- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/src/heap/mark-compact-inl.h b/src/heap/mark-compact-inl.h index 968dc0997..6e3ebd7fc 100644 --- a/src/heap/mark-compact-inl.h +++ b/src/heap/mark-compact-inl.h @@ -6,6 +6,7 @@ #define V8_HEAP_MARK_COMPACT_INL_H_ #include "src/heap/mark-compact.h" +#include "src/heap/slots-buffer.h" #include "src/isolate.h" namespace v8 { @@ -55,6 +56,32 @@ bool MarkCompactCollector::IsMarked(Object* obj) { } +void MarkCompactCollector::RecordSlot(HeapObject* object, Object** slot, + Object* target) { + Page* target_page = Page::FromAddress(reinterpret_cast
(target)); + if (target_page->IsEvacuationCandidate() && + !ShouldSkipEvacuationSlotRecording(object)) { + if (!SlotsBuffer::AddTo(slots_buffer_allocator_, + target_page->slots_buffer_address(), slot, + SlotsBuffer::FAIL_ON_OVERFLOW)) { + EvictPopularEvacuationCandidate(target_page); + } + } +} + + +void MarkCompactCollector::ForceRecordSlot(HeapObject* object, Object** slot, + Object* target) { + Page* target_page = Page::FromAddress(reinterpret_cast
(target)); + if (target_page->IsEvacuationCandidate() && + !ShouldSkipEvacuationSlotRecording(object)) { + CHECK(SlotsBuffer::AddTo(slots_buffer_allocator_, + target_page->slots_buffer_address(), slot, + SlotsBuffer::IGNORE_OVERFLOW)); + } +} + + void CodeFlusher::AddCandidate(SharedFunctionInfo* shared_info) { if (GetNextCandidate(shared_info) == NULL) { SetNextCandidate(shared_info, shared_function_info_candidates_head_); diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc index ad2ef3601..ffea05a0a 100644 --- a/src/heap/mark-compact.cc +++ b/src/heap/mark-compact.cc @@ -2581,32 +2581,6 @@ void MarkCompactCollector::RecordMigratedSlot(Object* value, Address slot) { } -void MarkCompactCollector::RecordSlot(HeapObject* object, Object** slot, - Object* target) { - Page* target_page = Page::FromAddress(reinterpret_cast
(target)); - if (target_page->IsEvacuationCandidate() && - !ShouldSkipEvacuationSlotRecording(object)) { - if (!SlotsBuffer::AddTo(slots_buffer_allocator_, - target_page->slots_buffer_address(), slot, - SlotsBuffer::FAIL_ON_OVERFLOW)) { - EvictPopularEvacuationCandidate(target_page); - } - } -} - - -void MarkCompactCollector::ForceRecordSlot(HeapObject* object, Object** slot, - Object* target) { - Page* target_page = Page::FromAddress(reinterpret_cast
(target)); - if (target_page->IsEvacuationCandidate() && - !ShouldSkipEvacuationSlotRecording(object)) { - CHECK(SlotsBuffer::AddTo(slots_buffer_allocator_, - target_page->slots_buffer_address(), slot, - SlotsBuffer::IGNORE_OVERFLOW)); - } -} - - void MarkCompactCollector::RecordMigratedCodeEntrySlot( Address code_entry, Address code_entry_slot) { if (Page::FromAddress(code_entry)->IsEvacuationCandidate()) { diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h index e0b7c38ca..fe01bb4e8 100644 --- a/src/heap/mark-compact.h +++ b/src/heap/mark-compact.h @@ -419,8 +419,9 @@ class MarkCompactCollector { void RecordRelocSlot(RelocInfo* rinfo, Object* target); void RecordCodeEntrySlot(HeapObject* object, Address slot, Code* target); void RecordCodeTargetPatch(Address pc, Code* target); - void RecordSlot(HeapObject* object, Object** slot, Object* target); - void ForceRecordSlot(HeapObject* object, Object** slot, Object* target); + INLINE(void RecordSlot(HeapObject* object, Object** slot, Object* target)); + INLINE(void ForceRecordSlot(HeapObject* object, Object** slot, + Object* target)); void UpdateSlots(SlotsBuffer* buffer); void UpdateSlotsRecordedIn(SlotsBuffer* buffer); -- 2.34.1