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 5961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5972 | 5972 |
5973 | 5973 |
5974 void Isolate::Exit() { | 5974 void Isolate::Exit() { |
5975 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 5975 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
5976 isolate->Exit(); | 5976 isolate->Exit(); |
5977 } | 5977 } |
5978 | 5978 |
5979 | 5979 |
5980 void Isolate::GetHeapStatistics(HeapStatistics* heap_statistics) { | 5980 void Isolate::GetHeapStatistics(HeapStatistics* heap_statistics) { |
5981 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); | 5981 i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); |
| 5982 if (!isolate->IsInitialized()) { |
| 5983 heap_statistics->total_heap_size_ = 0; |
| 5984 heap_statistics->total_heap_size_executable_ = 0; |
| 5985 heap_statistics->total_physical_size_ = 0; |
| 5986 heap_statistics->used_heap_size_ = 0; |
| 5987 heap_statistics->heap_size_limit_ = 0; |
| 5988 return; |
| 5989 } |
5982 i::Heap* heap = isolate->heap(); | 5990 i::Heap* heap = isolate->heap(); |
5983 heap_statistics->total_heap_size_ = heap->CommittedMemory(); | 5991 heap_statistics->total_heap_size_ = heap->CommittedMemory(); |
5984 heap_statistics->total_heap_size_executable_ = | 5992 heap_statistics->total_heap_size_executable_ = |
5985 heap->CommittedMemoryExecutable(); | 5993 heap->CommittedMemoryExecutable(); |
5986 heap_statistics->total_physical_size_ = heap->CommittedPhysicalMemory(); | 5994 heap_statistics->total_physical_size_ = heap->CommittedPhysicalMemory(); |
5987 heap_statistics->used_heap_size_ = heap->SizeOfObjects(); | 5995 heap_statistics->used_heap_size_ = heap->SizeOfObjects(); |
5988 heap_statistics->heap_size_limit_ = heap->MaxReserved(); | 5996 heap_statistics->heap_size_limit_ = heap->MaxReserved(); |
5989 } | 5997 } |
5990 | 5998 |
5991 | 5999 |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7069 | 7077 |
7070 v->VisitPointers(blocks_.first(), first_block_limit_); | 7078 v->VisitPointers(blocks_.first(), first_block_limit_); |
7071 | 7079 |
7072 for (int i = 1; i < blocks_.length(); i++) { | 7080 for (int i = 1; i < blocks_.length(); i++) { |
7073 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); | 7081 v->VisitPointers(blocks_[i], &blocks_[i][kHandleBlockSize]); |
7074 } | 7082 } |
7075 } | 7083 } |
7076 | 7084 |
7077 | 7085 |
7078 } } // namespace v8::internal | 7086 } } // namespace v8::internal |
OLD | NEW |