Bug 183435

Summary: [JSC] Optimize inherits<T> if T is final type
Product: WebKit Reporter: Yusuke Suzuki <ysuzuki>
Component: JavaScriptCoreAssignee: Yusuke Suzuki <ysuzuki>
Status: RESOLVED FIXED    
Severity: Normal CC: ews-watchlist, joepeck, keith_miller, mark.lam, msaboff, saam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 183429    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch mark.lam: review+

Yusuke Suzuki
Reported 2018-03-08 01:32:56 PST
If T is a final type, we do not need to traverse hierarchy. Consider a final type T, jsDynamicCast<T*>(vm, cell); in this case, if (cell->classInfo(vm) == T::info()) return static_cast<T*>(cell); return nullptr; is enough. We can this optimization in JSCast.h with std::is_final<T>.
Attachments
Patch (131.62 KB, patch)
2018-03-08 08:19 PST, Yusuke Suzuki
no flags
Patch (130.93 KB, patch)
2018-03-08 09:22 PST, Yusuke Suzuki
mark.lam: review+
Yusuke Suzuki
Comment 1 2018-03-08 08:19:34 PST
Yusuke Suzuki
Comment 2 2018-03-08 09:22:47 PST
Mark Lam
Comment 3 2018-03-08 10:04:56 PST
Comment on attachment 335304 [details] Patch r=me
Yusuke Suzuki
Comment 4 2018-03-08 10:22:48 PST
Thanks!
Yusuke Suzuki
Comment 5 2018-03-08 10:24:14 PST
Radar WebKit Bug Importer
Comment 6 2018-03-08 10:25:26 PST
Note You need to log in before you can comment on or make changes to this bug.