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

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

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/mark-compact-inl.h ('k') | src/heap/spaces.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_H_ 5 #ifndef V8_HEAP_SPACES_H_
6 #define V8_HEAP_SPACES_H_ 6 #define V8_HEAP_SPACES_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/base/atomicops.h" 9 #include "src/base/atomicops.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after
515 } 515 }
516 } 516 }
517 517
518 bool IsLeftOfProgressBar(Object** slot) { 518 bool IsLeftOfProgressBar(Object** slot) {
519 Address slot_address = reinterpret_cast<Address>(slot); 519 Address slot_address = reinterpret_cast<Address>(slot);
520 DCHECK(slot_address > this->address()); 520 DCHECK(slot_address > this->address());
521 return (slot_address - (this->address() + kObjectStartOffset)) < 521 return (slot_address - (this->address() + kObjectStartOffset)) <
522 progress_bar(); 522 progress_bar();
523 } 523 }
524 524
525 static void IncrementLiveBytesFromGC(Address address, int by) { 525 static void IncrementLiveBytesFromGC(HeapObject* object, int by) {
526 MemoryChunk::FromAddress(address)->IncrementLiveBytes(by); 526 MemoryChunk::FromAddress(object->address())->IncrementLiveBytes(by);
527 } 527 }
528 528
529 static void IncrementLiveBytesFromMutator(Address address, int by); 529 static void IncrementLiveBytesFromMutator(HeapObject* object, int by);
530 530
531 static const intptr_t kAlignment = 531 static const intptr_t kAlignment =
532 (static_cast<uintptr_t>(1) << kPageSizeBits); 532 (static_cast<uintptr_t>(1) << kPageSizeBits);
533 533
534 static const intptr_t kAlignmentMask = kAlignment - 1; 534 static const intptr_t kAlignmentMask = kAlignment - 1;
535 535
536 static const intptr_t kSizeOffset = 0; 536 static const intptr_t kSizeOffset = 0;
537 537
538 static const intptr_t kLiveBytesOffset = 538 static const intptr_t kLiveBytesOffset =
539 kSizeOffset + kPointerSize + kPointerSize + kPointerSize + kPointerSize + 539 kSizeOffset + kPointerSize + kPointerSize + kPointerSize + kPointerSize +
(...skipping 2359 matching lines...) Expand 10 before | Expand all | Expand 10 after
2899 count = 0; 2899 count = 0;
2900 } 2900 }
2901 // Must be small, since an iteration is used for lookup. 2901 // Must be small, since an iteration is used for lookup.
2902 static const int kMaxComments = 64; 2902 static const int kMaxComments = 64;
2903 }; 2903 };
2904 #endif 2904 #endif
2905 } 2905 }
2906 } // namespace v8::internal 2906 } // namespace v8::internal
2907 2907
2908 #endif // V8_HEAP_SPACES_H_ 2908 #endif // V8_HEAP_SPACES_H_
OLDNEW
« no previous file with comments | « src/heap/mark-compact-inl.h ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698