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/heap/spaces.h" | 5 #include "src/heap/spaces.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/full-codegen.h" | 9 #include "src/full-codegen/full-codegen.h" |
10 #include "src/heap/slots-buffer.h" | 10 #include "src/heap/slots-buffer.h" |
(...skipping 3015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3026 MemoryChunk* chunk = MemoryChunk::FromAddress(address); | 3026 MemoryChunk* chunk = MemoryChunk::FromAddress(address); |
3027 | 3027 |
3028 bool owned = (chunk->owner() == this); | 3028 bool owned = (chunk->owner() == this); |
3029 | 3029 |
3030 SLOW_DCHECK(!owned || FindObject(address)->IsHeapObject()); | 3030 SLOW_DCHECK(!owned || FindObject(address)->IsHeapObject()); |
3031 | 3031 |
3032 return owned; | 3032 return owned; |
3033 } | 3033 } |
3034 | 3034 |
3035 | 3035 |
3036 bool LargeObjectSpace::Contains(Address address) { | |
Hannes Payer (out of office)
2015/09/22 16:31:23
We have FindPage or FindObject (depending on what
titzer
2015/09/23 09:33:57
Ok, I can implement this method in terms of FindPa
| |
3037 for (LargePage* chunk = first_page_; chunk != NULL; | |
3038 chunk = chunk->next_page()) { | |
3039 if (chunk->Contains(address)) return true; | |
3040 } | |
3041 return false; | |
3042 } | |
3043 | |
3044 | |
3036 #ifdef VERIFY_HEAP | 3045 #ifdef VERIFY_HEAP |
3037 // We do not assume that the large object iterator works, because it depends | 3046 // We do not assume that the large object iterator works, because it depends |
3038 // on the invariants we are checking during verification. | 3047 // on the invariants we are checking during verification. |
3039 void LargeObjectSpace::Verify() { | 3048 void LargeObjectSpace::Verify() { |
3040 for (LargePage* chunk = first_page_; chunk != NULL; | 3049 for (LargePage* chunk = first_page_; chunk != NULL; |
3041 chunk = chunk->next_page()) { | 3050 chunk = chunk->next_page()) { |
3042 // Each chunk contains an object that starts at the large object page's | 3051 // Each chunk contains an object that starts at the large object page's |
3043 // object area start. | 3052 // object area start. |
3044 HeapObject* object = chunk->GetObject(); | 3053 HeapObject* object = chunk->GetObject(); |
3045 Page* page = Page::FromAddress(object->address()); | 3054 Page* page = Page::FromAddress(object->address()); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3144 object->ShortPrint(); | 3153 object->ShortPrint(); |
3145 PrintF("\n"); | 3154 PrintF("\n"); |
3146 } | 3155 } |
3147 printf(" --------------------------------------\n"); | 3156 printf(" --------------------------------------\n"); |
3148 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3157 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
3149 } | 3158 } |
3150 | 3159 |
3151 #endif // DEBUG | 3160 #endif // DEBUG |
3152 } // namespace internal | 3161 } // namespace internal |
3153 } // namespace v8 | 3162 } // namespace v8 |
OLD | NEW |