pass module version id to instrumentation wrappers#488
Merged
lucaspimentel merged 17 commits intomasterfrom Aug 22, 2019
Merged
Conversation
lucaspimentel
commented
Aug 22, 2019
| var graphQLAssembly = AppDomain.CurrentDomain.GetAssemblies() | ||
| .Where(a => a.GetName().Name.Equals(GraphQLAssemblyName)) | ||
| .Single(); | ||
| .Single(a => a.GetName().Name.Equals(GraphQLAssemblyName)); |
Member
Author
There was a problem hiding this comment.
Completely unrelated, but I couldn't help myself. Resharper points it out in bright green on my dark background.
lucaspimentel
commented
Aug 22, 2019
| rewriter_wrapper.SetILPosition(pInstr); | ||
| rewriter_wrapper.LoadInt32(pInstr->m_opcode); | ||
| rewriter_wrapper.LoadInt32(method_def_md_token); | ||
| rewriter_wrapper.LoadInt64(reinterpret_cast<INT64>(module_version_id_ptr)); |
Member
Author
There was a problem hiding this comment.
We treat the address of module_version_id as an INT64 and we push it into the stack before calling the wrapper method.
lucaspimentel
commented
Aug 22, 2019
| var returnType = method.ReturnType; | ||
| var parameters = method.GetParameters().Select(p => p.ParameterType).ToArray(); | ||
|
|
||
| var requiredParameterTypes = new[] { typeof(int), typeof(int), typeof(long) }; |
Member
Author
There was a problem hiding this comment.
Since I was adding another parameter to all wrappers, I though it useful to add this validation.
colin-higgins
approved these changes
Aug 22, 2019
Member
colin-higgins
left a comment
There was a problem hiding this comment.
Looks good to me! 🎉 🎉 🎉
|
|
||
| // we add 3 parameters to every wrapper method: opcode, mdToken, and | ||
| // module_version_id | ||
| const short added_parameters_count = 3; |
Contributor
There was a problem hiding this comment.
Thanks for this change, this helps my sanity 😄
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes proposed in this pull request:
module_version_idpointer onto stack before calling wrapper methodslong moduleVersionPtrparameter to every integration wrapper methodMethodBuild.Start()overload that takeslong moduleVersionPtrAssembly.GetCallingAssembly()withmoduleVersionPtr