Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
bf756bc
Use liberal vn for tls indirects
EgorBo Aug 1, 2022
c33bd4b
Merge branch 'main' of github.com:dotnet/runtime into main
EgorBo Aug 3, 2022
e9164de
Merge branch 'main' of github.com:dotnet/runtime into main
EgorBo Aug 3, 2022
24fc8a6
Initial impl
EgorBo Aug 4, 2022
75db099
Enable JitDisasm in Release
EgorBo Aug 4, 2022
0dfb332
Merge branch 'main' of github.com:dotnet/runtime into jit-disasm-release
EgorBo Aug 4, 2022
98a2a9d
Fix compilation errors
EgorBo Aug 4, 2022
3952560
Run jit-format
EgorBo Aug 4, 2022
c2d397a
Don't allocate instrDescDebugInfo when JitDisasm is not set
EgorBo Aug 4, 2022
f760723
fix build
EgorBo Aug 5, 2022
99c9254
clean up
EgorBo Aug 5, 2022
7fe3596
fix build
EgorBo Aug 5, 2022
4d776af
Apply Jakob's patch
EgorBo Aug 6, 2022
e95daa8
Remove some #ifdef DEBUG for displaying frame refs
jakobbotsch Aug 6, 2022
7255863
Fix alignment insertion assuming only emitForceNewIG can create new IGs
jakobbotsch Aug 6, 2022
be97773
Account for debug info when allocating IG buffers
jakobbotsch Aug 6, 2022
8f66d90
C++ify accessors
jakobbotsch Aug 6, 2022
611b9d2
Run jit-format
jakobbotsch Aug 6, 2022
adb7772
Fix a missing m_debugInfoSize add
jakobbotsch Aug 6, 2022
5e020ca
Couple of small cleanups
jakobbotsch Aug 6, 2022
9fa3367
Delete instrDesc constructors
jakobbotsch Aug 6, 2022
c0cb6da
Run jit-format
jakobbotsch Aug 6, 2022
8768b0e
Ensure alignment in inlineInstrDesc
jakobbotsch Aug 6, 2022
29f7c62
Update emitCheckAlignFitInCurIG
jakobbotsch Aug 6, 2022
6a1c872
Revert "Fix alignment insertion assuming only emitForceNewIG can crea…
jakobbotsch Aug 6, 2022
f266806
Oops
jakobbotsch Aug 6, 2022
829b019
Minor assertion nit
jakobbotsch Aug 6, 2022
13190b8
Update codegencommon.cpp
EgorBo Aug 8, 2022
b075a03
Tiny optimization
jakobbotsch Aug 8, 2022
d6759c2
Switch a couple of checks to m_debugInfoSize > 0
jakobbotsch Aug 8, 2022
00e754b
Move assert back
jakobbotsch Aug 8, 2022
318f275
Update emitarm64.cpp
EgorBo Aug 8, 2022
963596d
Add emitFirstInstrDesc and emitAdvanceInstrDesc
jakobbotsch Aug 9, 2022
840f26e
Fix function header
jakobbotsch Aug 9, 2022
4057d73
Fix build, fix bad refactor
jakobbotsch Aug 9, 2022
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
Prev Previous commit
Next Next commit
Don't allocate instrDescDebugInfo when JitDisasm is not set
  • Loading branch information
EgorBo committed Aug 4, 2022
commit c2d397a35bafea10c6bbfa7604503569598564eb
27 changes: 14 additions & 13 deletions src/coreclr/jit/emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1506,18 +1506,19 @@ void* emitter::emitAllocAnyInstr(size_t sz, emitAttr opsz)

emitInsCount++;

instrDescDebugInfo* info = (instrDescDebugInfo*)emitGetMem(sizeof(*info));

info->idNum = emitInsCount;
info->idSize = sz;
info->idVarRefOffs = 0;
info->idMemCookie = 0;
info->idFlags = GTF_EMPTY;
info->idFinallyCall = false;
info->idCatchRet = false;
info->idCallSig = nullptr;

id->idDebugOnlyInfo(info);
if (emitComp->opts.disAsm)
{
instrDescDebugInfo* info = (instrDescDebugInfo*)emitGetMem(sizeof(*info));
info->idNum = emitInsCount;
info->idSize = sz;
info->idVarRefOffs = 0;
info->idMemCookie = 0;
info->idFlags = GTF_EMPTY;
info->idFinallyCall = false;
info->idCatchRet = false;
info->idCallSig = nullptr;
id->idDebugOnlyInfo(info);
}

/* Store the size and handle the two special values
that indicate GCref and ByRef */
Expand Down Expand Up @@ -4259,12 +4260,12 @@ void emitter::emitRemoveJumpToNextInst()
emitDispIG(targetGroup, nullptr, false);
assert(jmp == id);
}
#endif // DEBUG

