Index: runtime/vm/scavenger.h |
diff --git a/runtime/vm/scavenger.h b/runtime/vm/scavenger.h |
index de6d01f9712af815797e8981b5dcaafbe9e38277..1fd7c9fe2bd88b93e8f26e2c6b7964e11a0408bc 100644 |
--- a/runtime/vm/scavenger.h |
+++ b/runtime/vm/scavenger.h |
@@ -121,25 +121,6 @@ class Scavenger { |
RawObject* FindObject(FindObjectVisitor* visitor) const; |
- uword TryAllocateNewTLAB(Thread* thread, intptr_t size) { |
- ASSERT(Utils::IsAligned(size, kObjectAlignment)); |
- ASSERT(heap_ != Dart::vm_isolate()->heap()); |
- ASSERT(!scavenging_); |
- uword result = top_; |
- intptr_t remaining = end_ - top_; |
- if (remaining < size) { |
- return 0; |
- } |
- ASSERT(to_->Contains(result)); |
- ASSERT((result & kObjectAlignmentMask) == object_alignment_); |
- top_ += size; |
- ASSERT(to_->Contains(top_) || (top_ == to_->end())); |
- ASSERT(result < top_); |
- thread->set_top(result); |
- thread->set_end(top_); |
- return result; |
- } |
- |
uword AllocateGC(intptr_t size) { |
ASSERT(Utils::IsAligned(size, kObjectAlignment)); |
ASSERT(heap_ != Dart::vm_isolate()->heap()); |
@@ -153,7 +134,7 @@ class Scavenger { |
ASSERT(to_->Contains(result)); |
ASSERT((result & kObjectAlignmentMask) == object_alignment_); |
top_ += size; |
- ASSERT((to_->Contains(top_)) || (top_ == to_->end())); |
+ ASSERT(to_->Contains(top_) || (top_ == to_->end())); |
return result; |
} |
@@ -162,8 +143,6 @@ class Scavenger { |
ASSERT(heap_ != Dart::vm_isolate()->heap()); |
ASSERT(thread->IsMutatorThread()); |
ASSERT(thread->isolate()->IsMutatorThreadScheduled()); |
- ASSERT(thread->top() <= top_); |
- ASSERT((thread->end() == 0) || (thread->end() == top_)); |
#if defined(DEBUG) |
if (FLAG_gc_at_alloc) { |
ASSERT(!scavenging_); |
@@ -180,7 +159,7 @@ class Scavenger { |
ASSERT(to_->Contains(result)); |
ASSERT((result & kObjectAlignmentMask) == object_alignment_); |
top += size; |
- ASSERT((to_->Contains(top)) || (top == to_->end())); |
+ ASSERT(to_->Contains(top) || (top == to_->end())); |
thread->set_top(top); |
return result; |
} |
@@ -201,7 +180,9 @@ class Scavenger { |
end_ = value; |
} |
- int64_t UsedInWords() const; |
+ int64_t UsedInWords() const { |
+ return (top_ - FirstObjectStart()) >> kWordSizeLog2; |
+ } |
int64_t CapacityInWords() const { return to_->size_in_words(); } |
int64_t ExternalInWords() const { return external_size_ >> kWordSizeLog2; } |
SpaceUsage GetCurrentUsage() const { |
@@ -234,8 +215,7 @@ class Scavenger { |
void AllocateExternal(intptr_t size); |
void FreeExternal(intptr_t size); |
- void MakeNewSpaceIterable() const; |
- uword FirstObjectStart() const { return to_->start() | object_alignment_; } |
+ void FlushTLS() const; |
private: |
// Ids for time and data records in Heap::GCStats. |
@@ -254,6 +234,7 @@ class Scavenger { |
kToKBAfterStoreBuffer = 3 |
}; |
+ uword FirstObjectStart() const { return to_->start() | object_alignment_; } |
SemiSpace* Prologue(Isolate* isolate, bool invoke_api_callbacks); |
void IterateStoreBuffers(Isolate* isolate, ScavengerVisitor* visitor); |
void IterateObjectIdTable(Isolate* isolate, ScavengerVisitor* visitor); |