Commit 8ce7898d authored by jkummerow's avatar jkummerow Committed by Commit bot

[heap] Move a few methods from spaces.h to spaces.cc

To avoid the need for including list-inl.h when you include spaces.h

Review-Url: https://codereview.chromium.org/2806493002
Cr-Commit-Position: refs/heads/master@{#44481}
parent 5e78b32d
...@@ -1222,6 +1222,22 @@ STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::CODE_SPACE) == ...@@ -1222,6 +1222,22 @@ STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::CODE_SPACE) ==
STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::MAP_SPACE) == STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::MAP_SPACE) ==
ObjectSpace::kObjectSpaceMapSpace); ObjectSpace::kObjectSpaceMapSpace);
void Space::AddAllocationObserver(AllocationObserver* observer) {
allocation_observers_->Add(observer);
}
void Space::RemoveAllocationObserver(AllocationObserver* observer) {
bool removed = allocation_observers_->RemoveElement(observer);
USE(removed);
DCHECK(removed);
}
void Space::PauseAllocationObservers() { allocation_observers_paused_ = true; }
void Space::ResumeAllocationObservers() {
allocation_observers_paused_ = false;
}
void Space::AllocationStep(Address soon_object, int size) { void Space::AllocationStep(Address soon_object, int size) {
if (!allocation_observers_paused_) { if (!allocation_observers_paused_) {
for (int i = 0; i < allocation_observers_->length(); ++i) { for (int i = 0; i < allocation_observers_->length(); ++i) {
......
...@@ -882,23 +882,15 @@ class Space : public Malloced { ...@@ -882,23 +882,15 @@ class Space : public Malloced {
// Identity used in error reporting. // Identity used in error reporting.
AllocationSpace identity() { return id_; } AllocationSpace identity() { return id_; }
virtual void AddAllocationObserver(AllocationObserver* observer) { V8_EXPORT_PRIVATE virtual void AddAllocationObserver(
allocation_observers_->Add(observer); AllocationObserver* observer);
}
virtual void RemoveAllocationObserver(AllocationObserver* observer) { V8_EXPORT_PRIVATE virtual void RemoveAllocationObserver(
bool removed = allocation_observers_->RemoveElement(observer); AllocationObserver* observer);
USE(removed);
DCHECK(removed);
}
virtual void PauseAllocationObservers() { V8_EXPORT_PRIVATE virtual void PauseAllocationObservers();
allocation_observers_paused_ = true;
}
virtual void ResumeAllocationObservers() { V8_EXPORT_PRIVATE virtual void ResumeAllocationObservers();
allocation_observers_paused_ = false;
}
void AllocationStep(Address soon_object, int size); void AllocationStep(Address soon_object, int 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