Bug 211796

Summary: Constant-fold common case of OpIsConstructor by speculating m_structure
Product: WebKit Reporter: Alexey Shvayka <ashvayka>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW    
Severity: Enhancement CC: keith_miller
Priority: P2    
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=144093

Alexey Shvayka
Reported 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.
Attachments
Note You need to log in before you can comment on or make changes to this bug.