PPTC & Pool Enhancements.

This commit is contained in:
LDj3SNuD 2021-01-27 06:21:37 +01:00
parent c4f56c5704
commit d31479a633
15 changed files with 624 additions and 406 deletions

View file

@ -2,6 +2,7 @@ using ARMeilleure.CodeGen.RegisterAllocators;
using ARMeilleure.Common;
using ARMeilleure.IntermediateRepresentation;
using ARMeilleure.Translation.PTC;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
@ -301,7 +302,7 @@ namespace ARMeilleure.CodeGen.X86
{
Assembler assembler = new Assembler(codeStream, _ptcInfo);
byte[] buffer;
Span<byte> buffer;
for (int index = 0; index < _jumps.Count; index++)
{
@ -309,7 +310,7 @@ namespace ARMeilleure.CodeGen.X86
buffer = new byte[jump.JumpPosition - _stream.Position];
_stream.Read(buffer, 0, buffer.Length);
_stream.Read(buffer);
_stream.Seek(_ptcDisabled ? ReservedBytesForJump : jump.InstSize, SeekOrigin.Current);
codeStream.Write(buffer);
@ -326,7 +327,7 @@ namespace ARMeilleure.CodeGen.X86
buffer = new byte[_stream.Length - _stream.Position];
_stream.Read(buffer, 0, buffer.Length);
_stream.Read(buffer);
codeStream.Write(buffer);