OLD | NEW |
---|---|
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 Loading... | |
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 // Isolate is unitialized thus heap is not configured yet. | |
payer
2013/03/27 10:23:52
I think we do not need that comment since the code
| |
5976 heap_statistics->total_heap_size_ = 0; | |
5977 heap_statistics->total_heap_size_executable_ = 0; | |
5978 heap_statistics->total_physical_size_ = 0; | |
5979 heap_statistics->used_heap_size_ = 0; | |
5980 heap_statistics->heap_size_limit_ = 0; | |
5981 return; | |
5982 } | |
5974 i::Heap* heap = isolate->heap(); | 5983 i::Heap* heap = isolate->heap(); |
5975 heap_statistics->total_heap_size_ = heap->CommittedMemory(); | 5984 heap_statistics->total_heap_size_ = heap->CommittedMemory(); |
5976 heap_statistics->total_heap_size_executable_ = | 5985 heap_statistics->total_heap_size_executable_ = |
5977 heap->CommittedMemoryExecutable(); | 5986 heap->CommittedMemoryExecutable(); |
5978 heap_statistics->total_physical_size_ = heap->CommittedPhysicalMemory(); | 5987 heap_statistics->total_physical_size_ = heap->CommittedPhysicalMemory(); |
5979 heap_statistics->used_heap_size_ = heap->SizeOfObjects(); | 5988 heap_statistics->used_heap_size_ = heap->SizeOfObjects(); |
5980 heap_statistics->heap_size_limit_ = heap->MaxReserved(); | 5989 heap_statistics->heap_size_limit_ = heap->MaxReserved(); |
5981 } | 5990 } |
5982 | 5991 |
5983 | 5992 |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
7061 | 7070 |
7062 v->VisitPointers(blocks_.first(), first_block_limit_); | 7071 v->VisitPointers(blocks_.first(), first_block_limit_); |
7063 | 7072 |
7064 for (int i = 1; i < blocks_.length(); i++) { | 7073 for (int i = 1; i < blocks_.length(); i++) { |
7065 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 7074 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
7066 } | 7075 } |
7067 } | 7076 } |
7068 | 7077 |
7069 | 7078 |
7070 } } // namespace v8::internal | 7079 } } // namespace v8::internal |
OLD | NEW |