-
Notifications
You must be signed in to change notification settings - Fork 4k
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
EnC: Defer lambda rude edit reporting to runtime #70418
Conversation
cd867cc
to
6464328
Compare
7f928bb
to
66317d7
Compare
@davidwengier @cston @jjonescz PTAL |
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.
EnC specific stuff looks good to me.
src/Compilers/Core/Portable/Emit/EditAndContinue/DefinitionMap.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/Emit/EditAndContinue/DefinitionMap.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/Emit/EditAndContinue/DefinitionMap.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Lowering/ClosureConversion/ClosureConversion.Analysis.Tree.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Portable/Lowering/ClosureConversion/ClosureConversion.cs
Show resolved
Hide resolved
src/Compilers/Core/Portable/Emit/EditAndContinue/DefinitionMap.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/Emit/EditAndContinue/DefinitionMap.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/Emit/EditAndContinue/DefinitionMap.cs
Outdated
Show resolved
Hide resolved
src/Compilers/Core/Portable/Emit/EditAndContinue/EncMappedMethod.cs
Outdated
Show resolved
Hide resolved
src/Compilers/VisualBasic/Portable/Emit/EditAndContinue/VisualBasicDefinitionMap.vb
Outdated
Show resolved
Hide resolved
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.
Reviewed Compiler and EE changes; minor comments only.
Had to force push :( Changes are in the last commit. |
src/Compilers/VisualBasic/Portable/Compilation/MethodCompiler.vb
Outdated
Show resolved
Hide resolved
Co-authored-by: Jan Jones <jan.jones.cz@gmail.com>
Defer the decision of whether or not to allow certain kinds of EnC changes to take effect to the runtime. Apply this approach to lambdas. The IDE currently blocks any changes to lambdas that would alter the shape of the closure (e.g. static lambda changed to a lambda capturing a variable). If, however, the old lambda is not invoked by the application (i.e. the delegate pointing to it is not used after the EnC update) there is no need to block the change. The new lambda will be constructed with the updated closure and can be executed without issues. The IDE does not know for any specific lambda whether or not the application will use the delegate after the edit. However, if we update the old version of the lambda body to throw an exception with rude edit message we can allow the change to go through. If the old lambda is executed it will throw and the debugger will display the rude edit message. As a follow up we will also consider emitting a specific exception type that gets a special treatment from the debugger -- see https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1903644.
Fixes #67841, #68708
Implements #70450, #54672