/// Try to fill a Baldrdash register, returning it if it was found.
Try to fill a Baldrdash register, returning it if it was found.
Try to fill a Baldrdash register returning it if it was found .
fn try_fill_baldrdash_reg(call_conv: isa::CallConv, param: &ir::AbiParam) -> Option<ABIArg> {
    if call_conv.extends_baldrdash() {
        match &param.purpose {
            &ir::ArgumentPurpose::VMContext => {
                // This is SpiderMonkey's `WasmTlsReg`.
                Some(ABIArg::Reg(
                    xreg(BALDRDASH_TLS_REG).to_real_reg(),
                    ir::types::I64,
                    param.extension,
                    param.purpose,
                ))
            }
            &ir::ArgumentPurpose::SignatureId => {
                // This is SpiderMonkey's `WasmTableCallSigReg`.
                Some(ABIArg::Reg(
                    xreg(BALDRDASH_SIG_REG).to_real_reg(),
                    ir::types::I64,
                    param.extension,
                    param.purpose,
                ))
            }
            &ir::ArgumentPurpose::CalleeTLS => {
                // This is SpiderMonkey's callee TLS slot in the extended frame of Wasm's ABI-2020.
                assert!(call_conv == isa::CallConv::Baldrdash2020);
                Some(ABIArg::Stack(
                    BALDRDASH_CALLEE_TLS_OFFSET,
                    ir::types::I64,
                    ir::ArgumentExtension::None,
                    param.purpose,
                ))
            }
            &ir::ArgumentPurpose::CallerTLS => {
                // This is SpiderMonkey's caller TLS slot in the extended frame of Wasm's ABI-2020.
                assert!(call_conv == isa::CallConv::Baldrdash2020);
                Some(ABIArg::Stack(
                    BALDRDASH_CALLER_TLS_OFFSET,
                    ir::types::I64,
                    ir::ArgumentExtension::None,
                    param.purpose,
                ))
            }
            _ => None,
        }
    } else {
        None
    }
}
fn try_fill_baldrdash_reg ( call_conv : isa :: CallConv , param : & ir :: AbiParam ) -> Option < ABIArg > { if call_conv . extends_baldrdash ( ) { match & param . purpose { & ir :: ArgumentPurpose :: VMContext => { // This is SpiderMonkey's `WasmTlsReg`. Some ( ABIArg :: Reg ( xreg ( BALDRDASH_TLS_REG ) . to_real_reg ( ) , ir :: types :: I64 , param . extension , param . purpose , ) ) } & ir :: ArgumentPurpose :: SignatureId => { // This is SpiderMonkey's `WasmTableCallSigReg`. Some ( ABIArg :: Reg ( xreg ( BALDRDASH_SIG_REG ) . to_real_reg ( ) , ir :: types :: I64 , param . extension , param . purpose , ) ) } & ir :: ArgumentPurpose :: CalleeTLS => { // This is SpiderMonkey's callee TLS slot in the extended frame of Wasm's ABI-2020. assert ! ( call_conv isa CallConv Baldrdash2020 ) ; Some ( ABIArg :: Stack ( BALDRDASH_CALLEE_TLS_OFFSET , ir :: types :: I64 , ir :: ArgumentExtension :: None , param . purpose , ) ) } & ir :: ArgumentPurpose :: CallerTLS => { // This is SpiderMonkey's caller TLS slot in the extended frame of Wasm's ABI-2020. assert ! ( call_conv isa CallConv Baldrdash2020 ) ; Some ( ABIArg :: Stack ( BALDRDASH_CALLER_TLS_OFFSET , ir :: types :: I64 , ir :: ArgumentExtension :: None , param . purpose , ) ) } _ => None , } } else { None } }
Try to fill a Baldrdash register, returning it if it was found.
Try to fill a Baldrdash register returning it if it was found .
call_conv
isa::CallConv
param
&ir::AbiParam