Bug 211796 - Constant-fold common case of OpIsConstructor by speculating m_structure
Summary: Constant-fold common case of OpIsConstructor by speculating m_structure
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Enhancement
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-12 12:58 PDT by Alexey Shvayka
Modified: 2020-05-12 14:11 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Shvayka 2020-05-12 12:58:49 PDT
For many function “types” we could know if it’s constructible from the structure cell.
For example, JSStrictFunction is always constructible, while JSArrowFunction and JSGeneratorFunction are not.
Probably we would just store a TriState on the structure and if every structure flowing into the IsConstructor is either TriState::True or TriState::False we can fold to a constant.
It’s possible we could store this info on the method table too.