mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 13:51:41 +00:00
Bug 1739683 - Fix code offset use in Wasm calls r=rhunt,lth
Differential Revision: https://phabricator.services.mozilla.com/D130527
This commit is contained in:
parent
3be98f74fd
commit
41cc09ff03
@ -7979,35 +7979,36 @@ void CodeGenerator::visitWasmCall(LWasmCall* lir) {
|
||||
|
||||
const wasm::CallSiteDesc& desc = mir->desc();
|
||||
const wasm::CalleeDesc& callee = mir->callee();
|
||||
CodeOffset retOffset;
|
||||
switch (callee.which()) {
|
||||
case wasm::CalleeDesc::Func:
|
||||
masm.call(desc, callee.funcIndex());
|
||||
retOffset = masm.call(desc, callee.funcIndex());
|
||||
reloadRegs = false;
|
||||
switchRealm = false;
|
||||
break;
|
||||
case wasm::CalleeDesc::Import:
|
||||
masm.wasmCallImport(desc, callee);
|
||||
retOffset = masm.wasmCallImport(desc, callee);
|
||||
break;
|
||||
case wasm::CalleeDesc::AsmJSTable:
|
||||
case wasm::CalleeDesc::WasmTable:
|
||||
masm.wasmCallIndirect(desc, callee, needsBoundsCheck);
|
||||
retOffset = masm.wasmCallIndirect(desc, callee, needsBoundsCheck);
|
||||
reloadRegs = switchRealm = callee.which() == wasm::CalleeDesc::WasmTable;
|
||||
break;
|
||||
case wasm::CalleeDesc::Builtin:
|
||||
masm.call(desc, callee.builtin());
|
||||
retOffset = masm.call(desc, callee.builtin());
|
||||
reloadRegs = false;
|
||||
switchRealm = false;
|
||||
break;
|
||||
case wasm::CalleeDesc::BuiltinInstanceMethod:
|
||||
masm.wasmCallBuiltinInstanceMethod(desc, mir->instanceArg(),
|
||||
callee.builtin(),
|
||||
mir->builtinMethodFailureMode());
|
||||
retOffset = masm.wasmCallBuiltinInstanceMethod(
|
||||
desc, mir->instanceArg(), callee.builtin(),
|
||||
mir->builtinMethodFailureMode());
|
||||
switchRealm = false;
|
||||
break;
|
||||
}
|
||||
|
||||
// Note the assembler offset for the associated LSafePoint.
|
||||
markSafepointAt(masm.currentOffset(), lir);
|
||||
markSafepointAt(retOffset.offset(), lir);
|
||||
|
||||
// Now that all the outbound in-memory args are on the stack, note the
|
||||
// required lower boundary point of the associated StackMap.
|
||||
|
Loading…
Reference in New Issue
Block a user