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

Side by Side Diff: src/vm/object_memory.cc

Issue 1263043007: Add ImmutableHeap class consisting of parts (Closed) Base URL: git@github.com:dart-lang/fletch.git@master
Patch Set: Addressed comments, merged other CL about allocation budget in space Created 5 years, 4 months 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
OLDNEW
1 // Copyright (c) 2014, the Fletch project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Fletch 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 #include "src/vm/object_memory.h" 5 #include "src/vm/object_memory.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 9
10 #include "src/shared/assert.h" 10 #include "src/shared/assert.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 115 }
116 116
117 void Space::TryDealloc(uword location, int size) { 117 void Space::TryDealloc(uword location, int size) {
118 if (top_ == location) top_ -= size; 118 if (top_ == location) top_ -= size;
119 } 119 }
120 120
121 void Space::AdjustAllocationBudget() { 121 void Space::AdjustAllocationBudget() {
122 allocation_budget_ = Utils::Maximum(512 * KB, Used()); 122 allocation_budget_ = Utils::Maximum(512 * KB, Used());
123 } 123 }
124 124
125 void Space::SetAllocationBudget(int new_budget) {
126 allocation_budget_ = new_budget;
127 }
128
125 void Space::PrependSpace(Space* space) { 129 void Space::PrependSpace(Space* space) {
126 bool was_empty = is_empty(); 130 bool was_empty = is_empty();
127 131
128 if (space->is_empty()) return; 132 if (space->is_empty()) return;
129 133
130 space->Flush(); 134 space->Flush();
131 135
132 Chunk* first = space->first(); 136 Chunk* first = space->first();
133 Chunk* chunk = first; 137 Chunk* chunk = first;
134 while (chunk != NULL) { 138 while (chunk != NULL) {
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 table = GetPageTable(address); 391 table = GetPageTable(address);
388 if (table == NULL) { 392 if (table == NULL) {
389 SetPageTable(address, table = new PageTable(address & ~0x3fffff)); 393 SetPageTable(address, table = new PageTable(address & ~0x3fffff));
390 } 394 }
391 } 395 }
392 table->Set((address >> 12) & 0x3ff, space); 396 table->Set((address >> 12) & 0x3ff, space);
393 } 397 }
394 } 398 }
395 399
396 } // namespace fletch 400 } // namespace fletch
OLDNEW
« src/vm/immutable_heap.h ('K') | « src/vm/object_memory.h ('k') | src/vm/vm.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698