Skip to content

perf: use nonvirtual JNI calls for known Kotlin implementations - #1814

Merged
mrousavy merged 8 commits into
v1from
mrousavy/v1-android-dispatch
Oct 21, 2026
Merged

mrousavy merged 8 commits into
v1from
mrousavy/v1-android-dispatch

Conversation

@mrousavy

@mrousavy mrousavy commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Uses fbjni nonvirtual calls for direct instance members when a Kotlin implementation is known and both inheritance and multiple implementations are disabled. Private conversion bridges also use nonvirtual calls.

KotlinHybridObjectType owns the eligibility getter for nonvirtual calls, used by both Kotlin and C++ generation. Every generated CxxPart exposes a static getClass(): eligible implementations use a kept Kotlin @JvmField class literal and a cached global JNI reference; other specs return their generated Java class. All instance member lookups use this accessor, including private conversion bridges.

Includes regenerated standalone and React Native specs.

Validation: Nitrogen generation, typecheck, ESLint, and formatting checks; generated Kotlin compilation and native C++ checks for arm64, armv7, and x86_64; host JVM and Android ART dispatch probes with -Xcheck:jni, covering inheritance, alternate implementations, and private conversion bridges. The getter and naming refactor leaves all 757 generated files byte-identical.

@mrousavy
mrousavy added this pull request to stack #1815 October 19, 2026 20:43
@vercel

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
nitro-docs Skipped Skipped Oct 21, 2026 12:08pm UTC

Request Review

@mrousavy
mrousavy marked this pull request as draft October 20, 2026 15:42
@mrousavy
mrousavy force-pushed the mrousavy/v1-android-dispatch branch from 0083daf to b636f61 Compare October 20, 2026 22:05
@mrousavy mrousavy changed the title perf: use nonvirtual JNI calls for concrete Kotlin implementations perf: use nonvirtual JNI calls for known Kotlin implementations Oct 20, 2026
@mrousavy
mrousavy marked this pull request as ready for review October 20, 2026 22:06
@mrousavy
mrousavy force-pushed the mrousavy/v1-android-dispatch branch from b636f61 to 9f84a2c Compare October 20, 2026 22:07
@mrousavy
mrousavy force-pushed the mrousavy/v1-android-dispatch branch from 9f84a2c to 6efaeec Compare October 20, 2026 22:39
Base automatically changed from mrousavy/v1-android-template to v1 October 20, 2026 23:06
@mrousavy
mrousavy force-pushed the mrousavy/v1-android-dispatch branch from 6efaeec to f8e7acb Compare October 20, 2026 23:06
@mrousavy
mrousavy force-pushed the mrousavy/v1-android-dispatch branch from 87e047e to 18e4613 Compare October 21, 2026 11:34
@mrousavy
mrousavy merged commit 66ff9b7 into v1 Oct 21, 2026
2 of 21 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 0a216055 Deployed Oct 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant