| 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 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 814 } | 814 } |
| 815 | 815 |
| 816 // Prepare for a scavenge. | 816 // Prepare for a scavenge. |
| 817 SpaceUsage usage_before = GetCurrentUsage(); | 817 SpaceUsage usage_before = GetCurrentUsage(); |
| 818 intptr_t promo_candidate_words = | 818 intptr_t promo_candidate_words = |
| 819 (survivor_end_ - FirstObjectStart()) / kWordSize; | 819 (survivor_end_ - FirstObjectStart()) / kWordSize; |
| 820 Prologue(isolate, invoke_api_callbacks); | 820 Prologue(isolate, invoke_api_callbacks); |
| 821 // The API prologue/epilogue may create/destroy zones, so we must not | 821 // The API prologue/epilogue may create/destroy zones, so we must not |
| 822 // depend on zone allocations surviving beyond the epilogue callback. | 822 // depend on zone allocations surviving beyond the epilogue callback. |
| 823 { | 823 { |
| 824 StackZone zone(isolate); | 824 StackZone zone(Thread::Current()); |
| 825 // Setup the visitor and run the scavenge. | 825 // Setup the visitor and run the scavenge. |
| 826 ScavengerVisitor visitor(isolate, this); | 826 ScavengerVisitor visitor(isolate, this); |
| 827 page_space->AcquireDataLock(); | 827 page_space->AcquireDataLock(); |
| 828 const bool prologue_weak_are_strong = !invoke_api_callbacks; | 828 const bool prologue_weak_are_strong = !invoke_api_callbacks; |
| 829 IterateRoots(isolate, &visitor, prologue_weak_are_strong); | 829 IterateRoots(isolate, &visitor, prologue_weak_are_strong); |
| 830 int64_t start = OS::GetCurrentTimeMicros(); | 830 int64_t start = OS::GetCurrentTimeMicros(); |
| 831 ProcessToSpace(&visitor); | 831 ProcessToSpace(&visitor); |
| 832 int64_t middle = OS::GetCurrentTimeMicros(); | 832 int64_t middle = OS::GetCurrentTimeMicros(); |
| 833 IterateWeakReferences(isolate, &visitor); | 833 IterateWeakReferences(isolate, &visitor); |
| 834 ScavengerWeakVisitor weak_visitor(this, prologue_weak_are_strong); | 834 ScavengerWeakVisitor weak_visitor(this, prologue_weak_are_strong); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 } | 903 } |
| 904 | 904 |
| 905 | 905 |
| 906 void Scavenger::FreeExternal(intptr_t size) { | 906 void Scavenger::FreeExternal(intptr_t size) { |
| 907 ASSERT(size >= 0); | 907 ASSERT(size >= 0); |
| 908 external_size_ -= size; | 908 external_size_ -= size; |
| 909 ASSERT(external_size_ >= 0); | 909 ASSERT(external_size_ >= 0); |
| 910 } | 910 } |
| 911 | 911 |
| 912 } // namespace dart | 912 } // namespace dart |
| OLD | NEW |