Do not deoptimize entire super class when adding a property #4489
+16
−1
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.
This PR contains:
Are tests included?
Breaking Changes?
List any relevant issue numbers:
Description
We do not want to deoptimize the entire super class when adding a property, it is enough to deoptimize just properties of the given path (actually in a manner of speaking we may not need to deoptimize at all but deoptimization is a more general concept than reassignment and there may be some edge cases we need to cover).
Following a discussion in Twitter https://twitter.com/pschroen/status/1522269915864256512?s=20&t=8igcqT2KuKkLKgGP3hjvVA, see https://rollupjs.org/repl/?version=2.71.1&shareable=JTdCJTIybW9kdWxlcyUyMiUzQSU1QiU3QiUyMm5hbWUlMjIlM0ElMjJtYWluLmpzJTIyJTJDJTIyY29kZSUyMiUzQSUyMmNsYXNzJTIwRm9vJTIwJTdCJTdEJTVDbiU1Q24lMkYlMkYlMjB0cnklMjByZW1vdmluZyUyMHRoaXMlMjBwcm90b3R5cGUlMjBwcm9wZXJ0eSU1Q25Gb28ucHJvdG90eXBlLmJhciUyMCUzRCUyMCU3QiU3RCUzQiU1Q24lNUNuY2xhc3MlMjBCYXIlMjBleHRlbmRzJTIwRm9vJTIwJTdCJTdEJTVDbiU1Q24lMkYlMkYlMjB0cnklMjByZW1vdmluZyUyMHRoaXMlMjBzdGF0aWMlMjBwcm9wZXJ0eSU1Q25CYXIuYmF6JTIwJTNEJTIwJTdCJTdEJTNCJTVDbiUyMiUyQyUyMmlzRW50cnklMjIlM0F0cnVlJTdEJTVEJTJDJTIyb3B0aW9ucyUyMiUzQSU3QiUyMmZvcm1hdCUyMiUzQSUyMmVzJTIyJTJDJTIybmFtZSUyMiUzQSUyMm15QnVuZGxlJTIyJTJDJTIyYW1kJTIyJTNBJTdCJTIyaWQlMjIlM0ElMjIlMjIlN0QlMkMlMjJnbG9iYWxzJTIyJTNBJTdCJTdEJTdEJTJDJTIyZXhhbXBsZSUyMiUzQW51bGwlN0Q=