wsharp at adobe.com
Fri Feb 15 14:38:52 PST 2019
Do you think it’s a reasonable request that if JSCallbackObject<Parent>::customHasInstance fails to find a JSObjectHasInstanceCallback that it would fall back and call the JSObject::defaultHasInstance routine? And if so, where would I open a bug for it?
For general performance numbers, my C++ based hasInstance is about 9x slower than if I could just use the built-in one. One written in JS doing the same prototype chain walking is about 3-5 slower depending on depth of prototype walking than the built in one.
From: <ggaren at apple.com> on behalf of Geoffrey Garen <ggaren at apple.com>
Date: Friday, February 15, 2019 at 1:46 PM
To: Werner Sharp <wsharp at adobe.com>
Cc: "webkit-dev at lists.webkit.org" <webkit-dev at lists.webkit.org>
On Feb 15, 2019, at 6:54 AM, Werner Sharp <wsharp at adobe.com<mailto:wsharp at adobe.com>> wrote:
On a related note, one thing I’ve found slow is my own implementation of my C++ class’s hasInstance because of the locking. I tried to leave the JSClassRef hasInstance NULL assuming that the internal instanceOf would work properly. But that doesn’t appear to work because the JSCallbackObject always sets the ImplementsHasInstance flag but not the ImplementsDefaultHasInstance flag. I would think that “JSCallbackObject<Parent>::customHasInstance” could be enhanced to call defaultHasInstance if JSObjectHasInstanceCallback hasInstance always returns false?
Or if there is some way that defautHasInstance can be called for a JSCallbackObject I’d appreciate to hear about it.
Thanks for your time.
webkit-dev mailing list
webkit-dev at lists.webkit.org<mailto:webkit-dev at lists.webkit.org>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev