Skip to content

Commit

Permalink
Removal of IBC infrastructure (#68717)
Browse files Browse the repository at this point in the history
* Removal of IBC infrastructure

* Crossgen2 - remove tuning flag.
  • Loading branch information
AaronRobinsonMSFT authored May 16, 2022
1 parent e71a46b commit 4f01044
Show file tree
Hide file tree
Showing 78 changed files with 194 additions and 5,354 deletions.
6 changes: 0 additions & 6 deletions src/coreclr/classlibnative/bcltype/arraynative.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1081,9 +1081,6 @@ FCIMPL2_IV(void, ArrayNative::InitializeArray, ArrayBase* pArrayRef, FCALLRuntim
if (!pField->IsRVA())
COMPlusThrow(kArgumentException);

// Report the RVA field to the logger.
g_IBCLogger.LogRVADataAccess(pField);

// Note that we do not check that the field is actually in the PE file that is initializing
// the array. Basically the data being published is can be accessed by anyone with the proper
// permissions (C# marks these as assembly visibility, and thus are protected from outside
Expand Down Expand Up @@ -1161,9 +1158,6 @@ FCIMPL3_VVI(void*, ArrayNative::GetSpanDataFrom, FCALLRuntimeFieldHandle structF
DWORD totalSize = pField->LoadSize();
DWORD targetTypeSize = targetTypeHandle.GetSize();

// Report the RVA field to the logger.
g_IBCLogger.LogRVADataAccess(pField);

data = pField->GetStaticAddressHandle(NULL);
_ASSERTE(data != NULL);
_ASSERTE(count != NULL);
Expand Down
596 changes: 0 additions & 596 deletions src/coreclr/inc/corbbtprof.h

This file was deleted.

167 changes: 0 additions & 167 deletions src/coreclr/inc/corcompile.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
* *
* *
\*****************************************************************************/
// See code:CorProfileData for information on Hot Cold splitting using profile data.


#ifndef _COR_COMPILE_H_
#define _COR_COMPILE_H_
Expand All @@ -24,7 +22,6 @@
#include <sstring.h>
#include <shash.h>
#include <daccess.h>
#include <corbbtprof.h>
#include <clrtypes.h>

typedef DPTR(struct CORCOMPILE_EXCEPTION_LOOKUP_TABLE)
Expand Down Expand Up @@ -55,9 +52,6 @@ typedef DPTR(RUNTIME_FUNCTION) PTR_RUNTIME_FUNCTION;

#endif // TARGET_X86


typedef DPTR(struct CORCOMPILE_METHOD_PROFILE_LIST)
PTR_CORCOMPILE_METHOD_PROFILE_LIST;
typedef DPTR(struct CORCOMPILE_RUNTIME_DLL_INFO)
PTR_CORCOMPILE_RUNTIME_DLL_INFO;
typedef DPTR(struct COR_ILMETHOD) PTR_COR_ILMETHOD;
Expand Down Expand Up @@ -290,167 +284,6 @@ struct CORCOMPILE_EXCEPTION_CLAUSE
};
};


/*********************************************************************************/
// The layout of this struct is required to be
// a 'next' pointer followed by a CORBBTPROF_METHOD_HEADER
//
struct CORCOMPILE_METHOD_PROFILE_LIST
{
CORCOMPILE_METHOD_PROFILE_LIST * next;
// CORBBTPROF_METHOD_HEADER info;

CORBBTPROF_METHOD_HEADER * GetInfo()
{ return (CORBBTPROF_METHOD_HEADER *) (this+1); }
};

class CorProfileData
{
public:
CorProfileData(void * rawProfileData); // really of type ZapImage::ProfileDataSection*

struct CORBBTPROF_TOKEN_INFO * GetTokenFlagsData(SectionFormat section)
{
return this->profilingTokenFlagsData[section].data;
}

DWORD GetTokenFlagsCount(SectionFormat section)
{
return this->profilingTokenFlagsData[section].count;
}

CORBBTPROF_BLOB_ENTRY * GetBlobStream()
{
return this->blobStream;
}

//
// Token lookup methods
//
ULONG GetTypeProfilingFlagsOfToken(mdToken token)
{
_ASSERTE(TypeFromToken(token) == mdtTypeDef);
return GetProfilingFlagsOfToken(token);
}

CORBBTPROF_BLOB_PARAM_SIG_ENTRY *GetBlobSigEntry(mdToken token)
{
_ASSERTE((TypeFromToken(token) == ibcTypeSpec) || (TypeFromToken(token) == ibcMethodSpec));

CORBBTPROF_BLOB_ENTRY * pBlobEntry = GetBlobEntry(token);
if (pBlobEntry == NULL)
return NULL;

_ASSERTE(pBlobEntry->token == token);
_ASSERTE((pBlobEntry->type == ParamTypeSpec) || (pBlobEntry->type == ParamMethodSpec));

return (CORBBTPROF_BLOB_PARAM_SIG_ENTRY *) pBlobEntry;
}

CORBBTPROF_BLOB_NAMESPACE_DEF_ENTRY *GetBlobExternalNamespaceDef(mdToken token)
{
_ASSERTE(TypeFromToken(token) == ibcExternalNamespace);

CORBBTPROF_BLOB_ENTRY * pBlobEntry = GetBlobEntry(token);
if (pBlobEntry == NULL)
return NULL;

_ASSERTE(pBlobEntry->token == token);
_ASSERTE(pBlobEntry->type == ExternalNamespaceDef);

return (CORBBTPROF_BLOB_NAMESPACE_DEF_ENTRY *) pBlobEntry;
}

CORBBTPROF_BLOB_TYPE_DEF_ENTRY *GetBlobExternalTypeDef(mdToken token)
{
_ASSERTE(TypeFromToken(token) == ibcExternalType);

CORBBTPROF_BLOB_ENTRY * pBlobEntry = GetBlobEntry(token);
if (pBlobEntry == NULL)
return NULL;

_ASSERTE(pBlobEntry->token == token);
_ASSERTE(pBlobEntry->type == ExternalTypeDef);

return (CORBBTPROF_BLOB_TYPE_DEF_ENTRY *) pBlobEntry;
}

CORBBTPROF_BLOB_SIGNATURE_DEF_ENTRY *GetBlobExternalSignatureDef(mdToken token)
{
_ASSERTE(TypeFromToken(token) == ibcExternalSignature);

CORBBTPROF_BLOB_ENTRY * pBlobEntry = GetBlobEntry(token);
if (pBlobEntry == NULL)
return NULL;

_ASSERTE(pBlobEntry->token == token);
_ASSERTE(pBlobEntry->type == ExternalSignatureDef);

return (CORBBTPROF_BLOB_SIGNATURE_DEF_ENTRY *) pBlobEntry;
}

CORBBTPROF_BLOB_METHOD_DEF_ENTRY *GetBlobExternalMethodDef(mdToken token)
{
_ASSERTE(TypeFromToken(token) == ibcExternalMethod);

CORBBTPROF_BLOB_ENTRY * pBlobEntry = GetBlobEntry(token);
if (pBlobEntry == NULL)
return NULL;

_ASSERTE(pBlobEntry->token == token);
_ASSERTE(pBlobEntry->type == ExternalMethodDef);

return (CORBBTPROF_BLOB_METHOD_DEF_ENTRY *) pBlobEntry;
}

private:
ULONG GetProfilingFlagsOfToken(mdToken token)
{
SectionFormat section = (SectionFormat)((TypeFromToken(token) >> 24) + FirstTokenFlagSection);

CORBBTPROF_TOKEN_INFO *profilingData = this->profilingTokenFlagsData[section].data;
DWORD cProfilingData = this->profilingTokenFlagsData[section].count;

if (profilingData != NULL)
{
for (DWORD i = 0; i < cProfilingData; i++)
{
if (profilingData[i].token == token)
return profilingData[i].flags;
}
}
return 0;
}

CORBBTPROF_BLOB_ENTRY *GetBlobEntry(idTypeSpec token)
{
CORBBTPROF_BLOB_ENTRY * pBlobEntry = this->GetBlobStream();
if (pBlobEntry == NULL)
return NULL;

while (pBlobEntry->TypeIsValid())
{
if (pBlobEntry->token == token)
{
return pBlobEntry;
}
pBlobEntry = pBlobEntry->GetNextEntry();
}

return NULL;
}

private:
struct
{
struct CORBBTPROF_TOKEN_INFO *data;
DWORD count;
}
profilingTokenFlagsData[SectionFormatCount];

CORBBTPROF_BLOB_ENTRY* blobStream;
};

/*********************************************************************************/
// When NGEN install /Profile is run, the ZapProfilingHandleImport fixup table contains
// these 5 values per MethodDesc
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/inc/mdcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ enum MAPPINGTYPE
#define COMPRESSED_MODEL_STREAM_A "#~"
#define ENC_MODEL_STREAM_A "#-"
#define MINIMAL_MD_STREAM_A "#JTD"
#define HOT_MODEL_STREAM_A "#!"
#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
#define PDB_STREAM_A "#Pdb"
#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
Expand All @@ -50,7 +49,6 @@ enum MAPPINGTYPE
#define COMPRESSED_MODEL_STREAM W("#~")
#define ENC_MODEL_STREAM W("#-")
#define MINIMAL_MD_STREAM W("#JTD")
#define HOT_MODEL_STREAM W("#!")
#ifdef FEATURE_METADATA_EMIT_PORTABLE_PDB
#define PDB_STREAM W("#Pdb")
#endif // FEATURE_METADATA_EMIT_PORTABLE_PDB
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/inc/metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#include "ex.h"

class CorProfileData;
class IMetaModelCommon;
class MDInternalRW;
class UTSemReadWrite;
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/inc/stgpool.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ const int DFT_CODE_HEAP_SIZE = 8192;
class StgStringPool;
class StgBlobPool;
class StgCodePool;
class CorProfileData;

// Perform binary search on index table.
//
Expand Down
1 change: 0 additions & 1 deletion src/coreclr/md/compiler/regmeta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ RegMeta::RegMeta() :
m_SetAPICaller(EXTERNAL_CALLER),
m_ModuleType(ValidatorModuleTypeInvalid),
m_bKeepKnownCa(false),
m_pCorProfileData(NULL),
m_ReorderingOptions(NoReordering)
#ifdef FEATURE_METADATA_RELEASE_MEMORY_ON_REOPEN
, m_safeToDeleteStgdb(true)
Expand Down
2 changes: 0 additions & 2 deletions src/coreclr/md/compiler/regmeta.h
Original file line number Diff line number Diff line change
Expand Up @@ -2059,8 +2059,6 @@ class RegMeta :

bool m_bKeepKnownCa; // Should all known CA's be kept?

CorProfileData *m_pCorProfileData;

MetaDataReorderingOptions m_ReorderingOptions;

#ifdef FEATURE_METADATA_RELEASE_MEMORY_ON_REOPEN
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/md/compiler/regmeta_emit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ HRESULT RegMeta::_SaveToStream( // S_OK or error.
HRESULT hr=S_OK;

IfFailGo(PreSave());
IfFailGo( m_pStgdb->SaveToStream(pIStream, m_ReorderingOptions, m_pCorProfileData) );
IfFailGo( m_pStgdb->SaveToStream(pIStream, m_ReorderingOptions) );

// Reset m_bSaveOptimized, this is to handle the incremental and ENC
// scenerios where one may do multiple saves.
Expand Down Expand Up @@ -281,7 +281,7 @@ STDMETHODIMP RegMeta::GetSaveSize( // S_OK or error.

IfFailGo(PreSave());

hr = m_pStgdb->GetSaveSize(fSave, (UINT32 *)pdwSaveSize, m_ReorderingOptions, m_pCorProfileData);
hr = m_pStgdb->GetSaveSize(fSave, (UINT32 *)pdwSaveSize, m_ReorderingOptions);

ErrExit:
STOP_MD_PERF(GetSaveSize);
Expand Down Expand Up @@ -792,7 +792,7 @@ HRESULT RegMeta::PreSave() // Return code.
m_bSaveOptimized = true;

// call get save size to trigger the PreSaveXXX on MetaModelRW class.
IfFailGo(m_pStgdb->m_MiniMd.PreSave(m_ReorderingOptions, m_pCorProfileData));
IfFailGo(m_pStgdb->m_MiniMd.PreSave(m_ReorderingOptions));

ErrExit:
m_bRemap = bRemapOld;
Expand Down
Loading

0 comments on commit 4f01044

Please sign in to comment.