Commit 27a71e94 authored by Predrag Rudic's avatar Predrag Rudic Committed by Commit Bot

MIPS32: Configure heap for snapshot with maximum reserved memory.

MIPS32 doesn't have constraint for maximum code range or maximum PC
relative code range, and allocation of kMaxPCRelativeCodeRangeInMB
memory results in OOM failure from allocator.

This patch also skips verifying transitive builtins for 64-bit MIPS
because it doesn't have implemented pc-relative calls and jumps yet.

Change-Id: I7cad154827c2a9fd274901895a5a54c5ce176b03
Reviewed-on: https://chromium-review.googlesource.com/c/1414853Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarSigurd Schneider <sigurds@chromium.org>
Commit-Queue: Predrag Rudic <prudic@wavecomp.com>
Cr-Commit-Position: refs/heads/master@{#58927}
parent 61b217b1
......@@ -51,7 +51,8 @@ AssemblerOptions BuiltinAssemblerOptions(Isolate* isolate,
isolate->heap()->memory_allocator()->code_range();
bool pc_relative_calls_fit_in_code_range =
!code_range.is_empty() &&
code_range.size() <= kMaxPCRelativeCodeRangeInMB * MB;
std::ceil(static_cast<float>(code_range.size() / MB)) <=
kMaxPCRelativeCodeRangeInMB;
options.isolate_independent_code = true;
options.use_pc_relative_calls_and_jumps = pc_relative_calls_fit_in_code_range;
......
......@@ -1029,10 +1029,12 @@ void DebugEvaluate::VerifyTransitiveBuiltins(Isolate* isolate) {
}
}
CHECK(!failed);
#ifdef V8_TARGET_ARCH_PPC
#if defined(V8_TARGET_ARCH_PPC) || defined(V8_TARGET_ARCH_MIPS64)
// Isolate-independent builtin calls and jumps do not emit reloc infos
// on PPC. We try to avoid using PC relative code due to performance
// issue with especially older hardwares.
// MIPS64 doesn't have PC relative code currently.
// TODO(mips): Add PC relative code to MIPS64.
USE(sanity_check);
#else
CHECK(sanity_check);
......
......@@ -195,6 +195,11 @@ constexpr bool kRequiresCodeRange = false;
constexpr size_t kMaximalCodeRangeSize = 0 * MB;
constexpr size_t kMinimumCodeRangeSize = 0 * MB;
constexpr size_t kMinExpectedOSPageSize = 64 * KB; // OS page on PPC Linux
#elif V8_TARGET_ARCH_MIPS
constexpr bool kRequiresCodeRange = false;
constexpr size_t kMaximalCodeRangeSize = 2048LL * MB;
constexpr size_t kMinimumCodeRangeSize = 0 * MB;
constexpr size_t kMinExpectedOSPageSize = 4 * KB; // OS page.
#else
constexpr bool kRequiresCodeRange = false;
constexpr size_t kMaximalCodeRangeSize = 0 * MB;
......
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