| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 VerifiedMemory::Accept(to_->start(), to_->end() - to_->start()); | 492 VerifiedMemory::Accept(to_->start(), to_->end() - to_->start()); |
| 493 #if defined(DEBUG) | 493 #if defined(DEBUG) |
| 494 // We can only safely verify the store buffers from old space if there is no | 494 // We can only safely verify the store buffers from old space if there is no |
| 495 // concurrent old space task. At the same time we prevent new tasks from | 495 // concurrent old space task. At the same time we prevent new tasks from |
| 496 // being spawned. | 496 // being spawned. |
| 497 { | 497 { |
| 498 PageSpace* page_space = heap_->old_space(); | 498 PageSpace* page_space = heap_->old_space(); |
| 499 MonitorLocker ml(page_space->tasks_lock()); | 499 MonitorLocker ml(page_space->tasks_lock()); |
| 500 if (page_space->tasks() == 0) { | 500 if (page_space->tasks() == 0) { |
| 501 VerifyStoreBufferPointerVisitor verify_store_buffer_visitor(isolate, to_); | 501 VerifyStoreBufferPointerVisitor verify_store_buffer_visitor(isolate, to_); |
| 502 heap_->IterateOldPointers(&verify_store_buffer_visitor); | 502 heap_->old_space()->VisitObjectPointers(&verify_store_buffer_visitor); |
| 503 } | 503 } |
| 504 } | 504 } |
| 505 #endif // defined(DEBUG) | 505 #endif // defined(DEBUG) |
| 506 from_->Delete(); | 506 from_->Delete(); |
| 507 from_ = NULL; | 507 from_ = NULL; |
| 508 if (invoke_api_callbacks && (isolate->gc_epilogue_callback() != NULL)) { | 508 if (invoke_api_callbacks && (isolate->gc_epilogue_callback() != NULL)) { |
| 509 (isolate->gc_epilogue_callback())(); | 509 (isolate->gc_epilogue_callback())(); |
| 510 } | 510 } |
| 511 } | 511 } |
| 512 | 512 |
| (...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 900 } | 900 } |
| 901 | 901 |
| 902 | 902 |
| 903 void Scavenger::FreeExternal(intptr_t size) { | 903 void Scavenger::FreeExternal(intptr_t size) { |
| 904 ASSERT(size >= 0); | 904 ASSERT(size >= 0); |
| 905 external_size_ -= size; | 905 external_size_ -= size; |
| 906 ASSERT(external_size_ >= 0); | 906 ASSERT(external_size_ >= 0); |
| 907 } | 907 } |
| 908 | 908 |
| 909 } // namespace dart | 909 } // namespace dart |
| OLD | NEW |