Skip to content
Closed
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: 2 additions & 5 deletions src/coreclr/clrdefinitions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,9 @@ if(CLR_CMAKE_HOST_WIN32)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif(CLR_CMAKE_HOST_WIN32)

if (NOT (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_UNIX))
add_compile_definitions(EnC_SUPPORTED)
endif()
if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_WIN32))
if(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_ARM OR (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_WIN32))
add_compile_definitions(FEATURE_ENC_SUPPORTED)
endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_WIN32))
endif(CLR_CMAKE_TARGET_ARCH_AMD64 OR CLR_CMAKE_TARGET_ARCH_ARM64 OR CLR_CMAKE_TARGET_ARCH_ARM OR (CLR_CMAKE_TARGET_ARCH_I386 AND CLR_CMAKE_TARGET_WIN32))

if(CLR_CMAKE_TARGET_WIN32 AND CLR_CMAKE_TARGET_ARCH_AMD64)
add_compile_definitions(OUT_OF_PROCESS_SETTHREADCONTEXT)
Expand Down
28 changes: 14 additions & 14 deletions src/coreclr/debug/daccess/dacdbiimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ void DacDbiInterfaceImpl::GetCompilerFlags (
bool DacDbiInterfaceImpl::CanSetEnCBits(Module * pModule)
{
_ASSERTE(pModule != NULL);
#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
// If we're using explicit sequence points (from the PDB), then we can't do EnC
// because EnC won't get updated pdbs and so the sequence points will be wrong.
bool fIgnorePdbs = ((pModule->GetDebuggerInfoBits() & DACF_IGNORE_PDBS) != 0);
Expand All @@ -736,10 +736,10 @@ bool DacDbiInterfaceImpl::CanSetEnCBits(Module * pModule)
!CORProfilerPresent() && // this queries target
#endif
fIgnorePdbs;
#else // ! EnC_SUPPORTED
#else // ! FEATURE_ENC_SUPPORTED
// Enc not supported on any other platforms.
bool fAllowEnc = false;
#endif
#endif // ! FEATURE_ENC_SUPPORTED

return fAllowEnc;
} // DacDbiInterfaceImpl::SetEnCBits
Expand Down Expand Up @@ -1517,7 +1517,7 @@ unsigned int DacDbiInterfaceImpl::GetTotalFieldCount(TypeHandle thApprox)
unsigned int IFCount = pMT->GetNumIntroducedInstanceFields();
unsigned int SFCount = pMT->GetNumStaticFields();

#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
PTR_Module pModule = pMT->GetModule();

// Stats above don't include EnC fields. So add them now.
Expand All @@ -1535,7 +1535,7 @@ unsigned int DacDbiInterfaceImpl::GetTotalFieldCount(TypeHandle thApprox)
SFCount += pEncData->GetAddedStaticFields();
}
}
#endif
#endif // FEATURE_ENC_SUPPORTED
return IFCount + SFCount;
} // DacDbiInterfaceImpl::GetTotalFieldCount

