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

Side by Side Diff: vm/heap.cc

Issue 10748006: Disable heap growth during weak handle processing unit test in order to avoid triggering of old spa… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
« vm/dart_api_impl_test.cc ('K') | « vm/heap.h ('k') | no next file » | 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/compiler_stats.h" 9 #include "vm/compiler_stats.h"
10 #include "vm/flags.h" 10 #include "vm/flags.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 148
149 RawInstructions* Heap::FindObjectInCodeSpace(FindObjectVisitor* visitor) { 149 RawInstructions* Heap::FindObjectInCodeSpace(FindObjectVisitor* visitor) {
150 // The code heap can only have RawInstructions objects. 150 // The code heap can only have RawInstructions objects.
151 RawObject* raw_obj = code_space_->FindObject(visitor); 151 RawObject* raw_obj = code_space_->FindObject(visitor);
152 ASSERT((raw_obj == Object::null()) || 152 ASSERT((raw_obj == Object::null()) ||
153 (raw_obj->GetClassId() == kInstructions)); 153 (raw_obj->GetClassId() == kInstructions));
154 return reinterpret_cast<RawInstructions*>(raw_obj); 154 return reinterpret_cast<RawInstructions*>(raw_obj);
155 } 155 }
156 156
157 157
158 void Heap::Scavenge(ApiCallbacks api_callbacks) {
159 bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks);
160 new_space_->Scavenge(invoke_api_callbacks);
161 }
162
163
158 void Heap::CollectGarbage(Space space, ApiCallbacks api_callbacks) { 164 void Heap::CollectGarbage(Space space, ApiCallbacks api_callbacks) {
159 bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks); 165 bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks);
160 switch (space) { 166 switch (space) {
161 case kNew: 167 case kNew:
162 new_space_->Scavenge(invoke_api_callbacks); 168 new_space_->Scavenge(invoke_api_callbacks);
163 if (new_space_->HadPromotionFailure()) { 169 if (new_space_->HadPromotionFailure()) {
164 old_space_->MarkSweep(true); 170 old_space_->MarkSweep(true);
165 } 171 }
166 break; 172 break;
167 case kOld: 173 case kOld:
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 isolate()->IncrementNoGCScopeDepth(); 271 isolate()->IncrementNoGCScopeDepth();
266 } 272 }
267 273
268 274
269 NoGCScope::~NoGCScope() { 275 NoGCScope::~NoGCScope() {
270 isolate()->DecrementNoGCScopeDepth(); 276 isolate()->DecrementNoGCScopeDepth();
271 } 277 }
272 #endif // defined(DEBUG) 278 #endif // defined(DEBUG)
273 279
274 } // namespace dart 280 } // namespace dart
OLDNEW
« vm/dart_api_impl_test.cc ('K') | « vm/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698