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

Side by Side Diff: src/api.cc

Issue 6111007: Add reporting of JS heap size limit to GetHeapStatistics. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 11 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 | « include/v8.h ('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 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 3281 matching lines...) Expand 10 before | Expand all | Expand 10 after
3292 3292
3293 3293
3294 bool v8::V8::Dispose() { 3294 bool v8::V8::Dispose() {
3295 i::V8::TearDown(); 3295 i::V8::TearDown();
3296 return true; 3296 return true;
3297 } 3297 }
3298 3298
3299 3299
3300 HeapStatistics::HeapStatistics(): total_heap_size_(0), 3300 HeapStatistics::HeapStatistics(): total_heap_size_(0),
3301 total_heap_size_executable_(0), 3301 total_heap_size_executable_(0),
3302 used_heap_size_(0) { } 3302 used_heap_size_(0),
3303 heap_size_limit_(0) { }
3303 3304
3304 3305
3305 void v8::V8::GetHeapStatistics(HeapStatistics* heap_statistics) { 3306 void v8::V8::GetHeapStatistics(HeapStatistics* heap_statistics) {
3306 heap_statistics->set_total_heap_size(i::Heap::CommittedMemory()); 3307 heap_statistics->set_total_heap_size(i::Heap::CommittedMemory());
3307 heap_statistics->set_total_heap_size_executable( 3308 heap_statistics->set_total_heap_size_executable(
3308 i::Heap::CommittedMemoryExecutable()); 3309 i::Heap::CommittedMemoryExecutable());
3309 heap_statistics->set_used_heap_size(i::Heap::SizeOfObjects()); 3310 heap_statistics->set_used_heap_size(i::Heap::SizeOfObjects());
3311 heap_statistics->set_heap_size_limit(i::Heap::MaxReserved());
3310 } 3312 }
3311 3313
3312 3314
3313 bool v8::V8::IdleNotification() { 3315 bool v8::V8::IdleNotification() {
3314 // Returning true tells the caller that it need not 3316 // Returning true tells the caller that it need not
3315 // continue to call IdleNotification. 3317 // continue to call IdleNotification.
3316 if (!i::V8::IsRunning()) return true; 3318 if (!i::V8::IsRunning()) return true;
3317 return i::V8::IdleNotification(); 3319 return i::V8::IdleNotification();
3318 } 3320 }
3319 3321
(...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after
5136 5138
5137 5139
5138 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) { 5140 char* HandleScopeImplementer::Iterate(ObjectVisitor* v, char* storage) {
5139 HandleScopeImplementer* thread_local = 5141 HandleScopeImplementer* thread_local =
5140 reinterpret_cast<HandleScopeImplementer*>(storage); 5142 reinterpret_cast<HandleScopeImplementer*>(storage);
5141 thread_local->IterateThis(v); 5143 thread_local->IterateThis(v);
5142 return storage + ArchiveSpacePerThread(); 5144 return storage + ArchiveSpacePerThread();
5143 } 5145 }
5144 5146
5145 } } // namespace v8::internal 5147 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698