| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/scavenger.h" | 5 #include "vm/scavenger.h" |
| 6 | 6 |
| 7 #include "vm/dart.h" | 7 #include "vm/dart.h" |
| 8 #include "vm/dart_api_state.h" | 8 #include "vm/dart_api_state.h" |
| 9 #include "vm/isolate.h" | 9 #include "vm/isolate.h" |
| 10 #include "vm/lockers.h" | 10 #include "vm/lockers.h" |
| (...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 } | 351 } |
| 352 // Setup local fields. | 352 // Setup local fields. |
| 353 top_ = FirstObjectStart(); | 353 top_ = FirstObjectStart(); |
| 354 resolved_top_ = top_; | 354 resolved_top_ = top_; |
| 355 end_ = to_->end(); | 355 end_ = to_->end(); |
| 356 | 356 |
| 357 survivor_end_ = FirstObjectStart(); | 357 survivor_end_ = FirstObjectStart(); |
| 358 | 358 |
| 359 UpdateMaxHeapCapacity(); | 359 UpdateMaxHeapCapacity(); |
| 360 UpdateMaxHeapUsage(); | 360 UpdateMaxHeapUsage(); |
| 361 if (heap_ != NULL) { | |
| 362 heap_->UpdateGlobalMaxUsed(); | |
| 363 } | |
| 364 } | 361 } |
| 365 | 362 |
| 366 | 363 |
| 367 Scavenger::~Scavenger() { | 364 Scavenger::~Scavenger() { |
| 368 ASSERT(!scavenging_); | 365 ASSERT(!scavenging_); |
| 369 to_->Delete(); | 366 to_->Delete(); |
| 370 } | 367 } |
| 371 | 368 |
| 372 | 369 |
| 373 intptr_t Scavenger::NewSizeInWords(intptr_t old_size_in_words) const { | 370 intptr_t Scavenger::NewSizeInWords(intptr_t old_size_in_words) const { |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 } | 900 } |
| 904 | 901 |
| 905 | 902 |
| 906 void Scavenger::FreeExternal(intptr_t size) { | 903 void Scavenger::FreeExternal(intptr_t size) { |
| 907 ASSERT(size >= 0); | 904 ASSERT(size >= 0); |
| 908 external_size_ -= size; | 905 external_size_ -= size; |
| 909 ASSERT(external_size_ >= 0); | 906 ASSERT(external_size_ >= 0); |
| 910 } | 907 } |
| 911 | 908 |
| 912 } // namespace dart | 909 } // namespace dart |
| OLD | NEW |