Bug 271949

Summary: AX: Introduce reference versions of AXObjectCache::get and AXObjectCache::getOrCreate
Product: WebKit Reporter: Tyler Wilcock <tyler_w>
Component: AccessibilityAssignee: Tyler Wilcock <tyler_w>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, hi, jcraig, joepeck, pangle, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Tyler Wilcock 2024-03-31 12:43:38 PDT
At most callsites of AXObjectCache::get and AXObjectCache::getOrCreate, we already know the Node* / RenderObject* / Widget* is not null, but we still perform an extra null check in these methods anyways, which is a waste. And looking at the assembly generated by clang, it's not smart enough to optimize the null checks away itself in any of these contexts.
Comment 1 Radar WebKit Bug Importer 2024-03-31 12:43:46 PDT
<rdar://problem/125689037>
Comment 2 Tyler Wilcock 2024-03-31 13:05:41 PDT
Created attachment 470689 [details]
Patch
Comment 3 chris fleizach 2024-04-01 16:58:27 PDT
Comment on attachment 470689 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=470689&action=review

> Source/WebCore/accessibility/AXObjectCache.h:301
> +    AccessibilityObject* get(Node* node) const

does it make sense to make these inline?
Comment 4 Tyler Wilcock 2024-04-01 17:47:10 PDT
Created attachment 470712 [details]
Patch
Comment 5 Tyler Wilcock 2024-04-01 17:47:27 PDT
(In reply to chris fleizach from comment #3)
> Comment on attachment 470689 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=470689&action=review
> 
> > Source/WebCore/accessibility/AXObjectCache.h:301
> > +    AccessibilityObject* get(Node* node) const
> 
> does it make sense to make these inline?
Yeah I think so, done in latest patch!
Comment 6 EWS 2024-04-02 00:05:58 PDT
Committed 276927@main (c608d5842016): <https://commits.webkit.org/276927@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 470712 [details].