Bug 1280411 - Wasm x64 doesn't know how to pass i64 constants, r=bbouvier

This commit is contained in:
Hannes Verschore 2016-06-21 13:52:11 +02:00
parent cb85a85a36
commit ecdad783a4
2 changed files with 9 additions and 1 deletions

View File

@ -393,6 +393,11 @@ if (hasI64()) {
(func (result i32) (call_import 0 (i64.const 0x123456789abcdef0)))
(export "" 0))`, imp)(), 42);
assertEq(wasmEvalText(`(module
(import "param" "" (param i64)(param i64)(param i64)(param i64)(param i64)(param i64)(param i64) (param i64) (result i32))
(func (result i32) (call_import 0 (i64.const 0x123456789abcdef0)(i64.const 0x123456789abcdef0)(i64.const 0x123456789abcdef0)(i64.const 0x123456789abcdef0)(i64.const 0x123456789abcdef0)(i64.const 0x123456789abcdef0)(i64.const 0x123456789abcdef0)(i64.const 0x123456789abcdef0)))
(export "" 0))`, imp)(), 42);
assertEqI64(wasmEvalText(`(module
(import "result" "" (param i32) (result i64))
(func (result i64) (call_import 0 (i32.const 3)))

View File

@ -274,7 +274,10 @@ CodeGeneratorX86Shared::visitAsmJSPassStackArg(LAsmJSPassStackArg* ins)
const MAsmJSPassStackArg* mir = ins->mir();
Address dst(StackPointer, mir->spOffset());
if (ins->arg()->isConstant()) {
masm.storePtr(ImmWord(ToInt32(ins->arg())), dst);
if (mir->input()->type() == MIRType::Int64)
masm.storePtr(ImmWord(ToInt64(ins->arg())), dst);
else
masm.storePtr(ImmWord(ToInt32(ins->arg())), dst);
} else {
if (ins->arg()->isGeneralReg()) {
masm.storePtr(ToRegister(ins->arg()), dst);