| Index: runtime/vm/scavenger.h
|
| ===================================================================
|
| --- runtime/vm/scavenger.h (revision 33235)
|
| +++ runtime/vm/scavenger.h (working copy)
|
| @@ -74,6 +74,9 @@
|
| return (top_ - FirstObjectStart()) >> kWordSizeLog2;
|
| }
|
| intptr_t CapacityInWords() const { return space_->size() >> kWordSizeLog2; }
|
| + intptr_t ExternalAllocatedInWords() const {
|
| + return external_allocation_size_ >> kWordSizeLog2;
|
| + }
|
|
|
| void VisitObjects(ObjectVisitor* visitor) const;
|
| void VisitObjectPointers(ObjectPointerVisitor* visitor) const;
|
| @@ -108,6 +111,9 @@
|
|
|
| void PrintToJSONObject(JSONObject* object);
|
|
|
| + void AllocateExternal(intptr_t size);
|
| + void FreeExternal(intptr_t size);
|
| +
|
| private:
|
| // Ids for time and data records in Heap::GCStats.
|
| enum {
|
| @@ -149,17 +155,23 @@
|
| // object sizes are always greater than sizeof(uword) and promoted objects do
|
| // not consume space in the to space they leave enough room for this stack.
|
| void PushToPromotedStack(uword addr) {
|
| + ASSERT(scavenging_);
|
| + ASSERT(external_allocation_size_ == 0);
|
| end_ -= sizeof(addr);
|
| ASSERT(end_ > top_);
|
| *reinterpret_cast<uword*>(end_) = addr;
|
| }
|
| uword PopFromPromotedStack() {
|
| + ASSERT(scavenging_);
|
| + ASSERT(external_allocation_size_ == 0);
|
| uword result = *reinterpret_cast<uword*>(end_);
|
| end_ += sizeof(result);
|
| ASSERT(end_ <= to_->end());
|
| return result;
|
| }
|
| bool PromotedStackHasMore() const {
|
| + ASSERT(scavenging_);
|
| + ASSERT(external_allocation_size_ == 0);
|
| return end_ < to_->end();
|
| }
|
|
|
| @@ -194,6 +206,10 @@
|
| int64_t gc_time_micros_;
|
| intptr_t collections_;
|
|
|
| + // The total size of external data associated with objects in this scavenger.
|
| + // External allocations decrease end_. If promoted stack is in use, this is 0.
|
| + intptr_t external_allocation_size_;
|
| +
|
| friend class ScavengerVisitor;
|
| friend class ScavengerWeakVisitor;
|
|
|
|
|