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

Side by Side Diff: src/heap/spaces-inl.h

Issue 2001073002: [build] Fix a clang warning (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 4 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
« no previous file with comments | « src/heap/spaces.cc ('k') | src/ia32/disasm-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 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 #ifndef V8_HEAP_SPACES_INL_H_ 5 #ifndef V8_HEAP_SPACES_INL_H_
6 #define V8_HEAP_SPACES_INL_H_ 6 #define V8_HEAP_SPACES_INL_H_
7 7
8 #include "src/heap/incremental-marking.h" 8 #include "src/heap/incremental-marking.h"
9 #include "src/heap/spaces.h" 9 #include "src/heap/spaces.h"
10 #include "src/isolate.h" 10 #include "src/isolate.h"
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 categories_[i].Initialize(static_cast<FreeListCategoryType>(i)); 304 categories_[i].Initialize(static_cast<FreeListCategoryType>(i));
305 } 305 }
306 } 306 }
307 307
308 void MemoryChunk::IncrementLiveBytesFromGC(HeapObject* object, int by) { 308 void MemoryChunk::IncrementLiveBytesFromGC(HeapObject* object, int by) {
309 MemoryChunk::FromAddress(object->address())->IncrementLiveBytes(by); 309 MemoryChunk::FromAddress(object->address())->IncrementLiveBytes(by);
310 } 310 }
311 311
312 void MemoryChunk::ResetLiveBytes() { 312 void MemoryChunk::ResetLiveBytes() {
313 if (FLAG_trace_live_bytes) { 313 if (FLAG_trace_live_bytes) {
314 PrintIsolate(heap()->isolate(), "live-bytes: reset page=%p %d->0\n", this, 314 PrintIsolate(heap()->isolate(), "live-bytes: reset page=%p %d->0\n",
315 live_byte_count_); 315 static_cast<void*>(this), live_byte_count_);
316 } 316 }
317 live_byte_count_ = 0; 317 live_byte_count_ = 0;
318 } 318 }
319 319
320 void MemoryChunk::IncrementLiveBytes(int by) { 320 void MemoryChunk::IncrementLiveBytes(int by) {
321 if (IsFlagSet(BLACK_PAGE)) return; 321 if (IsFlagSet(BLACK_PAGE)) return;
322 if (FLAG_trace_live_bytes) { 322 if (FLAG_trace_live_bytes) {
323 PrintIsolate(heap()->isolate(), 323 PrintIsolate(
324 "live-bytes: update page=%p delta=%d %d->%d\n", this, by, 324 heap()->isolate(), "live-bytes: update page=%p delta=%d %d->%d\n",
325 live_byte_count_, live_byte_count_ + by); 325 static_cast<void*>(this), by, live_byte_count_, live_byte_count_ + by);
326 } 326 }
327 live_byte_count_ += by; 327 live_byte_count_ += by;
328 DCHECK_GE(live_byte_count_, 0); 328 DCHECK_GE(live_byte_count_, 0);
329 DCHECK_LE(static_cast<size_t>(live_byte_count_), size_); 329 DCHECK_LE(static_cast<size_t>(live_byte_count_), size_);
330 } 330 }
331 331
332 void MemoryChunk::IncrementLiveBytesFromMutator(HeapObject* object, int by) { 332 void MemoryChunk::IncrementLiveBytesFromMutator(HeapObject* object, int by) {
333 MemoryChunk* chunk = MemoryChunk::FromAddress(object->address()); 333 MemoryChunk* chunk = MemoryChunk::FromAddress(object->address());
334 if (!chunk->InNewSpace() && !static_cast<Page*>(chunk)->SweepingDone()) { 334 if (!chunk->InNewSpace() && !static_cast<Page*>(chunk)->SweepingDone()) {
335 static_cast<PagedSpace*>(chunk->owner())->Allocate(by); 335 static_cast<PagedSpace*>(chunk->owner())->Allocate(by);
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
714 other->allocation_info_.Reset(nullptr, nullptr); 714 other->allocation_info_.Reset(nullptr, nullptr);
715 return true; 715 return true;
716 } 716 }
717 return false; 717 return false;
718 } 718 }
719 719
720 } // namespace internal 720 } // namespace internal
721 } // namespace v8 721 } // namespace v8
722 722
723 #endif // V8_HEAP_SPACES_INL_H_ 723 #endif // V8_HEAP_SPACES_INL_H_
OLDNEW
« no previous file with comments | « src/heap/spaces.cc ('k') | src/ia32/disasm-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698