-
-
Notifications
You must be signed in to change notification settings - Fork 406
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
Change type of prototypes of objects to Option<JsObject>
#1640
Conversation
762c8c5
to
9cb53e7
Compare
Test262 conformance changes:
|
e9ff234
to
c3610a9
Compare
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.
It's always nice to use the type-system to ensure invariants, should result in faster and more memory efficient code.
Concerning the name: I think we should prefix it with |
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 to me. Really nice idea.
I like JsPrototype, it's clear and it doesn't overlap with the |
c3610a9
to
82e9721
Compare
The objective of this PR is to try to make use of the null pointer optimization of the
Option
type, theoretically optimizing the access of the prototype of an object.It changes the following:
JsValue
toJsObject
ObjectPrototype
to avoid having to readOption<Option<JsObject>>
in some places. (name subject to change, maybe? I was thinking of using plainPrototype
but there's already aPROTOTYPE
constant, andObjectPrototype
doesn't sound as good because it could be confused with the intrinsic prototypes of constructor objects. I'd like to hear your suggestions on this)