Initial hot cold splitting support for crossgen2/VM #1900
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR marks the start of the work to get crossgen2 to support hot/cold splitting.
Here are the changes:
Scratch
, to be described in (13) below for more detail._methodColdCode
from_coldCode
and_coldCodeRelocs
duringPublishCode
._methodColdCode
and empty_coldCodeRelocs
duringCompileMethodCleanup
._methodColdCode
duringallocMem
.reserveUnwindInfo
to ignore unwind reservation forcoldCode
.allocUnwindInfo
to ignore unwindInfo allocation for 0 bytes.findKnownBlocks
to return_coldCodeReloc
whenBlockType.ColdCode
is asked for.recordRelocation
to setrelocTarget
to_methodColdCodeNode
whenBlockType.ColdCode
is asked for.MethodColdCodeNode
MethodGCInfoNode
toCalculateFuncletOffsets
so that the offset for the cold code chained unwind info is included if it exists.MethodWithGCInfo
to:MethodColdCodeNode
.GetFixupBlob
to include relocation for the cold code.RuntimeFunctionTableNode
to:ScratchNode
.ScratchNode
- the session is simply an array of cold code runtime function index to hot code runtime function index, so all even entries (e.g. 0, 2, 4) are cold code runtime function index and the corresponding odd indexes (e.g. 1, 3, 5) are the corresponding runtime function index for the corresponding hot code. The array is sorted by the cold code indexes, by (9), the hot code indexes should be sorted as well.--hot-cold-splitting
command-line option, and turn on theCORJIT_FLAG_PROCSPLIT
flag as needed.JitCodeToMethodInfo
already gave us a runtime function index, we do not know if it is hot or cold, so we use the scratch table to find it. If we got an even index, that would be cold code and therefore we map it back to the hot one.GetFuncletStartOffsets
to return the cold code block as well - technically the cold block is not a funclet, but it appears that the debugger might want it.IsFunclet
so that it avoids returningtrue
for the cold code block, by searching the scratch table.JitTokenToMethodRegionInfo
so that it will find and return the cold code block - again, by search the scratch table since we already have the hot part runtimeFunction.DebugDebugger
so that it usesEECodeInfo
to compute relative offset instead of a simple subtraction, that will allow us to account for the cold code.This work is far from complete - here is a list of issues filed for the project - these are known issues for now:
@amanasifkhalid, @BruceForstall
@dotnet/crossgen-contrib