Bug 1279248 - Part 27: Implement the 64bit variant of WasmLoadGlobalVar and WasmStoreGlobalVar on x86, r=bbouvier

This commit is contained in:
Hannes Verschore 2016-07-29 16:53:48 +02:00
parent e0af135939
commit ddb441b186
2 changed files with 30 additions and 0 deletions

View File

@ -1015,6 +1015,20 @@ CodeGeneratorX86::visitWasmLoadGlobalVar(LWasmLoadGlobalVar* ins)
masm.append(wasm::GlobalAccess(label, mir->globalDataOffset()));
}
void
CodeGeneratorX86::visitWasmLoadGlobalVarI64(LWasmLoadGlobalVarI64* ins)
{
MWasmLoadGlobalVar* mir = ins->mir();
MOZ_ASSERT(mir->type() == MIRType::Int64);
Register64 output = ToOutRegister64(ins);
CodeOffset labelLow = masm.movlWithPatch(PatchedAbsoluteAddress(), output.low);
masm.append(wasm::GlobalAccess(labelLow, mir->globalDataOffset() + INT64LOW_OFFSET));
CodeOffset labelHigh = masm.movlWithPatch(PatchedAbsoluteAddress(), output.high);
masm.append(wasm::GlobalAccess(labelHigh, mir->globalDataOffset() + INT64HIGH_OFFSET));
}
void
CodeGeneratorX86::visitWasmStoreGlobalVar(LWasmStoreGlobalVar* ins)
{
@ -1049,6 +1063,20 @@ CodeGeneratorX86::visitWasmStoreGlobalVar(LWasmStoreGlobalVar* ins)
masm.append(wasm::GlobalAccess(label, mir->globalDataOffset()));
}
void
CodeGeneratorX86::visitWasmStoreGlobalVarI64(LWasmStoreGlobalVarI64* ins)
{
MWasmStoreGlobalVar* mir = ins->mir();
MOZ_ASSERT(mir->value()->type() == MIRType::Int64);
Register64 input = ToRegister64(ins->getInt64Operand(LWasmStoreGlobalVarI64::InputIndex));
CodeOffset labelLow = masm.movlWithPatch(input.low, PatchedAbsoluteAddress());
masm.append(wasm::GlobalAccess(labelLow, mir->globalDataOffset() + INT64LOW_OFFSET));
CodeOffset labelHigh = masm.movlWithPatch(input.high, PatchedAbsoluteAddress());
masm.append(wasm::GlobalAccess(labelHigh, mir->globalDataOffset() + INT64HIGH_OFFSET));
}
namespace js {
namespace jit {

View File

@ -72,7 +72,9 @@ class CodeGeneratorX86 : public CodeGeneratorX86Shared
void visitWasmStore(LWasmStore* ins);
void visitWasmStoreI64(LWasmStoreI64* ins);
void visitWasmLoadGlobalVar(LWasmLoadGlobalVar* ins);
void visitWasmLoadGlobalVarI64(LWasmLoadGlobalVarI64* ins);
void visitWasmStoreGlobalVar(LWasmStoreGlobalVar* ins);
void visitWasmStoreGlobalVarI64(LWasmStoreGlobalVarI64* ins);
void visitAsmJSLoadHeap(LAsmJSLoadHeap* ins);
void visitAsmJSStoreHeap(LAsmJSStoreHeap* ins);
void visitAsmJSCompareExchangeHeap(LAsmJSCompareExchangeHeap* ins);