Chromium Code Reviews| Index: runtime/vm/scavenger.cc |
| diff --git a/runtime/vm/scavenger.cc b/runtime/vm/scavenger.cc |
| index e223803806f2d38d45b262508d6fd043e3ee7c3a..dbb4ce3e947043f890ac04d878a333e6e6f144d0 100644 |
| --- a/runtime/vm/scavenger.cc |
| +++ b/runtime/vm/scavenger.cc |
| @@ -415,7 +415,7 @@ Scavenger::Scavenger(Heap* heap, |
| if (to_ == NULL) { |
| FATAL("Out of memory.\n"); |
| } |
| - |
| + UpdateMaxHeapCapacity(); |
| // Setup local fields. |
| top_ = FirstObjectStart(); |
| resolved_top_ = top_; |
| @@ -459,6 +459,7 @@ SemiSpace* Scavenger::Prologue(Isolate* isolate, bool invoke_api_callbacks) { |
| // isolate to finish scavenge, etc.). |
| FATAL("Out of memory.\n"); |
| } |
| + UpdateMaxHeapCapacity(); |
| top_ = FirstObjectStart(); |
| resolved_top_ = top_; |
| end_ = to_->end(); |
| @@ -705,6 +706,20 @@ void Scavenger::ProcessToSpace(ScavengerVisitor* visitor) { |
| } |
| +void Scavenger::UpdateMaxHeapCapacity() { |
| + if (heap_ == NULL) { |
| + // Some unit tests. |
| + return; |
| + } |
| + ASSERT(to_ != NULL); |
| + ASSERT(heap_ != NULL); |
| + Isolate* isolate = heap_->isolate(); |
| + ASSERT(isolate != NULL); |
| + isolate->GetHeapNewCapacityMaxMetric()->SetValue( |
| + to_->size_in_words() * kWordSize); |
|
koda
2015/10/05 20:35:23
Non-standard indentation?
Cutch
2015/10/05 20:54:35
Done.
|
| +} |
| + |
| + |
| uword Scavenger::ProcessWeakProperty(RawWeakProperty* raw_weak, |
| ScavengerVisitor* visitor) { |
| // The fate of the weak property is determined by its key. |