Bug 271949 - AX: Introduce reference versions of AXObjectCache::get and AXObjectCache::getOrCreate
Summary: AX: Introduce reference versions of AXObjectCache::get and AXObjectCache::get...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tyler Wilcock
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-03-31 12:43 PDT by Tyler Wilcock
Modified: 2024-04-02 00:06 PDT (History)
12 users (show)

See Also:


Attachments
Patch (71.25 KB, patch)
2024-03-31 13:05 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff
Patch (71.30 KB, patch)
2024-04-01 17:47 PDT, Tyler Wilcock
no flags Details | Formatted Diff | Diff

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