Commit 13d69de0 authored by Sigurd Schneider's avatar Sigurd Schneider Committed by Commit Bot

[mksnapshot] Ensure valid code range if kMaximalCodeRangeSize is 0

kMaximalCodeRangeSize can be zero to indicate no limit, which was
misinterpreted by mksnapshot.

Bug: v8:6666
Change-Id: I512412a5ef866c0595654aa78c6761bc00b82c56
Reviewed-on: https://chromium-review.googlesource.com/1140057Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54486}
parent abab9fbb
......@@ -393,8 +393,11 @@ int main(int argc, char** argv) {
// Set code range such that relative jumps for builtins to
// builtin calls in the snapshot are possible.
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate);
size_t code_range_size = std::min(i::kMaximalCodeRangeSize / i::MB,
i::kMaxPCRelativeCodeRangeInMB);
size_t code_range_size =
i::kMaximalCodeRangeSize == 0
? i::kMaxPCRelativeCodeRangeInMB
: std::min(i::kMaximalCodeRangeSize / i::MB,
i::kMaxPCRelativeCodeRangeInMB);
i_isolate->heap()->ConfigureHeap(0, 0, code_range_size);
}
v8::SnapshotCreator snapshot_creator(isolate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment