Skip to content

Commit 61b61df

Browse files
psmarshalladdaleax
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 e513c3d commit 61b61df

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
@@ -5900,8 +5900,12 @@ class V8_EXPORT ResourceConstraints {
59005900
void set_max_old_space_size(int limit_in_mb) {
59015901
max_old_space_size_ = limit_in_mb;
59025902
}
5903-
int max_executable_size() const { return max_executable_size_; }
5904-
void set_max_executable_size(int limit_in_mb) {
5903+
V8_DEPRECATE_SOON("max_executable_size_ is subsumed by max_old_space_size_",
5904+
int max_executable_size() const) {
5905+
return max_executable_size_;
5906+
}
5907+
V8_DEPRECATE_SOON("max_executable_size_ is subsumed by max_old_space_size_",
5908+
void set_max_executable_size(int limit_in_mb)) {
59055909
max_executable_size_ = limit_in_mb;
59065910
}
59075911
uint32_t* stack_limit() const { return stack_limit_; }

deps/v8/src/api.cc

+2-9
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,6 @@ Extension::Extension(const char* name,
810810
ResourceConstraints::ResourceConstraints()
811811
: max_semi_space_size_(0),
812812
max_old_space_size_(0),
813-
max_executable_size_(0),
814813
stack_limit_(NULL),
815814
code_range_size_(0),
816815
max_zone_pool_size_(0) {}
@@ -832,24 +831,20 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory,
832831
if (physical_memory <= low_limit) {
833832
set_max_semi_space_size(i::Heap::kMaxSemiSpaceSizeLowMemoryDevice);
834833
set_max_old_space_size(i::Heap::kMaxOldSpaceSizeLowMemoryDevice);
835-
set_max_executable_size(i::Heap::kMaxExecutableSizeLowMemoryDevice);
836834
set_max_zone_pool_size(i::AccountingAllocator::kMaxPoolSizeLowMemoryDevice);
837835
} else if (physical_memory <= medium_limit) {
838836
set_max_semi_space_size(i::Heap::kMaxSemiSpaceSizeMediumMemoryDevice);
839837
set_max_old_space_size(i::Heap::kMaxOldSpaceSizeMediumMemoryDevice);
840-
set_max_executable_size(i::Heap::kMaxExecutableSizeMediumMemoryDevice);
841838
set_max_zone_pool_size(
842839
i::AccountingAllocator::kMaxPoolSizeMediumMemoryDevice);
843840
} else if (physical_memory <= high_limit) {
844841
set_max_semi_space_size(i::Heap::kMaxSemiSpaceSizeHighMemoryDevice);
845842
set_max_old_space_size(i::Heap::kMaxOldSpaceSizeHighMemoryDevice);
846-
set_max_executable_size(i::Heap::kMaxExecutableSizeHighMemoryDevice);
847843
set_max_zone_pool_size(
848844
i::AccountingAllocator::kMaxPoolSizeHighMemoryDevice);
849845
} else {
850846
set_max_semi_space_size(i::Heap::kMaxSemiSpaceSizeHugeMemoryDevice);
851847
set_max_old_space_size(i::Heap::kMaxOldSpaceSizeHugeMemoryDevice);
852-
set_max_executable_size(i::Heap::kMaxExecutableSizeHugeMemoryDevice);
853848
set_max_zone_pool_size(
854849
i::AccountingAllocator::kMaxPoolSizeHugeMemoryDevice);
855850
}
@@ -868,13 +863,11 @@ void SetResourceConstraints(i::Isolate* isolate,
868863
const ResourceConstraints& constraints) {
869864
int semi_space_size = constraints.max_semi_space_size();
870865
int old_space_size = constraints.max_old_space_size();
871-
int max_executable_size = constraints.max_executable_size();
872866
size_t code_range_size = constraints.code_range_size();
873867
size_t max_pool_size = constraints.max_zone_pool_size();
874-
if (semi_space_size != 0 || old_space_size != 0 ||
875-
max_executable_size != 0 || code_range_size != 0) {
868+
if (semi_space_size != 0 || old_space_size != 0 || code_range_size != 0) {
876869
isolate->heap()->ConfigureHeap(semi_space_size, old_space_size,
877-
max_executable_size, code_range_size);
870+
0 /*max_executable_size*/, code_range_size);
878871
}
879872
isolate->allocator()->ConfigureSegmentPool(max_pool_size);
880873

deps/v8/src/flag-definitions.h

-1
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,6 @@ DEFINE_BOOL(experimental_new_space_growth_heuristic, false,
625625
"of their absolute value.")
626626
DEFINE_INT(max_old_space_size, 0, "max size of the old space (in Mbytes)")
627627
DEFINE_INT(initial_old_space_size, 0, "initial old space size (in Mbytes)")
628-
DEFINE_INT(max_executable_size, 0, "max size of executable memory (in Mbytes)")
629628
DEFINE_BOOL(gc_global, false, "always perform global GCs")
630629
DEFINE_INT(gc_interval, -1, "garbage collect after <n> allocations")
631630
DEFINE_INT(retain_maps_for_n_gc, 2,

deps/v8/src/heap/heap.cc

-3
Original file line numberDiff line numberDiff line change
@@ -5085,9 +5085,6 @@ bool Heap::ConfigureHeap(size_t max_semi_space_size, size_t max_old_space_size,
50855085
max_old_generation_size_ =
50865086
static_cast<size_t>(FLAG_max_old_space_size) * MB;
50875087
}
5088-
if (FLAG_max_executable_size > 0) {
5089-
max_executable_size_ = static_cast<size_t>(FLAG_max_executable_size) * MB;
5090-
}
50915088

50925089
if (Page::kPageSize > MB) {
50935090
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
@@ -609,16 +609,6 @@ class Heap {
609609
static const int kMaxOldSpaceSizeHighMemoryDevice = 512 * kPointerMultiplier;
610610
static const int kMaxOldSpaceSizeHugeMemoryDevice = 1024 * kPointerMultiplier;
611611

612-
// The executable size has to be a multiple of Page::kPageSize.
613-
// Sizes are in MB.
614-
static const int kMaxExecutableSizeLowMemoryDevice = 96 * kPointerMultiplier;
615-
static const int kMaxExecutableSizeMediumMemoryDevice =
616-
192 * kPointerMultiplier;
617-
static const int kMaxExecutableSizeHighMemoryDevice =
618-
256 * kPointerMultiplier;
619-
static const int kMaxExecutableSizeHugeMemoryDevice =
620-
256 * kPointerMultiplier;
621-
622612
static const int kTraceRingBufferSize = 512;
623613
static const int kStacktraceBufferSize = 512;
624614

0 commit comments

Comments
 (0)