This repository was archived by the owner on Nov 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 503
Initial codegen node factory cleanup #6411
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
2a37fdc
Initial ReadyToRunCodegenNodeFactory cleanup
c3bb2b5
Extract part of ReadyToRunCodegenNodeFactory to separate class
ec77308
Fixes after rebase
0bd6857
Addressed code review feedback
ce30879
Fixed rebase issue
1e3ae4c
Minor additional cleanup
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
754 changes: 20 additions & 734 deletions
754
src/ILCompiler.ReadyToRun/src/Compiler/DependencyAnalysis/ReadyToRunCodegenNodeFactory.cs
Large diffs are not rendered by default.
Oops, something went wrong.
648 changes: 648 additions & 0 deletions
648
src/ILCompiler.ReadyToRun/src/Compiler/DependencyAnalysis/ReadyToRunSymbolNodeFactory.cs
Large diffs are not rendered by default.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
src/ILCompiler.ReadyToRun/src/Compiler/DependencyAnalysis/TypeAndMethod.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,43 @@ | ||
| // Licensed to the .NET Foundation under one or more agreements. | ||
| // The .NET Foundation licenses this file to you under the MIT license. | ||
| // See the LICENSE file in the project root for more information. | ||
|
|
||
| using System; | ||
| using Internal.TypeSystem; | ||
|
|
||
| namespace ILCompiler.DependencyAnalysis | ||
| { | ||
| internal struct TypeAndMethod : IEquatable<TypeAndMethod> | ||
| { | ||
| public readonly TypeDesc Type; | ||
| public readonly MethodDesc Method; | ||
| public readonly bool IsUnboxingStub; | ||
| public readonly bool IsInstantiatingStub; | ||
|
|
||
| public TypeAndMethod(TypeDesc type, MethodDesc method, bool isUnboxingStub, bool isInstantiatingStub) | ||
| { | ||
| Type = type; | ||
| Method = method; | ||
| IsUnboxingStub = isUnboxingStub; | ||
| IsInstantiatingStub = isInstantiatingStub; | ||
| } | ||
|
|
||
| public bool Equals(TypeAndMethod other) | ||
| { | ||
| return Type == other.Type && | ||
| Method == other.Method && | ||
| IsUnboxingStub == other.IsUnboxingStub && | ||
| IsInstantiatingStub == other.IsInstantiatingStub; | ||
| } | ||
|
|
||
| public override bool Equals(object obj) | ||
| { | ||
| return obj is TypeAndMethod other && Equals(other); | ||
| } | ||
|
|
||
| public override int GetHashCode() | ||
| { | ||
| return (Type?.GetHashCode() ?? 0) ^ unchecked(Method.GetHashCode() * 31) ^ (IsUnboxingStub ? -0x80000000 : 0) ^ (IsInstantiatingStub ? 0x40000000 : 0); | ||
| } | ||
| } | ||
| } |
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 |
|---|---|---|
|
|
@@ -37,6 +37,9 @@ public sealed class ReadyToRunCodegenCompilation : Compilation | |
| private readonly string _inputFilePath; | ||
|
|
||
| public new ReadyToRunCodegenNodeFactory NodeFactory { get; } | ||
|
|
||
| public ReadyToRunSymbolNodeFactory SymbolNodeFactory { get; } | ||
|
|
||
| internal ReadyToRunCodegenCompilation( | ||
| DependencyAnalyzerBase<NodeFactory> dependencyGraph, | ||
| ReadyToRunCodegenNodeFactory nodeFactory, | ||
|
|
@@ -50,6 +53,7 @@ internal ReadyToRunCodegenCompilation( | |
| : base(dependencyGraph, nodeFactory, roots, ilProvider, debugInformationProvider, devirtualizationManager, logger) | ||
| { | ||
| NodeFactory = nodeFactory; | ||
| SymbolNodeFactory = new ReadyToRunSymbolNodeFactory(nodeFactory); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is such a big hack. It will probably take several iterations to finish the transition, for now I believe this is just fine. |
||
| _corInfo = new Dictionary<EcmaModule, CorInfoImpl>(); | ||
| _jitConfigProvider = configProvider; | ||
|
|
||
|
|
||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering whether it might be more descriptive to call the new class "ReadyToRunHelperFactory".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably :)