JNI annotation processor should generate hint comments to help developers determine native method signatures
Categories
(GeckoView :: General, task, P1)
Tracking
(firefox84 fixed)
Tracking | Status | |
---|---|---|
firefox84 | --- | fixed |
People
(Reporter: bugzilla, Assigned: bugzilla)
Details
(Whiteboard: [geckoview:m84])
Attachments
(2 files)
When I first started working with our JNI stuff, one thing I noticed that increases difficulty is figuring out what a native method signature should actually be. This resulted in a bit of trial and error until I got something that built.
Our annotation processor already has an idea about what native method signatures should be; we just need to spit that information out as a comment that describes a sample signature for the developer-supplied native method(s).
I have some test patches, so I'll assign myself...
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
Assignee | ||
Comment 2•4 years ago
|
||
This patch adds some code to our annotation processor that produces comments in
our generated JNI headers to help the developer understand which types are
involved. There are two new types of comments:
- For generated methods from native to Java, we produce a simplified Java method
signature (sans package names) to help the caller disambiguate parameter
types. This is helpful since the machine-readable method signature tend to
usemozilla::jni::Object::Param
instead of actual types (for the purposes of
avoiding dependency hell, presumably). - For Java to native methods, we produce a sample signature that is usable for
the implementation of the native method.
While we did discuss some ideas about other locations where we could output this
data, I'd like to start with the generated header files for now. We can make
adjustments to the output location in future bugs.
I will be attaching an example of a generated header that contains these new
comments to the bug.
Pushed by aklotz@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5e3ff421cf2a Generate Java signature hints in JNI wrappers; r=geckoview-reviewers,agi
Comment 4•4 years ago
|
||
bugherder |
Description
•