| Index: src/spaces.h
|
| diff --git a/src/spaces.h b/src/spaces.h
|
| index 051deb4303e94f1be1de3d248fadcc765498c99f..c649b04e385da4dd58cc8fc7ba94246f9b7f9e46 100644
|
| --- a/src/spaces.h
|
| +++ b/src/spaces.h
|
| @@ -265,6 +265,7 @@ class Bitmap {
|
| }
|
|
|
| static bool IsSeq(uint32_t cell) { return cell == 0 || cell == 0xFFFFFFFF; }
|
| +
|
| private:
|
| uint32_t seq_start;
|
| uint32_t seq_type;
|
| @@ -451,12 +452,27 @@ class MemoryChunk {
|
| // Manage live byte count (count of bytes known to be live,
|
| // because they are marked black).
|
| void ResetLiveBytes() {
|
| + if (FLAG_trace_live_byte_count) {
|
| + PrintF("ResetLiveBytes:%p:%x->0\n",
|
| + static_cast<void*>(this), live_byte_count_);
|
| + }
|
| live_byte_count_ = 0;
|
| }
|
| void IncrementLiveBytes(int by) {
|
| + ASSERT_LE(static_cast<unsigned>(live_byte_count_), size_);
|
| + if (FLAG_trace_live_byte_count) {
|
| + printf("UpdateLiveBytes:%p:%x%c=%x->%x\n",
|
| + static_cast<void*>(this), live_byte_count_,
|
| + ((by < 0) ? '-' : '+'), ((by < 0) ? -by : by),
|
| + live_byte_count_ + by);
|
| + }
|
| live_byte_count_ += by;
|
| + ASSERT_LE(static_cast<unsigned>(live_byte_count_), size_);
|
| + }
|
| + int LiveBytes() {
|
| + ASSERT(static_cast<unsigned>(live_byte_count_) <= size_);
|
| + return live_byte_count_;
|
| }
|
| - int LiveBytes() { return live_byte_count_; }
|
| static void IncrementLiveBytes(Address address, int by) {
|
| MemoryChunk::FromAddress(address)->IncrementLiveBytes(by);
|
| }
|
| @@ -466,10 +482,11 @@ class MemoryChunk {
|
|
|
| static const intptr_t kAlignmentMask = kAlignment - 1;
|
|
|
| + static const intptr_t kSizeOffset = kPointerSize + kPointerSize;
|
| +
|
| static const intptr_t kLiveBytesOffset =
|
| - kPointerSize + kPointerSize + kPointerSize + kPointerSize +
|
| - kPointerSize + kPointerSize + kPointerSize + kPointerSize +
|
| - kIntSize;
|
| + kSizeOffset + kPointerSize + kPointerSize + kPointerSize +
|
| + kPointerSize + kPointerSize + kPointerSize + kIntSize;
|
|
|
| static const size_t kSlotsBufferOffset = kLiveBytesOffset + kIntSize;
|
|
|
| @@ -699,6 +716,10 @@ class Page : public MemoryChunk {
|
| void ClearSweptPrecisely() { ClearFlag(WAS_SWEPT_PRECISELY); }
|
| void ClearSweptConservatively() { ClearFlag(WAS_SWEPT_CONSERVATIVELY); }
|
|
|
| +#ifdef DEBUG
|
| + void Print();
|
| +#endif // DEBUG
|
| +
|
| friend class MemoryAllocator;
|
| };
|
|
|
|
|