| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/pages.h" | 5 #include "vm/pages.h" |
| 6 | 6 |
| 7 #include "platform/address_sanitizer.h" | 7 #include "platform/address_sanitizer.h" |
| 8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
| 9 #include "vm/compiler_stats.h" | 9 #include "vm/compiler_stats.h" |
| 10 #include "vm/gc_marker.h" | 10 #include "vm/gc_marker.h" |
| (...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 prev_page = page; | 952 prev_page = page; |
| 953 } else { | 953 } else { |
| 954 FreePage(page, prev_page); | 954 FreePage(page, prev_page); |
| 955 } | 955 } |
| 956 // Advance to the next page. | 956 // Advance to the next page. |
| 957 page = next_page; | 957 page = next_page; |
| 958 } | 958 } |
| 959 | 959 |
| 960 mid3 = OS::GetCurrentMonotonicMicros(); | 960 mid3 = OS::GetCurrentMonotonicMicros(); |
| 961 | 961 |
| 962 { heap_->new_space()->UnmarkNewSpace(); } |
| 963 |
| 962 if (!FLAG_concurrent_sweep) { | 964 if (!FLAG_concurrent_sweep) { |
| 963 // Sweep all regular sized pages now. | 965 // Sweep all regular sized pages now. |
| 964 prev_page = NULL; | 966 prev_page = NULL; |
| 965 page = pages_; | 967 page = pages_; |
| 966 while (page != NULL) { | 968 while (page != NULL) { |
| 967 HeapPage* next_page = page->next(); | 969 HeapPage* next_page = page->next(); |
| 968 bool page_in_use = | 970 bool page_in_use = |
| 969 sweeper.SweepPage(page, &freelist_[page->type()], true); | 971 sweeper.SweepPage(page, &freelist_[page->type()], true); |
| 970 if (page_in_use) { | 972 if (page_in_use) { |
| 971 prev_page = page; | 973 prev_page = page; |
| 972 } else { | 974 } else { |
| 973 FreePage(page, prev_page); | 975 FreePage(page, prev_page); |
| 974 } | 976 } |
| 975 // Advance to the next page. | 977 // Advance to the next page. |
| 976 page = next_page; | 978 page = next_page; |
| 977 } | 979 } |
| 980 |
| 978 if (FLAG_verify_after_gc) { | 981 if (FLAG_verify_after_gc) { |
| 979 OS::PrintErr("Verifying after sweeping..."); | 982 OS::PrintErr("Verifying after sweeping..."); |
| 980 heap_->VerifyGC(kForbidMarked); | 983 heap_->VerifyGC(kForbidMarked); |
| 981 OS::PrintErr(" done.\n"); | 984 OS::PrintErr(" done.\n"); |
| 982 } | 985 } |
| 983 } else { | 986 } else { |
| 984 // Start the concurrent sweeper task now. | 987 // Start the concurrent sweeper task now. |
| 985 GCSweeper::SweepConcurrent(isolate, pages_, pages_tail_, | 988 GCSweeper::SweepConcurrent(isolate, pages_, pages_tail_, |
| 986 &freelist_[HeapPage::kData]); | 989 &freelist_[HeapPage::kData]); |
| 987 } | 990 } |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1307 return 0; | 1310 return 0; |
| 1308 } else { | 1311 } else { |
| 1309 ASSERT(total_time >= gc_time); | 1312 ASSERT(total_time >= gc_time); |
| 1310 int result = static_cast<int>( | 1313 int result = static_cast<int>( |
| 1311 (static_cast<double>(gc_time) / static_cast<double>(total_time)) * 100); | 1314 (static_cast<double>(gc_time) / static_cast<double>(total_time)) * 100); |
| 1312 return result; | 1315 return result; |
| 1313 } | 1316 } |
| 1314 } | 1317 } |
| 1315 | 1318 |
| 1316 } // namespace dart | 1319 } // namespace dart |
| OLD | NEW |