| 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" |
| 11 #include "src/macro-assembler.h" | 11 #include "src/macro-assembler.h" |
| 12 #include "src/msan.h" | 12 #include "src/msan.h" |
| 13 #include "src/snapshot.h" |
| 13 | 14 |
| 14 namespace v8 { | 15 namespace v8 { |
| 15 namespace internal { | 16 namespace internal { |
| 16 | 17 |
| 17 | 18 |
| 18 // ---------------------------------------------------------------------------- | 19 // ---------------------------------------------------------------------------- |
| 19 // HeapObjectIterator | 20 // HeapObjectIterator |
| 20 | 21 |
| 21 HeapObjectIterator::HeapObjectIterator(PagedSpace* space) { | 22 HeapObjectIterator::HeapObjectIterator(PagedSpace* space) { |
| 22 // You can't actually iterate over the anchor page. It is not a real page, | 23 // You can't actually iterate over the anchor page. It is not a real page, |
| (...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1037 | 1038 |
| 1038 DCHECK(Capacity() <= max_capacity_); | 1039 DCHECK(Capacity() <= max_capacity_); |
| 1039 | 1040 |
| 1040 p->InsertAfter(anchor_.prev_page()); | 1041 p->InsertAfter(anchor_.prev_page()); |
| 1041 | 1042 |
| 1042 return true; | 1043 return true; |
| 1043 } | 1044 } |
| 1044 | 1045 |
| 1045 | 1046 |
| 1046 intptr_t PagedSpace::SizeOfFirstPage() { | 1047 intptr_t PagedSpace::SizeOfFirstPage() { |
| 1048 // If the snapshot contains a custom script, all size guarantees are off. |
| 1049 if (Snapshot::EmbedsScript()) return AreaSize(); |
| 1047 // If using an ool constant pool then transfer the constant pool allowance | 1050 // If using an ool constant pool then transfer the constant pool allowance |
| 1048 // from the code space to the old pointer space. | 1051 // from the code space to the old pointer space. |
| 1049 static const int constant_pool_delta = FLAG_enable_ool_constant_pool ? 48 : 0; | 1052 static const int constant_pool_delta = FLAG_enable_ool_constant_pool ? 48 : 0; |
| 1050 int size = 0; | 1053 int size = 0; |
| 1051 switch (identity()) { | 1054 switch (identity()) { |
| 1052 case OLD_POINTER_SPACE: | 1055 case OLD_POINTER_SPACE: |
| 1053 size = (128 + constant_pool_delta) * kPointerSize * KB; | 1056 size = (128 + constant_pool_delta) * kPointerSize * KB; |
| 1054 break; | 1057 break; |
| 1055 case OLD_DATA_SPACE: | 1058 case OLD_DATA_SPACE: |
| 1056 size = 192 * KB; | 1059 size = 192 * KB; |
| (...skipping 2167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3224 object->ShortPrint(); | 3227 object->ShortPrint(); |
| 3225 PrintF("\n"); | 3228 PrintF("\n"); |
| 3226 } | 3229 } |
| 3227 printf(" --------------------------------------\n"); | 3230 printf(" --------------------------------------\n"); |
| 3228 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3231 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
| 3229 } | 3232 } |
| 3230 | 3233 |
| 3231 #endif // DEBUG | 3234 #endif // DEBUG |
| 3232 } | 3235 } |
| 3233 } // namespace v8::internal | 3236 } // namespace v8::internal |
| OLD | NEW |