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

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

Issue 1256203004: AdjustLiveBytes and friends takes a heap object pointer instead of an address. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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
« no previous file with comments | « src/heap/spaces.h ('k') | src/objects.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 // 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/v8.h" 5 #include "src/v8.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/mark-compact.h" 10 #include "src/heap/mark-compact.h"
(...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after
913 } 913 }
914 vm->Uncommit(header, header_size); 914 vm->Uncommit(header, header_size);
915 } 915 }
916 return false; 916 return false;
917 } 917 }
918 918
919 919
920 // ----------------------------------------------------------------------------- 920 // -----------------------------------------------------------------------------
921 // MemoryChunk implementation 921 // MemoryChunk implementation
922 922
923 void MemoryChunk::IncrementLiveBytesFromMutator(Address address, int by) { 923 void MemoryChunk::IncrementLiveBytesFromMutator(HeapObject* object, int by) {
924 MemoryChunk* chunk = MemoryChunk::FromAddress(address); 924 MemoryChunk* chunk = MemoryChunk::FromAddress(object->address());
925 if (!chunk->InNewSpace() && !static_cast<Page*>(chunk)->WasSwept()) { 925 if (!chunk->InNewSpace() && !static_cast<Page*>(chunk)->WasSwept()) {
926 static_cast<PagedSpace*>(chunk->owner())->IncrementUnsweptFreeBytes(-by); 926 static_cast<PagedSpace*>(chunk->owner())->IncrementUnsweptFreeBytes(-by);
927 } 927 }
928 chunk->IncrementLiveBytes(by); 928 chunk->IncrementLiveBytes(by);
929 } 929 }
930 930
931 931
932 // ----------------------------------------------------------------------------- 932 // -----------------------------------------------------------------------------
933 // PagedSpace implementation 933 // PagedSpace implementation
934 934
(...skipping 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after
3141 object->ShortPrint(); 3141 object->ShortPrint();
3142 PrintF("\n"); 3142 PrintF("\n");
3143 } 3143 }
3144 printf(" --------------------------------------\n"); 3144 printf(" --------------------------------------\n");
3145 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3145 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3146 } 3146 }
3147 3147
3148 #endif // DEBUG 3148 #endif // DEBUG
3149 } // namespace internal 3149 } // namespace internal
3150 } // namespace v8 3150 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/spaces.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698