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

Side by Side Diff: src/spaces.cc

Issue 210020: Fix --heap-stats option on X64 (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 1888 matching lines...) Expand 10 before | Expand all | Expand 10 after
1899 PageIterator page_it(this, PageIterator::PAGES_IN_USE); 1899 PageIterator page_it(this, PageIterator::PAGES_IN_USE);
1900 while (page_it.has_next()) { 1900 while (page_it.has_next()) {
1901 Page* p = page_it.next(); 1901 Page* p = page_it.next();
1902 1902
1903 for (Address rset_addr = p->RSetStart(); 1903 for (Address rset_addr = p->RSetStart();
1904 rset_addr < p->RSetEnd(); 1904 rset_addr < p->RSetEnd();
1905 rset_addr += kIntSize) { 1905 rset_addr += kIntSize) {
1906 int rset = Memory::int_at(rset_addr); 1906 int rset = Memory::int_at(rset_addr);
1907 if (rset != 0) { 1907 if (rset != 0) {
1908 // Bits were set 1908 // Bits were set
1909 int intoff = rset_addr - p->address(); 1909 int intoff = rset_addr - p->address() - Page::kRSetOffset;
1910 int bitoff = 0; 1910 int bitoff = 0;
1911 for (; bitoff < kBitsPerInt; ++bitoff) { 1911 for (; bitoff < kBitsPerInt; ++bitoff) {
1912 if ((rset & (1 << bitoff)) != 0) { 1912 if ((rset & (1 << bitoff)) != 0) {
1913 int bitpos = intoff*kBitsPerByte + bitoff; 1913 int bitpos = intoff*kBitsPerByte + bitoff;
1914 Address slot = p->OffsetToAddress(bitpos << kObjectAlignmentBits); 1914 Address slot = p->OffsetToAddress(bitpos << kObjectAlignmentBits);
1915 Object** obj = reinterpret_cast<Object**>(slot); 1915 Object** obj = reinterpret_cast<Object**>(slot);
1916 if (*obj == Heap::raw_unchecked_fixed_array_map()) { 1916 if (*obj == Heap::raw_unchecked_fixed_array_map()) {
1917 rset_marked_arrays++; 1917 rset_marked_arrays++;
1918 FixedArray* fa = FixedArray::cast(HeapObject::FromAddress(slot)); 1918 FixedArray* fa = FixedArray::cast(HeapObject::FromAddress(slot));
1919 1919
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
2164 PageIterator page_it(this, PageIterator::PAGES_IN_USE); 2164 PageIterator page_it(this, PageIterator::PAGES_IN_USE);
2165 while (page_it.has_next()) { 2165 while (page_it.has_next()) {
2166 Page* p = page_it.next(); 2166 Page* p = page_it.next();
2167 2167
2168 for (Address rset_addr = p->RSetStart(); 2168 for (Address rset_addr = p->RSetStart();
2169 rset_addr < p->RSetEnd(); 2169 rset_addr < p->RSetEnd();
2170 rset_addr += kIntSize) { 2170 rset_addr += kIntSize) {
2171 int rset = Memory::int_at(rset_addr); 2171 int rset = Memory::int_at(rset_addr);
2172 if (rset != 0) { 2172 if (rset != 0) {
2173 // Bits were set 2173 // Bits were set
2174 int intoff = rset_addr - p->address(); 2174 int intoff = rset_addr - p->address() - Page::kRSetOffset;
2175 int bitoff = 0; 2175 int bitoff = 0;
2176 for (; bitoff < kBitsPerInt; ++bitoff) { 2176 for (; bitoff < kBitsPerInt; ++bitoff) {
2177 if ((rset & (1 << bitoff)) != 0) { 2177 if ((rset & (1 << bitoff)) != 0) {
2178 int bitpos = intoff*kBitsPerByte + bitoff; 2178 int bitpos = intoff*kBitsPerByte + bitoff;
2179 Address slot = p->OffsetToAddress(bitpos << kObjectAlignmentBits); 2179 Address slot = p->OffsetToAddress(bitpos << kObjectAlignmentBits);
2180 Object** obj = reinterpret_cast<Object**>(slot); 2180 Object** obj = reinterpret_cast<Object**>(slot);
2181 rset_marked_pointers++; 2181 rset_marked_pointers++;
2182 if (Heap::InNewSpace(*obj)) 2182 if (Heap::InNewSpace(*obj))
2183 cross_gen_pointers++; 2183 cross_gen_pointers++;
2184 } 2184 }
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after
2658 reinterpret_cast<Object**>(object->address() 2658 reinterpret_cast<Object**>(object->address()
2659 + Page::kObjectAreaSize), 2659 + Page::kObjectAreaSize),
2660 allocation_top); 2660 allocation_top);
2661 PrintF("\n"); 2661 PrintF("\n");
2662 } 2662 }
2663 } 2663 }
2664 } 2664 }
2665 #endif // DEBUG 2665 #endif // DEBUG
2666 2666
2667 } } // namespace v8::internal 2667 } } // namespace v8::internal
OLDNEW
« 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