Commit 60408d97 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[heap][cleanup] Avoid exposing store-buffer internals.

R=mlippautz@chromium.org
BUG=v8:7490

Change-Id: Ifb4b41db3ca34567d735203667978451815c60d4
Reviewed-on: https://chromium-review.googlesource.com/1181056Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55221}
parent 2af2d88b
......@@ -333,7 +333,7 @@ class RecordWriteCodeStubAssembler : public CodeStubAssembler {
store_buffer_top_addr, new_store_buffer_top);
Node* test = WordAnd(new_store_buffer_top,
IntPtrConstant(StoreBuffer::kStoreBufferMask));
IntPtrConstant(Heap::store_buffer_mask_constant()));
Label overflow(this);
Branch(WordEqual(test, IntPtrConstant(0)), &overflow, next);
......
......@@ -180,7 +180,7 @@ ExternalReference::incremental_marking_record_write_function() {
ExternalReference ExternalReference::store_buffer_overflow_function() {
return ExternalReference(
Redirect(FUNCTION_ADDR(StoreBuffer::StoreBufferOverflow)));
Redirect(Heap::store_buffer_overflow_function_address()));
}
ExternalReference ExternalReference::delete_handle_scope_extensions() {
......
......@@ -6,6 +6,7 @@
#include "src/base/template-utils.h"
#include "src/heap/array-buffer-tracker.h"
#include "src/heap/gc-tracer.h"
#include "src/heap/heap-inl.h"
namespace v8 {
......
......@@ -3,7 +3,9 @@
// found in the LICENSE file.
#include "src/heap/code-stats.h"
#include "src/objects-inl.h"
#include "src/reloc-info.h"
namespace v8 {
namespace internal {
......
......@@ -7,6 +7,8 @@
#include "src/heap/factory.h"
// Clients of this interface shouldn't depend on lots of heap internals.
// Do not include anything from src/heap here!
#include "src/handles-inl.h"
#include "src/objects-inl.h"
#include "src/string-hasher.h"
......
......@@ -5,6 +5,8 @@
#ifndef V8_HEAP_FACTORY_H_
#define V8_HEAP_FACTORY_H_
// Clients of this interface shouldn't depend on lots of heap internals.
// Do not include anything from src/heap here!
#include "src/builtins/builtins.h"
#include "src/globals.h"
#include "src/handles.h"
......
......@@ -17,11 +17,9 @@
#include "src/counters-inl.h"
#include "src/feedback-vector.h"
// TODO(mstarzinger): There are 3 more includes to remove in order to no longer
// TODO(mstarzinger): There is one more include to remove in order to no longer
// leak heap internals to users of this interface!
#include "src/heap/incremental-marking-inl.h"
#include "src/heap/spaces-inl.h"
#include "src/heap/store-buffer-inl.h"
#include "src/isolate.h"
#include "src/log.h"
#include "src/msan.h"
......@@ -429,10 +427,6 @@ bool Heap::ShouldBePromoted(Address old_address) {
(!page->ContainsLimit(age_mark) || old_address < age_mark);
}
Address* Heap::store_buffer_top_address() {
return store_buffer()->top_address();
}
void Heap::CopyBlock(Address dst, Address src, int byte_size) {
CopyWords(reinterpret_cast<Object**>(dst), reinterpret_cast<Object**>(src),
static_cast<size_t>(byte_size / kPointerSize));
......
......@@ -5246,6 +5246,20 @@ void Heap::CheckHandleCount() {
isolate_->handle_scope_implementer()->Iterate(&v);
}
Address* Heap::store_buffer_top_address() {
return store_buffer()->top_address();
}
// static
intptr_t Heap::store_buffer_mask_constant() {
return StoreBuffer::kStoreBufferMask;
}
// static
Address Heap::store_buffer_overflow_function_address() {
return FUNCTION_ADDR(StoreBuffer::StoreBufferOverflow);
}
void Heap::ClearRecordedSlot(HeapObject* object, Object** slot) {
Address slot_addr = reinterpret_cast<Address>(slot);
Page* page = Page::FromAddress(slot_addr);
......
......@@ -995,7 +995,9 @@ class Heap {
void SetIsMarkingFlag(uint8_t flag) { is_marking_flag_ = flag; }
inline Address* store_buffer_top_address();
Address* store_buffer_top_address();
static intptr_t store_buffer_mask_constant();
static Address store_buffer_overflow_function_address();
void ClearRecordedSlot(HeapObject* object, Object** slot);
void ClearRecordedSlotRange(Address start, Address end);
......
......@@ -11,6 +11,7 @@
#include "src/heap/gc-idle-time-handler.h"
#include "src/heap/gc-tracer.h"
#include "src/heap/heap-inl.h"
#include "src/heap/incremental-marking-inl.h"
#include "src/heap/mark-compact-inl.h"
#include "src/heap/object-stats.h"
#include "src/heap/objects-visiting-inl.h"
......
......@@ -17,6 +17,7 @@
#include "src/heap/heap-controller.h"
#include "src/heap/incremental-marking.h"
#include "src/heap/mark-compact.h"
#include "src/heap/remembered-set.h"
#include "src/heap/slot-set.h"
#include "src/heap/sweeper.h"
#include "src/msan.h"
......
......@@ -5,9 +5,10 @@
#ifndef V8_OBJECTS_MAYBE_OBJECT_INL_H_
#define V8_OBJECTS_MAYBE_OBJECT_INL_H_
#include "src/objects-inl.h"
#include "src/objects/maybe-object.h"
#include "src/objects-inl.h"
namespace v8 {
namespace internal {
......
......@@ -43,6 +43,7 @@
#include "src/heap/incremental-marking.h"
#include "src/heap/mark-compact.h"
#include "src/heap/memory-reducer.h"
#include "src/heap/remembered-set.h"
#include "src/ic/ic.h"
#include "src/macro-assembler-inl.h"
#include "src/objects-inl.h"
......
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