oleg-st / inlinemethod.fody Goto Github PK
View Code? Open in Web Editor NEWInline methods in compile time
License: MIT License
Inline methods in compile time
License: MIT License
Calling method from object.
When i call method from struct with interface, like a.GetValue(), i get
IL_002c: callvirt instance !0 class NlpGpuTools.Data.Types.IBaseMathPrimitive`1<float32>::GetValue()
Even if interface and target method has InlineMethod attribute.
Can you add InlineMethod.Fody support for this case?
Updating the nuget package has caused one of my projects to fail to compile, reverting to 0.6.2
works just the same as before.
I'm unable to product a minimal reproducible example right now, but code that I assume is supposed to be unreachable was reached, which led to the following compiler error:
Fody: An unhandled exception occurred:
Exception:
Unexpected stack-clearing instruction encountered
Type:
InlineMethod.Fody.Helper.InstructionWeavingException
StackTrace:
at InlineMethod.Fody.Extensions.CecilExtensions.GetPopCount(Instruction instruction) in C:\Work\c#\InlineMethod\src\InlineMethod.Fody\Extensions\CecilExtensions.cs:line 130
at InlineMethod.Fody.InlineMethodWeaver.AnalyzeArgs() in C:\Work\c#\InlineMethod\src\InlineMethod.Fody\InlineMethodWeaver.cs:line 642
at InlineMethod.Fody.InlineMethodWeaver.Process() in C:\Work\c#\InlineMethod\src\InlineMethod.Fody\InlineMethodWeaver.cs:line 710
at InlineMethod.Fody.ModuleWeaver.ProcessCallInstruction(Instruction instruction, MethodDefinition method) in C:\Work\c#\InlineMethod\src\InlineMethod.Fody\ModuleWeaver.cs:line 25
at InlineMethod.Fody.ModuleWeaver.ProcessMethod(MethodDefinition method) in C:\Work\c#\InlineMethod\src\InlineMethod.Fody\ModuleWeaver.cs:line 45
at InlineMethod.Fody.ModuleWeaver.Execute() in C:\Work\c#\InlineMethod\src\InlineMethod.Fody\ModuleWeaver.cs:line 67
at InnerWeaver.ExecuteWeavers() in C:\projects\fody\FodyIsolated\InnerWeaver.cs:line 204
at InnerWeaver.Execute() in C:\projects\fody\FodyIsolated\InnerWeaver.cs:line 112
Source:
InlineMethod.Fody
TargetSite:
Int32 GetPopCount(Mono.Cecil.Cil.Instruction)
The only function that I can think of to trigger this is perhaps this one, which must inline the stackalloc
since otherwise the memory address would be invalid by the time the function returns.
I'm sorry for not providing much information, I hope this is enough to sort the issue out.
Hi,
I'm attempting to integrate your Zstandard lib into Sharpcompress for Zstandard file support. What I'm coming across is that this Inlining seems to be affecting a lot of stackalloc usage and I have to remove it to make things behave correctly.
This can be seen behaviorly by looking at this commit and I had to remove two stackalloc arrays to make tests specific to this code area pass: adamhathcock/sharpcompress@aedda0a
I could be wrong but I think it's this specific weaver. Do you have any idea why this would be the case?
Thanks for this and the zstd lib!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.