Bug 1403914 - define WASM_HUGE_MEMORY so it's visible to all. r=luke

--HG--
extra : source : 91513f75ccc24c8b6b49590b08661b649cf9e033
extra : amend_source : 84ad108db53efd3230df89ba576d5b45b86b240f
This commit is contained in:
Lars T Hansen 2017-09-28 15:18:33 +02:00
parent ca3c8d9064
commit ea026b35c8
3 changed files with 15 additions and 6 deletions

View File

@ -646,6 +646,13 @@ if CONFIG['NIGHTLY_BUILD']:
if CONFIG['NIGHTLY_BUILD']:
DEFINES['ENABLE_WASM_THREAD_OPS'] = True
# Wasm code should use WASM_HUGE_MEMORY instead of JS_CODEGEN_X64
# so that it is easy to use the huge-mapping optimization for other
# 64-bit platforms in the future.
if CONFIG['JS_CODEGEN_X64']:
DEFINES['WASM_HUGE_MEMORY'] = True
if CONFIG['MOZ_DEBUG'] or CONFIG['NIGHTLY_BUILD']:
DEFINES['JS_CACHEIR_SPEW'] = True

View File

@ -30,6 +30,13 @@ using namespace js::wasm;
using mozilla::IsPowerOfTwo;
// A sanity check. We have only tested WASM_HUGE_MEMORY on x64, and only tested
// x64 with WASM_HUGE_MEMORY.
#if defined(WASM_HUGE_MEMORY) != defined(JS_CODEGEN_X64)
# error "Not an expected configuration"
#endif
void
Val::writePayload(uint8_t* dst) const
{

View File

@ -1650,12 +1650,7 @@ static const unsigned PageSize = 64 * 1024;
static const unsigned MaxMemoryAccessSize = sizeof(Val);
#ifdef JS_CODEGEN_X64
// All other code should use WASM_HUGE_MEMORY instead of JS_CODEGEN_X64 so that
// it is easy to use the huge-mapping optimization for other 64-bit platforms in
// the future.
# define WASM_HUGE_MEMORY
#ifdef WASM_HUGE_MEMORY
// On WASM_HUGE_MEMORY platforms, every asm.js or WebAssembly memory
// unconditionally allocates a huge region of virtual memory of size