Skip to content

[TrimmableTypeMap] Revisit delayed registerNatives mechanism for Application and Instrumentation subclasses #11194

@simonrozsival

Description

@simonrozsival

Application and Instrumentation java classes are loaded before the .NET runtime is initialized. This means we can't use static { ... } to register native methods and we implemented 2 separate ways of working around this:

  • ApplicationRegistration.java - generated code which we can call manually from JNIEnvInit and where we can register native methods for all the types that need it (very few usually)
  • lazy call to registerNatives from the generated java constructors of the Application and Instrumentation subclasses (and also from static methods)

We should settle on just one approach and simplify the generator code. I suggest removing the ApplicationRegistration class and only use the lazy registration just before the first native method is called.

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Task.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions