-
Notifications
You must be signed in to change notification settings - Fork 27
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
feat: perf work #230
feat: perf work #230
Conversation
@@ -134,7 +132,6 @@ export function tameDOM( | |||
env.remap(blueRefs.window, globalDescriptors); | |||
// remapping unforgeable objects | |||
env.remap(blueRefs.EventTargetProto, blueRefs.EventTargetProtoDescriptors); | |||
env.remap(blueRefs.WindowProto, blueRefs.WindowProtoDescriptors); |
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.
☝️ This call to remap is a noop since WindowProtoDescriptors
is an empty object and now removed.
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.
lol, I forgot that I have a branch with this change and the removal of record.WindowProtoDescriptors = {};
. Glad to see it go!
args[i] = getLocalValue(listOfValuesOrPointers[i]); | ||
// Inline `getLocalValue`. | ||
const arg = listOfValuesOrPointers[i]; | ||
args[i] = typeof arg === 'function' ? arg() : arg; |
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.
☝️ More inlining of code in apply
and construct
traps. Just easy reasonable inlining nothing overboard.
@@ -272,7 +274,9 @@ export function createMembraneMarshall() { | |||
key, | |||
callbackWithDescriptor | |||
); | |||
(descriptors as any)[key] = safeDesc!; | |||
if (safeDesc!) { |
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.
Just because there is an own property doesn't mean getOwnPropertyDescriptor
will return something. There's that WebKit bug Rick workaround. This is more of that.
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.
does this means we can remove the unnecessary condition for undefined descriptors somewhere else?
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.
does this means we can remove the unnecessary condition for undefined descriptors somewhere else?
No, the above is a guard that is needed for the bug case. Just because a property is an own property doesn't necessarily mean we will get a descriptor (in a perfect world, that made logical sense, we could trust that we would get a descriptor if an own property exists, but in this buggy world it is not guaranteed so the truthy guard is needed)
// Increasing to 20 as a baby step. | ||
Error.stackTraceLimit *= 2; | ||
} | ||
|
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.
👆 Moved that higher to avoid just setting it over and over and over.
None = 0, | ||
MagicMarker = 1 << 0, | ||
} | ||
ReflectSetPrototypeOf(MarshallSupportFlagsField, null); |
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.
Nulled the prototypes of our enums to avoid hasOwnProperty checks on them.
!ReflectApply(SetProtoHas, ESGlobalKeys, [key]) && | ||
!ReflectApply(ArrayProtoIncludes, ReflectiveIntrinsicObjectNames, [key]) | ||
) { | ||
const unsafeDesc = ReflectGetOwnPropertyDescriptor(source, key); | ||
// Safari 14.0.x (macOS) and 14.2 (iOS) have a bug where 'showModalDialog' |
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.
Easy inline at the intrinsics level ☝️
efbfd5c
to
6e3dc2a
Compare
combinedArgs[i + combinedOffset] = getTransferableValue(args[i]); | ||
const arg = args[i]; | ||
const combinedIndex = i + combinedOffset; | ||
// Inline `getTransferableValue`. |
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.
If JavaScript were to support Macros 🙊
a7cab18
to
cf38319
Compare
A perf pass for low hanging things in near-membrane