Chromium Code Reviews| 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 #ifndef VM_PAGES_H_ | 5 #ifndef VM_PAGES_H_ |
| 6 #define VM_PAGES_H_ | 6 #define VM_PAGES_H_ |
| 7 | 7 |
| 8 #include "vm/freelist.h" | 8 #include "vm/freelist.h" |
| 9 #include "vm/globals.h" | 9 #include "vm/globals.h" |
| 10 #include "vm/virtual_memory.h" | 10 #include "vm/virtual_memory.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 | 79 |
| 80 // The history holds the timing information of the last garbage collection | 80 // The history holds the timing information of the last garbage collection |
| 81 // runs. | 81 // runs. |
| 82 class PageSpaceGarbageCollectionHistory { | 82 class PageSpaceGarbageCollectionHistory { |
| 83 public: | 83 public: |
| 84 PageSpaceGarbageCollectionHistory(); | 84 PageSpaceGarbageCollectionHistory(); |
| 85 ~PageSpaceGarbageCollectionHistory() {} | 85 ~PageSpaceGarbageCollectionHistory() {} |
| 86 | 86 |
| 87 void AddGarbageCollectionTime(uint64_t start, uint64_t end); | 87 void AddGarbageCollectionTime(int64_t start, int64_t end); |
| 88 | 88 |
| 89 int GarbageCollectionTimeFraction(); | 89 int GarbageCollectionTimeFraction(); |
| 90 | 90 |
| 91 private: | 91 private: |
| 92 static const uint32_t kHistoryLength = 4; | 92 static const intptr_t kHistoryLength = 4; |
| 93 uint64_t start_[kHistoryLength]; | 93 int64_t start_[kHistoryLength]; |
| 94 uint64_t end_[kHistoryLength]; | 94 int64_t end_[kHistoryLength]; |
| 95 uint32_t index_; | 95 int64_t index_; |
|
Ivan Posva
2012/06/22 20:50:37
int or intptr_t? It should match whatever we use f
cshapiro
2012/06/22 21:17:27
Switched to an inptr_t. Done.
| |
| 96 | 96 |
| 97 DISALLOW_ALLOCATION(); | 97 DISALLOW_ALLOCATION(); |
| 98 DISALLOW_COPY_AND_ASSIGN(PageSpaceGarbageCollectionHistory); | 98 DISALLOW_COPY_AND_ASSIGN(PageSpaceGarbageCollectionHistory); |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 | 101 |
| 102 // If GC is able to reclaim more than heap_growth_ratio (in percent) memory | 102 // If GC is able to reclaim more than heap_growth_ratio (in percent) memory |
| 103 // and if the relative GC time is below a given threshold, | 103 // and if the relative GC time is below a given threshold, |
| 104 // then the heap is not grown when the next GC decision is made. | 104 // then the heap is not grown when the next GC decision is made. |
| 105 // PageSpaceController controls the heap size. | 105 // PageSpaceController controls the heap size. |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 bool sweeping_; | 238 bool sweeping_; |
| 239 | 239 |
| 240 PageSpaceController page_space_controller_; | 240 PageSpaceController page_space_controller_; |
| 241 | 241 |
| 242 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); | 242 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); |
| 243 }; | 243 }; |
| 244 | 244 |
| 245 } // namespace dart | 245 } // namespace dart |
| 246 | 246 |
| 247 #endif // VM_PAGES_H_ | 247 #endif // VM_PAGES_H_ |
| OLD | NEW |