Commit ec73d3db authored by palfia@homejinni.com's avatar palfia@homejinni.com

Adjust memory limits.

- Introduce new constant: kBootCodeSizeMultiplier to handle the code size differences across the platforms.

- Increase memory limits due to larger code size on MIPS.

BUG=
R=danno@chromium.org, plind44@gmail.com

Review URL: https://codereview.chromium.org/234153002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20825 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 91618cf1
......@@ -123,15 +123,20 @@ class FullCodeGenerator: public AstVisitor {
// Platform-specific code size multiplier.
#if V8_TARGET_ARCH_IA32
static const int kCodeSizeMultiplier = 100;
static const int kBootCodeSizeMultiplier = 100;
#elif V8_TARGET_ARCH_X64
static const int kCodeSizeMultiplier = 162;
static const int kBootCodeSizeMultiplier = 140;
#elif V8_TARGET_ARCH_ARM
static const int kCodeSizeMultiplier = 142;
static const int kBootCodeSizeMultiplier = 110;
#elif V8_TARGET_ARCH_ARM64
// TODO(all): Copied ARM value. Check this is sensible for ARM64.
static const int kCodeSizeMultiplier = 142;
static const int kBootCodeSizeMultiplier = 110;
#elif V8_TARGET_ARCH_MIPS
static const int kCodeSizeMultiplier = 142;
static const int kBootCodeSizeMultiplier = 120;
#else
#error Unsupported target architecture.
#endif
......
......@@ -27,6 +27,7 @@
#include "v8.h"
#include "full-codegen.h"
#include "macro-assembler.h"
#include "mark-compact.h"
#include "msan.h"
......@@ -1083,7 +1084,7 @@ intptr_t PagedSpace::SizeOfFirstPage() {
// upgraded to handle small pages.
size = AreaSize();
} else {
size = 480 * KB;
size = 480 * KB * FullCodeGenerator::kBootCodeSizeMultiplier / 100;
}
break;
default:
......
......@@ -39,6 +39,7 @@
#include "v8.h"
#include "full-codegen.h"
#include "global-handles.h"
#include "snapshot.h"
#include "cctest.h"
......@@ -496,18 +497,12 @@ TEST(BootUpMemoryUse) {
CcTest::InitializeVM();
intptr_t delta = MemoryInUse() - initial_memory;
printf("delta: %" V8_PTR_PREFIX "d kB\n", delta / 1024);
if (sizeof(initial_memory) == 8) { // 64-bit.
if (v8::internal::Snapshot::IsEnabled()) {
CHECK_LE(delta, 4100 * 1024);
} else {
CHECK_LE(delta, 4600 * 1024);
}
} else { // 32-bit.
if (v8::internal::Snapshot::IsEnabled()) {
CHECK_LE(delta, 3100 * 1024);
} else {
CHECK_LE(delta, 3450 * 1024);
}
if (v8::internal::Snapshot::IsEnabled()) {
CHECK_LE(delta,
3000 * 1024 * FullCodeGenerator::kBootCodeSizeMultiplier / 100);
} else {
CHECK_LE(delta,
3300 * 1024 * FullCodeGenerator::kBootCodeSizeMultiplier / 100);
}
}
}
......
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