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

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

Issue 11066118: Implement committed physical memory stats for Linux. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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 | Annotate | Revision Log
« src/spaces.cc ('K') | « src/spaces.cc ('k') | 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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 if (chunk->Contains(addr)) { 207 if (chunk->Contains(addr)) {
208 return chunk; 208 return chunk;
209 } 209 }
210 } 210 }
211 } 211 }
212 UNREACHABLE(); 212 UNREACHABLE();
213 return NULL; 213 return NULL;
214 } 214 }
215 215
216 216
217 void MemoryChunk::UpdateHighWaterMark(Address mark) {
218 if (mark == NULL) return;
219 // Need to subtract one from the mark because when a chunk is full the
220 // top points to the next address after the chunk, which effectively belongs
221 // to another chunk. See the comment to Page::FromAllocationTop.
222 MemoryChunk* chunk = MemoryChunk::FromAddress(mark - 1);
223 int new_mark = static_cast<int>(mark - chunk->address());
224 if (new_mark > chunk->high_water_mark_) {
225 chunk->high_water_mark_ = new_mark;
226 }
227 }
228
229
217 PointerChunkIterator::PointerChunkIterator(Heap* heap) 230 PointerChunkIterator::PointerChunkIterator(Heap* heap)
218 : state_(kOldPointerState), 231 : state_(kOldPointerState),
219 old_pointer_iterator_(heap->old_pointer_space()), 232 old_pointer_iterator_(heap->old_pointer_space()),
220 map_iterator_(heap->map_space()), 233 map_iterator_(heap->map_space()),
221 lo_iterator_(heap->lo_space()) { } 234 lo_iterator_(heap->lo_space()) { }
222 235
223 236
224 Page* Page::next_page() { 237 Page* Page::next_page() {
225 ASSERT(next_chunk()->owner() == owner()); 238 ASSERT(next_chunk()->owner() == owner());
226 return static_cast<Page*>(next_chunk()); 239 return static_cast<Page*>(next_chunk());
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 Map* map = object->map(); 372 Map* map = object->map();
360 Heap* heap = object->GetHeap(); 373 Heap* heap = object->GetHeap();
361 return map == heap->raw_unchecked_free_space_map() 374 return map == heap->raw_unchecked_free_space_map()
362 || map == heap->raw_unchecked_one_pointer_filler_map() 375 || map == heap->raw_unchecked_one_pointer_filler_map()
363 || map == heap->raw_unchecked_two_pointer_filler_map(); 376 || map == heap->raw_unchecked_two_pointer_filler_map();
364 } 377 }
365 378
366 } } // namespace v8::internal 379 } } // namespace v8::internal
367 380
368 #endif // V8_SPACES_INL_H_ 381 #endif // V8_SPACES_INL_H_
OLDNEW
« src/spaces.cc ('K') | « src/spaces.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698