Commit de79665c authored by mstarzinger's avatar mstarzinger Committed by Commit bot

[heap] No leakage of store-buffer.h outside of heap.

This prevents the internal store-buffer.h header to be usable outisde of
the "heap" directory. The logic inside that component is only useful
within the GC and is now properly encapsulated.

R=hpayer@chromium.org

Review-Url: https://codereview.chromium.org/2194793005
Cr-Commit-Position: refs/heads/master@{#38201}
parent a085b8a2
......@@ -438,6 +438,9 @@ void Heap::RecordFixedArrayElements(FixedArray* array, int offset, int length) {
}
}
Address* Heap::store_buffer_top_address() {
return store_buffer()->top_address();
}
bool Heap::AllowedToBeMigrated(HeapObject* obj, AllocationSpace dst) {
// Object migration is governed by the following rules:
......
......@@ -137,7 +137,7 @@ Heap::Heap()
scavenge_collector_(nullptr),
mark_compact_collector_(nullptr),
memory_allocator_(nullptr),
store_buffer_(this),
store_buffer_(nullptr),
incremental_marking_(nullptr),
gc_idle_time_handler_(nullptr),
memory_reducer_(nullptr),
......@@ -5281,6 +5281,9 @@ bool Heap::SetUp() {
code_range_size_))
return false;
// Initialize store buffer.
store_buffer_ = new StoreBuffer(this);
// Initialize incremental marking.
incremental_marking_ = new IncrementalMarking(this);
......@@ -5554,6 +5557,9 @@ void Heap::TearDown() {
}
strong_roots_list_ = NULL;
delete store_buffer_;
store_buffer_ = nullptr;
delete memory_allocator_;
memory_allocator_ = nullptr;
}
......
......@@ -16,9 +16,8 @@
#include "src/base/atomic-utils.h"
#include "src/globals.h"
#include "src/heap-symbols.h"
// TODO(mstarzinger): Two more includes to kill!
// TODO(mstarzinger): One more include to kill!
#include "src/heap/spaces.h"
#include "src/heap/store-buffer.h"
#include "src/list.h"
namespace v8 {
......@@ -326,6 +325,7 @@ class MemoryReducer;
class ObjectStats;
class Scavenger;
class ScavengeJob;
class StoreBuffer;
class WeakObjectRetainer;
enum PromotionMode { PROMOTE_MARKED, DEFAULT_PROMOTION };
......@@ -1128,7 +1128,7 @@ class Heap {
inline void RecordFixedArrayElements(FixedArray* array, int offset,
int length);
Address* store_buffer_top_address() { return store_buffer()->top_address(); }
inline Address* store_buffer_top_address();
void ClearRecordedSlot(HeapObject* object, Object** slot);
void ClearRecordedSlotRange(Address start, Address end);
......@@ -1551,7 +1551,7 @@ class Heap {
ROOT_LIST(ROOT_ACCESSOR)
#undef ROOT_ACCESSOR
StoreBuffer* store_buffer() { return &store_buffer_; }
StoreBuffer* store_buffer() { return store_buffer_; }
void set_current_gc_flags(int flags) {
current_gc_flags_ = flags;
......@@ -2193,7 +2193,7 @@ class Heap {
MemoryAllocator* memory_allocator_;
StoreBuffer store_buffer_;
StoreBuffer* store_buffer_;
IncrementalMarking* incremental_marking_;
......
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