| 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/object.h" | 10 #include "vm/object.h" |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 // TODO(cshapiro): Add a decision procedure for determining when the | 348 // TODO(cshapiro): Add a decision procedure for determining when the |
| 349 // the API callbacks should be invoked. | 349 // the API callbacks should be invoked. |
| 350 Scavenge(false); | 350 Scavenge(false); |
| 351 } | 351 } |
| 352 | 352 |
| 353 | 353 |
| 354 void Scavenger::Scavenge(bool invoke_api_callbacks) { | 354 void Scavenger::Scavenge(bool invoke_api_callbacks) { |
| 355 // Scavenging is not reentrant. Make sure that is the case. | 355 // Scavenging is not reentrant. Make sure that is the case. |
| 356 ASSERT(!scavenging_); | 356 ASSERT(!scavenging_); |
| 357 scavenging_ = true; | 357 scavenging_ = true; |
| 358 had_promotion_failure_ = false; |
| 358 Isolate* isolate = Isolate::Current(); | 359 Isolate* isolate = Isolate::Current(); |
| 359 NoHandleScope no_handles(isolate); | 360 NoHandleScope no_handles(isolate); |
| 360 | 361 |
| 361 if (FLAG_verify_before_gc) { | 362 if (FLAG_verify_before_gc) { |
| 362 OS::PrintErr("Verifying before Scavenge... "); | 363 OS::PrintErr("Verifying before Scavenge... "); |
| 363 heap_->Verify(); | 364 heap_->Verify(); |
| 364 OS::PrintErr(" done.\n"); | 365 OS::PrintErr(" done.\n"); |
| 365 } | 366 } |
| 366 | 367 |
| 367 Timer timer(FLAG_verbose_gc, "Scavenge"); | 368 Timer timer(FLAG_verbose_gc, "Scavenge"); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 386 OS::PrintErr(" done.\n"); | 387 OS::PrintErr(" done.\n"); |
| 387 } | 388 } |
| 388 | 389 |
| 389 count_++; | 390 count_++; |
| 390 // Done scavenging. Reset the marker. | 391 // Done scavenging. Reset the marker. |
| 391 ASSERT(scavenging_); | 392 ASSERT(scavenging_); |
| 392 scavenging_ = false; | 393 scavenging_ = false; |
| 393 } | 394 } |
| 394 | 395 |
| 395 } // namespace dart | 396 } // namespace dart |
| OLD | NEW |