Skip to content

Commit 188630b

Browse files
psmarshalljasnell
authored andcommitted
v8: backport a9e56f4f36d from upstream v8
Because 5.8 still had other uses of the removed flag, there are some extra changes in Heap::ConfigureHeap and api.cc:SetResourceConstraints. Original commit message: [heap] Remove max_executable_size resource constraint. BUG=chromium:716032 Review-Url: https://codereview.chromium.org/2890603007 Cr-Commit-Position: refs/heads/master@{#45400} PR-URL: #13217 Reviewed-By: Franziska Hinkelmann <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 0f3bfaf commit 188630b

File tree

5 files changed

+8
-25
lines changed

5 files changed

+8
-25
lines changed

deps/v8/include/v8.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -5723,8 +5723,12 @@ class V8_EXPORT ResourceConstraints {
57235723
void set_max_old_space_size(int limit_in_mb) {
57245724
max_old_space_size_ = limit_in_mb;
57255725
}
5726-
int max_executable_size() const { return max_executable_size_; }
5727-
void set_max_executable_size(int limit_in_mb) {
5726+
V8_DEPRECATE_SOON("max_executable_size_ is subsumed by max_old_space_size_",
5727+
int max_executable_size() const) {
5728+
return max_executable_size_;
5729+
}
5730+
V8_DEPRECATE_SOON("max_executable_size_ is subsumed by max_old_space_size_",
5731+
void set_max_executable_size(int limit_in_mb)) {
57285732
max_executable_size_ = limit_in_mb;
57295733
}
57305734
uint32_t* stack_limit() const { return stack_limit_; }

deps/v8/src/api.cc

+2-9
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,6 @@ Extension::Extension(const char* name,
798798
ResourceConstraints::ResourceConstraints()
799799
: max_semi_space_size_(0),
800800
max_old_space_size_(0),
801-
max_executable_size_(0),
802801
stack_limit_(NULL),
803802
code_range_size_(0),
804803
max_zone_pool_size_(0) {}
@@ -820,24 +819,20 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory,
820819
if (physical_memory <= low_limit) {
821820
set_max_semi_space_size(i::Heap::kMaxSemiSpaceSizeLowMemoryDevice);
822821
set_max_old_space_size(i::Heap::kMaxOldSpaceSizeLowMemoryDevice);
823-
set_max_executable_size(i::Heap::kMaxExecutableSizeLowMemoryDevice);
824822
set_max_zone_pool_size(i::AccountingAllocator::kMaxPoolSizeLowMemoryDevice);
825823
} else if (physical_memory <= medium_limit) {
826824
set_max_semi_space_size(i::Heap::kMaxSemiSpaceSizeMediumMemoryDevice);
827825
set_max_old_space_size(i::Heap::kMaxOldSpaceSizeMediumMemoryDevice);
828-
set_max_executable_size(i::Heap::kMaxExecutableSizeMediumMemoryDevice);
829826
set_max_zone_pool_size(
830827
i::AccountingAllocator::kMaxPoolSizeMediumMemoryDevice);
831828
} else if (physical_memory <= high_limit) {
832829
set_max_semi_space_size(i::Heap::kMaxSemiSpaceSizeHighMemoryDevice);
833830
set_max_old_space_size(i::Heap::kMaxOldSpaceSizeHighMemoryDevice);
834-
set_max_executable_size(i::Heap::kMaxExecutableSizeHighMemoryDevice);
835831
set_max_zone_pool_size(
836832
i::AccountingAllocator::kMaxPoolSizeHighMemoryDevice);
837833
} else {
838834
set_max_semi_space_size(i::Heap::kMaxSemiSpaceSizeHugeMemoryDevice);
839835
set_max_old_space_size(i::Heap::kMaxOldSpaceSizeHugeMemoryDevice);
840-
set_max_executable_size(i::Heap::kMaxExecutableSizeHugeMemoryDevice);
841836
set_max_zone_pool_size(
842837
i::AccountingAllocator::kMaxPoolSizeHugeMemoryDevice);
843838
}
@@ -856,13 +851,11 @@ void SetResourceConstraints(i::Isolate* isolate,
856851
const ResourceConstraints& constraints) {
857852
int semi_space_size = constraints.max_semi_space_size();
858853
int old_space_size = constraints.max_old_space_size();
859-
int max_executable_size = constraints.max_executable_size();
860854
size_t code_range_size = constraints.code_range_size();
861855
size_t max_pool_size = constraints.max_zone_pool_size();
862-
if (semi_space_size != 0 || old_space_size != 0 ||
863-
max_executable_size != 0 || code_range_size != 0) {
856+
if (semi_space_size != 0 || old_space_size != 0 || code_range_size != 0) {
864857
isolate->heap()->ConfigureHeap(semi_space_size, old_space_size,
865-
max_executable_size, code_range_size);
858+
0 /*max_executable_size*/, code_range_size);
866859
}
867860
isolate->allocator()->ConfigureSegmentPool(max_pool_size);
868861

deps/v8/src/flag-definitions.h

-1
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,6 @@ DEFINE_BOOL(experimental_new_space_growth_heuristic, false,
604604
"of their absolute value.")
605605
DEFINE_INT(max_old_space_size, 0, "max size of the old space (in Mbytes)")
606606
DEFINE_INT(initial_old_space_size, 0, "initial old space size (in Mbytes)")
607-
DEFINE_INT(max_executable_size, 0, "max size of executable memory (in Mbytes)")
608607
DEFINE_BOOL(gc_global, false, "always perform global GCs")
609608
DEFINE_INT(gc_interval, -1, "garbage collect after <n> allocations")
610609
DEFINE_INT(retain_maps_for_n_gc, 2,

deps/v8/src/heap/heap.cc

-3
Original file line numberDiff line numberDiff line change
@@ -5077,9 +5077,6 @@ bool Heap::ConfigureHeap(size_t max_semi_space_size, size_t max_old_space_size,
50775077
max_old_generation_size_ =
50785078
static_cast<size_t>(FLAG_max_old_space_size) * MB;
50795079
}
5080-
if (FLAG_max_executable_size > 0) {
5081-
max_executable_size_ = static_cast<size_t>(FLAG_max_executable_size) * MB;
5082-
}
50835080

50845081
if (Page::kPageSize > MB) {
50855082
max_semi_space_size_ = ROUND_UP(max_semi_space_size_, Page::kPageSize);

deps/v8/src/heap/heap.h

-10
Original file line numberDiff line numberDiff line change
@@ -614,16 +614,6 @@ class Heap {
614614
static const int kMaxOldSpaceSizeHighMemoryDevice = 512 * kPointerMultiplier;
615615
static const int kMaxOldSpaceSizeHugeMemoryDevice = 1024 * kPointerMultiplier;
616616

617-
// The executable size has to be a multiple of Page::kPageSize.
618-
// Sizes are in MB.
619-
static const int kMaxExecutableSizeLowMemoryDevice = 96 * kPointerMultiplier;
620-
static const int kMaxExecutableSizeMediumMemoryDevice =
621-
192 * kPointerMultiplier;
622-
static const int kMaxExecutableSizeHighMemoryDevice =
623-
256 * kPointerMultiplier;
624-
static const int kMaxExecutableSizeHugeMemoryDevice =
625-
256 * kPointerMultiplier;
626-
627617
static const int kTraceRingBufferSize = 512;
628618
static const int kStacktraceBufferSize = 512;
629619

0 commit comments

Comments
 (0)