-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial hot cold splitting support for crossgen2/VM
- Loading branch information
Showing
21 changed files
with
386 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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.