[Webkit-unassigned] [Bug 145605] Function.prototype.bind: Bound functions must use the [[Prototype]] of their target function instead of Function.prototype

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 10 11:36:04 PDT 2015


--- Comment #25 from Geoffrey Garen <ggaren at apple.com> ---
> @Geoffrey:
> Isn't the structure system designed to create one empty object structure per
> prototype? If so, how would the number of structures being allocated cause
> this regression?

When you call Structure::create (via JSBoundFunction::createStucture), you allocate a structure. There is no default mechanism to avoid or de-duplicate that allocation. Allocation takes time and increases GC pressure.

> And I don't see the relevance of the `prototype` property to a `bind` call?

You're right: I misspoke when I mentioned .prototype.

> If my above assumption re. structures is incorrect, would it not make more
> sense to check whether [[Prototype]] is not Function.prototype, and only
> then create a new structure.

Yes, I think that's the right short-term solution: Maintain the per-global-object bound function structure, and only allocate a new structure if the per-global-object structure will not do.

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150910/29d2e1e5/attachment-0001.html>

More information about the webkit-unassigned mailing list