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

Side by Side Diff: src/api.cc

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 | « no previous file | src/heap.h » ('j') | src/heap.h » ('J')
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 3254 matching lines...) Expand 10 before | Expand all | Expand 10 after
3265 3265
3266 HeapStatistics::HeapStatistics(): total_heap_size_(0), 3266 HeapStatistics::HeapStatistics(): total_heap_size_(0),
3267 total_heap_size_executable_(0), 3267 total_heap_size_executable_(0),
3268 used_heap_size_(0) { } 3268 used_heap_size_(0) { }
3269 3269
3270 3270
3271 void v8::V8::GetHeapStatistics(HeapStatistics* heap_statistics) { 3271 void v8::V8::GetHeapStatistics(HeapStatistics* heap_statistics) {
3272 heap_statistics->set_total_heap_size(i::Heap::CommittedMemory()); 3272 heap_statistics->set_total_heap_size(i::Heap::CommittedMemory());
3273 heap_statistics->set_total_heap_size_executable( 3273 heap_statistics->set_total_heap_size_executable(
3274 i::Heap::CommittedMemoryExecutable()); 3274 i::Heap::CommittedMemoryExecutable());
3275 heap_statistics->set_used_heap_size(i::Heap::SizeOfObjects()); 3275 heap_statistics->set_used_heap_size(i::Heap::SizeOfObjectsSlow());
3276 } 3276 }
3277 3277
3278 3278
3279 bool v8::V8::IdleNotification() { 3279 bool v8::V8::IdleNotification() {
3280 // Returning true tells the caller that it need not 3280 // Returning true tells the caller that it need not
3281 // continue to call IdleNotification. 3281 // continue to call IdleNotification.
3282 if (!i::V8::IsRunning()) return true; 3282 if (!i::V8::IsRunning()) return true;
3283 return i::V8::IdleNotification(); 3283 return i::V8::IdleNotification();
3284 } 3284 }
3285 3285
(...skipping 1714 matching lines...) Expand 10 before | Expand all | Expand 10 after
5000 5000
5001 5001
5002 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 5002 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
5003 HandleScopeImplementer* thread_local = 5003 HandleScopeImplementer* thread_local =
5004 reinterpret_cast<HandleScopeImplementer*>(storage); 5004 reinterpret_cast<HandleScopeImplementer*>(storage);
5005 thread_local->IterateThis(v); 5005 thread_local->IterateThis(v);
5006 return storage + ArchiveSpacePerThread(); 5006 return storage + ArchiveSpacePerThread();
5007 } 5007 }
5008 5008
5009 } } // namespace v8::internal 5009 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap.h » ('j') | src/heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698