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