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

Side by Side Diff: src/store-buffer.cc

Issue 11118018: Enable --verify-heap in release mode (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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 | « src/store-buffer.h ('k') | test/cctest/test-debug.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 } 365 }
366 } 366 }
367 367
368 368
369 void StoreBuffer::GCPrologue() { 369 void StoreBuffer::GCPrologue() {
370 ClearFilteringHashSets(); 370 ClearFilteringHashSets();
371 during_gc_ = true; 371 during_gc_ = true;
372 } 372 }
373 373
374 374
375 #ifdef DEBUG 375 #ifdef VERIFY_HEAP
376 static void DummyScavengePointer(HeapObject** p, HeapObject* o) { 376 static void DummyScavengePointer(HeapObject** p, HeapObject* o) {
377 // Do nothing. 377 // Do nothing.
378 } 378 }
379 379
380 380
381 void StoreBuffer::VerifyPointers(PagedSpace* space, 381 void StoreBuffer::VerifyPointers(PagedSpace* space,
382 RegionCallback region_callback) { 382 RegionCallback region_callback) {
383 PageIterator it(space); 383 PageIterator it(space);
384 384
385 while (it.has_next()) { 385 while (it.has_next()) {
(...skipping 22 matching lines...) Expand all
408 heap_->InNewSpace(*slot); 408 heap_->InNewSpace(*slot);
409 slot_address += kPointerSize; 409 slot_address += kPointerSize;
410 } 410 }
411 } 411 }
412 } 412 }
413 } 413 }
414 #endif 414 #endif
415 415
416 416
417 void StoreBuffer::Verify() { 417 void StoreBuffer::Verify() {
418 #ifdef DEBUG 418 #ifdef VERIFY_HEAP
419 VerifyPointers(heap_->old_pointer_space(), 419 VerifyPointers(heap_->old_pointer_space(),
420 &StoreBuffer::FindPointersToNewSpaceInRegion); 420 &StoreBuffer::FindPointersToNewSpaceInRegion);
421 VerifyPointers(heap_->map_space(), 421 VerifyPointers(heap_->map_space(),
422 &StoreBuffer::FindPointersToNewSpaceInMapsRegion); 422 &StoreBuffer::FindPointersToNewSpaceInMapsRegion);
423 VerifyPointers(heap_->lo_space()); 423 VerifyPointers(heap_->lo_space());
424 #endif 424 #endif
425 } 425 }
426 426
427 427
428 void StoreBuffer::GCEpilogue() { 428 void StoreBuffer::GCEpilogue() {
429 during_gc_ = false; 429 during_gc_ = false;
430 #ifdef VERIFY_HEAP
430 if (FLAG_verify_heap) { 431 if (FLAG_verify_heap) {
431 Verify(); 432 Verify();
432 } 433 }
434 #endif
433 } 435 }
434 436
435 437
436 void StoreBuffer::FindPointersToNewSpaceInRegion( 438 void StoreBuffer::FindPointersToNewSpaceInRegion(
437 Address start, Address end, ObjectSlotCallback slot_callback) { 439 Address start, Address end, ObjectSlotCallback slot_callback) {
438 for (Address slot_address = start; 440 for (Address slot_address = start;
439 slot_address < end; 441 slot_address < end;
440 slot_address += kPointerSize) { 442 slot_address += kPointerSize) {
441 Object** slot = reinterpret_cast<Object**>(slot_address); 443 Object** slot = reinterpret_cast<Object**>(slot_address);
442 if (heap_->InNewSpace(*slot)) { 444 if (heap_->InNewSpace(*slot)) {
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 heap_->isolate()->counters()->store_buffer_compactions()->Increment(); 712 heap_->isolate()->counters()->store_buffer_compactions()->Increment();
711 CheckForFullBuffer(); 713 CheckForFullBuffer();
712 } 714 }
713 715
714 716
715 void StoreBuffer::CheckForFullBuffer() { 717 void StoreBuffer::CheckForFullBuffer() {
716 EnsureSpace(kStoreBufferSize * 2); 718 EnsureSpace(kStoreBufferSize * 2);
717 } 719 }
718 720
719 } } // namespace v8::internal 721 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/store-buffer.h ('k') | test/cctest/test-debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698