| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 class_table->ResetCountersOld(); | 256 class_table->ResetCountersOld(); |
| 257 } | 257 } |
| 258 } | 258 } |
| 259 | 259 |
| 260 | 260 |
| 261 void Heap::CollectGarbage(Space space) { | 261 void Heap::CollectGarbage(Space space) { |
| 262 if (space == kOld) { | 262 if (space == kOld) { |
| 263 CollectGarbage(space, kInvokeApiCallbacks, kOldSpace); | 263 CollectGarbage(space, kInvokeApiCallbacks, kOldSpace); |
| 264 } else { | 264 } else { |
| 265 ASSERT(space == kNew); | 265 ASSERT(space == kNew); |
| 266 CollectGarbage(space, kIgnoreApiCallbacks, kNewSpace); | 266 CollectGarbage(space, kInvokeApiCallbacks, kNewSpace); |
| 267 } | 267 } |
| 268 } | 268 } |
| 269 | 269 |
| 270 | 270 |
| 271 void Heap::CollectAllGarbage() { | 271 void Heap::CollectAllGarbage() { |
| 272 Isolate* isolate = Isolate::Current(); | 272 Isolate* isolate = Isolate::Current(); |
| 273 TIMERSCOPE(isolate, time_gc); | 273 TIMERSCOPE(isolate, time_gc); |
| 274 { | 274 { |
| 275 VMTagScope tagScope(isolate, VMTag::kGCNewSpaceTagId); | 275 VMTagScope tagScope(isolate, VMTag::kGCNewSpaceTagId); |
| 276 RecordBeforeGC(kNew, kFull); | 276 RecordBeforeGC(kNew, kFull); |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 heap->DisableGrowthControl(); | 581 heap->DisableGrowthControl(); |
| 582 } | 582 } |
| 583 | 583 |
| 584 | 584 |
| 585 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { | 585 NoHeapGrowthControlScope::~NoHeapGrowthControlScope() { |
| 586 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); | 586 Heap* heap = reinterpret_cast<Isolate*>(isolate())->heap(); |
| 587 heap->SetGrowthControlState(current_growth_controller_state_); | 587 heap->SetGrowthControlState(current_growth_controller_state_); |
| 588 } | 588 } |
| 589 | 589 |
| 590 } // namespace dart | 590 } // namespace dart |
| OLD | NEW |