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/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
8 #include "src/full-codegen.h" | 9 #include "src/full-codegen.h" |
9 #include "src/heap/mark-compact.h" | 10 #include "src/heap/mark-compact.h" |
10 #include "src/macro-assembler.h" | 11 #include "src/macro-assembler.h" |
11 #include "src/msan.h" | 12 #include "src/msan.h" |
12 | 13 |
13 namespace v8 { | 14 namespace v8 { |
14 namespace internal { | 15 namespace internal { |
15 | 16 |
16 | 17 |
(...skipping 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 size_t size = 2 * reserved_semispace_capacity; | 1184 size_t size = 2 * reserved_semispace_capacity; |
1184 Address base = heap()->isolate()->memory_allocator()->ReserveAlignedMemory( | 1185 Address base = heap()->isolate()->memory_allocator()->ReserveAlignedMemory( |
1185 size, size, &reservation_); | 1186 size, size, &reservation_); |
1186 if (base == NULL) return false; | 1187 if (base == NULL) return false; |
1187 | 1188 |
1188 chunk_base_ = base; | 1189 chunk_base_ = base; |
1189 chunk_size_ = static_cast<uintptr_t>(size); | 1190 chunk_size_ = static_cast<uintptr_t>(size); |
1190 LOG(heap()->isolate(), NewEvent("InitialChunk", chunk_base_, chunk_size_)); | 1191 LOG(heap()->isolate(), NewEvent("InitialChunk", chunk_base_, chunk_size_)); |
1191 | 1192 |
1192 DCHECK(initial_semispace_capacity <= maximum_semispace_capacity); | 1193 DCHECK(initial_semispace_capacity <= maximum_semispace_capacity); |
1193 DCHECK(IsPowerOf2(maximum_semispace_capacity)); | 1194 DCHECK(base::bits::IsPowerOfTwo32(maximum_semispace_capacity)); |
1194 | 1195 |
1195 // Allocate and set up the histogram arrays if necessary. | 1196 // Allocate and set up the histogram arrays if necessary. |
1196 allocated_histogram_ = NewArray<HistogramInfo>(LAST_TYPE + 1); | 1197 allocated_histogram_ = NewArray<HistogramInfo>(LAST_TYPE + 1); |
1197 promoted_histogram_ = NewArray<HistogramInfo>(LAST_TYPE + 1); | 1198 promoted_histogram_ = NewArray<HistogramInfo>(LAST_TYPE + 1); |
1198 | 1199 |
1199 #define SET_NAME(name) \ | 1200 #define SET_NAME(name) \ |
1200 allocated_histogram_[name].set_name(#name); \ | 1201 allocated_histogram_[name].set_name(#name); \ |
1201 promoted_histogram_[name].set_name(#name); | 1202 promoted_histogram_[name].set_name(#name); |
1202 INSTANCE_TYPE_LIST(SET_NAME) | 1203 INSTANCE_TYPE_LIST(SET_NAME) |
1203 #undef SET_NAME | 1204 #undef SET_NAME |
(...skipping 1893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3097 object->ShortPrint(); | 3098 object->ShortPrint(); |
3098 PrintF("\n"); | 3099 PrintF("\n"); |
3099 } | 3100 } |
3100 printf(" --------------------------------------\n"); | 3101 printf(" --------------------------------------\n"); |
3101 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); | 3102 printf(" Marked: %x, LiveCount: %x\n", mark_size, LiveBytes()); |
3102 } | 3103 } |
3103 | 3104 |
3104 #endif // DEBUG | 3105 #endif // DEBUG |
3105 } | 3106 } |
3106 } // namespace v8::internal | 3107 } // namespace v8::internal |
OLD | NEW |