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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
797 Scavenge(false); | 797 Scavenge(false); |
798 } | 798 } |
799 | 799 |
800 | 800 |
801 void Scavenger::Scavenge(bool invoke_api_callbacks) { | 801 void Scavenger::Scavenge(bool invoke_api_callbacks) { |
802 // Scavenging is not reentrant. Make sure that is the case. | 802 // Scavenging is not reentrant. Make sure that is the case. |
803 ASSERT(!scavenging_); | 803 ASSERT(!scavenging_); |
804 scavenging_ = true; | 804 scavenging_ = true; |
805 Isolate* isolate = heap_->isolate(); | 805 Isolate* isolate = heap_->isolate(); |
806 PageSpace* page_space = heap_->old_space(); | 806 PageSpace* page_space = heap_->old_space(); |
807 NoHandleScope no_handles(isolate); | 807 NoSafepointScope no_safepoints; |
808 | 808 |
809 // TODO(koda): Make verification more compatible with concurrent sweep. | 809 // TODO(koda): Make verification more compatible with concurrent sweep. |
810 if (FLAG_verify_before_gc && !FLAG_concurrent_sweep) { | 810 if (FLAG_verify_before_gc && !FLAG_concurrent_sweep) { |
811 OS::PrintErr("Verifying before Scavenge..."); | 811 OS::PrintErr("Verifying before Scavenge..."); |
812 heap_->Verify(kForbidMarked); | 812 heap_->Verify(kForbidMarked); |
813 OS::PrintErr(" done.\n"); | 813 OS::PrintErr(" done.\n"); |
814 } | 814 } |
815 | 815 |
816 // Prepare for a scavenge. | 816 // Prepare for a scavenge. |
817 SpaceUsage usage_before = GetCurrentUsage(); | 817 SpaceUsage usage_before = GetCurrentUsage(); |
(...skipping 85 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 |