Skip to content

Avoid global JNI ref copies in FabricUIManager lookups - #59617

Open
javache wants to merge 1 commit into
react:mainfrom
javache:export-D128203842
Open

javache wants to merge 1 commit into
react:mainfrom
javache:export-D128203842

Conversation

@javache

@javache javache commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Summary:
Keep a stable owning global JNI reference in the context container and expose a borrowed alias under the existing FabricUIManager key. Use alias reads for synchronous Android Fabric measurement, colour resolution and image prefetching, avoiding global-reference allocation and release on each lookup.

Add instrumentation coverage for exact alias/owner handle identity, mixed legacy global-ref and alias readers, and legacy-copy validity after the aliased handle owner is released. Stale global-ref readers still depend on the current fbjni wrapper representation; these tests exercise that compatibility, not a type-safe C++ guarantee.

Changelog: [Internal]

Differential Revision: D128203842

Summary:
Keep a stable owning global JNI reference in the context container and expose a borrowed alias under the existing `FabricUIManager` key. Use alias reads for synchronous Android Fabric measurement, colour resolution and image prefetching, avoiding global-reference allocation and release on each lookup.

Add instrumentation coverage for exact alias/owner handle identity, mixed legacy global-ref and alias readers, and legacy-copy validity after the aliased handle owner is released. Stale global-ref readers still depend on the current fbjni wrapper representation; these tests exercise that compatibility, not a type-safe C++ guarantee.

Changelog: [Internal]

Differential Revision: D128203842
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 29, 2026
@meta-codesync

meta-codesync Bot commented Oct 29, 2026

Copy link
Copy Markdown

@javache has exported this pull request. If you are a Meta employee, you can view the originating Diff in D128203842.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant