Bug 179478 - [JSC] Optimize default constructor implementation for derived class with array iterator protocol check
Summary: [JSC] Optimize default constructor implementation for derived class with arra...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords:
Depends on:
Blocks: 178064
  Show dependency treegraph
 
Reported: 2017-11-09 07:44 PST by Yusuke Suzuki
Modified: 2017-11-09 08:28 PST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2017-11-09 07:44:48 PST
Current default constructor implementation for derived class is,

constructor(...args)
{
    super(...args);
}

But the above code allocates arrays until FTL while that is apparently unnecessary for many cases.
It makes super() call construct_varargs with opaque array... Which is not good since DFGByteCodeParser do not handle it well if the constructor is non JS.
So, extends Array case is not optimized well in this case.

We would like to explore the performance improvement by changing this to

constructor(...args)
{
    if (@isArrayIteratorProtocolFastAndNonObservable()) {
        @superForwardArguments();
        return;
    }
    super(@spread());
}