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

Side by Side Diff: src/heap.h

Issue 4888001: Provide more accurate results about used heap size via GetHeapStatistics. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 10 years, 1 month 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 | « src/api.cc ('k') | src/heap.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 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 static intptr_t CommittedMemoryExecutable(); 268 static intptr_t CommittedMemoryExecutable();
269 269
270 // Returns the available bytes in space w/o growing. 270 // Returns the available bytes in space w/o growing.
271 // Heap doesn't guarantee that it can allocate an object that requires 271 // Heap doesn't guarantee that it can allocate an object that requires
272 // all available bytes. Check MaxHeapObjectSize() instead. 272 // all available bytes. Check MaxHeapObjectSize() instead.
273 static intptr_t Available(); 273 static intptr_t Available();
274 274
275 // Returns the maximum object size in paged space. 275 // Returns the maximum object size in paged space.
276 static inline int MaxObjectSizeInPagedSpace(); 276 static inline int MaxObjectSizeInPagedSpace();
277 277
278 // Returns of size of all objects residing in the heap. 278 // Returns size of all objects residing in the heap.
279 static intptr_t SizeOfObjects(); 279 static intptr_t SizeOfObjects();
280 // Does the same as the previous function, but more precisely,
Mads Ager (chromium) 2010/11/12 11:11:27 Hmm, this looks strange. Computing the same but ge
281 // by iterating heap contents. The resulting number is usually
282 // ~10% lower.
283 static intptr_t SizeOfObjectsSlow();
280 284
281 // Return the starting address and a mask for the new space. And-masking an 285 // Return the starting address and a mask for the new space. And-masking an
282 // address with the mask will result in the start address of the new space 286 // address with the mask will result in the start address of the new space
283 // for all addresses in either semispace. 287 // for all addresses in either semispace.
284 static Address NewSpaceStart() { return new_space_.start(); } 288 static Address NewSpaceStart() { return new_space_.start(); }
285 static uintptr_t NewSpaceMask() { return new_space_.mask(); } 289 static uintptr_t NewSpaceMask() { return new_space_.mask(); }
286 static Address NewSpaceTop() { return new_space_.top(); } 290 static Address NewSpaceTop() { return new_space_.top(); }
287 291
288 static NewSpace* new_space() { return &new_space_; } 292 static NewSpace* new_space() { return &new_space_; }
289 static OldSpace* old_pointer_space() { return old_pointer_space_; } 293 static OldSpace* old_pointer_space() { return old_pointer_space_; }
(...skipping 1795 matching lines...) Expand 10 before | Expand all | Expand 10 after
2085 // Return whether this object should be retained. If NULL is returned the 2089 // Return whether this object should be retained. If NULL is returned the
2086 // object has no references. Otherwise the address of the retained object 2090 // object has no references. Otherwise the address of the retained object
2087 // should be returned as in some GC situations the object has been moved. 2091 // should be returned as in some GC situations the object has been moved.
2088 virtual Object* RetainAs(Object* object) = 0; 2092 virtual Object* RetainAs(Object* object) = 0;
2089 }; 2093 };
2090 2094
2091 2095
2092 } } // namespace v8::internal 2096 } } // namespace v8::internal
2093 2097
2094 #endif // V8_HEAP_H_ 2098 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698