Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/heap.h" | 5 #include "vm/heap.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "platform/utils.h" | 8 #include "platform/utils.h" |
| 9 #include "vm/flags.h" | 9 #include "vm/flags.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 207 Isolate* isolate = Isolate::Current(); | 207 Isolate* isolate = Isolate::Current(); |
| 208 bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks); | 208 bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks); |
| 209 switch (space) { | 209 switch (space) { |
| 210 case kNew: { | 210 case kNew: { |
| 211 VMTagScope tagScope(isolate, VMTag::kGCNewSpaceTagId); | 211 VMTagScope tagScope(isolate, VMTag::kGCNewSpaceTagId); |
| 212 RecordBeforeGC(kNew, kNewSpace); | 212 RecordBeforeGC(kNew, kNewSpace); |
| 213 UpdateClassHeapStatsBeforeGC(kNew); | 213 UpdateClassHeapStatsBeforeGC(kNew); |
| 214 new_space_->Scavenge(invoke_api_callbacks); | 214 new_space_->Scavenge(invoke_api_callbacks); |
| 215 RecordAfterGC(); | 215 RecordAfterGC(); |
| 216 PrintStats(); | 216 PrintStats(); |
| 217 if (new_space_->HadPromotionFailure()) { | 217 if (new_space_->HadPromotionFailure() || |
| 218 (old_space_->ExternalInWords() > | |
| 219 (FLAG_new_gen_heap_size * MBInWords))) { | |
|
koda
2014/04/01 16:58:07
Thanks for this fix. It does address the immediate
Anders Johnsen
2014/04/02 11:16:28
Yes, refactor error - should be old. Changed to yo
| |
| 218 // Old collections should call the API callbacks. | 220 // Old collections should call the API callbacks. |
| 219 CollectGarbage(kOld, kInvokeApiCallbacks); | 221 CollectGarbage(kOld, kInvokeApiCallbacks); |
| 220 } | 222 } |
| 221 break; | 223 break; |
| 222 } | 224 } |
| 223 case kOld: | 225 case kOld: |
| 224 case kCode: { | 226 case kCode: { |
| 225 VMTagScope tagScope(isolate, VMTag::kGCOldSpaceTagId); | 227 VMTagScope tagScope(isolate, VMTag::kGCOldSpaceTagId); |
| 226 bool promotion_failure = new_space_->HadPromotionFailure(); | 228 bool promotion_failure = new_space_->HadPromotionFailure(); |
| 227 RecordBeforeGC(kOld, promotion_failure ? kPromotionFailure : kOldSpace); | 229 RecordBeforeGC(kOld, promotion_failure ? kPromotionFailure : kOldSpace); |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 579 heap->DisableGrowthControl(); | 581 heap->DisableGrowthControl(); |
| 580 } | 582 } |
| 581 | 583 |
| 582 | 584 |
| 583 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { | 585 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { |
| 584 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); | 586 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); |
| 585 heap->SetGrowthControlState(current_growth_controller_state_); | 587 heap->SetGrowthControlState(current_growth_controller_state_); |
| 586 } | 588 } |
| 587 | 589 |
| 588 } // namespace dart | 590 } // namespace dart |
| OLD | NEW |