Skip to content

Commit

Permalink
Auto-generate all C++ header overrides of the entire jit interface (d…
Browse files Browse the repository at this point in the history
…otnet#45920)

* Auto-generate all C++ header overrides of the entire jit interface
- This reduces the amount of manual change required when updating the jit interface to just implementation changes
- Will cause compile errors if any api is removed from the interface, but not removed from various implementations

* Consistently specify override on the jit ee interface header
- Satisfies warnings on clang
  • Loading branch information
davidwrighton committed Dec 14, 2020
1 parent 1aac928 commit 7696202
Show file tree
Hide file tree
Showing 8 changed files with 769 additions and 1,767 deletions.
713 changes: 2 additions & 711 deletions src/coreclr/ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h

Large diffs are not rendered by default.

716 changes: 716 additions & 0 deletions src/coreclr/inc/icorjitinfoimpl_generated.h

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -552,8 +552,6 @@ static void SPMI_ICorJitInfoImpl(TextWriter tw, IEnumerable<FunctionDecl> functi
{
WriteAutogeneratedHeader(tw);
tw.Write(@"
#ifndef _ICorJitInfoImpl
#define _ICorJitInfoImpl
// ICorJitInfoImpl: declare for implementation all the members of the ICorJitInfo interface (which are
// specified as pure virtual methods). This is done once, here, and all implementations share it,
Expand Down Expand Up @@ -587,11 +585,10 @@ static void SPMI_ICorJitInfoImpl(TextWriter tw, IEnumerable<FunctionDecl> functi
}
tw.Write(Environment.NewLine + " " + param.Type.NativeTypeName2 + " " + param.Name);
}
tw.WriteLine(");");
tw.WriteLine(") override;");
}

tw.Write(@"
#endif // _ICorJitInfoImpl
/**********************************************************************************/
// clang-format on
/**********************************************************************************/
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/tools/Common/JitInterface/ThunkGenerator/gen.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pushd %~dp0
call ..\..\..\..\..\..\..\dotnet.cmd run -- ThunkInput.txt ..\CorInfoBase.cs ..\..\..\aot\jitinterface\jitinterface.h ..\..\..\..\jit\ICorJitInfo_API_names.h ..\..\..\..\jit\ICorJitInfo_API_wrapper.hpp ..\..\..\..\ToolBox\superpmi\superpmi-shared\icorjitinfoimpl.h ..\..\..\..\ToolBox\superpmi\superpmi-shim-counter\icorjitinfo.cpp ..\..\..\..\ToolBox\superpmi\superpmi-shim-simple\icorjitinfo.cpp
call ..\..\..\..\..\..\..\dotnet.cmd run -- InstructionSetGenerator InstructionSetDesc.txt ..\..\Internal\Runtime\ReadyToRunInstructionSet.cs ..\..\Internal\Runtime\ReadyToRunInstructionSetHelper.cs ..\CorInfoInstructionSet.cs ..\..\..\..\inc\corinfoinstructionset.h ..\..\..\..\inc\readytoruninstructionset.h
call ..\..\..\..\..\..\dotnet.cmd run -- ThunkInput.txt ..\CorInfoBase.cs ..\..\..\aot\jitinterface\jitinterface.h ..\..\..\..\jit\ICorJitInfo_API_names.h ..\..\..\..\jit\ICorJitInfo_API_wrapper.hpp ..\..\..\..\inc\icorjitinfoimpl_generated.h ..\..\..\..\ToolBox\superpmi\superpmi-shim-counter\icorjitinfo.cpp ..\..\..\..\ToolBox\superpmi\superpmi-shim-simple\icorjitinfo.cpp
call ..\..\..\..\..\..\dotnet.cmd run -- InstructionSetGenerator InstructionSetDesc.txt ..\..\Internal\Runtime\ReadyToRunInstructionSet.cs ..\..\Internal\Runtime\ReadyToRunInstructionSetHelper.cs ..\CorInfoInstructionSet.cs ..\..\..\..\inc\corinfoinstructionset.h ..\..\..\..\inc\readytoruninstructionset.h
popd
4 changes: 2 additions & 2 deletions src/coreclr/tools/Common/JitInterface/ThunkGenerator/gen.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
cd "$(dirname ${BASH_SOURCE[0]})"
../../../../../../../dotnet.sh run -- ThunkInput.txt ../CorInfoBase.cs ../../../aot/jitinterface/jitinterface.h ../../../../jit/ICorJitInfo_API_names.h ../../../../jit/ICorJitInfo_API_wrapper.hpp ../../../../ToolBox/superpmi/superpmi-shared/icorjitinfoimpl.h ../../../../ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp ../../../../ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp
../../../../../../../dotnet.sh run -- InstructionSetGenerator InstructionSetDesc.txt ../../Internal/Runtime/ReadyToRunInstructionSet.cs ../../Internal/Runtime/ReadyToRunInstructionSetHelper.cs ../CorInfoInstructionSet.cs ../../../../inc/corinfoinstructionset.h ../../../../inc/readytoruninstructionset.h
../../../../../../dotnet.sh run -- ThunkInput.txt ../CorInfoBase.cs ../../../aot/jitinterface/jitinterface.h ../../../../jit/ICorJitInfo_API_names.h ../../../../jit/ICorJitInfo_API_wrapper.hpp ../../../../inc/icorjitinfoimpl_generated.h ../../../../ToolBox/superpmi/superpmi-shim-counter/icorjitinfo.cpp ../../../../ToolBox/superpmi/superpmi-shim-simple/icorjitinfo.cpp
../../../../../../dotnet.sh run -- InstructionSetGenerator InstructionSetDesc.txt ../../Internal/Runtime/ReadyToRunInstructionSet.cs ../../Internal/Runtime/ReadyToRunInstructionSetHelper.cs ../CorInfoInstructionSet.cs ../../../../inc/corinfoinstructionset.h ../../../../inc/readytoruninstructionset.h
10 changes: 10 additions & 0 deletions src/coreclr/vm/jitinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ BOOL ModifyCheckForDynamicMethod(DynamicResolver *pResolver,

/*****************************************************************************/

void CEEInfo::setOverride(ICorDynamicInfo *pOverride, CORINFO_METHOD_HANDLE currentMethod)
{
LIMITED_METHOD_CONTRACT;
m_pOverride = pOverride;
m_pMethodBeingCompiled = (MethodDesc *)currentMethod; // method being compiled

m_hMethodForSecurity_Key = NULL;
m_pMethodForSecurity_Value = NULL;
}

// Initialize from data we passed across to the JIT
void CEEInfo::GetTypeContext(const CORINFO_SIG_INST *info, SigTypeContext *pTypeContext)
{
Expand Down
Loading

0 comments on commit 7696202

Please sign in to comment.