Expand Down Expand Up @@ -1612,7 +1612,7 @@ void DacDbiInterfaceImpl::ComputeFieldData(PTR_FieldDesc pFD,
{
pCurrentFieldData->Initialize(pFD->IsStatic(), pFD->IsPrimitive(), pFD->GetMemberDef());

#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
// If the field was newly introduced via EnC, and hasn't yet
// been fixed up, then we'll send back a marker indicating
// that it isn't yet available.
Expand All @@ -1627,7 +1627,7 @@ void DacDbiInterfaceImpl::ComputeFieldData(PTR_FieldDesc pFD,
pCurrentFieldData->m_fFldIsCollectibleStatic = FALSE;
}
else
#endif // EnC_SUPPORTED
#endif // FEATURE_ENC_SUPPORTED
{
// Otherwise, we'll compute the info & send it back.
pCurrentFieldData->m_fFldStorageAvailable = TRUE;
Expand Down Expand Up @@ -3934,7 +3934,7 @@ FieldDesc * DacDbiInterfaceImpl::GetEnCFieldDesc(const EnCHangingFieldInfo * pEn
//-----------------------------------------------------------------------------
PTR_CBYTE DacDbiInterfaceImpl::GetPtrToEnCField(FieldDesc * pFD, const EnCHangingFieldInfo * pEnCFieldInfo)
{
#ifndef EnC_SUPPORTED
#ifndef FEATURE_ENC_SUPPORTED
_ASSERTE(!"Trying to get the address of an EnC field where EnC is not supported! ");
return NULL;
#else
Expand Down Expand Up @@ -3971,7 +3971,7 @@ PTR_CBYTE DacDbiInterfaceImpl::GetPtrToEnCField(FieldDesc * pFD, const EnCHangin
ThrowHR(CORDBG_E_ENC_HANGING_FIELD);
}
return pORField;
#endif // EnC_SUPPORTED
#endif // FEATURE_ENC_SUPPORTED
} // DacDbiInterfaceImpl::GetPtrToEnCField

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -4047,11 +4047,11 @@ void DacDbiInterfaceImpl::GetEnCHangingFieldInfo(const EnCHangingFieldInfo * pEn
_ASSERTE(pFD->IsEnCNew()); // We shouldn't be here if it wasn't added to an
// already loaded class.

#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
pORField = GetPtrToEnCField(pFD, pEnCFieldInfo);
#else
_ASSERTE(!"We shouldn't be here: EnC not supported");
#endif // EnC_SUPPORTED
#endif // FEATURE_ENC_SUPPORTED

InitFieldData(pFD, pORField, pEnCFieldInfo, pFieldData);
*pfStatic = (pFD->IsStatic() != 0);
Expand Down Expand Up @@ -4237,11 +4237,11 @@ HRESULT DacDbiInterfaceImpl::IsModuleMapped(VMPTR_Module pModule, OUT BOOL *isMo
bool DacDbiInterfaceImpl::MetadataUpdatesApplied()
{
DD_ENTER_MAY_THROW;
#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
return g_metadataUpdatesApplied;
#else
return false;
#endif
#endif // !FEATURE_ENC_SUPPORTED
}

// Helper to initialize a TargetBuffer from a MemoryRange
Expand Down Expand Up @@ -7424,7 +7424,7 @@ HRESULT DacDbiInterfaceImpl::AreOptimizationsDisabled(VMPTR_Module vmModule, mdM
#else
pOptimizationsDisabled->SetDacTargetPtr(0);
#endif

return S_OK;
}

Expand Down
16 changes: 8 additions & 8 deletions src/coreclr/debug/di/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1852,7 +1852,7 @@ CordbFunction * CordbModule::CreateFunction(mdMethodDef funcMetaDataToken, SIZE_
return pCopy;
}

#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
//---------------------------------------------------------------------------------------
//
// Creates a new CordbFunction object to represent this new version of a function and
Expand Down Expand Up @@ -1929,7 +1929,7 @@ HRESULT CordbModule::UpdateFunction(mdMethodDef funcMetaDataToken,

return hr;
}
#endif // EnC_SUPPORTED
#endif // FEATURE_ENC_SUPPORTED


HRESULT CordbModule::LookupOrCreateClass(mdTypeDef classMetaDataToken,CordbClass** ppClass)
Expand Down Expand Up @@ -3078,9 +3078,9 @@ HRESULT CordbCode::GetVersionNumber( ULONG32 *nVersion)

*nVersion = (ULONG32)m_nVersion;

#ifndef EnC_SUPPORTED
#ifndef FEATURE_ENC_SUPPORTED
_ASSERTE(*nVersion == 1);
#endif // EnC_SUPPORTED
#endif // FEATURE_ENC_SUPPORTED

return S_OK;
}
Expand Down Expand Up @@ -3114,16 +3114,16 @@ CordbILCode::CordbILCode(CordbFunction * pFunction,
mdSignature localVarSigToken,
UINT_PTR id)
: CordbCode(pFunction, id, nVersion, TRUE),
#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
m_fIsOld(FALSE),
#endif
#endif // FEATURE_ENC_SUPPORTED
m_codeRegionInfo(codeRegionInfo),
m_localVarSigToken(localVarSigToken)
{
} // CordbILCode::CordbILCode


#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
//-----------------------------------------------------------------------------
// CordbILCode::MakeOld
// Internal method to perform any cleanup necessary when a code blob is no longer
Expand All @@ -3133,7 +3133,7 @@ void CordbILCode::MakeOld()
{
m_fIsOld = TRUE;
}
#endif
#endif // FEATURE_ENC_SUPPORTED

//-----------------------------------------------------------------------------
// CordbILCode::GetAddress
Expand Down
16 changes: 8 additions & 8 deletions src/coreclr/debug/di/rsfunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ HRESULT CordbFunction::CreateBreakpoint(ICorDebugFunctionBreakpoint **ppBreakpoi
return hr;
}

#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
//-----------------------------------------------------------------------------
// CordbFunction::MakeOld
// Internal method to do any cleanup necessary when a Function is no longer
Expand All @@ -440,7 +440,7 @@ void CordbFunction::MakeOld()
m_pILCode->MakeOld();
}
}
#endif
#endif // FEATURE_ENC_SUPPORTED

//-----------------------------------------------------------------------------
// CordbFunction::GetLocalVarSigToken
Expand Down Expand Up @@ -501,11 +501,11 @@ HRESULT CordbFunction::GetCurrentVersionNumber(ULONG32 *pnCurrentVersion)

*pnCurrentVersion = (ULONG32)(curFunc->m_dwEnCVersionNumber);

#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
_ASSERTE( *pnCurrentVersion >= this->m_dwEnCVersionNumber );
#else
_ASSERTE(*pnCurrentVersion == CorDB_DEFAULT_ENC_FUNCTION_VERSION);
#endif
#endif // !FEATURE_ENC_SUPPORTED

return hr;
}
Expand Down Expand Up @@ -536,11 +536,11 @@ HRESULT CordbFunction::GetVersionNumber(ULONG32 *pnVersion)

*pnVersion = (ULONG32)m_dwEnCVersionNumber;

#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
_ASSERTE(*pnVersion >= CorDB_DEFAULT_ENC_FUNCTION_VERSION);
#else
_ASSERTE(*pnVersion == CorDB_DEFAULT_ENC_FUNCTION_VERSION);
#endif
#endif // !FEATURE_ENC_SUPPORTED

return S_OK;
}
Expand Down Expand Up @@ -616,7 +616,7 @@ HRESULT CordbFunction::CreateNativeBreakpoint(ICorDebugFunctionBreakpoint **ppBr
// Triggers a new JIT so the next time the function is called, it will be unoptimized.
//
// Parameters
//
//
//
// Returns:
// S_OK on success.
Expand Down Expand Up @@ -656,7 +656,7 @@ HRESULT CordbFunction::DisableOptimizations()
//
// Parameters:
// BOOL *pOptimizationsDisabled
//
//
//
// Returns:
// S_OK on success.
Expand Down
14 changes: 7 additions & 7 deletions src/coreclr/debug/di/rspriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -5120,13 +5120,13 @@ class CordbClass : public CordbBase, public ICorDebugClass, public ICorDebugClas
mdFieldDef fieldDef);
mdTypeDef GetTypeDef() { return (mdTypeDef)m_id; }

#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
// when we get an added field or method, mark the class to force re-init when we access it
void MakeOld()
{
m_loadLevel = Constructed;
}
#endif // EnC_SUPPORTED
#endif // FEATURE_ENC_SUPPORTED

//-----------------------------------------------------------
// Data members
Expand Down Expand Up @@ -5458,9 +5458,9 @@ class CordbFunction : public CordbBase,
CordbReJitILCode** ppILCode);


