[heap] make SupportsInlineAllocation virtual in SpaceWithLinearArea

This is a prepratory change to allow more refactoring of code between
New and PagedSpace.

Bug: 
Change-Id: Iabda8365cae0de2278d772e56728e900e688c9aa
Reviewed-on: https://chromium-review.googlesource.com/815904
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Ali Ijaz Sheikh <ofrobots@google.com>
Cr-Commit-Position: refs/heads/master@{#49966}
This commit is contained in:
Ali Ijaz Sheikh 2017-12-07 17:48:33 -08:00 committed by Commit Bot
parent 47a81f0bd2
commit eb62a4aba4

View File

@ -997,6 +997,9 @@ class Space : public Malloced {
protected: protected:
intptr_t GetNextInlineAllocationStepSize(); intptr_t GetNextInlineAllocationStepSize();
bool AllocationObserversActive() {
return !allocation_observers_paused_ && !allocation_observers_.empty();
}
std::vector<AllocationObserver*> allocation_observers_; std::vector<AllocationObserver*> allocation_observers_;
bool allocation_observers_paused_; bool allocation_observers_paused_;
@ -1973,6 +1976,8 @@ class SpaceWithLinearArea : public Space {
allocation_info_.Reset(nullptr, nullptr); allocation_info_.Reset(nullptr, nullptr);
} }
virtual bool SupportsInlineAllocation() = 0;
// Returns the allocation pointer in this space. // Returns the allocation pointer in this space.
Address top() { return allocation_info_.top(); } Address top() { return allocation_info_.top(); }
Address limit() { return allocation_info_.limit(); } Address limit() { return allocation_info_.limit(); }
@ -2237,7 +2242,7 @@ class V8_EXPORT_PRIVATE PagedSpace
} }
void DecreaseLimit(Address new_limit); void DecreaseLimit(Address new_limit);
void StartNextInlineAllocationStep() override; void StartNextInlineAllocationStep() override;
bool SupportsInlineAllocation() { bool SupportsInlineAllocation() override {
return identity() == OLD_SPACE && !is_local(); return identity() == OLD_SPACE && !is_local();
} }
@ -2775,7 +2780,7 @@ class NewSpace : public SpaceWithLinearArea {
HistogramInfo* promoted_histogram_; HistogramInfo* promoted_histogram_;
bool EnsureAllocation(int size_in_bytes, AllocationAlignment alignment); bool EnsureAllocation(int size_in_bytes, AllocationAlignment alignment);
bool SupportsInlineAllocation() override { return true; }
void StartNextInlineAllocationStep() override; void StartNextInlineAllocationStep() override;
friend class SemiSpaceIterator; friend class SemiSpaceIterator;