-
Notifications
You must be signed in to change notification settings - Fork 215
Initial hot cold splitting support for crossgen2/VM #1900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
cshung
merged 1 commit into
dotnet:feature/hot-cold-splitting
from
cshung:public/bootstrapping-hot-cold-splitting
Jun 21, 2022
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
...ls/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/MethodColdCodeNode.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
|
|
||
| using System; | ||
| using System.Diagnostics; | ||
| using Internal.Text; | ||
| using Internal.TypeSystem; | ||
|
|
||
| namespace ILCompiler.DependencyAnalysis.ReadyToRun | ||
| { | ||
| public class MethodColdCodeNode : ObjectNode, ISymbolDefinitionNode | ||
| { | ||
| private ObjectData _methodColdCode; | ||
| private MethodDesc _owningMethod; | ||
|
|
||
| public MethodColdCodeNode(MethodDesc owningMethod) | ||
| { | ||
| _owningMethod = owningMethod; | ||
| } | ||
|
|
||
| public int Offset => 0; | ||
|
|
||
| public override ObjectNodeSection Section | ||
| { | ||
| get | ||
| { | ||
| // TODO, Unix | ||
| return ObjectNodeSection.ManagedCodeWindowsContentSection; | ||
| } | ||
| } | ||
|
|
||
| public override bool IsShareable => false; | ||
|
|
||
| // This ClassCode must be larger than that of MethodCodeNode to ensure it got sorted at the end of the code | ||
| public override int ClassCode => 788492408; | ||
|
|
||
| public override bool StaticDependenciesAreComputed => _methodColdCode != null; | ||
|
|
||
| public void AppendMangledName(NameMangler nameMangler, Utf8StringBuilder sb) | ||
| { | ||
| sb.Append("__coldcode_" + nameMangler.GetMangledMethodName(_owningMethod)); | ||
| } | ||
|
|
||
| public override int CompareToImpl(ISortableNode other, CompilerComparer comparer) | ||
| { | ||
| MethodColdCodeNode otherNode = (MethodColdCodeNode)other; | ||
| return comparer.Compare(_owningMethod, otherNode._owningMethod); | ||
| } | ||
|
|
||
| public override ObjectData GetData(NodeFactory factory, bool relocsOnly = false) => _methodColdCode; | ||
|
|
||
| protected override string GetName(NodeFactory context) => throw new NotImplementedException(); | ||
|
|
||
| public void SetCode(ObjectData data) | ||
| { | ||
| Debug.Assert(_methodColdCode == null); | ||
| _methodColdCode = data; | ||
| } | ||
|
|
||
| public int GetColdCodeSize() | ||
| { | ||
| return _methodColdCode.Data.Length; | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.