JITDUMP("IG%02u IN%04x is the last instruction in the group and jumps to the next instruction group "
"IG%02u %s, removing.\n",
jmpGroup->igNum, jmp->idDebugOnlyInfo()->idNum, targetGroup->igNum,
emitLabelString(targetGroup));
#endif // DEBUG

// Unlink the jump from emitJumpList while keeping the previousJmp the same.
if (previousJmp != nullptr)
Expand Down
26 changes: 7 additions & 19 deletions src/coreclr/jit/emit.h
Original file line number Diff line number Diff line change
Expand Up @@ -822,28 +822,19 @@ class emitter
CLANG_FORMAT_COMMENT_ANCHOR;

//
// This is the end of the 'small' instrDesc which is the same on all
// platforms (except 64-bit DEBUG which is a little bigger).
// Non-DEBUG sizes:
// x86/amd64/arm/arm64: 64 bits
// DEBUG sizes (includes one pointer):
// This is the end of the 'small' instrDesc which is the same on all platforms
// Sizes (includes one pointer):
// x86: 2 DWORDs, 96 bits
// amd64: 4 DWORDs, 128 bits
// arm: 3 DWORDs, 96 bits
// arm64: 4 DWORDs, 128 bits
// There should no padding or alignment issues on any platform or
// configuration (including DEBUG which has 1 extra pointer).
// There should no padding or alignment issues on any platform or configuration.
//
// If you add lots more fields that need to be cleared (such
// as various flags), you might need to update the body of
// emitter::emitAllocInstr() to clear them.

/*
If you add lots more fields that need to be cleared (such
as various flags), you might need to update the body of
emitter::emitAllocInstr() to clear them.
*/

#define SMALL_IDSC_DEBUG_EXTRA (sizeof(void*))

#define SMALL_IDSC_SIZE (8 + SMALL_IDSC_DEBUG_EXTRA)
#define SMALL_IDSC_SIZE (8 + sizeof(void*))

void checkSizes();

Expand Down Expand Up @@ -2688,10 +2679,7 @@ class emitter

inline void emitter::instrDesc::checkSizes()
{
#ifdef DEBUG
C_ASSERT(SMALL_IDSC_SIZE == (offsetof(instrDesc, _idDebugOnlyInfo) + sizeof(instrDescDebugInfo*)));
#endif
C_ASSERT(SMALL_IDSC_SIZE == offsetof(instrDesc, _idAddrUnion));
}

/*****************************************************************************
Expand Down
8 changes: 7 additions & 1 deletion src/coreclr/jit/emitarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4837,8 +4837,14 @@ void emitter::emitIns_Call(EmitCallType callType,
}
}
id->idDebugOnlyInfo()->idCallSig = sigInfo;
#endif
id->idDebugOnlyInfo()->idMemCookie = (size_t)methHnd; // method token
#else
if (emitComp->opts.disAsm)
{
id->idDebugOnlyInfo()->idMemCookie = (size_t)methHnd; // method token
}
#endif


#ifdef LATE_DISASM
if (addr != nullptr)
Expand Down
7 changes: 6 additions & 1 deletion src/coreclr/jit/emitarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8701,8 +8701,13 @@ void emitter::emitIns_Call(EmitCallType callType,
}
}
id->idDebugOnlyInfo()->idCallSig = sigInfo;
#endif
id->idDebugOnlyInfo()->idMemCookie = (size_t)methHnd; // method token
#else
if (emitComp->opts.disAsm)
{
id->idDebugOnlyInfo()->idMemCookie = (size_t)methHnd; // method token
}
#endif

#ifdef LATE_DISASM
if (addr != nullptr)
Expand Down
15 changes: 14 additions & 1 deletion src/coreclr/jit/emitxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4367,7 +4367,15 @@ void emitter::emitIns_IJ(emitAttr attr, regNumber reg, unsigned base)
id->idAddr()->iiaAddrMode.amBaseReg = REG_NA;
id->idAddr()->iiaAddrMode.amIndxReg = reg;
id->idAddr()->iiaAddrMode.amScale = emitter::OPSZP;

#ifdef DEBUG
id->idDebugOnlyInfo()->idMemCookie = base;
#else
if (emitComp->opts.disAsm)
{
id->idDebugOnlyInfo()->idMemCookie = base;
}
#endif

id->idCodeSize(sz);

Expand Down Expand Up @@ -7989,8 +7997,13 @@ void emitter::emitIns_Call(EmitCallType callType,

#ifdef DEBUG
id->idDebugOnlyInfo()->idCallSig = sigInfo;
#endif
id->idDebugOnlyInfo()->idMemCookie = (size_t)methHnd; // method token
#else
if (emitComp->opts.disAsm)
{
id->idDebugOnlyInfo()->idMemCookie = (size_t)methHnd; // method token
}
#endif

#ifdef LATE_DISASM
if (addr != nullptr)
Expand Down