RESOLVED FIXED 183435
[JSC] Optimize inherits<T> if T is final type
https://bugs.webkit.org/show_bug.cgi?id=183435
Summary [JSC] Optimize inherits<T> if T is final type
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.