[Webkit-unassigned] [Bug 40970] [PATCH] Add equivalent of one-argument Array constructor functionality to JSC C API

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jun 28 18:55:38 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=40970





--- Comment #6 from Caio Marcelo de Oliveira Filho <caio.oliveira at openbossa.org>  2010-06-28 18:55:39 PST ---
Ok. I agree now that extending C API in this case isn't desirable.


> Though the current optimization is written for the JSArray constructor, I think a better solution going forward would be for JSArray to take any assignment to .length -- either an implicit assignment by the constructor quirk, or an explicit assignment by API or the .length property -- as a storage size hint.

This seems to be a better solution and keeps the C API clean.


> It would also be nice if JSArray could allocate spare storage larger than MIN_SPARSE_ARRAY_INDEX, at least for a few arrays, reclaiming wasted / fragmented space as needed.

You mean allowing a larger vector (when e.g. it was explicitly asked) even if it doesn't satisfy the minimum threshold that today's code use? If so, when the reclaim could take place?


> It's best not to expose these kinds of details in complex and quirky APIs. It might seem like the right thing to do looking at JavaScriptCore from the inside out, but API should be designed for understanding from the outside in.

I'll keep that advice in mind. Thanks.

"Operational" question: should this bug be marked as WONTFIX or RESOLVED and another one created for the "use 'length' as storage size hint"?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list