| 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/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/compiler_stats.h" | 8 #include "vm/compiler_stats.h" |
| 9 #include "vm/gc_marker.h" | 9 #include "vm/gc_marker.h" |
| 10 #include "vm/gc_sweeper.h" | 10 #include "vm/gc_sweeper.h" |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 } | 593 } |
| 594 for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { | 594 for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { |
| 595 if ((it.page()->type() == type) && it.page()->Contains(addr)) { | 595 if ((it.page()->type() == type) && it.page()->Contains(addr)) { |
| 596 return true; | 596 return true; |
| 597 } | 597 } |
| 598 } | 598 } |
| 599 return false; | 599 return false; |
| 600 } | 600 } |
| 601 | 601 |
| 602 | 602 |
| 603 bool PageSpace::DataContains(uword addr) const { |
| 604 for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { |
| 605 if ((it.page()->type() != HeapPage::kExecutable) && |
| 606 it.page()->Contains(addr)) { |
| 607 return true; |
| 608 } |
| 609 } |
| 610 return false; |
| 611 } |
| 612 |
| 613 |
| 603 void PageSpace::AddRegionsToObjectSet(ObjectSet* set) const { | 614 void PageSpace::AddRegionsToObjectSet(ObjectSet* set) const { |
| 604 ASSERT((pages_ != NULL) || (exec_pages_ != NULL) || (large_pages_ != NULL)); | 615 ASSERT((pages_ != NULL) || (exec_pages_ != NULL) || (large_pages_ != NULL)); |
| 605 for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { | 616 for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { |
| 606 set->AddRegion(it.page()->object_start(), it.page()->object_end()); | 617 set->AddRegion(it.page()->object_start(), it.page()->object_end()); |
| 607 } | 618 } |
| 608 } | 619 } |
| 609 | 620 |
| 610 | 621 |
| 611 void PageSpace::VisitObjects(ObjectVisitor* visitor) const { | 622 void PageSpace::VisitObjects(ObjectVisitor* visitor) const { |
| 612 for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { | 623 for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { |
| (...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 return 0; | 1269 return 0; |
| 1259 } else { | 1270 } else { |
| 1260 ASSERT(total_time >= gc_time); | 1271 ASSERT(total_time >= gc_time); |
| 1261 int result = static_cast<int>( | 1272 int result = static_cast<int>( |
| 1262 (static_cast<double>(gc_time) / static_cast<double>(total_time)) * 100); | 1273 (static_cast<double>(gc_time) / static_cast<double>(total_time)) * 100); |
| 1263 return result; | 1274 return result; |
| 1264 } | 1275 } |
| 1265 } | 1276 } |
| 1266 | 1277 |
| 1267 } // namespace dart | 1278 } // namespace dart |
| OLD | NEW |