Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(357)

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

Issue 528993002: First step to cleanup the power-of-2 mess. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: clang-format Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap/spaces.h ('k') | src/hydrogen-instructions.h » ('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/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
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
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
OLDNEW
« no previous file with comments | « src/heap/spaces.h ('k') | src/hydrogen-instructions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698