Bug 186193 - [JSC] NewArrayBuffer should have non-CoW mode
Summary: [JSC] NewArrayBuffer should have non-CoW mode
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Blocks: 186724
  Show dependency treegraph
Reported: 2018-06-01 06:33 PDT by Yusuke Suzuki
Modified: 2018-06-19 07:01 PDT (History)
6 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2018-06-01 06:33:10 PDT
In some program, array created by new_array_buffer is not immutable (I think Kraken/crypto-aes and SixSpeed spread-literal.es5 are).
But ArrayifyToStructure's array copying is really slow compared to non CoW array creation in NewArrayBuffer.
I think we should have non-CoW mode for NewArrayBuffer / new_array_buffer. ArrayAllocationProfile should carefully profile the use of resulted array, and tell us whether using CoW mode is profitable.
Comment 1 Saam Barati 2018-06-01 08:55:24 PDT
Why is arrayify to structure slow?
Comment 2 Keith Miller 2018-06-01 14:10:27 PDT
It seems like if this is a problem the fix is to make Arrayification faster. Since the total amount of work duplicating the butterfly should be the same either way, I don't see any obvious reason to eagerly copy.