summaryrefslogtreecommitdiff
path: root/src/jit
diff options
context:
space:
mode:
authorBruce Forstall <brucefo@microsoft.com>2017-04-07 14:18:26 -0700
committerBruce Forstall <brucefo@microsoft.com>2017-04-07 14:22:29 -0700
commit79064d73939dd28c320ac8dd848770d1406806bb (patch)
treedac6bbfe707ab019ca175b5519b44d892320c24d /src/jit
parent4371b15df7ae47d218ce283713d4e5ecb6fb4b71 (diff)
downloadcoreclr-79064d73939dd28c320ac8dd848770d1406806bb.tar.gz
coreclr-79064d73939dd28c320ac8dd848770d1406806bb.tar.bz2
coreclr-79064d73939dd28c320ac8dd848770d1406806bb.zip
Remove RELOC_SUPPORT define
It's always defined, is always expected to be defined, and the build doesn't work without it. Also remove unused `SECURITY_CHECK` and `VERIFY_IMPORTER` defines.
Diffstat (limited to 'src/jit')
-rw-r--r--src/jit/assertionprop.cpp4
-rw-r--r--src/jit/compiler.cpp4
-rw-r--r--src/jit/compiler.h8
-rw-r--r--src/jit/emit.cpp2
-rw-r--r--src/jit/emit.h36
-rw-r--r--src/jit/emitarm.cpp18
-rw-r--r--src/jit/emitarm.h4
-rw-r--r--src/jit/emitarm64.cpp2
-rw-r--r--src/jit/emitarm64.h4
-rw-r--r--src/jit/emitinl.h6
-rw-r--r--src/jit/emitxarch.cpp106
-rw-r--r--src/jit/emitxarch.h4
-rw-r--r--src/jit/gentree.cpp4
-rw-r--r--src/jit/instr.cpp7
-rw-r--r--src/jit/jit.h11
15 files changed, 20 insertions, 200 deletions
diff --git a/src/jit/assertionprop.cpp b/src/jit/assertionprop.cpp
index 4c18a284cf..767d63a0df 100644
--- a/src/jit/assertionprop.cpp
+++ b/src/jit/assertionprop.cpp
@@ -2438,11 +2438,9 @@ GenTreePtr Compiler::optVNConstantPropOnTree(BasicBlock* block, GenTreePtr stmt,
#ifdef _TARGET_64BIT_
if (vnStore->IsVNHandle(vnCns))
{
-#ifdef RELOC_SUPPORT
// Don't perform constant folding that involves a handle that needs
// to be recorded as a relocation with the VM.
if (!opts.compReloc)
-#endif
{
newTree = gtNewIconHandleNode(value, vnStore->GetHandleFlags(vnCns));
newTree->gtVNPair = ValueNumPair(vnLib, vnCns);
@@ -2511,11 +2509,9 @@ GenTreePtr Compiler::optVNConstantPropOnTree(BasicBlock* block, GenTreePtr stmt,
#ifndef _TARGET_64BIT_
if (vnStore->IsVNHandle(vnCns))
{
-#ifdef RELOC_SUPPORT
// Don't perform constant folding that involves a handle that needs
// to be recorded as a relocation with the VM.
if (!opts.compReloc)
-#endif
{
newTree = gtNewIconHandleNode(value, vnStore->GetHandleFlags(vnCns));
newTree->gtVNPair = ValueNumPair(vnLib, vnCns);
diff --git a/src/jit/compiler.cpp b/src/jit/compiler.cpp
index df54c8f32a..14b2abafb6 100644
--- a/src/jit/compiler.cpp
+++ b/src/jit/compiler.cpp
@@ -3321,11 +3321,9 @@ void Compiler::compInitOptions(JitFlags* jitFlags)
info.compMethodInfo->args.pSig);
#endif
-//-------------------------------------------------------------------------
+ //-------------------------------------------------------------------------
-#if RELOC_SUPPORT
opts.compReloc = jitFlags->IsSet(JitFlags::JIT_FLAG_RELOC);
-#endif
#ifdef DEBUG
#if defined(_TARGET_XARCH_) && !defined(LEGACY_BACKEND)
diff --git a/src/jit/compiler.h b/src/jit/compiler.h
index 4ec18a70a1..482ad496fa 100644
--- a/src/jit/compiler.h
+++ b/src/jit/compiler.h
@@ -7865,13 +7865,11 @@ public:
// (or)
// 3. When opts.compDbgEnC is true. (See also Compiler::compCompile).
//
-// When this flag is set, jit will allocate a gc-reference local variable (lvaSecurityObject),
-// which gets reported as a GC root to stackwalker.
-// (See also ICodeManager::GetAddrOfSecurityObject.)
+ // When this flag is set, jit will allocate a gc-reference local variable (lvaSecurityObject),
+ // which gets reported as a GC root to stackwalker.
+ // (See also ICodeManager::GetAddrOfSecurityObject.)
-#if RELOC_SUPPORT
bool compReloc;
-#endif
#ifdef DEBUG
#if defined(_TARGET_XARCH_) && !defined(LEGACY_BACKEND)
diff --git a/src/jit/emit.cpp b/src/jit/emit.cpp
index e9ba4e501e..9ba9c58169 100644
--- a/src/jit/emit.cpp
+++ b/src/jit/emit.cpp
@@ -1381,7 +1381,6 @@ void* emitter::emitAllocInstr(size_t sz, emitAttr opsz)
id->idOpSize(EA_SIZE(opsz));
}
-#if RELOC_SUPPORT
// Amd64: ip-relative addressing is supported even when not generating relocatable ngen code
if (EA_IS_DSP_RELOC(opsz)
#ifndef _TARGET_AMD64_
@@ -1400,7 +1399,6 @@ void* emitter::emitAllocInstr(size_t sz, emitAttr opsz)
/* instruction has an immediate constant that is relocatable */
id->idSetIsCnsReloc();
}
-#endif
#if EMITTER_STATS
emitTotalInsCnt++;
diff --git a/src/jit/emit.h b/src/jit/emit.h
index 91cf96e2b1..b230a24a0d 100644
--- a/src/jit/emit.h
+++ b/src/jit/emit.h
@@ -738,21 +738,13 @@ protected:
// arm64: 48 bits
CLANG_FORMAT_COMMENT_ANCHOR;
-#ifdef RELOC_SUPPORT
-
unsigned _idCnsReloc : 1; // LargeCns is an RVA and needs reloc tag
unsigned _idDspReloc : 1; // LargeDsp is an RVA and needs reloc tag
#define ID_EXTRA_RELOC_BITS (2)
-#else // RELOC_SUPPORT
-
-#define ID_EXTRA_RELOC_BITS (0)
-
-#endif // RELOC_SUPPORT
-
////////////////////////////////////////////////////////////////////////
- // Space taken up to here (assuming RELOC_SUPPORT):
+ // Space taken up to here:
// x86: 40 bits
// amd64: 48 bits
// arm: 50 bits
@@ -768,7 +760,7 @@ protected:
#define ID_MAX_SMALL_CNS (int)((1 << ID_BIT_SMALL_CNS) - 1U)
////////////////////////////////////////////////////////////////////////
- // Small constant size (assuming RELOC_SUPPORT):
+ // Small constant size:
// x86: 24 bits
// amd64: 16 bits
// arm: 14 bits
@@ -777,7 +769,7 @@ protected:
unsigned _idSmallCns : ID_BIT_SMALL_CNS;
////////////////////////////////////////////////////////////////////////
- // Space taken up to here (with RELOC_SUPPORT): 64 bits, all architectures, by design.
+ // Space taken up to here: 64 bits, all architectures, by design.
////////////////////////////////////////////////////////////////////////
CLANG_FORMAT_COMMENT_ANCHOR;
@@ -829,23 +821,13 @@ protected:
#define ID_EXTRA_BITFIELD_BITS (7)
-//
-// For x86, we are using 7 bits from the second DWORD for bitfields.
-//
-
-#ifdef RELOC_SUPPORT
+ //
+ // For x86, we are using 7 bits from the second DWORD for bitfields.
+ //
unsigned _idCnsReloc : 1; // LargeCns is an RVA and needs reloc tag
unsigned _idDspReloc : 1; // LargeDsp is an RVA and needs reloc tag
-#define ID_EXTRA_RELOC_BITS (2)
-
-#else // RELOC_SUPPORT
-
-#define ID_EXTRA_RELOC_BITS (0)
-
-#endif // RELOC_SUPPORT
-
#define ID_EXTRA_REG_BITS (0)
#define ID_EXTRA_BITS (ID_EXTRA_BITFIELD_BITS + ID_EXTRA_RELOC_BITS + ID_EXTRA_REG_BITS)
@@ -856,7 +838,7 @@ protected:
#define ID_MIN_SMALL_CNS 0
#define ID_MAX_SMALL_CNS (int)((1 << ID_BIT_SMALL_CNS) - 1U)
- // For x86 (assuming RELOC_SUPPORT) we have 23 bits remaining for the
+ // For x86 we have 23 bits remaining for the
// small constant in this extra DWORD.
unsigned _idSmallCns : ID_BIT_SMALL_CNS;
@@ -1283,8 +1265,6 @@ protected:
}
#endif // defined(_TARGET_ARM_)
-#ifdef RELOC_SUPPORT
-
bool idIsCnsReloc() const
{
assert(!idIsTiny());
@@ -1311,8 +1291,6 @@ protected:
return idIsDspReloc() || idIsCnsReloc();
}
-#endif
-
unsigned idSmallCns() const
{
assert(!idIsTiny());
diff --git a/src/jit/emitarm.cpp b/src/jit/emitarm.cpp
index 77ee3cfc18..ebefa27fb8 100644
--- a/src/jit/emitarm.cpp
+++ b/src/jit/emitarm.cpp
@@ -4303,14 +4303,12 @@ void emitter::emitIns_R_D(instruction ins, emitAttr attr, unsigned offs, regNumb
id->idInsFmt(fmt);
id->idInsSize(isz);
-#if RELOC_SUPPORT
if (emitComp->opts.compReloc)
{
// Set the relocation flags - these give hint to zap to perform
// relocation of the specified 32bit address.
id->idSetRelocFlags(attr);
}
-#endif // RELOC_SUPPORT
dispIns(id);
appendToCurIG(id);
@@ -4593,7 +4591,6 @@ void emitter::emitIns_Call(EmitCallType callType,
id->idSetIsCallAddr();
}
-#if RELOC_SUPPORT
if (emitComp->opts.compReloc)
{
// Since this is an indirect call through a pointer and we don't
@@ -4602,7 +4599,6 @@ void emitter::emitIns_Call(EmitCallType callType,
id->idSetIsDspReloc();
}
-#endif
}
#ifdef DEBUG
@@ -5268,7 +5264,6 @@ BYTE* emitter::emitOutputLJ(insGroup* ig, BYTE* dst, instrDesc* i)
else if (fmt == IF_T2_J2)
{
assert((distVal & 1) == 0);
-#ifdef RELOC_SUPPORT
if (emitComp->opts.compReloc && emitJumpCrossHotColdBoundary(srcOffs, dstOffs))
{
// dst isn't an actual final target location, just some intermediate
@@ -5277,7 +5272,6 @@ BYTE* emitter::emitOutputLJ(insGroup* ig, BYTE* dst, instrDesc* i)
// rely on the relocation to do all the work
}
else
-#endif
{
assert(distVal >= CALL_DIST_MAX_NEG);
assert(distVal <= CALL_DIST_MAX_POS);
@@ -5304,7 +5298,6 @@ BYTE* emitter::emitOutputLJ(insGroup* ig, BYTE* dst, instrDesc* i)
unsigned instrSize = emitOutput_Thumb2Instr(dst, code);
-#ifdef RELOC_SUPPORT
if (emitComp->opts.compReloc)
{
if (emitJumpCrossHotColdBoundary(srcOffs, dstOffs))
@@ -5317,7 +5310,6 @@ BYTE* emitter::emitOutputLJ(insGroup* ig, BYTE* dst, instrDesc* i)
}
}
}
-#endif // RELOC_SUPPORT
dst += instrSize;
}
@@ -5982,9 +5974,7 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
assert(!id->idIsLclVar());
assert((ins == INS_movw) || (ins == INS_movt));
imm += (size_t)emitConsBlock;
-#ifdef RELOC_SUPPORT
if (!id->idIsCnsReloc() && !id->idIsDspReloc())
-#endif
{
goto SPLIT_IMM;
}
@@ -6002,7 +5992,6 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
}
}
-#ifdef RELOC_SUPPORT
if (id->idIsCnsReloc() || id->idIsDspReloc())
{
assert((ins == INS_movt) || (ins == INS_movw));
@@ -6011,7 +6000,6 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
emitRecordRelocation((void*)(dst - 8), (void*)imm, IMAGE_REL_BASED_THUMB_MOV32);
}
else
-#endif // RELOC_SUPPORT
{
assert((imm & 0x0000ffff) == imm);
code |= (imm & 0x00ff);
@@ -6234,7 +6222,6 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
}
code = emitInsCode(ins, fmt);
-#ifdef RELOC_SUPPORT
if (id->idIsDspReloc())
{
callInstrSize = SafeCvtAssert<unsigned char>(emitOutput_Thumb2Instr(dst, code));
@@ -6243,7 +6230,6 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
emitRecordRelocation((void*)(dst - 4), addr, IMAGE_REL_BASED_THUMB_BRANCH24);
}
else
-#endif // RELOC_SUPPORT
{
addr = (BYTE*)((size_t)addr & ~1); // Clear the lowest bit from target address
@@ -6949,14 +6935,12 @@ void emitter::emitDispInsHelp(
{
if (emitComp->opts.disDiffable)
imm = 0xD1FF;
-#if RELOC_SUPPORT
if (id->idIsCnsReloc() || id->idIsDspReloc())
{
if (emitComp->opts.disDiffable)
imm = 0xD1FFAB1E;
printf("%s RELOC ", (id->idIns() == INS_movw) ? "LOW" : "HIGH");
}
-#endif // RELOC_SUPPORT
}
emitDispImm(imm, false, (fmt == IF_T2_N));
break;
@@ -6987,12 +6971,10 @@ void emitter::emitDispInsHelp(
assert(jdsc != NULL);
-#ifdef RELOC_SUPPORT
if (id->idIsDspReloc())
{
printf("reloc ");
}
-#endif
printf("%s ADDRESS J_M%03u_DS%02u", (id->idIns() == INS_movw) ? "LOW" : "HIGH",
Compiler::s_compMethodsCount, imm);
diff --git a/src/jit/emitarm.h b/src/jit/emitarm.h
index 8ad1268310..4ec189385c 100644
--- a/src/jit/emitarm.h
+++ b/src/jit/emitarm.h
@@ -10,10 +10,8 @@
struct CnsVal
{
- int cnsVal;
-#ifdef RELOC_SUPPORT
+ int cnsVal;
bool cnsReloc;
-#endif
};
insSize emitInsSize(insFormat insFmt);
diff --git a/src/jit/emitarm64.cpp b/src/jit/emitarm64.cpp
index f0eb641259..70409b8cd2 100644
--- a/src/jit/emitarm64.cpp
+++ b/src/jit/emitarm64.cpp
@@ -6838,12 +6838,10 @@ void emitter::emitIns_Call(EmitCallType callType,
id->idSetIsCallAddr();
}
-#if RELOC_SUPPORT
if (emitComp->opts.compReloc)
{
id->idSetIsDspReloc();
}
-#endif
}
#ifdef DEBUG
diff --git a/src/jit/emitarm64.h b/src/jit/emitarm64.h
index 5459a0d6c8..6a8e42b86f 100644
--- a/src/jit/emitarm64.h
+++ b/src/jit/emitarm64.h
@@ -19,9 +19,7 @@ static bool strictArmAsm;
struct CnsVal
{
ssize_t cnsVal;
-#ifdef RELOC_SUPPORT
- bool cnsReloc;
-#endif
+ bool cnsReloc;
};
#ifdef DEBUG
diff --git a/src/jit/emitinl.h b/src/jit/emitinl.h
index 302b8ea448..82ad53d341 100644
--- a/src/jit/emitinl.h
+++ b/src/jit/emitinl.h
@@ -144,9 +144,7 @@ inline int emitter::emitGetInsCDinfo(instrDesc* id)
inline void emitter::emitGetInsCns(instrDesc* id, CnsVal* cv)
{
-#ifdef RELOC_SUPPORT
cv->cnsReloc = id->idIsCnsReloc();
-#endif
if (id->idIsLargeCns())
{
cv->cnsVal = ((instrDescCns*)id)->idcCnsVal;
@@ -159,9 +157,7 @@ inline void emitter::emitGetInsCns(instrDesc* id, CnsVal* cv)
inline ssize_t emitter::emitGetInsAmdCns(instrDesc* id, CnsVal* cv)
{
-#ifdef RELOC_SUPPORT
cv->cnsReloc = id->idIsCnsReloc();
-#endif
if (id->idIsLargeDsp())
{
if (id->idIsLargeCns())
@@ -192,9 +188,7 @@ inline ssize_t emitter::emitGetInsAmdCns(instrDesc* id, CnsVal* cv)
inline void emitter::emitGetInsDcmCns(instrDesc* id, CnsVal* cv)
{
-#ifdef RELOC_SUPPORT
cv->cnsReloc = id->idIsCnsReloc();
-#endif
if (id->idIsLargeCns())
{
if (id->idIsLargeDsp())
diff --git a/src/jit/emitxarch.cpp b/src/jit/emitxarch.cpp
index 9a2fd1efa6..b495d015d6 100644
--- a/src/jit/emitxarch.cpp
+++ b/src/jit/emitxarch.cpp
@@ -1802,13 +1802,11 @@ inline UNATIVE_OFFSET emitter::emitInsSizeSV(instrDesc* id, int var, int dsp, in
valSize = sizeof(int);
}
-#ifdef RELOC_SUPPORT
if (id->idIsCnsReloc())
{
valInByte = false; // relocs can't be placed in a byte
assert(valSize == sizeof(int));
}
-#endif
if (valInByte)
{
@@ -1884,13 +1882,11 @@ UNATIVE_OFFSET emitter::emitInsSizeAM(instrDesc* id, code_t code)
break;
}
-#ifdef RELOC_SUPPORT
if (id->idIsDspReloc())
{
dspInByte = false; // relocs can't be placed in a byte
dspIsZero = false; // relocs won't always be zero
}
-#endif
if (code & 0xFF000000)
{
@@ -2077,13 +2073,11 @@ inline UNATIVE_OFFSET emitter::emitInsSizeAM(instrDesc* id, code_t code, int val
valSize = sizeof(INT32);
}
-#ifdef RELOC_SUPPORT
if (id->idIsCnsReloc())
{
valInByte = false; // relocs can't be placed in a byte
assert(valSize == sizeof(INT32));
}
-#endif
if (valInByte)
{
@@ -2125,13 +2119,11 @@ inline UNATIVE_OFFSET emitter::emitInsSizeCV(instrDesc* id, code_t code, int val
valSize = sizeof(INT32);
#endif // !_TARGET_AMD64_
-#ifdef RELOC_SUPPORT
if (id->idIsCnsReloc())
{
valInByte = false; // relocs can't be placed in a byte
assert(valSize == sizeof(INT32));
}
-#endif
if (valInByte)
{
@@ -3666,13 +3658,11 @@ void emitter::emitIns_IJ(emitAttr attr, regNumber reg, unsigned base)
void emitter::emitIns_C(instruction ins, emitAttr attr, CORINFO_FIELD_HANDLE fldHnd, int offs)
{
-#if RELOC_SUPPORT
// Static always need relocs
if (!jitStaticFldIsGlobAddr(fldHnd))
{
attr = EA_SET_FLG(attr, EA_DSP_RELOC_FLG);
}
-#endif
UNATIVE_OFFSET sz;
instrDesc* id;
@@ -3834,13 +3824,11 @@ void emitter::emitIns_R_R_R(instruction ins, emitAttr attr, regNumber targetReg,
*/
void emitter::emitIns_R_C(instruction ins, emitAttr attr, regNumber reg, CORINFO_FIELD_HANDLE fldHnd, int offs)
{
-#if RELOC_SUPPORT
// Static always need relocs
if (!jitStaticFldIsGlobAddr(fldHnd))
{
attr = EA_SET_FLG(attr, EA_DSP_RELOC_FLG);
}
-#endif
emitAttr size = EA_SIZE(attr);
@@ -3919,13 +3907,11 @@ void emitter::emitIns_R_C(instruction ins, emitAttr attr, regNumber reg, CORINFO
void emitter::emitIns_C_R(instruction ins, emitAttr attr, CORINFO_FIELD_HANDLE fldHnd, regNumber reg, int offs)
{
-#if RELOC_SUPPORT
// Static always need relocs
if (!jitStaticFldIsGlobAddr(fldHnd))
{
attr = EA_SET_FLG(attr, EA_DSP_RELOC_FLG);
}
-#endif
emitAttr size = EA_SIZE(attr);
@@ -3994,13 +3980,11 @@ void emitter::emitIns_C_R(instruction ins, emitAttr attr, CORINFO_FIELD_HANDLE f
void emitter::emitIns_C_I(instruction ins, emitAttr attr, CORINFO_FIELD_HANDLE fldHnd, int offs, int val)
{
-#if RELOC_SUPPORT
// Static always need relocs
if (!jitStaticFldIsGlobAddr(fldHnd))
{
attr = EA_SET_FLG(attr, EA_DSP_RELOC_FLG);
}
-#endif
insFormat fmt;
@@ -4082,7 +4066,6 @@ void emitter::emitIns_J_S(instruction ins, emitAttr attr, BasicBlock* dst, int v
emitTotalIGjmps++;
#endif
-#if RELOC_SUPPORT
#ifndef _TARGET_AMD64_
// Storing the address of a basicBlock will need a reloc
// as the instruction uses the absolute address,
@@ -4095,7 +4078,6 @@ void emitter::emitIns_J_S(instruction ins, emitAttr attr, BasicBlock* dst, int v
{
id->idSetIsDspReloc();
}
-#endif // RELOC_SUPPORT
id->idCodeSize(sz);
@@ -5027,7 +5009,6 @@ void emitter::emitIns_J(instruction ins, BasicBlock* dst, int instrCount /* = 0
}
else if (ins == INS_push || ins == INS_push_hide)
{
-#if RELOC_SUPPORT
// Pushing the address of a basicBlock will need a reloc
// as the instruction uses the absolute address,
// not a relative address
@@ -5035,7 +5016,6 @@ void emitter::emitIns_J(instruction ins, BasicBlock* dst, int instrCount /* = 0
{
id->idSetIsDspReloc();
}
-#endif
sz = PUSH_INST_SIZE;
}
else
@@ -5532,7 +5512,6 @@ void emitter::emitIns_Call(EmitCallType callType,
id->idAddr()->iiaAddr = (BYTE*)addr;
sz = 6;
-#if RELOC_SUPPORT
// Since this is an indirect call through a pointer and we don't
// currently pass in emitAttr into this function, we query codegen
// whether addr needs a reloc.
@@ -5550,7 +5529,6 @@ void emitter::emitIns_Call(EmitCallType callType,
sz++;
}
#endif //_TARGET_AMD64_
-#endif // RELOC_SUPPORT
}
else
{
@@ -5570,13 +5548,11 @@ void emitter::emitIns_Call(EmitCallType callType,
id->idSetIsCallAddr();
}
-#if RELOC_SUPPORT
// Direct call to a method and no addr indirection is needed.
if (codeGen->genCodeAddrNeedsReloc((size_t)addr))
{
id->idSetIsDspReloc();
}
-#endif
}
#ifdef DEBUG
@@ -6031,12 +6007,10 @@ void emitter::emitDispClsVar(CORINFO_FIELD_HANDLE fldHnd, ssize_t offs, bool rel
doffs = Compiler::eeGetJitDataOffs(fldHnd);
-#ifdef RELOC_SUPPORT
if (reloc)
{
printf("reloc ");
}
-#endif
if (doffs >= 0)
{
@@ -6252,12 +6226,10 @@ void emitter::emitDispAddrMode(instrDesc* id, bool noDetail)
if (jdsc)
{
-#ifdef RELOC_SUPPORT
if (id->idIsDspReloc())
{
printf("reloc ");
}
-#endif
printf("J_M%03u_DS%02u", Compiler::s_compMethodsCount, id->idDebugOnlyInfo()->idMemCookie);
}
@@ -6298,7 +6270,6 @@ void emitter::emitDispAddrMode(instrDesc* id, bool noDetail)
nsep = true;
}
-#ifdef RELOC_SUPPORT
if ((id->idIsDspReloc()) && (id->idIns() != INS_i_jmp))
{
if (nsep)
@@ -6308,7 +6279,6 @@ void emitter::emitDispAddrMode(instrDesc* id, bool noDetail)
emitDispReloc(disp);
}
else
-#endif
{
// Munge any pointers if we want diff-able disassembly
if (emitComp->opts.disDiffable)
@@ -6515,11 +6485,8 @@ void emitter::emitDispIns(
printf("IN%04x: ", idNum);
}
-#ifdef RELOC_SUPPORT
#define ID_INFO_DSP_RELOC ((bool)(id->idIsDspReloc()))
-#else
-#define ID_INFO_DSP_RELOC false
-#endif
+
/* Display a constant value if the instruction references one */
if (!isNew)
@@ -6736,13 +6703,11 @@ void emitter::emitDispIns(
// no 8-byte immediates allowed here!
assert((val >= 0xFFFFFFFF80000000LL) && (val <= 0x000000007FFFFFFFLL));
#endif
-#ifdef RELOC_SUPPORT
if (id->idIsCnsReloc())
{
emitDispReloc(val);
}
else
-#endif
{
PRINT_CONSTANT:
// Munge any pointers if we want diff-able disassembly
@@ -6864,13 +6829,11 @@ void emitter::emitDispIns(
else
{
printf(", ");
-#ifdef RELOC_SUPPORT
if (cnsVal.cnsReloc)
{
emitDispReloc(val);
}
else
-#endif
{
goto PRINT_CONSTANT;
}
@@ -6945,13 +6908,11 @@ void emitter::emitDispIns(
else
{
printf(", ");
-#ifdef RELOC_SUPPORT
if (cnsVal.cnsReloc)
{
emitDispReloc(val);
}
else
-#endif
{
goto PRINT_CONSTANT;
}
@@ -7051,13 +7012,11 @@ void emitter::emitDispIns(
assert((val >= 0xFFFFFFFF80000000LL) && (val <= 0x000000007FFFFFFFLL));
#endif
printf(", ");
-#ifdef RELOC_SUPPORT
if (id->idIsCnsReloc())
{
emitDispReloc(val);
}
else
-#endif
{
goto PRINT_CONSTANT;
}
@@ -7125,14 +7084,11 @@ void emitter::emitDispIns(
// no 8-byte immediates allowed here!
assert((val >= 0xFFFFFFFF80000000LL) && (val <= 0x000000007FFFFFFFLL));
#endif
-#ifdef RELOC_SUPPORT
if (cnsVal.cnsReloc)
{
emitDispReloc(val);
}
- else
-#endif
- if (id->idInsFmt() == IF_MRW_SHF)
+ else if (id->idInsFmt() == IF_MRW_SHF)
{
emitDispShift(ins, (BYTE)val);
}
@@ -7177,13 +7133,11 @@ void emitter::emitDispIns(
case IF_RRW_CNS:
printf("%s, ", emitRegName(id->idReg1(), attr));
val = emitGetInsSC(id);
-#ifdef RELOC_SUPPORT
if (id->idIsCnsReloc())
{
emitDispReloc(val);
}
else
-#endif
{
goto PRINT_CONSTANT;
}
@@ -7529,11 +7483,7 @@ BYTE* emitter::emitOutputAM(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc)
ssize_t cval = addc->cnsVal;
// Does the constant fit in a byte?
- if ((signed char)cval == cval &&
-#ifdef RELOC_SUPPORT
- addc->cnsReloc == false &&
-#endif
- ins != INS_mov && ins != INS_test)
+ if ((signed char)cval == cval && addc->cnsReloc == false && ins != INS_mov && ins != INS_test)
{
if (id->idInsFmt() != IF_ARW_SHF)
{
@@ -7678,12 +7628,10 @@ GOT_DSP:
dspInByte = ((signed char)dsp == (ssize_t)dsp);
dspIsZero = (dsp == 0);
-#ifdef RELOC_SUPPORT
if (id->idIsDspReloc())
{
dspInByte = false; // relocs can't be placed in a byte
}
-#endif
// Is there a [scaled] index component?
if (rgx == REG_NA)
@@ -7777,12 +7725,10 @@ GOT_DSP:
dst += emitOutputWord(dst, code | 0x8500);
dst += emitOutputLong(dst, dsp);
-#ifdef RELOC_SUPPORT
if (id->idIsDspReloc())
{
emitRecordRelocation((void*)(dst - sizeof(INT32)), (void*)dsp, IMAGE_REL_BASED_HIGHLOW);
}
-#endif
}
break;
@@ -7817,12 +7763,10 @@ GOT_DSP:
dst += emitOutputWord(dst, code | 0x8400);
dst += emitOutputByte(dst, 0x24);
dst += emitOutputLong(dst, dsp);
-#ifdef RELOC_SUPPORT
if (id->idIsDspReloc())
{
emitRecordRelocation((void*)(dst - sizeof(INT32)), (void*)dsp, IMAGE_REL_BASED_HIGHLOW);
}
-#endif
}
break;
@@ -7848,12 +7792,10 @@ GOT_DSP:
{
dst += emitOutputWord(dst, code | 0x8000);
dst += emitOutputLong(dst, dsp);
-#ifdef RELOC_SUPPORT
if (id->idIsDspReloc())
{
emitRecordRelocation((void*)(dst - sizeof(INT32)), (void*)dsp, IMAGE_REL_BASED_HIGHLOW);
}
-#endif
}
}
@@ -7898,12 +7840,10 @@ GOT_DSP:
dst += emitOutputWord(dst, code | 0x8400);
dst += emitOutputByte(dst, regByte);
dst += emitOutputLong(dst, dsp);
-#ifdef RELOC_SUPPORT
if (id->idIsDspReloc())
{
emitRecordRelocation((void*)(dst - sizeof(INT32)), (void*)dsp, IMAGE_REL_BASED_HIGHLOW);
}
-#endif
}
}
}
@@ -7923,12 +7863,10 @@ GOT_DSP:
}
dst += emitOutputLong(dst, dsp);
-#ifdef RELOC_SUPPORT
if (id->idIsDspReloc())
{
emitRecordRelocation((void*)(dst - sizeof(INT32)), (void*)dsp, IMAGE_REL_BASED_HIGHLOW);
}
-#endif
}
}
else
@@ -7956,12 +7894,10 @@ GOT_DSP:
dst += emitOutputWord(dst, code | 0x8400);
dst += emitOutputByte(dst, regByte);
dst += emitOutputLong(dst, dsp);
-#ifdef RELOC_SUPPORT
if (id->idIsDspReloc())
{
emitRecordRelocation((void*)(dst - sizeof(INT32)), (void*)dsp, IMAGE_REL_BASED_HIGHLOW);
}
-#endif
}
}
}
@@ -7995,13 +7931,11 @@ GOT_DSP:
assert(!"unexpected operand size");
}
-#ifdef RELOC_SUPPORT
if (addc->cnsReloc)
{
emitRecordRelocation((void*)(dst - sizeof(INT32)), (void*)(size_t)cval, IMAGE_REL_BASED_HIGHLOW);
assert(opsz == 4);
}
-#endif
}
DONE:
@@ -8151,11 +8085,7 @@ BYTE* emitter::emitOutputSV(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc)
ssize_t cval = addc->cnsVal;
// Does the constant fit in a byte?
- if ((signed char)cval == cval &&
-#ifdef RELOC_SUPPORT
- addc->cnsReloc == false &&
-#endif
- ins != INS_mov && ins != INS_test)
+ if ((signed char)cval == cval && addc->cnsReloc == false && ins != INS_mov && ins != INS_test)
{
if (id->idInsFmt() != IF_SRW_SHF)
{
@@ -8290,10 +8220,8 @@ BYTE* emitter::emitOutputSV(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc)
dspInByte = ((signed char)dsp == (int)dsp);
dspIsZero = (dsp == 0);
-#ifdef RELOC_SUPPORT
// for stack varaibles the dsp should never be a reloc
assert(id->idIsDspReloc() == 0);
-#endif
if (EBPbased)
{
@@ -8413,13 +8341,11 @@ BYTE* emitter::emitOutputSV(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc)
assert(!"unexpected operand size");
}
-#ifdef RELOC_SUPPORT
if (addc->cnsReloc)
{
emitRecordRelocation((void*)(dst - sizeof(INT32)), (void*)(size_t)cval, IMAGE_REL_BASED_HIGHLOW);
assert(opsz == 4);
}
-#endif
}
// Does this instruction operate on a GC ref value?
@@ -8562,11 +8488,7 @@ BYTE* emitter::emitOutputCV(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc)
{
ssize_t cval = addc->cnsVal;
// Does the constant fit in a byte?
- if ((signed char)cval == cval &&
-#ifdef RELOC_SUPPORT
- addc->cnsReloc == false &&
-#endif
- ins != INS_mov && ins != INS_test)
+ if ((signed char)cval == cval && addc->cnsReloc == false && ins != INS_mov && ins != INS_test)
{
if (id->idInsFmt() != IF_MRW_SHF)
{
@@ -8808,12 +8730,10 @@ BYTE* emitter::emitOutputCV(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc)
dst += emitOutputLong(dst, (int)target);
#endif //_TARGET_X86_
-#ifdef RELOC_SUPPORT
if (id->idIsDspReloc())
{
emitRecordRelocation((void*)(dst - sizeof(int)), target, IMAGE_REL_BASED_DISP32, 0, addlDelta);
}
-#endif
}
else
{
@@ -8826,12 +8746,10 @@ BYTE* emitter::emitOutputCV(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc)
dst += emitOutputSizeT(dst, (ssize_t)target);
-#ifdef RELOC_SUPPORT
if (id->idIsDspReloc())
{
emitRecordRelocation((void*)(dst - sizeof(void*)), target, IMAGE_REL_BASED_MOFFSET);
}
-#endif
#endif //_TARGET_X86_
}
@@ -8863,13 +8781,11 @@ BYTE* emitter::emitOutputCV(BYTE* dst, instrDesc* id, code_t code, CnsVal* addc)
default:
assert(!"unexpected operand size");
}
-#ifdef RELOC_SUPPORT
if (addc->cnsReloc)
{
emitRecordRelocation((void*)(dst - sizeof(INT32)), (void*)(size_t)cval, IMAGE_REL_BASED_HIGHLOW);
assert(opsz == 4);
}
-#endif
}
// Does this instruction operate on a GC ref value?
@@ -9591,12 +9507,10 @@ BYTE* emitter::emitOutputRI(BYTE* dst, instrDesc* id)
ssize_t val = emitGetInsSC(id);
bool valInByte = ((signed char)val == val) && (ins != INS_mov) && (ins != INS_test);
-#ifdef RELOC_SUPPORT
if (id->idIsCnsReloc())
{
valInByte = false; // relocs can't be placed in a byte
}
-#endif
noway_assert(emitVerifyEncodable(ins, size, reg));
@@ -9684,12 +9598,10 @@ BYTE* emitter::emitOutputRI(BYTE* dst, instrDesc* id)
}
#endif
-#ifdef RELOC_SUPPORT
if (id->idIsCnsReloc())
{
emitRecordRelocation((void*)(dst - (unsigned)EA_SIZE(size)), (void*)(size_t)val, IMAGE_REL_BASED_MOFFSET);
}
-#endif
goto DONE;
}
@@ -9846,13 +9758,11 @@ BYTE* emitter::emitOutputRI(BYTE* dst, instrDesc* id)
break;
}
-#ifdef RELOC_SUPPORT
if (id->idIsCnsReloc())
{
emitRecordRelocation((void*)(dst - sizeof(INT32)), (void*)(size_t)val, IMAGE_REL_BASED_HIGHLOW);
assert(size == EA_4BYTE);
}
-#endif
}
DONE:
@@ -9961,7 +9871,6 @@ BYTE* emitter::emitOutputIV(BYTE* dst, instrDesc* id)
noway_assert(size < EA_8BYTE || ((int)val == val && !id->idIsCnsReloc()));
#endif
-#ifdef RELOC_SUPPORT
if (id->idIsCnsReloc())
{
valInByte = false; // relocs can't be placed in a byte
@@ -9969,7 +9878,6 @@ BYTE* emitter::emitOutputIV(BYTE* dst, instrDesc* id)
// Of these instructions only the push instruction can have reloc
assert(ins == INS_push || ins == INS_push_hide);
}
-#endif
switch (ins)
{
@@ -10011,12 +9919,10 @@ BYTE* emitter::emitOutputIV(BYTE* dst, instrDesc* id)
dst += emitOutputByte(dst, code);
dst += emitOutputLong(dst, val);
-#ifdef RELOC_SUPPORT
if (id->idIsCnsReloc())
{
emitRecordRelocation((void*)(dst - sizeof(INT32)), (void*)(size_t)val, IMAGE_REL_BASED_HIGHLOW);
}
-#endif
}
// Did we push a GC ref value?
@@ -10603,12 +10509,10 @@ size_t emitter::emitOutputInstr(insGroup* ig, instrDesc* id, BYTE** dp)
dst += emitOutputLong(dst, offset);
-#ifdef RELOC_SUPPORT
if (id->idIsDspReloc())
{
emitRecordRelocation((void*)(dst - sizeof(INT32)), addr, IMAGE_REL_BASED_REL32);
}
-#endif
DONE_CALL:
diff --git a/src/jit/emitxarch.h b/src/jit/emitxarch.h
index 82b55a962f..faeba7d942 100644
--- a/src/jit/emitxarch.h
+++ b/src/jit/emitxarch.h
@@ -40,9 +40,7 @@ typedef unsigned __int64 code_t;
struct CnsVal
{
ssize_t cnsVal;
-#ifdef RELOC_SUPPORT
- bool cnsReloc;
-#endif
+ bool cnsReloc;
};
UNATIVE_OFFSET emitInsSize(code_t code);
diff --git a/src/jit/gentree.cpp b/src/jit/gentree.cpp
index 3b1016bfa9..c5733b81e4 100644
--- a/src/jit/gentree.cpp
+++ b/src/jit/gentree.cpp
@@ -15975,11 +15975,7 @@ size_t GenTreeIndir::Offset()
bool GenTreeIntConCommon::ImmedValNeedsReloc(Compiler* comp)
{
-#ifdef RELOC_SUPPORT
return comp->opts.compReloc && (gtOper == GT_CNS_INT) && IsIconHandle();
-#else
- return false;
-#endif
}
//------------------------------------------------------------------------
diff --git a/src/jit/instr.cpp b/src/jit/instr.cpp
index 56b9e86655..e2435cab28 100644
--- a/src/jit/instr.cpp
+++ b/src/jit/instr.cpp
@@ -797,7 +797,6 @@ void CodeGen::sched_AM(instruction ins,
}
else if (addr->IsCnsIntOrI())
{
-#ifdef RELOC_SUPPORT
// Do we need relocations?
if (compiler->opts.compReloc && addr->IsIconHandle())
{
@@ -806,7 +805,6 @@ void CodeGen::sched_AM(instruction ins,
// so that we can uniquely identify the handle
assert(offs <= 4);
}
-#endif
ssize_t disp = addr->gtIntCon.gtIconVal + offs;
if ((insType == eIT_Store) && (ireg != REG_NA))
{
@@ -1113,7 +1111,6 @@ void CodeGen::sched_AM(instruction ins,
assert(addr->IsCnsIntOrI());
-#ifdef RELOC_SUPPORT
// Do we need relocations?
if (compiler->opts.compReloc && addr->IsIconHandle())
{
@@ -1122,7 +1119,7 @@ void CodeGen::sched_AM(instruction ins,
// so that we can uniquely identify the handle
assert(offs <= 4);
}
-#endif
+
reg = REG_NA;
ssize_t disp = addr->gtIntCon.gtIconVal + offs;
@@ -3894,9 +3891,7 @@ void CodeGen::instGen_Set_Reg_To_Zero(emitAttr size, regNumber reg, insFlags fla
*/
void CodeGen::instGen_Set_Reg_To_Imm(emitAttr size, regNumber reg, ssize_t imm, insFlags flags)
{
-#if RELOC_SUPPORT
if (!compiler->opts.compReloc)
-#endif // RELOC_SUPPORT
{
size = EA_SIZE(size); // Strip any Reloc flags from size if we aren't doing relocs
}
diff --git a/src/jit/jit.h b/src/jit/jit.h
index cec24a9b3f..ee3f8c9117 100644
--- a/src/jit/jit.h
+++ b/src/jit/jit.h
@@ -742,17 +742,6 @@ private:
/*****************************************************************************/
-#define SECURITY_CHECK 1
-#define VERIFY_IMPORTER 1
-
-/*****************************************************************************/
-
-#if !defined(RELOC_SUPPORT)
-#define RELOC_SUPPORT 1
-#endif
-
-/*****************************************************************************/
-
#include "error.h"
/*****************************************************************************/