Keep AllocationSpace and ObjectSpace enums in sync.
BUG= Review URL: https://codereview.chromium.org/806693011 Cr-Commit-Position: refs/heads/master@{#25917}
This commit is contained in:
parent
65e69497ab
commit
c37e09d7ea
25
include/v8.h
25
include/v8.h
@ -4401,18 +4401,19 @@ typedef void* (*CreateHistogramCallback)(const char* name,
|
||||
typedef void (*AddHistogramSampleCallback)(void* histogram, int sample);
|
||||
|
||||
// --- Memory Allocation Callback ---
|
||||
enum ObjectSpace {
|
||||
kObjectSpaceNewSpace = 1 << 0,
|
||||
kObjectSpaceOldPointerSpace = 1 << 1,
|
||||
kObjectSpaceOldDataSpace = 1 << 2,
|
||||
kObjectSpaceCodeSpace = 1 << 3,
|
||||
kObjectSpaceMapSpace = 1 << 4,
|
||||
kObjectSpaceLoSpace = 1 << 5,
|
||||
|
||||
kObjectSpaceAll = kObjectSpaceNewSpace | kObjectSpaceOldPointerSpace |
|
||||
kObjectSpaceOldDataSpace | kObjectSpaceCodeSpace | kObjectSpaceMapSpace |
|
||||
kObjectSpaceLoSpace
|
||||
};
|
||||
enum ObjectSpace {
|
||||
kObjectSpaceNewSpace = 1 << 0,
|
||||
kObjectSpaceOldPointerSpace = 1 << 1,
|
||||
kObjectSpaceOldDataSpace = 1 << 2,
|
||||
kObjectSpaceCodeSpace = 1 << 3,
|
||||
kObjectSpaceMapSpace = 1 << 4,
|
||||
kObjectSpaceCellSpace = 1 << 5,
|
||||
kObjectSpacePropertyCellSpace = 1 << 6,
|
||||
kObjectSpaceLoSpace = 1 << 7,
|
||||
kObjectSpaceAll = kObjectSpaceNewSpace | kObjectSpaceOldPointerSpace |
|
||||
kObjectSpaceOldDataSpace | kObjectSpaceCodeSpace |
|
||||
kObjectSpaceMapSpace | kObjectSpaceLoSpace
|
||||
};
|
||||
|
||||
enum AllocationAction {
|
||||
kAllocationActionAllocate = 1 << 0,
|
||||
|
@ -362,6 +362,7 @@ typedef bool (*WeakSlotCallbackWithHeap)(Heap* heap, Object** pointer);
|
||||
|
||||
// NOTE: SpaceIterator depends on AllocationSpace enumeration values being
|
||||
// consecutive.
|
||||
// Keep this enum in sync with the ObjectSpace enum in v8.h
|
||||
enum AllocationSpace {
|
||||
NEW_SPACE, // Semispaces collected with copying collector.
|
||||
OLD_POINTER_SPACE, // May contain pointers to new space.
|
||||
|
@ -922,6 +922,24 @@ void MemoryChunk::IncrementLiveBytesFromMutator(Address address, int by) {
|
||||
// -----------------------------------------------------------------------------
|
||||
// PagedSpace implementation
|
||||
|
||||
STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::NEW_SPACE) ==
|
||||
ObjectSpace::kObjectSpaceNewSpace);
|
||||
STATIC_ASSERT(static_cast<ObjectSpace>(1
|
||||
<< AllocationSpace::OLD_POINTER_SPACE) ==
|
||||
ObjectSpace::kObjectSpaceOldPointerSpace);
|
||||
STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::OLD_DATA_SPACE) ==
|
||||
ObjectSpace::kObjectSpaceOldDataSpace);
|
||||
STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::CODE_SPACE) ==
|
||||
ObjectSpace::kObjectSpaceCodeSpace);
|
||||
STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::CELL_SPACE) ==
|
||||
ObjectSpace::kObjectSpaceCellSpace);
|
||||
STATIC_ASSERT(
|
||||
static_cast<ObjectSpace>(1 << AllocationSpace::PROPERTY_CELL_SPACE) ==
|
||||
ObjectSpace::kObjectSpacePropertyCellSpace);
|
||||
STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::MAP_SPACE) ==
|
||||
ObjectSpace::kObjectSpaceMapSpace);
|
||||
|
||||
|
||||
PagedSpace::PagedSpace(Heap* heap, intptr_t max_capacity, AllocationSpace space,
|
||||
Executability executable)
|
||||
: Space(heap, space, executable),
|
||||
|
Loading…
Reference in New Issue
Block a user