[webkit-reviews] review denied: [Bug 131083] Rewrite Function.bind as a builtin : [Attachment 228879] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Apr 8 14:36:14 PDT 2014


Geoffrey Garen <ggaren at apple.com> has denied Oliver Hunt <oliver at apple.com>'s
request for review:
Bug 131083: Rewrite Function.bind as a builtin
https://bugs.webkit.org/show_bug.cgi?id=131083

Attachment 228879: Patch
https://bugs.webkit.org/attachment.cgi?id=228879&action=review

------- Additional Comments from Geoffrey Garen <ggaren at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=228879&action=review


This patch looks good, but I'd like you to code up a change below, or something
like it:

> Source/JavaScriptCore/ChangeLog:11
> +	   Instead we not just return a regular JS closure with a few

"just"

> Source/JavaScriptCore/runtime/JSObject.h:1212
> +    if (propertyName == vm.propertyNames->prototypePrivateName)
> +	   propertyName = vm.propertyNames->prototype;

Let's try to avoid tight coupling between the details of function.bind,
instanceof, and generic property access. Here's a suggestion:

(1) instanceof does a getById for prototoypeForHasInstancePrivateName
(2) function.bind functions respond to prototoypeForHasInstancePrivateName by
forwarding to their targets' .prototype property
(3) Standard functions intercept sets of .prototype, and also set
prototoypeforhadinstanceprivatename -- this makes instanceof cacheable for
standard functions
(4) This change to general property access can be removed


More information about the webkit-reviews mailing list