#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
void MakeOld();
#endif
#endif // FEATURE_ENC_SUPPORTED

//-----------------------------------------------------------
// Accessors
Expand Down Expand Up @@ -5755,9 +5755,9 @@ class CordbILCode : public CordbCode
// get total size of the IL code
ULONG32 GetSize() { return m_codeRegionInfo.cbSize; }

#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
void MakeOld();
#endif // EnC_SUPPORTED
#endif // FEATURE_ENC_SUPPORTED

HRESULT GetLocalVarSig(SigParser *pLocalsSigParser, ULONG *pLocalVarCount);
HRESULT GetLocalVariableType(DWORD dwIndex, const Instantiation * pInst, CordbType ** ppResultType);
Expand All @@ -5775,7 +5775,7 @@ class CordbILCode : public CordbCode
//-----------------------------------------------------------

private:
#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
UINT m_fIsOld : 1; // marks this instance as an old EnC version
bool m_encBreakpointsApplied;
#endif
Expand Down
20 changes: 10 additions & 10 deletions src/coreclr/debug/ee/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2773,7 +2773,7 @@ DPOSS_ACTION DebuggerController::ScanForTriggers(CORDB_ADDRESS_TYPE *address,
return used;
}

#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
// This function will check for an EnC patch at the given address and return
// it if one is there, otherwise it will return NULL.
DebuggerControllerPatch *DebuggerController::GetEnCPatch(const BYTE *address)
Expand Down Expand Up @@ -2822,7 +2822,7 @@ DPOSS_ACTION DebuggerController::ScanForTriggers(CORDB_ADDRESS_TYPE *address,

return NULL;
}
#endif //EnC_SUPPORTED
#endif //FEATURE_ENC_SUPPORTED

