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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 page->ClearFlag(MemoryChunk::SCAN_ON_SCAVENGE); | 1103 page->ClearFlag(MemoryChunk::SCAN_ON_SCAVENGE); |
1104 } | 1104 } |
1105 | 1105 |
1106 DCHECK(!free_list_.ContainsPageFreeListItems(page)); | 1106 DCHECK(!free_list_.ContainsPageFreeListItems(page)); |
1107 | 1107 |
1108 if (Page::FromAllocationTop(allocation_info_.top()) == page) { | 1108 if (Page::FromAllocationTop(allocation_info_.top()) == page) { |
1109 allocation_info_.set_top(NULL); | 1109 allocation_info_.set_top(NULL); |
1110 allocation_info_.set_limit(NULL); | 1110 allocation_info_.set_limit(NULL); |
1111 } | 1111 } |
1112 | 1112 |
1113 page->Unlink(); | 1113 // If page is still in a list, unlink it from that list. |
| 1114 if (page->next_chunk() != NULL) { |
| 1115 DCHECK(page->prev_chunk() != NULL); |
| 1116 page->Unlink(); |
| 1117 } |
| 1118 |
1114 if (page->IsFlagSet(MemoryChunk::CONTAINS_ONLY_DATA)) { | 1119 if (page->IsFlagSet(MemoryChunk::CONTAINS_ONLY_DATA)) { |
1115 heap()->isolate()->memory_allocator()->Free(page); | 1120 heap()->isolate()->memory_allocator()->Free(page); |
1116 } else { | 1121 } else { |
1117 heap()->QueueMemoryChunkForFree(page); | 1122 heap()->QueueMemoryChunkForFree(page); |
1118 } | 1123 } |
1119 | 1124 |
1120 DCHECK(Capacity() > 0); | 1125 DCHECK(Capacity() > 0); |
1121 accounting_stats_.ShrinkSpace(AreaSize()); | 1126 accounting_stats_.ShrinkSpace(AreaSize()); |
1122 } | 1127 } |
1123 | 1128 |
(...skipping 2006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3130 object->ShortPrint(); | 3135 object->ShortPrint(); |
3131 PrintF("\n"); | 3136 PrintF("\n"); |
3132 } | 3137 } |
3133 printf(" --------------------------------------\n"); | 3138 printf(" --------------------------------------\n"); |
3134 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3139 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
3135 } | 3140 } |
3136 | 3141 |
3137 #endif // DEBUG | 3142 #endif // DEBUG |
3138 } | 3143 } |
3139 } // namespace v8::internal | 3144 } // namespace v8::internal |
OLD | NEW |