| 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 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 } | 492 } |
| 493 private: | 493 private: |
| 494 const PageSpace* space_; | 494 const PageSpace* space_; |
| 495 MutexLocker ml_; | 495 MutexLocker ml_; |
| 496 NoGCScope no_gc; | 496 NoGCScope no_gc; |
| 497 HeapPage* page_; | 497 HeapPage* page_; |
| 498 }; | 498 }; |
| 499 | 499 |
| 500 | 500 |
| 501 void PageSpace::MakeIterable() const { | 501 void PageSpace::MakeIterable() const { |
| 502 // TODO(koda): Assert not called from concurrent sweeper task. | 502 // Assert not called from concurrent sweeper task. |
| 503 // TODO(koda): Use thread/task identity when implemented. |
| 504 ASSERT(Isolate::Current()->heap() != NULL); |
| 503 if (bump_top_ < bump_end_) { | 505 if (bump_top_ < bump_end_) { |
| 504 FreeListElement::AsElement(bump_top_, bump_end_ - bump_top_); | 506 FreeListElement::AsElement(bump_top_, bump_end_ - bump_top_); |
| 505 } | 507 } |
| 506 } | 508 } |
| 507 | 509 |
| 508 | 510 |
| 509 bool PageSpace::Contains(uword addr) const { | 511 bool PageSpace::Contains(uword addr) const { |
| 510 for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { | 512 for (ExclusivePageIterator it(this); !it.Done(); it.Advance()) { |
| 511 if (it.page()->Contains(addr)) { | 513 if (it.page()->Contains(addr)) { |
| 512 return true; | 514 return true; |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1115 return 0; | 1117 return 0; |
| 1116 } else { | 1118 } else { |
| 1117 ASSERT(total_time >= gc_time); | 1119 ASSERT(total_time >= gc_time); |
| 1118 int result = static_cast<int>((static_cast<double>(gc_time) / | 1120 int result = static_cast<int>((static_cast<double>(gc_time) / |
| 1119 static_cast<double>(total_time)) * 100); | 1121 static_cast<double>(total_time)) * 100); |
| 1120 return result; | 1122 return result; |
| 1121 } | 1123 } |
| 1122 } | 1124 } |
| 1123 | 1125 |
| 1124 } // namespace dart | 1126 } // namespace dart |
| OLD | NEW |