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

Side by Side Diff: vm/heap.cc

Issue 10271032: - Add extra checking when validating objects. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 7 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/assembler_macros_x64.cc ('k') | vm/intrinsifier_ia32.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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 227
228 228
229 void Heap::Init(Isolate* isolate) { 229 void Heap::Init(Isolate* isolate) {
230 ASSERT(isolate->heap() == NULL); 230 ASSERT(isolate->heap() == NULL);
231 Heap* heap = new Heap(); 231 Heap* heap = new Heap();
232 isolate->set_heap(heap); 232 isolate->set_heap(heap);
233 } 233 }
234 234
235 235
236 bool Heap::Verify() const { 236 bool Heap::Verify() const {
237 VerifyPointersVisitor visitor; 237 VerifyPointersVisitor visitor(Isolate::Current());
238 new_space_->VisitObjectPointers(&visitor); 238 new_space_->VisitObjectPointers(&visitor);
239 old_space_->VisitObjectPointers(&visitor); 239 old_space_->VisitObjectPointers(&visitor);
240 code_space_->VisitObjectPointers(&visitor); 240 code_space_->VisitObjectPointers(&visitor);
241 stub_code_space_->VisitObjectPointers(&visitor); 241 stub_code_space_->VisitObjectPointers(&visitor);
242 // Only returning a value so that Heap::Validate can be called from an ASSERT. 242 // Only returning a value so that Heap::Validate can be called from an ASSERT.
243 return true; 243 return true;
244 } 244 }
245 245
246 246
247 #if defined(DEBUG) 247 #if defined(DEBUG)
248 NoGCScope::NoGCScope() : StackResource(Isolate::Current()) { 248 NoGCScope::NoGCScope() : StackResource(Isolate::Current()) {
249 isolate()->IncrementNoGCScopeDepth(); 249 isolate()->IncrementNoGCScopeDepth();
250 } 250 }
251 251
252 252
253 NoGCScope::~NoGCScope() { 253 NoGCScope::~NoGCScope() {
254 isolate()->DecrementNoGCScopeDepth(); 254 isolate()->DecrementNoGCScopeDepth();
255 } 255 }
256 #endif // defined(DEBUG) 256 #endif // defined(DEBUG)
257 257
258 } // namespace dart 258 } // namespace dart
OLDNEW
« no previous file with comments | « vm/assembler_macros_x64.cc ('k') | vm/intrinsifier_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698