Use generic GetFunctionPointerForDelegate method and other tweaks

This commit is contained in:
gdkchan 2019-07-17 22:17:08 -03:00
parent 686f7f4ff2
commit beda03f8c8
3 changed files with 4 additions and 8 deletions

View file

@ -17,7 +17,7 @@ namespace ARMeilleure.Diagnostics
public static void StartPass(PassName name)
{
#if DEBUG
#if M_DEBUG
WriteOutput(name + " pass started...");
_startTime = Stopwatch.GetTimestamp();
@ -26,7 +26,7 @@ namespace ARMeilleure.Diagnostics
public static void EndPass(PassName name, ControlFlowGraph cfg)
{
#if DEBUG
#if M_DEBUG
EndPass(name);
WriteOutput("IR after " + name + " pass:");
@ -37,7 +37,7 @@ namespace ARMeilleure.Diagnostics
public static void EndPass(PassName name)
{
#if DEBUG
#if M_DEBUG
long elapsedTime = Stopwatch.GetTimestamp() - _startTime;
_accumulatedTime[(int)name] += elapsedTime;

View file

@ -46,8 +46,6 @@ namespace ARMeilleure.Instructions
public static void SupervisorCall(ulong address, int imm)
{
System.Span<byte> test = stackalloc byte[0x2000];
GetContext().OnSupervisorCall(address, imm);
}

View file

@ -10,8 +10,6 @@ namespace ARMeilleure.Translation
{
class EmitterContext
{
private Dictionary<ulong, Operand> _labels;
private Dictionary<Operand, BasicBlock> _irLabels;
@ -89,7 +87,7 @@ namespace ARMeilleure.Translation
//Add the delegate to the cache to ensure it will not be garbage collected.
func = DelegateCache.GetOrAdd(func);
IntPtr ptr = Marshal.GetFunctionPointerForDelegate(func);
IntPtr ptr = Marshal.GetFunctionPointerForDelegate<Delegate>(func);
OperandType returnType = GetOperandType(func.Method.ReturnType);