Chromium Code Reviews

Side by Side Diff: src/heap/spaces.cc

Issue 1511933002: [cctest] Add tests for aborting compaction of pages (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments; fixed typos Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « src/heap/heap.cc ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1150 matching lines...)
1161 Address next = cur + obj->Size(); 1161 Address next = cur + obj->Size();
1162 if ((cur <= addr) && (addr < next)) return obj; 1162 if ((cur <= addr) && (addr < next)) return obj;
1163 } 1163 }
1164 1164
1165 UNREACHABLE(); 1165 UNREACHABLE();
1166 return Smi::FromInt(0); 1166 return Smi::FromInt(0);
1167 } 1167 }
1168 1168
1169 1169
1170 bool PagedSpace::CanExpand(size_t size) { 1170 bool PagedSpace::CanExpand(size_t size) {
1171 if (heap()->force_oom()) return false;
Hannes Payer (out of office) 2015/12/10 18:11:54 This check should be done within heap()->CanExpand
Michael Lippautz 2015/12/10 18:20:54 Done. Thanks for clarifying!
1172
1171 DCHECK(heap()->mark_compact_collector()->is_compacting() || 1173 DCHECK(heap()->mark_compact_collector()->is_compacting() ||
1172 Capacity() <= heap()->MaxOldGenerationSize()); 1174 Capacity() <= heap()->MaxOldGenerationSize());
1173 1175
1174 // Are we going to exceed capacity for this space? At this point we can be 1176 // Are we going to exceed capacity for this space? At this point we can be
1175 // way over the maximum size because of AlwaysAllocate scopes and large 1177 // way over the maximum size because of AlwaysAllocate scopes and large
1176 // objects. 1178 // objects.
1177 if (!heap()->CanExpandOldGeneration(static_cast<int>(size))) return false; 1179 if (!heap()->CanExpandOldGeneration(static_cast<int>(size))) return false;
1178 1180
1179 return true; 1181 return true;
1180 } 1182 }
(...skipping 2143 matching lines...)
3324 object->ShortPrint(); 3326 object->ShortPrint();
3325 PrintF("\n"); 3327 PrintF("\n");
3326 } 3328 }
3327 printf(" --------------------------------------\n"); 3329 printf(" --------------------------------------\n");
3328 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); 3330 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes());
3329 } 3331 }
3330 3332
3331 #endif // DEBUG 3333 #endif // DEBUG
3332 } // namespace internal 3334 } // namespace internal
3333 } // namespace v8 3335 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | test/cctest/cctest.gyp » ('j') | no next file with comments »

Powered by Google App Engine