Commit 189ed62c authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

[heap] Store start of LinearAllocationArea

Right now the allocation observer counters are increased by the LAB size
when allocating the LAB and are decreased later when retiring the rest
of the LAB. In the future counters will be monotonic by increasing them
by the actual used size when retiring a LAB. The start of the LAB is
required for that.

Bug: v8:10315
Change-Id: Ibeca34914f61abcea2a1c1a7b9a042c9be14a589
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2316100Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69039}
parent 5f4a90ae
...@@ -369,14 +369,19 @@ class PageRange { ...@@ -369,14 +369,19 @@ class PageRange {
// space. // space.
class LinearAllocationArea { class LinearAllocationArea {
public: public:
LinearAllocationArea() : top_(kNullAddress), limit_(kNullAddress) {} LinearAllocationArea()
LinearAllocationArea(Address top, Address limit) : top_(top), limit_(limit) {} : start_(kNullAddress), top_(kNullAddress), limit_(kNullAddress) {}
LinearAllocationArea(Address top, Address limit)
: start_(top), top_(top), limit_(limit) {}
void Reset(Address top, Address limit) { void Reset(Address top, Address limit) {
start_ = top;
set_top(top); set_top(top);
set_limit(limit); set_limit(limit);
} }
V8_INLINE Address start() const { return start_; }
V8_INLINE void set_top(Address top) { V8_INLINE void set_top(Address top) {
SLOW_DCHECK(top == kNullAddress || (top & kHeapObjectTagMask) == 0); SLOW_DCHECK(top == kNullAddress || (top & kHeapObjectTagMask) == 0);
top_ = top; top_ = top;
...@@ -404,6 +409,8 @@ class LinearAllocationArea { ...@@ -404,6 +409,8 @@ class LinearAllocationArea {
#endif #endif
private: private:
// Current allocation top.
Address start_;
// Current allocation top. // Current allocation top.
Address top_; Address top_;
// Current allocation limit. // Current allocation limit.
......
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