Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(887)

Unified Diff: runtime/vm/scavenger.h

Issue 3005623002: Revert "Puts TLABs back into the build and fixes assert failure." (Closed)
Patch Set: Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scavenger.h
diff --git a/runtime/vm/scavenger.h b/runtime/vm/scavenger.h
index 160354a1413bab283b6c01ea77e9aaecb7bc1151..4d59fc862e50354d70ae9d49d539f4f06829014d 100644
--- a/runtime/vm/scavenger.h
+++ b/runtime/vm/scavenger.h
@@ -10,7 +10,6 @@
#include "vm/dart.h"
#include "vm/flags.h"
#include "vm/globals.h"
-#include "vm/lockers.h"
#include "vm/raw_object.h"
#include "vm/ring_buffer.h"
#include "vm/spaces.h"
@@ -124,26 +123,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_);
- MutexLocker ml(space_lock_);
- 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());
@@ -157,7 +136,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;
}
@@ -166,8 +145,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_);
@@ -184,7 +161,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;
}
@@ -204,7 +181,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 {
@@ -237,10 +216,7 @@ class Scavenger {
void AllocateExternal(intptr_t size);
void FreeExternal(intptr_t size);
- void MakeNewSpaceIterable() const;
- int64_t FreeSpaceInWords(Isolate* isolate) const;
- void MakeAllTLABsIterable(Isolate* isolate) const;
- void AbandonAllTLABs(Isolate* isolate);
+ void FlushTLS() const;
private:
// Ids for time and data records in Heap::GCStats.
@@ -339,8 +315,6 @@ class Scavenger {
bool failed_to_promote_;
- // Protects new space during the allocation of new TLABs
- Mutex* space_lock_;
friend class ScavengerVisitor;
friend class ScavengerWeakVisitor;
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698