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

Side by Side Diff: vm/heap.cc

Issue 10827209: Unify class ids and snapshot object ids list so that we don't have disparate and sometimes confusin… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 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 | Annotate | Revision Log
« no previous file with comments | « vm/freelist.h ('k') | vm/heap_profiler.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) 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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 void Heap::IterateCodeObjects(ObjectVisitor* visitor) { 163 void Heap::IterateCodeObjects(ObjectVisitor* visitor) {
164 code_space_->VisitObjects(visitor); 164 code_space_->VisitObjects(visitor);
165 } 165 }
166 166
167 167
168 RawInstructions* Heap::FindObjectInCodeSpace(FindObjectVisitor* visitor) { 168 RawInstructions* Heap::FindObjectInCodeSpace(FindObjectVisitor* visitor) {
169 // The code heap can only have RawInstructions objects. 169 // The code heap can only have RawInstructions objects.
170 RawObject* raw_obj = code_space_->FindObject(visitor); 170 RawObject* raw_obj = code_space_->FindObject(visitor);
171 ASSERT((raw_obj == Object::null()) || 171 ASSERT((raw_obj == Object::null()) ||
172 (raw_obj->GetClassId() == kInstructions)); 172 (raw_obj->GetClassId() == kInstructionsCid));
173 return reinterpret_cast<RawInstructions*>(raw_obj); 173 return reinterpret_cast<RawInstructions*>(raw_obj);
174 } 174 }
175 175
176 176
177 void Heap::CollectGarbage(Space space, ApiCallbacks api_callbacks) { 177 void Heap::CollectGarbage(Space space, ApiCallbacks api_callbacks) {
178 bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks); 178 bool invoke_api_callbacks = (api_callbacks == kInvokeApiCallbacks);
179 switch (space) { 179 switch (space) {
180 case kNew: 180 case kNew:
181 new_space_->Scavenge(invoke_api_callbacks); 181 new_space_->Scavenge(invoke_api_callbacks);
182 if (new_space_->HadPromotionFailure()) { 182 if (new_space_->HadPromotionFailure()) {
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 isolate()->IncrementNoGCScopeDepth(); 338 isolate()->IncrementNoGCScopeDepth();
339 } 339 }
340 340
341 341
342 NoGCScope::~NoGCScope() { 342 NoGCScope::~NoGCScope() {
343 isolate()->DecrementNoGCScopeDepth(); 343 isolate()->DecrementNoGCScopeDepth();
344 } 344 }
345 #endif // defined(DEBUG) 345 #endif // defined(DEBUG)
346 346
347 } // namespace dart 347 } // namespace dart
OLDNEW
« no previous file with comments | « vm/freelist.h ('k') | vm/heap_profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698