diff options
author | Brian Sullivan <briansul@microsoft.com> | 2017-10-20 11:23:41 -0700 |
---|---|---|
committer | Brian Sullivan <briansul@microsoft.com> | 2017-10-24 10:38:36 -0700 |
commit | b5a2484a9c1dbc751f77fe1934149c78d7f0ffc1 (patch) | |
tree | 6ebda585cc2a7cbf8bb8e56d78e730b07415ec15 | |
parent | f8d6405c8e0680a1184dc07123aeb4abe62e9e87 (diff) | |
download | coreclr-b5a2484a9c1dbc751f77fe1934149c78d7f0ffc1.tar.gz coreclr-b5a2484a9c1dbc751f77fe1934149c78d7f0ffc1.tar.bz2 coreclr-b5a2484a9c1dbc751f77fe1934149c78d7f0ffc1.zip |
Cleanup unused emitter arguments
Removed unused idClsCookie from struct instrDescDebugInfo
Cleaned up several ifdefs
-rw-r--r-- | src/jit/emit.cpp | 5 | ||||
-rw-r--r-- | src/jit/emit.h | 13 | ||||
-rw-r--r-- | src/jit/emitarm.cpp | 28 | ||||
-rw-r--r-- | src/jit/emitarm.h | 9 | ||||
-rw-r--r-- | src/jit/emitarm64.cpp | 25 | ||||
-rw-r--r-- | src/jit/emitarm64.h | 9 | ||||
-rw-r--r-- | src/jit/emitxarch.cpp | 52 | ||||
-rw-r--r-- | src/jit/emitxarch.h | 19 |
8 files changed, 35 insertions, 125 deletions
diff --git a/src/jit/emit.cpp b/src/jit/emit.cpp index 432d16deea..31ef44d529 100644 --- a/src/jit/emit.cpp +++ b/src/jit/emit.cpp @@ -1337,7 +1337,7 @@ void* emitter::emitAllocInstr(size_t sz, emitAttr opsz) emitInsCount++; -#if defined(DEBUG) || defined(LATE_DISASM) +#if defined(DEBUG) /* In debug mode we clear/set some additional fields */ instrDescDebugInfo* info = (instrDescDebugInfo*)emitGetMem(sizeof(*info)); @@ -1346,7 +1346,6 @@ void* emitter::emitAllocInstr(size_t sz, emitAttr opsz) info->idSize = sz; info->idVarRefOffs = 0; info->idMemCookie = 0; - info->idClsCookie = nullptr; #ifdef TRANSLATE_PDB info->idilStart = emitInstrDescILBase; #endif @@ -1356,7 +1355,7 @@ void* emitter::emitAllocInstr(size_t sz, emitAttr opsz) id->idDebugOnlyInfo(info); -#endif // defined(DEBUG) || defined(LATE_DISASM) +#endif // defined(DEBUG) /* Store the size and handle the two special values that indicate GCref and ByRef */ diff --git a/src/jit/emit.h b/src/jit/emit.h index 63243f4d0a..c2b5281861 100644 --- a/src/jit/emit.h +++ b/src/jit/emit.h @@ -530,7 +530,7 @@ protected: int amDisp : AM_DISP_BITS; }; -#if defined(DEBUG) || defined(LATE_DISASM) // LATE_DISASM needs the idMemCookie on calls to display the call target name +#ifdef DEBUG // This information is used in DEBUG builds to display the method name for call instructions struct instrDesc; @@ -539,8 +539,7 @@ protected: unsigned idNum; size_t idSize; // size of the instruction descriptor unsigned idVarRefOffs; // IL offset for LclVar reference - size_t idMemCookie; // for display of member names in addr modes - void* idClsCookie; // for display of member names in addr modes + size_t idMemCookie; // for display of method name (also used by switch table) #ifdef TRANSLATE_PDB unsigned int idilStart; // instruction descriptor source information for PDB translation #endif @@ -549,7 +548,7 @@ protected: CORINFO_SIG_INFO* idCallSig; // Used to report native call site signatures to the EE }; -#endif // defined(DEBUG) || defined(LATE_DISASM) +#endif // DEBUG #ifdef _TARGET_ARM_ unsigned insEncodeSetFlags(insFlags sf); @@ -777,7 +776,7 @@ protected: #endif // !HAS_TINY_DESC -#if defined(DEBUG) || defined(LATE_DISASM) +#ifdef DEBUG instrDescDebugInfo* _idDebugOnlyInfo; @@ -792,7 +791,7 @@ protected: } private: -#endif // defined(DEBUG) || defined(LATE_DISASM) +#endif // DEBUG // // This is the end of the smallest instrDesc we can allocate for all @@ -869,7 +868,7 @@ protected: emitter::emitAllocInstr() to clear them. */ -#if defined(DEBUG) || defined(LATE_DISASM) +#if DEBUG #define TINY_IDSC_DEBUG_EXTRA (sizeof(void*)) #else #define TINY_IDSC_DEBUG_EXTRA (0) diff --git a/src/jit/emitarm.cpp b/src/jit/emitarm.cpp index c65d799d50..ae98d31868 100644 --- a/src/jit/emitarm.cpp +++ b/src/jit/emitarm.cpp @@ -3808,19 +3808,12 @@ void emitter::emitIns_C_I(instruction ins, emitAttr attr, CORINFO_FIELD_HANDLE f * The following adds instructions referencing address modes. */ -void emitter::emitIns_I_AR( - instruction ins, emitAttr attr, int val, regNumber reg, int offs, int memCookie, void* clsCookie) +void emitter::emitIns_I_AR(instruction ins, emitAttr attr, int val, regNumber reg, int offs) { NYI("emitIns_I_AR"); } -void emitter::emitIns_R_AR(instruction ins, - emitAttr attr, - regNumber ireg, - regNumber reg, - int offs, - int memCookie /* = 0 */, - void* clsCookie /* = NULL */) +void emitter::emitIns_R_AR(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs) { if (ins == INS_mov) { @@ -3890,13 +3883,7 @@ void emitter::emitIns_R_AI(instruction ins, emitAttr attr, regNumber ireg, ssize NYI("emitIns_R_AI"); } -void emitter::emitIns_AR_R(instruction ins, - emitAttr attr, - regNumber ireg, - regNumber reg, - int offs, - int memCookie /* = 0 */, - void* clsCookie /* = NULL */) +void emitter::emitIns_AR_R(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs) { if (ins == INS_mov) { @@ -4652,20 +4639,17 @@ void emitter::emitIns_Call(EmitCallType callType, VarSetOps::ToString(emitComp, ((instrDescCGCA*)id)->idcGCvars)); } } -#endif -#if defined(DEBUG) || defined(LATE_DISASM) id->idDebugOnlyInfo()->idMemCookie = (size_t)methHnd; // method token - id->idDebugOnlyInfo()->idClsCookie = 0; id->idDebugOnlyInfo()->idCallSig = sigInfo; -#endif +#endif // DEBUG -#if defined(LATE_DISASM) +#ifdef LATE_DISASM if (addr != nullptr) { codeGen->getDisAssembler().disSetMethod((size_t)addr, methHnd); } -#endif // defined(LATE_DISASM) +#endif // LATE_DISASM dispIns(id); appendToCurIG(id); diff --git a/src/jit/emitarm.h b/src/jit/emitarm.h index 62d9af6569..5ba76fe226 100644 --- a/src/jit/emitarm.h +++ b/src/jit/emitarm.h @@ -325,16 +325,13 @@ void emitIns_R_D(instruction ins, emitAttr attr, unsigned offs, regNumber reg); void emitIns_J_R(instruction ins, emitAttr attr, BasicBlock* dst, regNumber reg); -void emitIns_I_AR( - instruction ins, emitAttr attr, int val, regNumber reg, int offs, int memCookie = 0, void* clsCookie = NULL); +void emitIns_I_AR(instruction ins, emitAttr attr, int val, regNumber reg, int offs); -void emitIns_R_AR( - instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs, int memCookie = 0, void* clsCookie = NULL); +void emitIns_R_AR(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs); void emitIns_R_AI(instruction ins, emitAttr attr, regNumber ireg, ssize_t disp); -void emitIns_AR_R( - instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs, int memCookie = 0, void* clsCookie = NULL); +void emitIns_AR_R(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs); void emitIns_R_ARR(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, regNumber rg2, int disp); diff --git a/src/jit/emitarm64.cpp b/src/jit/emitarm64.cpp index b5cc06e5f2..3f11cc4f9b 100644 --- a/src/jit/emitarm64.cpp +++ b/src/jit/emitarm64.cpp @@ -6793,13 +6793,7 @@ void emitter::emitIns_C_R(instruction ins, emitAttr attr, CORINFO_FIELD_HANDLE f assert(!"emitIns_C_R not supported for RyuJIT backend"); } -void emitter::emitIns_R_AR(instruction ins, - emitAttr attr, - regNumber ireg, - regNumber reg, - int offs, - int memCookie /* = 0 */, - void* clsCookie /* = NULL */) +void emitter::emitIns_R_AR(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs) { NYI("emitIns_R_AR"); } @@ -6858,13 +6852,7 @@ void emitter::emitIns_R_AI(instruction ins, emitAttr attr, regNumber ireg, ssize } } -void emitter::emitIns_AR_R(instruction ins, - emitAttr attr, - regNumber ireg, - regNumber reg, - int offs, - int memCookie /* = 0 */, - void* clsCookie /* = NULL */) +void emitter::emitIns_AR_R(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs) { NYI("emitIns_AR_R"); } @@ -7408,20 +7396,17 @@ void emitter::emitIns_Call(EmitCallType callType, VarSetOps::ToString(emitComp, ((instrDescCGCA*)id)->idcGCvars)); } } -#endif -#if defined(DEBUG) || defined(LATE_DISASM) id->idDebugOnlyInfo()->idMemCookie = (size_t)methHnd; // method token - id->idDebugOnlyInfo()->idClsCookie = 0; id->idDebugOnlyInfo()->idCallSig = sigInfo; -#endif +#endif // DEBUG -#if defined(LATE_DISASM) +#ifdef LATE_DISASM if (addr != nullptr) { codeGen->getDisAssembler().disSetMethod((size_t)addr, methHnd); } -#endif // defined(LATE_DISASM) +#endif // LATE_DISASM dispIns(id); appendToCurIG(id); diff --git a/src/jit/emitarm64.h b/src/jit/emitarm64.h index 87d99952cf..0838d6e336 100644 --- a/src/jit/emitarm64.h +++ b/src/jit/emitarm64.h @@ -783,16 +783,13 @@ void emitIns_J_R(instruction ins, emitAttr attr, BasicBlock* dst, regNumber reg) void emitIns_J_R_I(instruction ins, emitAttr attr, BasicBlock* dst, regNumber reg, int imm); -void emitIns_I_AR( - instruction ins, emitAttr attr, int val, regNumber reg, int offs, int memCookie = 0, void* clsCookie = NULL); +void emitIns_I_AR(instruction ins, emitAttr attr, int val, regNumber reg, int offs); -void emitIns_R_AR( - instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs, int memCookie = 0, void* clsCookie = NULL); +void emitIns_R_AR(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs); void emitIns_R_AI(instruction ins, emitAttr attr, regNumber ireg, ssize_t disp); -void emitIns_AR_R( - instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs, int memCookie = 0, void* clsCookie = NULL); +void emitIns_AR_R(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs); void emitIns_R_ARR(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, regNumber rg2, int disp); diff --git a/src/jit/emitxarch.cpp b/src/jit/emitxarch.cpp index 09fdb1bd08..ee0afd0f7f 100644 --- a/src/jit/emitxarch.cpp +++ b/src/jit/emitxarch.cpp @@ -4229,8 +4229,7 @@ void emitter::emitIns_R_L(instruction ins, emitAttr attr, BasicBlock* dst, regNu * The following adds instructions referencing address modes. */ -void emitter::emitIns_I_AR( - instruction ins, emitAttr attr, int val, regNumber reg, int disp, int memCookie, void* clsCookie) +void emitter::emitIns_I_AR(instruction ins, emitAttr attr, int val, regNumber reg, int disp) { assert((CodeGen::instIsFP(ins) == false) && (EA_SIZE(attr) <= EA_8BYTE)); @@ -4274,13 +4273,6 @@ void emitter::emitIns_I_AR( id->idIns(ins); id->idInsFmt(fmt); - assert((memCookie == NULL) == (clsCookie == nullptr)); - -#ifdef DEBUG - id->idDebugOnlyInfo()->idMemCookie = memCookie; - id->idDebugOnlyInfo()->idClsCookie = clsCookie; -#endif - id->idAddr()->iiaAddrMode.amBaseReg = reg; id->idAddr()->iiaAddrMode.amIndxReg = REG_NA; @@ -4349,8 +4341,7 @@ void emitter::emitIns_I_AI(instruction ins, emitAttr attr, int val, ssize_t disp emitCurIGsize += sz; } -void emitter::emitIns_R_AR( - instruction ins, emitAttr attr, regNumber ireg, regNumber base, int disp, int memCookie, void* clsCookie) +void emitter::emitIns_R_AR(instruction ins, emitAttr attr, regNumber ireg, regNumber base, int disp) { assert((CodeGen::instIsFP(ins) == false) && (EA_SIZE(attr) <= EA_32BYTE) && (ireg != REG_NA)); noway_assert(emitVerifyEncodable(ins, EA_SIZE(attr), ireg)); @@ -4374,13 +4365,6 @@ void emitter::emitIns_R_AR( id->idInsFmt(fmt); id->idReg1(ireg); - assert((memCookie == NULL) == (clsCookie == nullptr)); - -#ifdef DEBUG - id->idDebugOnlyInfo()->idMemCookie = memCookie; - id->idDebugOnlyInfo()->idClsCookie = clsCookie; -#endif - id->idAddr()->iiaAddrMode.amBaseReg = base; id->idAddr()->iiaAddrMode.amIndxReg = REG_NA; @@ -4418,8 +4402,7 @@ void emitter::emitIns_R_AI(instruction ins, emitAttr attr, regNumber ireg, ssize emitCurIGsize += sz; } -void emitter::emitIns_AR_R( - instruction ins, emitAttr attr, regNumber ireg, regNumber base, int disp, int memCookie, void* clsCookie) +void emitter::emitIns_AR_R(instruction ins, emitAttr attr, regNumber ireg, regNumber base, int disp) { UNATIVE_OFFSET sz; instrDesc* id = emitNewInstrAmd(attr, disp); @@ -4446,13 +4429,6 @@ void emitter::emitIns_AR_R( id->idIns(ins); id->idInsFmt(fmt); - assert((memCookie == NULL) == (clsCookie == nullptr)); - -#ifdef DEBUG - id->idDebugOnlyInfo()->idMemCookie = memCookie; - id->idDebugOnlyInfo()->idClsCookie = clsCookie; -#endif - id->idAddr()->iiaAddrMode.amBaseReg = base; id->idAddr()->iiaAddrMode.amIndxReg = REG_NA; @@ -5662,20 +5638,17 @@ void emitter::emitIns_Call(EmitCallType callType, } } } -#endif -#if defined(DEBUG) || defined(LATE_DISASM) id->idDebugOnlyInfo()->idMemCookie = (size_t)methHnd; // method token - id->idDebugOnlyInfo()->idClsCookie = nullptr; id->idDebugOnlyInfo()->idCallSig = sigInfo; -#endif +#endif // DEBUG -#if defined(LATE_DISASM) +#ifdef LATE_DISASM if (addr != nullptr) { codeGen->getDisAssembler().disSetMethod((size_t)addr, methHnd); } -#endif // defined(LATE_DISASM) +#endif // LATE_DISASM id->idCodeSize(sz); @@ -6434,19 +6407,8 @@ void emitter::emitDispAddrMode(instrDesc* id, bool noDetail) printf("]"); - if (id->idDebugOnlyInfo()->idClsCookie) - { - if (id->idIns() == INS_call) - { - printf("%s", emitFncName((CORINFO_METHOD_HANDLE)id->idDebugOnlyInfo()->idMemCookie)); - } - else - { - printf("%s", emitFldName((CORINFO_FIELD_HANDLE)id->idDebugOnlyInfo()->idMemCookie)); - } - } // pretty print string if it looks like one - else if (id->idGCref() == GCT_GCREF && id->idIns() == INS_mov && id->idAddr()->iiaAddrMode.amBaseReg == REG_NA) + if ((id->idGCref() == GCT_GCREF) && (id->idIns() == INS_mov) && (id->idAddr()->iiaAddrMode.amBaseReg == REG_NA)) { const wchar_t* str = emitComp->eeGetCPString(disp); if (str != nullptr) diff --git a/src/jit/emitxarch.h b/src/jit/emitxarch.h index de8e81faa1..25053b3e49 100644 --- a/src/jit/emitxarch.h +++ b/src/jit/emitxarch.h @@ -391,28 +391,15 @@ void emitIns_R_L(instruction ins, emitAttr attr, BasicBlock* dst, regNumber reg) void emitIns_R_D(instruction ins, emitAttr attr, unsigned offs, regNumber reg); -void emitIns_I_AR( - instruction ins, emitAttr attr, int val, regNumber reg, int offs, int memCookie = 0, void* clsCookie = nullptr); +void emitIns_I_AR(instruction ins, emitAttr attr, int val, regNumber reg, int offs); void emitIns_I_AI(instruction ins, emitAttr attr, int val, ssize_t disp); -void emitIns_R_AR(instruction ins, - emitAttr attr, - regNumber ireg, - regNumber reg, - int offs, - int memCookie = 0, - void* clsCookie = nullptr); +void emitIns_R_AR(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs); void emitIns_R_AI(instruction ins, emitAttr attr, regNumber ireg, ssize_t disp); -void emitIns_AR_R(instruction ins, - emitAttr attr, - regNumber ireg, - regNumber reg, - int offs, - int memCookie = 0, - void* clsCookie = nullptr); +void emitIns_AR_R(instruction ins, emitAttr attr, regNumber ireg, regNumber reg, int offs); void emitIns_AI_R(instruction ins, emitAttr attr, regNumber ireg, ssize_t disp); |