Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Diagnostics for emitted IL code #54

Closed
dadhi opened this issue Feb 20, 2018 · 8 comments
Closed

Diagnostics for emitted IL code #54

dadhi opened this issue Feb 20, 2018 · 8 comments

Comments

@dadhi
Copy link
Owner

dadhi commented Feb 20, 2018

The FEC may generate different IL and therefore may display different execution performance for the result delegate.

There is also question of correctness and easy of debugging.

It also should simplify new features implementation, etc. etc.

Really strange, that the project was able to get to this point without such thing.

For all these purposes we need an ability to dump the resulting IL, so it can be compared with standard IL produced by C# compiler.

@dadhi
Copy link
Owner Author

dadhi commented Feb 20, 2018

Ok, it was a lot of words. What exactly should we do:

  1. Output the IL for fast compiled delegate.
  2. Output the IL for normally compiled delegate.
  3. If possible output target Asm for both.
  4. IL output obviously should not affect compilation performance.

@dadhi
Copy link
Owner Author

dadhi commented Feb 27, 2018

Here is working IL Visualizer for VS 2017: https://github.com/dadhi/il-visualizer

@dadhi
Copy link
Owner Author

dadhi commented Mar 2, 2018

The produced IL is the same :)

IL_0000: ldarg.1    
IL_0001: ldarg.2    
IL_0002: add        
IL_0003: ret        

Therefore the difference in calling the delegate.
I have an idea to test 3 parameters delegate with first empty Closure argument instead of static delegate with 2 parameters.

@dzmitry-lahoda
Copy link
Contributor

My current approach:
image

https://en.wikipedia.org/wiki/List_of_CIL_instructions

@dzmitry-lahoda
Copy link
Contributor

dzmitry-lahoda commented Aug 16, 2018

2017 support https://github.com/drewnoakes/il-visualizer merged into main repository. So may star and use only that. It seems nice helper to add into contibuting part of readme. bartdesmet does intresting work regarding expression so.

@dadhi
Copy link
Owner Author

dadhi commented Aug 16, 2018

Yep, I was also thinking to add it to readme, time-saver for me, especially in debug.

@dadhi
Copy link
Owner Author

dadhi commented Oct 21, 2020

The new diagnostics instruments available from the TestTools class:

  • PrintIL()
  • PrintCSharpString()
  • AssertOpCodes()

@dadhi dadhi closed this as completed Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants