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

Side by Side Diff: src/spaces.cc

Issue 306001: Heap profiler: skip byte arrays that represent free list blocks when counting allocated objects. (Closed)
Patch Set: added the third type to check Created 11 years, 2 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/spaces.h ('k') | src/spaces-inl.h » ('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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 } else if (size_in_bytes == 2 * kPointerSize) { 1533 } else if (size_in_bytes == 2 * kPointerSize) {
1534 set_map(Heap::raw_unchecked_two_pointer_filler_map()); 1534 set_map(Heap::raw_unchecked_two_pointer_filler_map());
1535 } else { 1535 } else {
1536 UNREACHABLE(); 1536 UNREACHABLE();
1537 } 1537 }
1538 ASSERT(Size() == size_in_bytes); 1538 ASSERT(Size() == size_in_bytes);
1539 } 1539 }
1540 1540
1541 1541
1542 Address FreeListNode::next() { 1542 Address FreeListNode::next() {
1543 ASSERT(map() == Heap::raw_unchecked_byte_array_map() || 1543 ASSERT(IsFreeListNode(this));
1544 map() == Heap::raw_unchecked_two_pointer_filler_map());
1545 if (map() == Heap::raw_unchecked_byte_array_map()) { 1544 if (map() == Heap::raw_unchecked_byte_array_map()) {
1546 ASSERT(Size() >= kNextOffset + kPointerSize); 1545 ASSERT(Size() >= kNextOffset + kPointerSize);
1547 return Memory::Address_at(address() + kNextOffset); 1546 return Memory::Address_at(address() + kNextOffset);
1548 } else { 1547 } else {
1549 return Memory::Address_at(address() + kPointerSize); 1548 return Memory::Address_at(address() + kPointerSize);
1550 } 1549 }
1551 } 1550 }
1552 1551
1553 1552
1554 void FreeListNode::set_next(Address next) { 1553 void FreeListNode::set_next(Address next) {
1555 ASSERT(map() == Heap::raw_unchecked_byte_array_map() || 1554 ASSERT(IsFreeListNode(this));
1556 map() == Heap::raw_unchecked_two_pointer_filler_map());
1557 if (map() == Heap::raw_unchecked_byte_array_map()) { 1555 if (map() == Heap::raw_unchecked_byte_array_map()) {
1558 ASSERT(Size() >= kNextOffset + kPointerSize); 1556 ASSERT(Size() >= kNextOffset + kPointerSize);
1559 Memory::Address_at(address() + kNextOffset) = next; 1557 Memory::Address_at(address() + kNextOffset) = next;
1560 } else { 1558 } else {
1561 Memory::Address_at(address() + kPointerSize) = next; 1559 Memory::Address_at(address() + kPointerSize) = next;
1562 } 1560 }
1563 } 1561 }
1564 1562
1565 1563
1566 OldSpaceFreeList::OldSpaceFreeList(AllocationSpace owner) : owner_(owner) { 1564 OldSpaceFreeList::OldSpaceFreeList(AllocationSpace owner) : owner_(owner) {
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
2780 reinterpret_cast<Object**>(object->address() 2778 reinterpret_cast<Object**>(object->address()
2781 + Page::kObjectAreaSize), 2779 + Page::kObjectAreaSize),
2782 allocation_top); 2780 allocation_top);
2783 PrintF("\n"); 2781 PrintF("\n");
2784 } 2782 }
2785 } 2783 }
2786 } 2784 }
2787 #endif // DEBUG 2785 #endif // DEBUG
2788 2786
2789 } } // namespace v8::internal 2787 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/spaces.h ('k') | src/spaces-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698