Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion src/coreclr/jit/codegenwasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3098,7 +3098,34 @@ void CodeGen::genEHCatchRet(BasicBlock* block)

void CodeGen::genStructReturn(GenTree* treeNode)
{
NYI_WASM("genStructReturn");
assert(treeNode->OperIs(GT_RETURN));

GenTree* op1 = treeNode->AsOp()->GetReturnValue();
GenTree* actualOp1 = op1->gtSkipReloadOrCopy();

const ReturnTypeDesc& retTypeDesc = m_compiler->compRetTypeDesc;
const unsigned regCount = retTypeDesc.GetReturnRegCount();

assert(regCount <= MAX_RET_REG_COUNT);

Comment thread
kg marked this conversation as resolved.
if (actualOp1->OperIsFieldList())
{
// Go through and consume the fields in the field list so liveness is correct.
unsigned regIndex = 0;
for (GenTreeFieldList::Use& use : actualOp1->AsFieldList()->Uses())
{
genConsumeReg(use.GetNode());
regIndex++;
}

// We should only have one field in the field list, and MAX_RET_REG_COUNT is 1 on Wasm.
assert(regIndex == regCount);
assert(regIndex == 1);

return;
}

NYI_WASM("genStructReturn non-fieldlist cases");
}

void CodeGen::genEmitGSCookieCheck(bool tailCall)
Expand Down
Loading