-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow type sharing for Object.create objects #3901
Conversation
Do you think these changes will be obsolete? #3847 |
8274242
to
874b0a6
Compare
No, I don't really think these changes will interact. It seems like in your case comparing against null is slow, but for me it's when you have a null prototype things are slow because of type sharing issues. |
Let me re-phrase my question then. What I understood from the PR -> Use a cached type ref. in case of So; and second.. This PR introduces |
The reason why I restrict to One of the reasons null needs its own special case is that existing infrastructure relies on internal properties on the prototype object to help share the type. However, null is a plain old RecyclableObject rather than a DynamicObject, and as such it doesn't have any internal properties. I'm still not getting the connection with #3847. What do you think you will need to do to accommodate this change? As long as null is still a RecylableObject, I'm not doing anything fundamentally new. A user can already set their prototype to null (and SetPrototype takes a RecylableObject*), I'm just caching the type in JS library so different objects with null prototype can share a DynamicType. |
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.
LGTM, although I don't have enough context to have high confidence in my evaluation.
LGTM too. My questions were mostly informal. |
Merge pull request #3901 from MikeHolman:objcreateopt This is similar to my last iteration (#3834): Use the normal Object type if prototype is Object.prototype Use a new shared type for the case of null prototype (saved on javascriptLibrary) Difference is instead of using my new cache for other types, use the existing machinery in CreateObjectType
Look(s/ed) good! |
This is similar to my last iteration (#3834):
Use the normal Object type if prototype is Object.prototype
Use a new shared type for the case of null prototype (saved on javascriptLibrary)
Difference is instead of using my new cache for other types, use the existing machinery in CreateObjectType