diff options
author | gdkchan <gab.dark.100@gmail.com> | 2020-02-17 18:30:54 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-17 22:30:54 +0100 |
commit | e5f78fb1d44b825ee9195660f4387680055137dc (patch) | |
tree | 59cfa56dc046bd27aa1d7e9d7b0840ffafd9f601 /ARMeilleure/IntermediateRepresentation/BasicBlock.cs | |
parent | e9a37ca6a85346c05149deac916dc90de43ad240 (diff) |
Replace LinkedList by IntrusiveList to avoid allocations on JIT (#931)
* Replace LinkedList by IntrusiveList to avoid allocations on JIT
* Fix wrong replacements
Diffstat (limited to 'ARMeilleure/IntermediateRepresentation/BasicBlock.cs')
-rw-r--r-- | ARMeilleure/IntermediateRepresentation/BasicBlock.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ARMeilleure/IntermediateRepresentation/BasicBlock.cs b/ARMeilleure/IntermediateRepresentation/BasicBlock.cs index 06839f30..ac48ac8e 100644 --- a/ARMeilleure/IntermediateRepresentation/BasicBlock.cs +++ b/ARMeilleure/IntermediateRepresentation/BasicBlock.cs @@ -2,13 +2,14 @@ using System.Collections.Generic; namespace ARMeilleure.IntermediateRepresentation { - class BasicBlock + class BasicBlock : IIntrusiveListNode<BasicBlock> { public int Index { get; set; } - public LinkedListNode<BasicBlock> Node { get; set; } + public BasicBlock ListPrevious { get; set; } + public BasicBlock ListNext { get; set; } - public LinkedList<Node> Operations { get; } + public IntrusiveList<Node> Operations { get; } private BasicBlock _next; private BasicBlock _branch; @@ -33,7 +34,7 @@ namespace ARMeilleure.IntermediateRepresentation public BasicBlock() { - Operations = new LinkedList<Node>(); + Operations = new IntrusiveList<Node>(); Predecessors = new List<BasicBlock>(); @@ -77,7 +78,7 @@ namespace ARMeilleure.IntermediateRepresentation public Node GetLastOp() { - return Operations.Last?.Value; + return Operations.Last; } } }
\ No newline at end of file |