// DebuggerController::DispatchPatchOrSingleStep - Ask any patches that are active at a given
// address if they want to do anything about the exception that's occurred there. How: For the given
Expand Down Expand Up @@ -2871,7 +2871,7 @@ DPOSS_ACTION DebuggerController::DispatchPatchOrSingleStep(Thread *thread, CONTE

TADDR originalAddress = 0;

#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
DebuggerControllerPatch *dcpEnCOriginal = NULL;

// If this sequence point has an EnC patch, we want to process it ahead of any others. If the
Expand Down Expand Up @@ -2912,7 +2912,7 @@ DPOSS_ACTION DebuggerController::DispatchPatchOrSingleStep(Thread *thread, CONTE
LOG((LF_CORDB|LF_ENC,LL_INFO10000, "DC::DPOSS done EnC short-circuit, ignoring\n"));
// if we got here, then the EnC remap opportunity was not taken, so just continue on.
}
#endif // EnC_SUPPORTED
#endif // FEATURE_ENC_SUPPORTED

TP_RESULT tpr;

Expand Down Expand Up @@ -3000,7 +3000,7 @@ DPOSS_ACTION DebuggerController::DispatchPatchOrSingleStep(Thread *thread, CONTE
}
}

#if defined EnC_SUPPORTED
#if defined FEATURE_ENC_SUPPORTED
Exit:
#endif

Expand All @@ -3009,7 +3009,7 @@ DPOSS_ACTION DebuggerController::DispatchPatchOrSingleStep(Thread *thread, CONTE
// @todo - do we need to get the context again here?
CONTEXT *pCtx = GetManagedLiveCtx(thread);

#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
DebuggerControllerPatch *dcpEnCCurrent = GetEnCPatch(dac_cast<PTR_CBYTE>((GetIP(context))));

// we have a new patch if the original was null and the current is non-null. Otherwise we have an old
Expand Down Expand Up @@ -3094,7 +3094,7 @@ void DebuggerController::EnableSingleStep()
m_singleStep = true;
}

#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED
// Note that this doesn't tell us if Single Stepping is currently enabled
// at the hardware level (ie, for x86, if (context->EFlags & 0x100), but
// rather, if we WANT single stepping enabled (pThread->m_State &Thread::TS_DebuggerIsStepping)
Expand All @@ -3119,7 +3119,7 @@ BOOL DebuggerController::IsSingleStepEnabled(Thread *pThread)
else
return FALSE;
}
#endif //EnC_SUPPORTED
#endif //FEATURE_ENC_SUPPORTED

void DebuggerController::EnableSingleStep(Thread *pThread)
{
Expand Down Expand Up @@ -8627,7 +8627,7 @@ bool DebuggerFuncEvalComplete::SendEvent(Thread *thread, bool fIpChanged)
return true;
}

#ifdef EnC_SUPPORTED
#ifdef FEATURE_ENC_SUPPORTED

// * ------------------------------------------------------------------------ *
// * DebuggerEnCBreakpoint routines
Expand Down Expand Up @@ -8895,7 +8895,7 @@ TP_RESULT DebuggerEnCBreakpoint::HandleRemapComplete(DebuggerControllerPatch *pa

return TPR_IGNORE_AND_STOP;
}
#endif //EnC_SUPPORTED
#endif //FEATURE_ENC_SUPPORTED

// continuable-exceptions
// * ------------------------------------------------------------------------ *
Expand Down
Loading