Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2519,6 +2519,7 @@ bool CodeGenInterface::genUseOptimizedWriteBarriers(GenTreeStoreInd* store)
return false;
#endif
}
#endif // !TARGET_WASM

//----------------------------------------------------------------------
// genWriteBarrierHelperForWriteBarrierForm: Given a write barrier form
Expand Down Expand Up @@ -2555,6 +2556,8 @@ CorInfoHelpFunc CodeGenInterface::genWriteBarrierHelperForWriteBarrierForm(GCInf
}
}

#if !defined(TARGET_WASM)

// -----------------------------------------------------------------------------
// genGetGSCookieTempRegs:
// Get a mask of registers to use for the GS cookie check generated in a
Expand Down Expand Up @@ -2603,6 +2606,8 @@ regMaskTP CodeGenInterface::genGetGSCookieTempRegs(bool tailCall)
#endif
}

#endif // !defined(TARGET_WASM)

//----------------------------------------------------------------------
// genGCWriteBarrier: Generate a write barrier for a node.
//
Expand Down Expand Up @@ -2688,6 +2693,8 @@ void CodeGen::genGCWriteBarrier(GenTreeStoreInd* store, GCInfo::WriteBarrierForm
EA_PTRSIZE); // retSize
}

#ifndef TARGET_WASM

/*
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Expand Down
17 changes: 8 additions & 9 deletions src/coreclr/jit/codegenwasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1375,18 +1375,18 @@ void CodeGen::genCodeForStoreInd(GenTreeStoreInd* tree)
GenTree* data = tree->Data();
GenTree* addr = tree->Addr();

// We must consume the operands in the proper execution order,
// so that liveness is updated appropriately.
genConsumeAddress(addr);
genConsumeRegs(data);

GCInfo::WriteBarrierForm writeBarrierForm = gcInfo.gcIsWriteBarrierCandidate(tree);
if (writeBarrierForm != GCInfo::WBF_NoBarrier)
{
NYI_WASM("write barriers in StoreInd");
genGCWriteBarrier(tree, writeBarrierForm);
}
else // A normal store, not a WriteBarrier store
{
// We must consume the operands in the proper execution order,
// so that liveness is updated appropriately.
genConsumeAddress(addr);
genConsumeRegs(data);

var_types type = tree->TypeGet();
instruction ins = ins_Store(type);

Expand Down Expand Up @@ -1498,13 +1498,12 @@ void CodeGen::genCallInstruction(GenTreeCall* call)

if (call->IsHelperCall())
{
NYI_WASM("Call helper statically without indirection cell");
assert(!call->IsFastTailCall());
CorInfoHelpFunc helperNum = m_compiler->eeGetHelperNum(params.methHnd);
noway_assert(helperNum != CORINFO_HELP_UNDEF);

CORINFO_CONST_LOOKUP helperLookup = m_compiler->compGetHelperFtn(helperNum);
params.addr = helperLookup.addr;
assert(helperLookup.accessType == IAT_VALUE);
params.addr = helperLookup.addr;
}
else
{
Expand Down
4 changes: 3 additions & 1 deletion src/coreclr/jit/emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4525,8 +4525,10 @@ void emitter::emitRecomputeIGoffsets()
//
void emitter::emitDispCommentForHandle(size_t handle, size_t cookie, GenTreeFlags flag) const
{
#ifdef TARGET_XARCH
#if defined(TARGET_XARCH)
const char* commentPrefix = " ;";
#elif defined(TARGET_WASM)
const char* commentPrefix = " ;;";
#else
const char* commentPrefix = " //";
#endif
Expand Down
12 changes: 11 additions & 1 deletion src/coreclr/jit/emitwasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ void emitter::emitIns_Call(const EmitCallParams& params)
{
INDEBUG(id->idDebugOnlyInfo()->idCallSig = params.sigInfo);
id->idDebugOnlyInfo()->idMemCookie = (size_t)params.methHnd; // method token
id->idDebugOnlyInfo()->idFlags = GTF_ICON_METHOD_HDL;
}

dispIns(id);
Expand Down Expand Up @@ -685,14 +686,21 @@ void emitter::emitDispIns(
BasicBlock* const targetBlock = id->idDebugOnlyInfo()->idTargetBlock;
if (targetBlock != nullptr)
{
printf(" ;; ");
printf(" ;;");
insGroup* const targetGroup = (insGroup*)emitCodeGetCookie(targetBlock);
assert(targetGroup != nullptr);
emitPrintLabel(targetGroup);
}
}
};

auto dispHandleIfAny = [this, id]() {
if (m_debugInfoSize > 0)
{
emitDispCommentForHandle(id->idDebugOnlyInfo()->idMemCookie, 0, id->idDebugOnlyInfo()->idFlags);
}
};

// The reference for the following style of display is wasm-objdump output.
//
switch (fmt)
Expand All @@ -707,13 +715,15 @@ void emitter::emitDispIns(
cnsval_ssize_t imm = emitGetInsSC(id);
printf(" %llu", (uint64_t)imm);
dispJumpTargetIfAny();
dispHandleIfAny();
}
break;

case IF_CALL_INDIRECT:
{
cnsval_ssize_t imm = emitGetInsSC(id);
printf(" %llu 0", (uint64_t)imm);
dispHandleIfAny();
}
break;

Expand Down
Loading