Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/heap/spaces.h')
-rw-r--r--deps/v8/src/heap/spaces.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/deps/v8/src/heap/spaces.h b/deps/v8/src/heap/spaces.h
index dbd0d82008c..47272501f37 100644
--- a/deps/v8/src/heap/spaces.h
+++ b/deps/v8/src/heap/spaces.h
@@ -110,7 +110,7 @@ class Space;
// Some assertion macros used in the debugging mode.
#define DCHECK_PAGE_ALIGNED(address) \
- DCHECK((OffsetFrom(address) & Page::kPageAlignmentMask) == 0)
+ DCHECK((OffsetFrom(address) & kPageAlignmentMask) == 0)
#define DCHECK_OBJECT_ALIGNED(address) \
DCHECK((OffsetFrom(address) & kObjectAlignmentMask) == 0)
@@ -312,7 +312,11 @@ class MemoryChunk {
// |SWEEP_TO_ITERATE|: The page requires sweeping using external markbits
// to iterate the page.
- SWEEP_TO_ITERATE = 1u << 17
+ SWEEP_TO_ITERATE = 1u << 17,
+
+ // |INCREMENTAL_MARKING|: Indicates whether incremental marking is currently
+ // enabled.
+ INCREMENTAL_MARKING = 1u << 18
};
using Flags = uintptr_t;
@@ -403,7 +407,6 @@ class MemoryChunk {
// Page size in bytes. This must be a multiple of the OS page size.
static const int kPageSize = 1 << kPageSizeBits;
- static const intptr_t kPageAlignmentMask = (1 << kPageSizeBits) - 1;
static const int kAllocatableMemory = kPageSize - kObjectStartOffset;
@@ -512,6 +515,9 @@ class MemoryChunk {
InvalidatedSlots* AllocateInvalidatedSlots();
void ReleaseInvalidatedSlots();
void RegisterObjectWithInvalidatedSlots(HeapObject* object, int size);
+ // Updates invalidated_slots after array left-trimming.
+ void MoveObjectWithInvalidatedSlots(HeapObject* old_start,
+ HeapObject* new_start);
InvalidatedSlots* invalidated_slots() { return invalidated_slots_; }
void ReleaseLocalTracker();
@@ -623,6 +629,10 @@ class MemoryChunk {
bool InFromSpace() { return IsFlagSet(IN_FROM_SPACE); }
+ bool InOldSpace() const;
+
+ bool InLargeObjectSpace() const;
+
Space* owner() const { return owner_; }
void set_owner(Space* space) { owner_ = space; }
@@ -758,7 +768,8 @@ class Page : public MemoryChunk {
// Page flags copied from from-space to to-space when flipping semispaces.
static const intptr_t kCopyOnFlipFlagsMask =
static_cast<intptr_t>(MemoryChunk::POINTERS_TO_HERE_ARE_INTERESTING) |
- static_cast<intptr_t>(MemoryChunk::POINTERS_FROM_HERE_ARE_INTERESTING);
+ static_cast<intptr_t>(MemoryChunk::POINTERS_FROM_HERE_ARE_INTERESTING) |
+ static_cast<intptr_t>(MemoryChunk::INCREMENTAL_MARKING);
// Returns the page containing a given address. The address ranges
// from [page_addr .. page_addr + kPageSize[. This only works if the object
@@ -766,6 +777,10 @@ class Page : public MemoryChunk {
static Page* FromAddress(Address addr) {
return reinterpret_cast<Page*>(OffsetFrom(addr) & ~kPageAlignmentMask);
}
+ static Page* FromHeapObject(const HeapObject* o) {
+ return reinterpret_cast<Page*>(reinterpret_cast<Address>(o) &
+ ~kAlignmentMask);
+ }
// Returns the page containing the address provided. The address can
// potentially point righter after the page. To be also safe for tagged values
@@ -1196,7 +1211,7 @@ class SkipList {
}
static inline int RegionNumber(Address addr) {
- return (OffsetFrom(addr) & Page::kPageAlignmentMask) >> kRegionSizeLog2;
+ return (OffsetFrom(addr) & kPageAlignmentMask) >> kRegionSizeLog2;
}
static void Update(Address addr, int size) {
@@ -1990,7 +2005,10 @@ class LocalAllocationBuffer {
// Indicates that a buffer cannot be used for allocations anymore. Can result
// from either reassigning a buffer, or trying to construct it from an
// invalid {AllocationResult}.
- static inline LocalAllocationBuffer InvalidBuffer();
+ static LocalAllocationBuffer InvalidBuffer() {
+ return LocalAllocationBuffer(
+ nullptr, LinearAllocationArea(kNullAddress, kNullAddress));
+ }
// Creates a new LAB from a given {AllocationResult}. Results in
// InvalidBuffer if the result indicates a retry.