OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
9 #include "src/full-codegen.h" | 9 #include "src/full-codegen.h" |
10 #include "src/heap/mark-compact.h" | 10 #include "src/heap/mark-compact.h" |
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
983 MemoryChunk::UpdateHighWaterMark(allocation_info_.top()); | 983 MemoryChunk::UpdateHighWaterMark(allocation_info_.top()); |
984 size_t size = 0; | 984 size_t size = 0; |
985 PageIterator it(this); | 985 PageIterator it(this); |
986 while (it.has_next()) { | 986 while (it.has_next()) { |
987 size += it.next()->CommittedPhysicalMemory(); | 987 size += it.next()->CommittedPhysicalMemory(); |
988 } | 988 } |
989 return size; | 989 return size; |
990 } | 990 } |
991 | 991 |
992 | 992 |
| 993 bool PagedSpace::ContainsSafe(Address addr) { |
| 994 Page* p = Page::FromAddress(addr); |
| 995 PageIterator iterator(this); |
| 996 while (iterator.has_next()) { |
| 997 if (iterator.next() == p) return true; |
| 998 } |
| 999 return false; |
| 1000 } |
| 1001 |
| 1002 |
993 Object* PagedSpace::FindObject(Address addr) { | 1003 Object* PagedSpace::FindObject(Address addr) { |
994 // Note: this function can only be called on iterable spaces. | 1004 // Note: this function can only be called on iterable spaces. |
995 DCHECK(!heap()->mark_compact_collector()->in_use()); | 1005 DCHECK(!heap()->mark_compact_collector()->in_use()); |
996 | 1006 |
997 if (!Contains(addr)) return Smi::FromInt(0); // Signaling not found. | 1007 if (!Contains(addr)) return Smi::FromInt(0); // Signaling not found. |
998 | 1008 |
999 Page* p = Page::FromAddress(addr); | 1009 Page* p = Page::FromAddress(addr); |
1000 HeapObjectIterator it(p, NULL); | 1010 HeapObjectIterator it(p, NULL); |
1001 for (HeapObject* obj = it.Next(); obj != NULL; obj = it.Next()) { | 1011 for (HeapObject* obj = it.Next(); obj != NULL; obj = it.Next()) { |
1002 Address cur = obj->address(); | 1012 Address cur = obj->address(); |
(...skipping 2117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3120 object->ShortPrint(); | 3130 object->ShortPrint(); |
3121 PrintF("\n"); | 3131 PrintF("\n"); |
3122 } | 3132 } |
3123 printf(" --------------------------------------\n"); | 3133 printf(" --------------------------------------\n"); |
3124 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3134 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
3125 } | 3135 } |
3126 | 3136 |
3127 #endif // DEBUG | 3137 #endif // DEBUG |
3128 } | 3138 } |
3129 } // namespace v8::internal | 3139 } // namespace v8::internal |
OLD | NEW |