From: Per Bothner <per@bothner.com>
To: Bernd Kreimeier <bk@lokigames.com>
Cc: java-discuss@sourceware.cygnus.com, classpath@gnu.org
Subject: Re: Proposal for CNI/JNI problems
Date: Sat, 01 Apr 2000 00:00:00 -0000 [thread overview]
Message-ID: <m2k8laj0qe.fsf@magnus.bothner.com> (raw)
In-Reply-To: <14465.3924.684222.646003@ares.lokigames-lan.com>
Bernd Kreimeier <bk@lokigames.com> writes:
> compile time additional information about object memory layout,
> for a JNI source?
Well, in some ways you have more information, because you all
the low-level details needed for JNI. But in other ways it is much
harder [to compile JNI to the CNI ABI] because JNI is all function
calls and it may be difficult to infer the programmer's intention.
For example, you have a JNI function that gets a jfieldID, and
other functions to actually use the jfieldID to access a field.
The problem is the compiler needs to follow the chain of
getting the jclass -> getting the jfieldID -> getting the actual field
before it can figure out the actual field. It need to replace all
of that with a direct field access in CNI. Following that chain
can be difficult when (e.g.) a jfieldID is cached. It may require
some global analysis (i.e. more than a single method).
> In other words, the semantics of JNI code prohibits all
> CNI-like optimizations due to parsing complexity issues?
Not the parsing; the global analysis mentioned above.
> If a hypothetical G++ "emit-jni" option would generate JNI C
G++ emits assembly code, not C. -femit-jni would emit binary
code *equivalent* to JNI C (i.e. *as if* compiled from JNI C),
but not actually C.
> No doubt, JNI ABI compatibility would make CNI a much more
> viable option. In this case, the major concerns seem to be
> Hans Boehm's points (3) and (5), quote:
Those are certainly important concerns. We may have to settle
for conditional compilation in tricky cases. The goal, though,
would be that *most* native methods would not need conditional
compilation, or that the -femit-jni at least greatly reduces
the uglyness of conditional compilation. If we can't figure out
how to do that, then there isn't much point in the idea.
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/
next prev parent reply other threads:[~2000-04-01 0:00 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-04-01 0:00 Paul Fisher
2000-04-01 0:00 ` Per Bothner
2000-04-01 0:00 ` Bernd Kreimeier
2000-04-01 0:00 ` Per Bothner
2000-04-01 0:00 ` Bernd Kreimeier
2000-04-01 0:00 ` Per Bothner [this message]
2000-04-01 0:00 ` Bernd Kreimeier
2000-04-01 0:00 ` Per Bothner
2000-04-01 0:00 ` Bernd Kreimeier
2000-04-01 0:00 ` Per Bothner
2000-04-01 0:00 ` Bernd Kreimeier
2000-04-01 0:00 ` Alexandre Oliva
2000-04-01 0:00 ` Jochen Hoenicke
2000-04-01 0:00 ` Per Bothner
2000-04-01 0:00 ` Stuart Ballard
2000-04-01 0:00 ` Jon Olson
2000-04-01 0:00 ` Paul Fisher
2000-04-01 0:00 ` Aaron M. Renn
2000-04-01 0:00 ` Stuart Ballard
2000-04-01 0:00 ` Chris Blizzard
2000-04-01 0:00 ` Chris Blizzard
2000-04-01 0:00 ` Per Bothner
2000-04-01 0:00 Boehm, Hans
2000-04-01 0:00 Lam.Mark
2000-04-01 0:00 ` Aaron M. Renn
2000-04-01 0:00 ` Brian Jones
2000-04-01 0:00 David Pettersson
2000-04-01 0:00 ` Per Bothner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2k8laj0qe.fsf@magnus.bothner.com \
--to=per@bothner.com \
--cc=bk@lokigames.com \
--cc=classpath@gnu.org \
--cc=java-discuss@sourceware.cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).