PPTC & Pool Enhancements. (#1968)
* PPTC & Pool Enhancements. * Avoid buffer allocations in CodeGenContext.GetCode(). Avoid stream allocations in PTC.PtcInfo. Refactoring/nits. * Use XXHash128, for Ptc.Load & Ptc.Save, x10 faster than Md5. * Why not a nice Span. * Added a simple PtcFormatter library for deserialization/serialization, which does not require reflection, in use at PtcJumpTable and PtcProfiler; improves maintainability and simplicity/readability of affected code. * Nits. * Revert #1987. * Revert "Revert #1987." This reverts commit 998be765cf7f7da5ff0c1c08de704c9012b0f49c.
This commit is contained in:
parent
1586880114
commit
dc0adb533d
20 changed files with 777 additions and 603 deletions
|
@ -9,7 +9,8 @@ namespace ARMeilleure.Translation.PTC
|
|||
private readonly BinaryWriter _relocWriter;
|
||||
private readonly BinaryWriter _unwindInfoWriter;
|
||||
|
||||
public MemoryStream CodeStream { get; }
|
||||
public byte[] Code { get; set; }
|
||||
|
||||
public MemoryStream RelocStream { get; }
|
||||
public MemoryStream UnwindInfoStream { get; }
|
||||
|
||||
|
@ -17,7 +18,6 @@ namespace ARMeilleure.Translation.PTC
|
|||
|
||||
public PtcInfo()
|
||||
{
|
||||
CodeStream = new MemoryStream();
|
||||
RelocStream = new MemoryStream();
|
||||
UnwindInfoStream = new MemoryStream();
|
||||
|
||||
|
@ -27,11 +27,6 @@ namespace ARMeilleure.Translation.PTC
|
|||
RelocEntriesCount = 0;
|
||||
}
|
||||
|
||||
public void WriteCode(MemoryStream codeStream)
|
||||
{
|
||||
codeStream.WriteTo(CodeStream);
|
||||
}
|
||||
|
||||
public void WriteRelocEntry(RelocEntry relocEntry)
|
||||
{
|
||||
_relocWriter.Write((int)relocEntry.Position);
|
||||
|
@ -60,7 +55,6 @@ namespace ARMeilleure.Translation.PTC
|
|||
_relocWriter.Dispose();
|
||||
_unwindInfoWriter.Dispose();
|
||||
|
||||
CodeStream.Dispose();
|
||||
RelocStream.Dispose();
|
||||
UnwindInfoStream.Dispose();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue