Commit f602d2c8 authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[heap] Move LO_SPACE methods to the right classes

Move around some methods to make LargeObjectSpace (mostly)
thread-independent.

Bug: chromium:1011762
Change-Id: I4cc512979a30fa21fd9cb3a90592761cbb01a303
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1878709
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64561}
parent eb667651
......@@ -4087,7 +4087,7 @@ LargePage* CodeLargeObjectSpace::FindPage(Address a) {
return nullptr;
}
void LargeObjectSpace::ClearMarkingStateOfLiveObjects() {
void OldLargeObjectSpace::ClearMarkingStateOfLiveObjects() {
IncrementalMarking::NonAtomicMarkingState* marking_state =
heap()->incremental_marking()->non_atomic_marking_state();
LargeObjectSpaceObjectIterator it(this);
......@@ -4119,7 +4119,7 @@ void CodeLargeObjectSpace::RemoveChunkMapEntries(LargePage* page) {
}
}
void LargeObjectSpace::PromoteNewLargeObject(LargePage* page) {
void OldLargeObjectSpace::PromoteNewLargeObject(LargePage* page) {
DCHECK_EQ(page->owner_identity(), NEW_LO_SPACE);
DCHECK(page->IsLargePage());
DCHECK(page->IsFlagSet(MemoryChunk::FROM_PAGE));
......
......@@ -3230,8 +3230,6 @@ class LargeObjectSpace : public Space {
public:
using iterator = LargePageIterator;
LargeObjectSpace(Heap* heap, AllocationSpace id);
~LargeObjectSpace() override { TearDown(); }
// Releases internal resources, frees objects in this space.
......@@ -3248,14 +3246,9 @@ class LargeObjectSpace : public Space {
int PageCount() { return page_count_; }
// Clears the marking state of live objects.
void ClearMarkingStateOfLiveObjects();
// Frees unmarked objects.
void FreeUnmarkedObjects();
void PromoteNewLargeObject(LargePage* page);
// Checks whether a heap object is in this space; O(1).
V8_EXPORT_PRIVATE bool Contains(HeapObject obj);
// Checks whether an address is in the object area in this space. Iterates
......@@ -3272,9 +3265,6 @@ class LargeObjectSpace : public Space {
return reinterpret_cast<LargePage*>(Space::first_page());
}
// Collect code statistics.
void CollectCodeStatistics();
iterator begin() { return iterator(first_page()); }
iterator end() { return iterator(nullptr); }
......@@ -3289,6 +3279,8 @@ class LargeObjectSpace : public Space {
#endif
protected:
LargeObjectSpace(Heap* heap, AllocationSpace id);
LargePage* AllocateLargePage(int object_size, Executability executable);
size_t size_; // allocated bytes
......@@ -3306,6 +3298,11 @@ class OldLargeObjectSpace : public LargeObjectSpace {
V8_EXPORT_PRIVATE V8_WARN_UNUSED_RESULT AllocationResult
AllocateRaw(int object_size);
// Clears the marking state of live objects.
void ClearMarkingStateOfLiveObjects();
void PromoteNewLargeObject(LargePage* page);
protected:
explicit OldLargeObjectSpace(Heap* heap, AllocationSpace id);
V8_WARN_UNUSED_RESULT AllocationResult AllocateRaw(int object_size,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment