From abdee1f2fa9531c78eeadef6d0bb8fb1f823d011 Mon Sep 17 00:00:00 2001 From: David Wrighton Date: Thu, 23 May 2019 16:18:07 -0700 Subject: Fewer ilstubs in corelib from reflection apis (#24708) Rework use of marshalling for RuntimeTypeHandle, RuntimeModule, RuntimeAssembly, and IRuntimeMethodInfo as used by QCalls - Remove special QCall only used marshallers for RuntimeAssembly, RuntimeModule and IRuntimeMethodInfo - Following the pattern of ObjectHandleOnStack, implement QCall handle types for RuntimeAssembly/Module/TypeHandle. Use these in all QCalls that once passed the types directly. - For uses of IRuntimeMethodInfo, follow the existing RuntimeMethodHandleInternal pattern Also perform some replacement of bool marshalling with use of Interop.BOOL, and a few cases of using pointers instead of byref arguments. Fix delivers a relatively small win on startup, and small throughput gains around reflection as IL stubs are no longer necessary for many functions in reflection that once needed them. Reduces methods jitted on powershell startup from 422 to 399, (About 5%) but performance win is only about 5ms on ~400ms as the methods removed are simple. --- src/tools/r2rdump/R2RReader.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/tools/r2rdump') diff --git a/src/tools/r2rdump/R2RReader.cs b/src/tools/r2rdump/R2RReader.cs index 9f88f38e30..edfbec05f2 100644 --- a/src/tools/r2rdump/R2RReader.cs +++ b/src/tools/r2rdump/R2RReader.cs @@ -557,11 +557,15 @@ namespace R2RDump { gcInfo = new Amd64.GcInfo(Image, unwindOffset + unwindInfo.Size, Machine, R2RHeader.MajorVersion); } + catch (OverflowException) + { + Console.WriteLine($"Warning: Could not parse GC Info for method: {method.SignatureString}"); + } catch (IndexOutOfRangeException) { Console.WriteLine($"Warning: Could not parse GC Info for method: {method.SignatureString}"); } - + } } else if (Machine == Machine.I386) -- cgit v1.2.3