Bug 1518210 - Wasm: Bounds checking support for x64. r=lth

x86_64 can re-use MacroAssembler-x86-shared for its wasmBoundsCheck, and so it
doesn't require any new assembler code.

It does require a small baseline compiler change to ensure that TlsData is
loaded if we are going to do a bounds check.

I tested this commit with a x64 try run and manually disabling WASM_HUGE_MEMORY.

Differential Revision: https://phabricator.services.mozilla.com/D41863

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ryan Hunt 2019-08-30 02:32:21 +00:00
parent 8e67053a0c
commit 21846c8c78
2 changed files with 4 additions and 10 deletions

View File

@ -5368,11 +5368,11 @@ class BaseCompiler final : public BaseCompilerInterface {
}
MOZ_MUST_USE bool needTlsForAccess(const AccessCheck& check) {
#if defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32) || \
defined(JS_CODEGEN_MIPS64)
return !check.omitBoundsCheck;
#elif defined(JS_CODEGEN_X86)
#if defined(JS_CODEGEN_X86)
return true;
#elif defined(JS_CODEGEN_ARM) || defined(JS_CODEGEN_MIPS32) || \
defined(JS_CODEGEN_MIPS64) || !defined(WASM_HUGE_MEMORY)
return !check.omitBoundsCheck;
#else
return false;
#endif

View File

@ -34,12 +34,6 @@ using namespace js::wasm;
using mozilla::IsPowerOfTwo;
using mozilla::MakeEnumeratedRange;
// We have only tested x64 with WASM_HUGE_MEMORY.
#if defined(JS_CODEGEN_X64) && !defined(WASM_HUGE_MEMORY)
# error "Not an expected configuration"
#endif
// We have only tested WASM_HUGE_MEMORY on x64 and arm64.
#if defined(WASM_HUGE_MEMORY)