From a9e56f4f36d70d16a956367133dda258c4f52bf4 Mon Sep 17 00:00:00 2001 From: hpayer Date: Thu, 18 May 2017 10:37:57 -0700 Subject: [PATCH] [heap] Remove max_executable_size resource constraint. BUG=chromium:716032 Review-Url: https://codereview.chromium.org/2890603007 Cr-Commit-Position: refs/heads/master@{#45400} --- include/v8.h | 8 ++++++-- src/api.cc | 9 +-------- src/flag-definitions.h | 1 - src/heap/heap.h | 10 ---------- 4 files changed, 7 insertions(+), 21 deletions(-) diff --git a/include/v8.h b/include/v8.h index 099dfb25b4..3ed2a4140c 100644 --- a/include/v8.h +++ b/include/v8.h @@ -5905,8 +5905,12 @@ class V8_EXPORT ResourceConstraints { void set_max_old_space_size(int limit_in_mb) { max_old_space_size_ = limit_in_mb; } - int max_executable_size() const { return max_executable_size_; } - void set_max_executable_size(int limit_in_mb) { + V8_DEPRECATE_SOON("max_executable_size_ is subsumed by max_old_space_size_", + int max_executable_size() const) { + return max_executable_size_; + } + V8_DEPRECATE_SOON("max_executable_size_ is subsumed by max_old_space_size_", + void set_max_executable_size(int limit_in_mb)) { max_executable_size_ = limit_in_mb; } uint32_t* stack_limit() const { return stack_limit_; } diff --git a/src/api.cc b/src/api.cc index 1e7253727a..87e6a4c4a4 100644 --- a/src/api.cc +++ b/src/api.cc @@ -813,7 +813,6 @@ Extension::Extension(const char* name, ResourceConstraints::ResourceConstraints() : max_semi_space_size_(0), max_old_space_size_(0), - max_executable_size_(0), stack_limit_(NULL), code_range_size_(0), max_zone_pool_size_(0) {} @@ -835,24 +834,20 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory, if (physical_memory <= low_limit) { set_max_semi_space_size(i::Heap::kMaxSemiSpaceSizeLowMemoryDevice); set_max_old_space_size(i::Heap::kMaxOldSpaceSizeLowMemoryDevice); - set_max_executable_size(i::Heap::kMaxExecutableSizeLowMemoryDevice); set_max_zone_pool_size(i::AccountingAllocator::kMaxPoolSizeLowMemoryDevice); } else if (physical_memory <= medium_limit) { set_max_semi_space_size(i::Heap::kMaxSemiSpaceSizeMediumMemoryDevice); set_max_old_space_size(i::Heap::kMaxOldSpaceSizeMediumMemoryDevice); - set_max_executable_size(i::Heap::kMaxExecutableSizeMediumMemoryDevice); set_max_zone_pool_size( i::AccountingAllocator::kMaxPoolSizeMediumMemoryDevice); } else if (physical_memory <= high_limit) { set_max_semi_space_size(i::Heap::kMaxSemiSpaceSizeHighMemoryDevice); set_max_old_space_size(i::Heap::kMaxOldSpaceSizeHighMemoryDevice); - set_max_executable_size(i::Heap::kMaxExecutableSizeHighMemoryDevice); set_max_zone_pool_size( i::AccountingAllocator::kMaxPoolSizeHighMemoryDevice); } else { set_max_semi_space_size(i::Heap::kMaxSemiSpaceSizeHugeMemoryDevice); set_max_old_space_size(i::Heap::kMaxOldSpaceSizeHugeMemoryDevice); - set_max_executable_size(i::Heap::kMaxExecutableSizeHugeMemoryDevice); set_max_zone_pool_size( i::AccountingAllocator::kMaxPoolSizeHugeMemoryDevice); } @@ -871,11 +866,9 @@ void SetResourceConstraints(i::Isolate* isolate, const ResourceConstraints& constraints) { int semi_space_size = constraints.max_semi_space_size(); int old_space_size = constraints.max_old_space_size(); - int max_executable_size = constraints.max_executable_size(); size_t code_range_size = constraints.code_range_size(); size_t max_pool_size = constraints.max_zone_pool_size(); - if (semi_space_size != 0 || old_space_size != 0 || - max_executable_size != 0 || code_range_size != 0) { + if (semi_space_size != 0 || old_space_size != 0 || code_range_size != 0) { isolate->heap()->ConfigureHeap(semi_space_size, old_space_size, code_range_size); } diff --git a/src/flag-definitions.h b/src/flag-definitions.h index d280847431..07ca43a72b 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h @@ -634,7 +634,6 @@ DEFINE_BOOL(experimental_new_space_growth_heuristic, false, "of their absolute value.") DEFINE_INT(max_old_space_size, 0, "max size of the old space (in Mbytes)") DEFINE_INT(initial_old_space_size, 0, "initial old space size (in Mbytes)") -DEFINE_INT(max_executable_size, 0, "max size of executable memory (in Mbytes)") DEFINE_BOOL(gc_global, false, "always perform global GCs") DEFINE_INT(gc_interval, -1, "garbage collect after allocations") DEFINE_INT(retain_maps_for_n_gc, 2, diff --git a/src/heap/heap.h b/src/heap/heap.h index 80dc5b5ff1..a1cb4d22be 100644 --- a/src/heap/heap.h +++ b/src/heap/heap.h @@ -627,16 +627,6 @@ class Heap { static const int kMaxOldSpaceSizeHighMemoryDevice = 512 * kPointerMultiplier; static const int kMaxOldSpaceSizeHugeMemoryDevice = 1024 * kPointerMultiplier; - // The executable size has to be a multiple of Page::kPageSize. - // Sizes are in MB. - static const int kMaxExecutableSizeLowMemoryDevice = 96 * kPointerMultiplier; - static const int kMaxExecutableSizeMediumMemoryDevice = - 192 * kPointerMultiplier; - static const int kMaxExecutableSizeHighMemoryDevice = - 256 * kPointerMultiplier; - static const int kMaxExecutableSizeHugeMemoryDevice = - 256 * kPointerMultiplier; - static const int kTraceRingBufferSize = 512; static const int kStacktraceBufferSize = 512;