// Number of bits to represent the page size for paged spaces. The value of 20
// gives 1Mb bytes per page.
+#if V8_HOST_ARCH_PPC && V8_TARGET_ARCH_PPC && V8_OS_LINUX
+// Bump up for Power Linux due to larger (64K) page size.
+const int kPageSizeBits = 22;
+#else
const int kPageSizeBits = 20;
+#endif
#endif // V8_BASE_BUILD_CONFIG_H_
#endif
// Ensure old_generation_size_ is a multiple of kPageSize.
- DCHECK(MB >= Page::kPageSize);
+ DCHECK((max_old_generation_size_ & (Page::kPageSize - 1)) == 0);
memset(roots_, 0, sizeof(roots_[0]) * kRootListLength);
set_native_contexts_list(NULL);
max_executable_size_ = static_cast<intptr_t>(FLAG_max_executable_size) * MB;
}
+ if (Page::kPageSize > MB) {
+ max_semi_space_size_ = ROUND_UP(max_semi_space_size_, Page::kPageSize);
+ max_old_generation_size_ =
+ ROUND_UP(max_old_generation_size_, Page::kPageSize);
+ max_executable_size_ = ROUND_UP(max_executable_size_, Page::kPageSize);
+ }
+
if (FLAG_stress_compaction) {
// This will cause more frequent GCs when stressing.
max_semi_space_size_ = Page::kPageSize;
reserved_semispace_size_ = max_semi_space_size_;
}
- // The max executable size must be less than or equal to the max old
- // generation size.
- if (max_executable_size_ > max_old_generation_size_) {
- max_executable_size_ = max_old_generation_size_;
- }
-
// The new space size must be a power of two to support single-bit testing
// for containment.
max_semi_space_size_ =
max_semi_space_size_ / MB);
}
} else {
- initial_semispace_size_ = initial_semispace_size;
+ initial_semispace_size_ =
+ ROUND_UP(initial_semispace_size, Page::kPageSize);
}
}
max_semi_space_size_ / MB);
}
} else {
- target_semispace_size_ = target_semispace_size;
+ target_semispace_size_ = ROUND_UP(target_semispace_size, Page::kPageSize);
}
}
Max(static_cast<intptr_t>(paged_space_count * Page::kPageSize),
max_old_generation_size_);
+ // The max executable size must be less than or equal to the max old
+ // generation size.
+ if (max_executable_size_ > max_old_generation_size_) {
+ max_executable_size_ = max_old_generation_size_;
+ }
+
if (FLAG_initial_old_space_size > 0) {
initial_old_generation_size_ = FLAG_initial_old_space_size * MB;
} else {
void Run() {
v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+ const intptr_t pageSizeMult =
+ v8::internal::Page::kPageSize / v8::internal::MB;
switch (testCase_) {
case SetResourceConstraints: {
- create_params.constraints.set_max_semi_space_size(1);
- create_params.constraints.set_max_old_space_size(4);
+ create_params.constraints.set_max_semi_space_size(1 * pageSizeMult);
+ create_params.constraints.set_max_old_space_size(4 * pageSizeMult);
break;
}
default:
UNINITIALIZED_TEST(OneByteArrayJoin) {
v8::Isolate::CreateParams create_params;
// Set heap limits.
- create_params.constraints.set_max_semi_space_size(1);
- create_params.constraints.set_max_old_space_size(6);
+ create_params.constraints.set_max_semi_space_size(1 * Page::kPageSize / MB);
+ create_params.constraints.set_max_old_space_size(6 * Page::kPageSize / MB);
create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
v8::Isolate* isolate = v8::Isolate::New(create_params);
isolate->Enter();