Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Side by Side Diff: vm/pages.h

Issue 8962006: - Honor max_capacity even for large page allocation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | vm/pages.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 96
97 private: 97 private:
98 static const intptr_t kAllocatablePageSize = kPageSize - sizeof(HeapPage); 98 static const intptr_t kAllocatablePageSize = kPageSize - sizeof(HeapPage);
99 99
100 void AllocatePage(); 100 void AllocatePage();
101 HeapPage* AllocateLargePage(intptr_t size); 101 HeapPage* AllocateLargePage(intptr_t size);
102 void FreeLargePage(HeapPage* page, HeapPage* previous_page); 102 void FreeLargePage(HeapPage* page, HeapPage* previous_page);
103 void FreePages(HeapPage* pages); 103 void FreePages(HeapPage* pages);
104 104
105 static intptr_t LargePageSizeFor(intptr_t size);
106 bool CanIncreaseCapacity(intptr_t increase) {
107 ASSERT(capacity_ < max_capacity_);
108 return increase <= (max_capacity_ - capacity_);
109 }
110
105 uword TryBumpAllocate(intptr_t size); 111 uword TryBumpAllocate(intptr_t size);
106 112
107 FreeList freelist_; 113 FreeList freelist_;
108 114
109 Heap* heap_; 115 Heap* heap_;
110 116
111 HeapPage* pages_; 117 HeapPage* pages_;
112 HeapPage* pages_tail_; 118 HeapPage* pages_tail_;
113 HeapPage* large_pages_; 119 HeapPage* large_pages_;
114 120
115 // Various sizes being tracked for this generation. 121 // Various sizes being tracked for this generation.
116 intptr_t max_capacity_; 122 intptr_t max_capacity_;
117 intptr_t capacity_; 123 intptr_t capacity_;
118 intptr_t in_use_; 124 intptr_t in_use_;
119 125
120 // Old-gen GC cycle count. 126 // Old-gen GC cycle count.
121 int count_; 127 int count_;
122 128
123 bool is_executable_; 129 bool is_executable_;
124 130
125 // Keep track whether a MarkSweep is currently running. 131 // Keep track whether a MarkSweep is currently running.
126 bool sweeping_; 132 bool sweeping_;
127 133
128 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace); 134 DISALLOW_IMPLICIT_CONSTRUCTORS(PageSpace);
129 }; 135 };
130 136
131 } // namespace dart 137 } // namespace dart
132 138
133 #endif // VM_PAGES_H_ 139 #endif // VM_PAGES_H_
OLDNEW
« no previous file with comments | « no previous file | vm/pages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698