-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Use jit interface thunkgen tech for more files #45044
Conversation
davidwrighton
commented
Nov 21, 2020
•
edited
Loading
edited
- Reduce the boilerplate logic when modifying the jit ee interface
- 3 new files in superpmi are now autogenerated as well as 2 files in the jit directory are now autogenerated
- Reduce to only having one copy of the jit-ee interface guid
@dotnet/jit-contrib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I had been thinking we should do something like this for a long time.
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
// DO NOT EDIT THIS FILE! It IS AUTOGENERATED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you leave breadcrumbs here and in the other newly auto-generated files to hiht at how they can be regenerated?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please include pointers to the instructions for re-generation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/dotnet/runtime/blob/master/docs/project/updating-jitinterface.md is the current doc if changes are needed there.
@BruceForstall @sandreenko think you should look this over too. |
Why is that? That's very unfortunate. I think depending on the PAL headers would be ok, but it would be really nice to avoid linking with the PAL. I was hoping that the number of places we link the PAL will decrease over time... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should make updating the JIT-EE interface easier, which is much appreciated.
{ | ||
tw.Write($"\n{decl.ReturnType.NativeTypeName} WrapICorJitInfo::{ decl.FunctionName}("); | ||
bool isFirst = true; | ||
foreach (Parameter param in decl.Parameters) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit? Looks like you could save lots of duplicated code by extracting a function to output function signatures, and function argument call lists
WriteManagedThunkInterface(tw, functions); | ||
} | ||
using (TextWriter tw = new StreamWriter(args[2])) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like you should have at least minimal argument validation here, like checking the number of arguments, and a "usage" message that would also serve as a short description of what this tool is doing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, I like the simplified jit ee interface changes.
@@ -1,4 +1,4 @@ | |||
pushd %~dp0 | |||
call ..\..\..\..\..\..\..\dotnet.cmd run -- ThunkInput.txt ..\CorInfoBase.cs ..\..\..\aot\jitinterface\jitinterface.h | |||
call ..\..\..\..\..\..\..\dotnet.cmd run -- ThunkInput.txt ..\CorInfoBase.cs ..\..\..\aot\jitinterface\jitinterface.h ..\..\..\..\jit\ICorJitInfo_API_names.h ..\..\..\..\jit\ICorJitInfo_API_wrapper.hpp ..\..\..\..\ToolBox\superpmi\superpmi-shared\icorjitinfoimpl.h ..\..\..\..\ToolBox\superpmi\superpmi-shim-counter\icorjitinfo.cpp ..\..\..\..\ToolBox\superpmi\superpmi-shim-simple\icorjitinfo.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: name these paths like ..\..\..\..\..\..\..\
etc?
@@ -9,17 +9,17 @@ typedef char16_t WCHAR; | |||
typedef wchar_t WCHAR; | |||
#endif | |||
|
|||
class CorInfoException |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: why was it renamed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CorInfoException is an enum type in corinfo.h
- Removes duplicate copy of jit ee api version guid - Sets up for making jit interface wrapper actually implement the jit interface Update generater to match previous manual modification Use ICorJitInfo interface for jit thunk directly instead of relying on parallel definition to match up - Found a bug in handling of TryResolveToken Generate api names Generate jit api wrapper from thunk generator Generate icorjitinfoimpl.h spmi counter shim icorjitinfo superpmi-shim-simple Update linux script Fix utf8 char out marshalling Builds on Linux but doesn't work Compile with PAL Respond to code review feedback
c0819a1
to
6d957aa
Compare
Updated with code review feedback. I've stepped back from requiring the PAL, as that was causing odd problems. I may address that in a future change. |
} | ||
virtual unsigned int getMethodAttribs( | ||
void* ftn) | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: The indentation is off.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The generator is ugly enough as it is. Unless there is pushback, I'd prefer to leave the indentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comment-related comments
@@ -0,0 +1,28 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this file also need a license notice?
0x65a1, | ||
0x487a, | ||
{0x85, 0x53, 0xc8, 0x45, 0x49, 0x6d, 0xa9, 0x01} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: missing trailing end-of-line character?
src/coreclr/src/inc/corinfo.h
Outdated
{0x85, 0x53, 0xc8, 0x45, 0x49, 0x6d, 0xa9, 0x01} | ||
}; | ||
|
||
#include "jiteeversionguid.h" | ||
////////////////////////////////////////////////////////////////////////////////////////////////////////// |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the "END JITEEVersionIdentifier" comment needs to be in the jiteeversionguid.h file.
We probably should have big, unmiss-able, comments at the top of all the JIT-EE interface files pointing to the JIT-EE version, but that's somewhat unrelated; this system only works when code reviewers know to ask for an interface GUID change.
Maybe the jiteeversionguid.h file should also point to the updating-jitinterface.md
documentation.
With dotnet#45044 it moved from corinfo.h to jiteeversionguid.h
With dotnet#45044 it moved from corinfo.h to jiteeversionguid.h
With #45044 it moved from corinfo.h to jiteeversionguid.h