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

Side by Side Diff: runtime/vm/heap.cc

Issue 1433243003: Background compilation work: (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: d Created 5 years, 1 month 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
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/object.h » ('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) 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/heap.h" 5 #include "vm/heap.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 ASSERT(space == kOld); 172 ASSERT(space == kOld);
173 old_space_.AllocateExternal(size); 173 old_space_.AllocateExternal(size);
174 if (old_space_.NeedsGarbageCollection()) { 174 if (old_space_.NeedsGarbageCollection()) {
175 CollectAllGarbage(); 175 CollectAllGarbage();
176 } 176 }
177 } 177 }
178 } 178 }
179 179
180 void Heap::FreeExternal(intptr_t size, Space space) { 180 void Heap::FreeExternal(intptr_t size, Space space) {
181 if (space == kNew) { 181 if (space == kNew) {
182 isolate()->AssertCurrentThreadIsMutator();
183 new_space_.FreeExternal(size); 182 new_space_.FreeExternal(size);
184 } else { 183 } else {
185 ASSERT(space == kOld); 184 ASSERT(space == kOld);
186 old_space_.FreeExternal(size); 185 old_space_.FreeExternal(size);
187 } 186 }
188 } 187 }
189 188
190 void Heap::PromoteExternal(intptr_t size) { 189 void Heap::PromoteExternal(intptr_t size) {
191 new_space_.FreeExternal(size); 190 new_space_.FreeExternal(size);
192 old_space_.AllocateExternal(size); 191 old_space_.AllocateExternal(size);
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 Dart::vm_isolate()->heap()->WriteProtect(false, include_code_pages_); 807 Dart::vm_isolate()->heap()->WriteProtect(false, include_code_pages_);
809 } 808 }
810 809
811 810
812 WritableVMIsolateScope::~WritableVMIsolateScope() { 811 WritableVMIsolateScope::~WritableVMIsolateScope() {
813 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0); 812 ASSERT(Dart::vm_isolate()->heap()->UsedInWords(Heap::kNew) == 0);
814 Dart::vm_isolate()->heap()->WriteProtect(true, include_code_pages_); 813 Dart::vm_isolate()->heap()->WriteProtect(true, include_code_pages_);
815 } 814 }
816 815
817 } // namespace dart 816 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/flow_graph_optimizer.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698