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

Side by Side Diff: src/api.cc

Issue 12965013: Make Isolate::GetHeapStatistics robust against half-initialized isolates. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Code review (hpayer) Created 7 years, 8 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
« 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 5953 matching lines...) Expand 10 before | Expand all | Expand 10 after
5964 5964
5965 5965
5966 void Isolate::Exit() { 5966 void Isolate::Exit() {
5967 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 5967 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
5968 isolate->Exit(); 5968 isolate->Exit();
5969 } 5969 }
5970 5970
5971 5971
5972 void Isolate::GetHeapStatistics(HeapStatistics* heap_statistics) { 5972 void Isolate::GetHeapStatistics(HeapStatistics* heap_statistics) {
5973 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); 5973 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
5974 if (!isolate->IsInitialized()) {
5975 heap_statistics->total_heap_size_ = 0;
5976 heap_statistics->total_heap_size_executable_ = 0;
5977 heap_statistics->total_physical_size_ = 0;
5978 heap_statistics->used_heap_size_ = 0;
5979 heap_statistics->heap_size_limit_ = 0;
5980 return;
5981 }
5974 i::Heap* heap = isolate->heap(); 5982 i::Heap* heap = isolate->heap();
5975 heap_statistics->total_heap_size_ = heap->CommittedMemory(); 5983 heap_statistics->total_heap_size_ = heap->CommittedMemory();
5976 heap_statistics->total_heap_size_executable_ = 5984 heap_statistics->total_heap_size_executable_ =
5977 heap->CommittedMemoryExecutable(); 5985 heap->CommittedMemoryExecutable();
5978 heap_statistics->total_physical_size_ = heap->CommittedPhysicalMemory(); 5986 heap_statistics->total_physical_size_ = heap->CommittedPhysicalMemory();
5979 heap_statistics->used_heap_size_ = heap->SizeOfObjects(); 5987 heap_statistics->used_heap_size_ = heap->SizeOfObjects();
5980 heap_statistics->heap_size_limit_ = heap->MaxReserved(); 5988 heap_statistics->heap_size_limit_ = heap->MaxReserved();
5981 } 5989 }
5982 5990
5983 5991
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after
7061 7069
7062 v->VisitPointers(blocks_.first(), first_block_limit_); 7070 v->VisitPointers(blocks_.first(), first_block_limit_);
7063 7071
7064 for (int i = 1; i < blocks_.length(); i++) { 7072 for (int i = 1; i < blocks_.length(); i++) {
7065 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); 7073 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]);
7066 } 7074 }
7067 } 7075 }
7068 7076
7069 7077
7070 } } // namespace v8::internal 7078 } } // 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