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/platform/platform.h" | 7 #include "src/base/platform/platform.h" |
8 #include "src/full-codegen.h" | 8 #include "src/full-codegen.h" |
9 #include "src/heap/mark-compact.h" | 9 #include "src/heap/mark-compact.h" |
10 #include "src/macro-assembler.h" | 10 #include "src/macro-assembler.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 HeapObjectCallback size_func) { | 40 HeapObjectCallback size_func) { |
41 Space* owner = page->owner(); | 41 Space* owner = page->owner(); |
42 DCHECK(owner == page->heap()->old_pointer_space() || | 42 DCHECK(owner == page->heap()->old_pointer_space() || |
43 owner == page->heap()->old_data_space() || | 43 owner == page->heap()->old_data_space() || |
44 owner == page->heap()->map_space() || | 44 owner == page->heap()->map_space() || |
45 owner == page->heap()->cell_space() || | 45 owner == page->heap()->cell_space() || |
46 owner == page->heap()->property_cell_space() || | 46 owner == page->heap()->property_cell_space() || |
47 owner == page->heap()->code_space()); | 47 owner == page->heap()->code_space()); |
48 Initialize(reinterpret_cast<PagedSpace*>(owner), page->area_start(), | 48 Initialize(reinterpret_cast<PagedSpace*>(owner), page->area_start(), |
49 page->area_end(), kOnePageOnly, size_func); | 49 page->area_end(), kOnePageOnly, size_func); |
50 DCHECK(page->WasSweptPrecisely() || page->SweepingCompleted()); | 50 DCHECK(page->WasSweptPrecisely() || |
| 51 (static_cast<PagedSpace*>(owner)->swept_precisely() && |
| 52 page->SweepingCompleted())); |
51 } | 53 } |
52 | 54 |
53 | 55 |
54 void HeapObjectIterator::Initialize(PagedSpace* space, Address cur, Address end, | 56 void HeapObjectIterator::Initialize(PagedSpace* space, Address cur, Address end, |
55 HeapObjectIterator::PageMode mode, | 57 HeapObjectIterator::PageMode mode, |
56 HeapObjectCallback size_f) { | 58 HeapObjectCallback size_f) { |
57 // Check that we actually can iterate this space. | 59 // Check that we actually can iterate this space. |
58 DCHECK(space->swept_precisely()); | 60 DCHECK(space->swept_precisely()); |
59 | 61 |
60 space_ = space; | 62 space_ = space; |
(...skipping 13 matching lines...) Expand all Loading... |
74 if (cur_addr_ == NULL) { | 76 if (cur_addr_ == NULL) { |
75 cur_page = space_->anchor(); | 77 cur_page = space_->anchor(); |
76 } else { | 78 } else { |
77 cur_page = Page::FromAddress(cur_addr_ - 1); | 79 cur_page = Page::FromAddress(cur_addr_ - 1); |
78 DCHECK(cur_addr_ == cur_page->area_end()); | 80 DCHECK(cur_addr_ == cur_page->area_end()); |
79 } | 81 } |
80 cur_page = cur_page->next_page(); | 82 cur_page = cur_page->next_page(); |
81 if (cur_page == space_->anchor()) return false; | 83 if (cur_page == space_->anchor()) return false; |
82 cur_addr_ = cur_page->area_start(); | 84 cur_addr_ = cur_page->area_start(); |
83 cur_end_ = cur_page->area_end(); | 85 cur_end_ = cur_page->area_end(); |
84 DCHECK(cur_page->WasSweptPrecisely()); | 86 DCHECK(cur_page->WasSweptPrecisely() || |
| 87 (static_cast<PagedSpace*>(cur_page->owner())->swept_precisely() && |
| 88 cur_page->SweepingCompleted())); |
85 return true; | 89 return true; |
86 } | 90 } |
87 | 91 |
88 | 92 |
89 // ----------------------------------------------------------------------------- | 93 // ----------------------------------------------------------------------------- |
90 // CodeRange | 94 // CodeRange |
91 | 95 |
92 | 96 |
93 CodeRange::CodeRange(Isolate* isolate) | 97 CodeRange::CodeRange(Isolate* isolate) |
94 : isolate_(isolate), | 98 : isolate_(isolate), |
(...skipping 3000 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3095 object->ShortPrint(); | 3099 object->ShortPrint(); |
3096 PrintF("\n"); | 3100 PrintF("\n"); |
3097 } | 3101 } |
3098 printf(" --------------------------------------\n"); | 3102 printf(" --------------------------------------\n"); |
3099 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3103 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
3100 } | 3104 } |
3101 | 3105 |
3102 #endif // DEBUG | 3106 #endif // DEBUG |
3103 } | 3107 } |
3104 } // namespace v8::internal | 3108 } // namespace v8::internal |
OLD | NEW |