Description: mksnapshot uses too much memory on 32-bit mipsel
Author: Jérémy Lal <kapouer@melix.org>
Last-Update: 2020-06-03
Forwarded: https://bugs.chromium.org/p/v8/issues/detail?id=10586

This ensures that we reserve 500M instead of 2G range for codegen
ensures that qemu-mips can allocate such large ranges

Signed-off-by: Khem Raj <raj.khem@gmail.com>

--- a/deps/v8/src/common/globals.h
+++ b/deps/v8/src/common/globals.h
@@ -224,7 +224,7 @@ constexpr size_t kMinimumCodeRangeSize =
 constexpr size_t kMinExpectedOSPageSize = 64 * KB;  // OS page on PPC Linux
 #elif V8_TARGET_ARCH_MIPS
 constexpr bool kPlatformRequiresCodeRange = false;
-constexpr size_t kMaximalCodeRangeSize = 2048LL * MB;
+constexpr size_t kMaximalCodeRangeSize = 512 * MB;
 constexpr size_t kMinimumCodeRangeSize = 0 * MB;
 constexpr size_t kMinExpectedOSPageSize = 4 * KB;  // OS page.
 #else
--- a/deps/v8/src/codegen/mips/constants-mips.h
+++ b/deps/v8/src/codegen/mips/constants-mips.h
@@ -140,7 +140,7 @@ const uint32_t kLeastSignificantByteInIn
 namespace v8 {
 namespace internal {
 
-constexpr size_t kMaxPCRelativeCodeRangeInMB = 4096;
+constexpr size_t kMaxPCRelativeCodeRangeInMB = 1024;
 
 // -----------------------------------------------------------------------------
 // Registers and FPURegisters.
