| 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 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 | 983 |
| 984 DCHECK(Capacity() <= max_capacity_); | 984 DCHECK(Capacity() <= max_capacity_); |
| 985 | 985 |
| 986 p->InsertAfter(anchor_.prev_page()); | 986 p->InsertAfter(anchor_.prev_page()); |
| 987 | 987 |
| 988 return true; | 988 return true; |
| 989 } | 989 } |
| 990 | 990 |
| 991 | 991 |
| 992 intptr_t PagedSpace::SizeOfFirstPage() { | 992 intptr_t PagedSpace::SizeOfFirstPage() { |
| 993 // If using an ool constant pool then transfer the constant pool allowance |
| 994 // from the code space to the old pointer space. |
| 995 static const int constant_pool_delta = FLAG_enable_ool_constant_pool ? 48 : 0; |
| 993 int size = 0; | 996 int size = 0; |
| 994 switch (identity()) { | 997 switch (identity()) { |
| 995 case OLD_POINTER_SPACE: | 998 case OLD_POINTER_SPACE: |
| 996 size = 112 * kPointerSize * KB; | 999 size = (96 + constant_pool_delta) * kPointerSize * KB; |
| 997 break; | 1000 break; |
| 998 case OLD_DATA_SPACE: | 1001 case OLD_DATA_SPACE: |
| 999 size = 192 * KB; | 1002 size = 192 * KB; |
| 1000 break; | 1003 break; |
| 1001 case MAP_SPACE: | 1004 case MAP_SPACE: |
| 1002 size = 16 * kPointerSize * KB; | 1005 size = 16 * kPointerSize * KB; |
| 1003 break; | 1006 break; |
| 1004 case CELL_SPACE: | 1007 case CELL_SPACE: |
| 1005 size = 16 * kPointerSize * KB; | 1008 size = 16 * kPointerSize * KB; |
| 1006 break; | 1009 break; |
| 1007 case PROPERTY_CELL_SPACE: | 1010 case PROPERTY_CELL_SPACE: |
| 1008 size = 8 * kPointerSize * KB; | 1011 size = 8 * kPointerSize * KB; |
| 1009 break; | 1012 break; |
| 1010 case CODE_SPACE: { | 1013 case CODE_SPACE: { |
| 1011 CodeRange* code_range = heap()->isolate()->code_range(); | 1014 CodeRange* code_range = heap()->isolate()->code_range(); |
| 1012 if (code_range != NULL && code_range->valid()) { | 1015 if (code_range != NULL && code_range->valid()) { |
| 1013 // When code range exists, code pages are allocated in a special way | 1016 // When code range exists, code pages are allocated in a special way |
| 1014 // (from the reserved code range). That part of the code is not yet | 1017 // (from the reserved code range). That part of the code is not yet |
| 1015 // upgraded to handle small pages. | 1018 // upgraded to handle small pages. |
| 1016 size = AreaSize(); | 1019 size = AreaSize(); |
| 1017 } else { | 1020 } else { |
| 1018 size = | 1021 size = RoundUp((480 - constant_pool_delta) * KB * |
| 1019 RoundUp(480 * KB * FullCodeGenerator::kBootCodeSizeMultiplier / 100, | 1022 FullCodeGenerator::kBootCodeSizeMultiplier / 100, |
| 1020 kPointerSize); | 1023 kPointerSize); |
| 1021 } | 1024 } |
| 1022 break; | 1025 break; |
| 1023 } | 1026 } |
| 1024 default: | 1027 default: |
| 1025 UNREACHABLE(); | 1028 UNREACHABLE(); |
| 1026 } | 1029 } |
| 1027 return Min(size, AreaSize()); | 1030 return Min(size, AreaSize()); |
| 1028 } | 1031 } |
| 1029 | 1032 |
| 1030 | 1033 |
| (...skipping 2068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3099 object->ShortPrint(); | 3102 object->ShortPrint(); |
| 3100 PrintF("\n"); | 3103 PrintF("\n"); |
| 3101 } | 3104 } |
| 3102 printf(" --------------------------------------\n"); | 3105 printf(" --------------------------------------\n"); |
| 3103 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3106 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
| 3104 } | 3107 } |
| 3105 | 3108 |
| 3106 #endif // DEBUG | 3109 #endif // DEBUG |
| 3107 } | 3110 } |
| 3108 } // namespace v8::internal | 3111 } // namespace v8::internal |
| OLD | NEW |