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

Side by Side Diff: src/heap/spaces.cc

Issue 1455273003: [heap] Enforce size checks in allocation stats. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « src/heap/spaces.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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/spaces.h" 5 #include "src/heap/spaces.h"
6 6
7 #include "src/base/bits.h" 7 #include "src/base/bits.h"
8 #include "src/base/platform/platform.h" 8 #include "src/base/platform/platform.h"
9 #include "src/full-codegen/full-codegen.h" 9 #include "src/full-codegen/full-codegen.h"
10 #include "src/heap/slots-buffer.h" 10 #include "src/heap/slots-buffer.h"
(...skipping 2689 matching lines...) Expand 10 before | Expand all | Expand 10 after
2700 // on the first allocation after the sweep. 2700 // on the first allocation after the sweep.
2701 EmptyAllocationInfo(); 2701 EmptyAllocationInfo();
2702 2702
2703 // Clear the free list before a full GC---it will be rebuilt afterward. 2703 // Clear the free list before a full GC---it will be rebuilt afterward.
2704 free_list_.Reset(); 2704 free_list_.Reset();
2705 } 2705 }
2706 2706
2707 2707
2708 intptr_t PagedSpace::SizeOfObjects() { 2708 intptr_t PagedSpace::SizeOfObjects() {
2709 const intptr_t size = Size() - (limit() - top()); 2709 const intptr_t size = Size() - (limit() - top());
2710 DCHECK_GE(size, 0); 2710 CHECK_GE(limit(), top());
2711 CHECK_GE(size, 0);
2711 USE(size); 2712 USE(size);
2712 return size; 2713 return size;
2713 } 2714 }
2714 2715
2715 2716
2716 // After we have booted, we have created a map which represents free space 2717 // After we have booted, we have created a map which represents free space
2717 // on the heap. If there was already a free list then the elements on it 2718 // on the heap. If there was already a free list then the elements on it
2718 // were created with the wrong FreeSpaceMap (normally NULL), so we need to 2719 // were created with the wrong FreeSpaceMap (normally NULL), so we need to
2719 // fix them. 2720 // fix them.
2720 void PagedSpace::RepairFreeListsAfterDeserialization() { 2721 void PagedSpace::RepairFreeListsAfterDeserialization() {
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
3300 object->ShortPrint(); 3301 object->ShortPrint();
3301 PrintF("\n"); 3302 PrintF("\n");
3302 } 3303 }
3303 printf(" --------------------------------------\n"); 3304 printf(" --------------------------------------\n");
3304 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3305 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3305 } 3306 }
3306 3307
3307 #endif // DEBUG 3308 #endif // DEBUG
3308 } // namespace internal 3309 } // namespace internal
3309 } // namespace v8 3310 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698