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 // the API callbacks should be invoked. | 348 // the API callbacks should be invoked. |
349 Scavenge(false); | 349 Scavenge(false); |
350 } | 350 } |
351 | 351 |
352 | 352 |
353 void Scavenger::Scavenge(bool invoke_api_callbacks) { | 353 void Scavenger::Scavenge(bool invoke_api_callbacks) { |
354 // Scavenging is not reentrant. Make sure that is the case. | 354 // Scavenging is not reentrant. Make sure that is the case. |
355 ASSERT(!scavenging_); | 355 ASSERT(!scavenging_); |
356 scavenging_ = true; | 356 scavenging_ = true; |
357 Isolate* isolate = Isolate::Current(); | 357 Isolate* isolate = Isolate::Current(); |
358 NoHandleScope no_handles(isolate); | 358 NOHANDLESCOPE(isolate); |
359 | 359 |
360 if (FLAG_verify_before_gc) { | 360 if (FLAG_verify_before_gc) { |
361 OS::PrintErr("Verifying before Scavenge... "); | 361 OS::PrintErr("Verifying before Scavenge... "); |
362 heap_->Verify(); | 362 heap_->Verify(); |
363 OS::PrintErr(" done.\n"); | 363 OS::PrintErr(" done.\n"); |
364 } | 364 } |
365 | 365 |
366 Timer timer(FLAG_verbose_gc, "Scavenge"); | 366 Timer timer(FLAG_verbose_gc, "Scavenge"); |
367 timer.Start(); | 367 timer.Start(); |
368 // Setup the visitor and run a scavenge. | 368 // Setup the visitor and run a scavenge. |
(...skipping 16 matching lines...) Expand all Loading... |
385 OS::PrintErr(" done.\n"); | 385 OS::PrintErr(" done.\n"); |
386 } | 386 } |
387 | 387 |
388 count_++; | 388 count_++; |
389 // Done scavenging. Reset the marker. | 389 // Done scavenging. Reset the marker. |
390 ASSERT(scavenging_); | 390 ASSERT(scavenging_); |
391 scavenging_ = false; | 391 scavenging_ = false; |
392 } | 392 } |
393 | 393 |
394 } // namespace dart | 394 } // namespace dart |
OLD | NEW |