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

Side by Side Diff: runtime/vm/heap.cc

Issue 220113004: Trigger old-space GC when scavange made the external heap of old-space larger than max old-space si… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698