Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
squash! restore abi compat
  • Loading branch information
bnoordhuis committed Feb 21, 2018
commit a68a1dbb4c5ef4558579224b7b6c199205755aea
22 changes: 12 additions & 10 deletions deps/v8/include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -6124,13 +6124,13 @@ class V8_EXPORT ResourceConstraints {

// Returns the max semi-space size in MB.
V8_DEPRECATE_SOON("Use max_semi_space_size_in_kb()",
size_t max_semi_space_size()) {
return max_semi_space_size_in_kb_ / 1024;
int max_semi_space_size()) {
return static_cast<int>(max_semi_space_size_in_kb_ / 1024);
}

// Sets the max semi-space size in MB.
V8_DEPRECATE_SOON("Use set_max_semi_space_size_in_kb(size_t limit_in_kb)",
void set_max_semi_space_size(size_t limit_in_mb)) {
void set_max_semi_space_size(int limit_in_mb)) {
max_semi_space_size_in_kb_ = limit_in_mb * 1024;
}

Expand All @@ -6144,16 +6144,16 @@ class V8_EXPORT ResourceConstraints {
max_semi_space_size_in_kb_ = limit_in_kb;
}

size_t max_old_space_size() const { return max_old_space_size_; }
void set_max_old_space_size(size_t limit_in_mb) {
int max_old_space_size() const { return max_old_space_size_; }
void set_max_old_space_size(int limit_in_mb) {
max_old_space_size_ = limit_in_mb;
}
V8_DEPRECATE_SOON("max_executable_size_ is subsumed by max_old_space_size_",
size_t max_executable_size() const) {
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(size_t limit_in_mb)) {
void set_max_executable_size(int limit_in_mb)) {
max_executable_size_ = limit_in_mb;
}
uint32_t* stack_limit() const { return stack_limit_; }
Expand All @@ -6164,15 +6164,17 @@ class V8_EXPORT ResourceConstraints {
code_range_size_ = limit_in_mb;
}
size_t max_zone_pool_size() const { return max_zone_pool_size_; }
void set_max_zone_pool_size(size_t bytes) { max_zone_pool_size_ = bytes; }
void set_max_zone_pool_size(const size_t bytes) {
max_zone_pool_size_ = bytes;
}

private:
// max_semi_space_size_ is in KB
size_t max_semi_space_size_in_kb_;

// The remaining limits are in MB
size_t max_old_space_size_;
size_t max_executable_size_;
int max_old_space_size_;
int max_executable_size_;
uint32_t* stack_limit_;
size_t code_range_size_;
size_t max_zone_pool_size_;
Expand Down
4 changes: 3 additions & 1 deletion deps/v8/src/api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,9 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory,
void SetResourceConstraints(i::Isolate* isolate,
const ResourceConstraints& constraints) {
size_t semi_space_size = constraints.max_semi_space_size_in_kb();
size_t old_space_size = constraints.max_old_space_size();
size_t old_space_size =
static_cast<size_t>(
static_cast<unsigned int>(constraints.max_old_space_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 || code_range_size != 0) {
Expand Down