You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[TrimmableTypeMap] Runtime should walk Java interfaces when class hierarchy walk fails #11386
The trimmable typemap runtime (TrimmableTypeMap.GetProxyForJavaObject) only walks the Java class hierarchy via getSuperclass() — it never checks Java interfaces. When an intermediate class entry is trimmed (e.g., javax/net/ssl/X509ExtendedTrustManager), the hierarchy walk cannot find a TypeMap entry for Java interfaces like javax/net/ssl/X509TrustManager, even though the entry exists in the trimmed TypeMap.
The llvm-ir typemap has the same limitation but masks it because its custom trimming mechanism preserves more class entries.
Example
TrustManagerFactory.GetTrustManagers() returns objects whose Java class hierarchy is:
com.android.org.conscrypt.TrustManagerImpl → no TypeMap entry
javax.net.ssl.X509ExtendedTrustManager → TRIMMED (nothing references it)
java.lang.Object → does not match ITrustManager
The interface entry javax/net/ssl/X509TrustManager → IX509TrustManagerInvoker is preserved but unreachable.
Suggested approach
Add a fallback Java interface walk (via JNI getInterfaces()) after the class hierarchy walk fails. This could potentially reuse the proxy mechanism similar to how array TypeMap entries work.
Investigation needed
Should we also preserve intermediate class entries (like X509ExtendedTrustManager) in the trimmable TypeMap to match llvm-ir behavior?
How to efficiently walk Java interfaces without excessive JNI calls
Whether this should be done in the TypeMap generator or at runtime
Activity