Bug 178124 - [JSC] CallLinkInfo should record new.target for op_construct
Summary: [JSC] CallLinkInfo should record new.target for op_construct
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:
 
Reported: 2017-10-10 03:53 PDT by Yusuke Suzuki
Modified: 2017-10-10 03:53 PDT (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-10-10 03:53:07 PDT
Let's consider the case,


class DerivedArray extends Array {
    constructor()
    {
        super(4);
    }
}

new DerivedArray;

When compiling DerivedArray's constructor, we do not have information about new.target well.
In that case, we cannot attempt to make this `super(4)` to some kind of `NewArrayWithSize()` with new.target's allocation profile.


In the case of usual JS functions, op_create_this has this information. But when subclassing builtin objects (like Arrays), we do not have op_create_this and this cache. We should have this one in op_construct's CallLinkInfo.