[Webkit-unassigned] [Bug 222412] Add type method for WASM Global, Memory and Table JS API classes
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Mar 17 05:39:43 PDT 2021
https://bugs.webkit.org/show_bug.cgi?id=222412
Caio Lima <ticaiolima at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ticaiolima at gmail.com
--- Comment #10 from Caio Lima <ticaiolima at gmail.com> ---
Comment on attachment 423340
--> https://bugs.webkit.org/attachment.cgi?id=423340
Patch
View in context: https://bugs.webkit.org/attachment.cgi?id=423340&action=review
> Source/JavaScriptCore/wasm/js/JSWebAssemblyMemory.cpp:139
> + JSObject* result = constructEmptyObject(globalObject, globalObject->objectPrototype(), 2);
We are setting `inlineCapacity` to 2 here, but there are cases where we will potentially have 3 properties. This will make such object allocate a butterfly when we have the third property, increasing the amount of memory we use for this object, and slowing down the access of such property (because it will be stored inside the butterfly). Since `maximum` property is conditional, I think we could move the creation of `result` after we know if it will be included or not.
> Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.cpp:133
> + JSObject* result = constructEmptyObject(globalObject, globalObject->objectPrototype(), 3);
Ditto here. But in this case we are setting 3 while we don't know if `maximum` is going to be present. In such situation, we are allocating some space that might be useless.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210317/da9c40c5/attachment.htm>
More information about the webkit-unassigned
mailing list