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

Unified Diff: src/spaces.cc

Issue 12340101: Avoid HEAP macro in spaces.cc (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index f5f7d6af0e6b45cc3637a91b46048484cc5689b1..ac1d187237b939c3bf5572a7ccddf8d24bad8778 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -68,11 +68,11 @@ HeapObjectIterator::HeapObjectIterator(PagedSpace* space,
HeapObjectIterator::HeapObjectIterator(Page* page,
HeapObjectCallback size_func) {
Space* owner = page->owner();
- ASSERT(owner == HEAP->old_pointer_space() ||
- owner == HEAP->old_data_space() ||
- owner == HEAP->map_space() ||
- owner == HEAP->cell_space() ||
- owner == HEAP->code_space());
+ ASSERT(owner == page->heap()->old_pointer_space() ||
+ owner == page->heap()->old_data_space() ||
+ owner == page->heap()->map_space() ||
+ owner == page->heap()->cell_space() ||
+ owner == page->heap()->code_space());
Initialize(reinterpret_cast<PagedSpace*>(owner),
page->area_start(),
page->area_end(),
@@ -2004,7 +2004,7 @@ void FreeListNode::set_size(Heap* heap, int size_in_bytes) {
FreeListNode* FreeListNode::next() {
ASSERT(IsFreeListNode(this));
- if (map() == HEAP->raw_unchecked_free_space_map()) {
+ if (map() == GetHeap()->raw_unchecked_free_space_map()) {
ASSERT(map() == NULL || Size() >= kNextOffset + kPointerSize);
return reinterpret_cast<FreeListNode*>(
Memory::Address_at(address() + kNextOffset));
@@ -2017,7 +2017,7 @@ FreeListNode* FreeListNode::next() {
FreeListNode** FreeListNode::next_address() {
ASSERT(IsFreeListNode(this));
- if (map() == HEAP->raw_unchecked_free_space_map()) {
+ if (map() == GetHeap()->raw_unchecked_free_space_map()) {
ASSERT(Size() >= kNextOffset + kPointerSize);
return reinterpret_cast<FreeListNode**>(address() + kNextOffset);
} else {
@@ -2031,7 +2031,7 @@ void FreeListNode::set_next(FreeListNode* next) {
// While we are booting the VM the free space map will actually be null. So
// we have to make sure that we don't try to use it for anything at that
// stage.
- if (map() == HEAP->raw_unchecked_free_space_map()) {
+ if (map() == GetHeap()->raw_unchecked_free_space_map()) {
ASSERT(map() == NULL || Size() >= kNextOffset + kPointerSize);
Memory::Address_at(address() + kNextOffset) =
reinterpret_cast<Address>(next);
@@ -2242,7 +2242,7 @@ FreeListNode* FreeList::FindNodeFor(int size_in_bytes, int* node_size) {
break;
}
- ASSERT((*cur)->map() == HEAP->raw_unchecked_free_space_map());
+ ASSERT((*cur)->map() == heap_->raw_unchecked_free_space_map());
FreeSpace* cur_as_free_space = reinterpret_cast<FreeSpace*>(*cur);
int size = cur_as_free_space->Size();
if (size >= size_in_bytes) {
@@ -2378,7 +2378,7 @@ intptr_t FreeListCategory::SumFreeList() {
intptr_t sum = 0;
FreeListNode* cur = top_;
while (cur != NULL) {
- ASSERT(cur->map() == HEAP->raw_unchecked_free_space_map());
+ ASSERT(cur->map() == cur->GetHeap()->raw_unchecked_free_space_map());
FreeSpace* cur_as_free_space = reinterpret_cast<FreeSpace*>(cur);
sum += cur_as_free_space->Size();
cur = cur->next();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698