Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
92c76eba
Commit
92c76eba
authored
Apr 08, 2002
by
Bryce McKinlay
Committed by
Bryce McKinlay
Apr 08, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* gcj.texi (Invocation): Document CNI invocation API.
From-SVN: r52012
parent
19fe522a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
1 deletions
+67
-1
gcc/java/ChangeLog
+4
-0
gcc/java/gcj.texi
+63
-1
No files found.
gcc/java/ChangeLog
View file @
92c76eba
2002-04-08 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* gcj.texi (Invocation): Document CNI invocation API.
2002-04-04 Neil Booth <neil@daikokuya.demon.co.uk>
* expr.c (truthvalue_conversion): Rename. Update.
...
...
gcc/java/gcj.texi
View file @
92c76eba
...
...
@@ -860,6 +860,7 @@ alternative to the standard JNI (Java Native Interface).
*
Mixing
with
C
++::
How
CNI
can
interoperate
with
C
++.
*
Exception
Handling
::
How
exceptions
are
handled
.
*
Synchronization
::
Synchronizing
between
Java
and
C
++.
*
Invocation
::
Starting
the
Java
runtime
from
C
++.
*
Reflection
::
Using
reflection
from
C
++.
@
end
menu
...
...
@@ -1544,7 +1545,7 @@ in your @acronym{CNI} classes, as long as you use the appropriate cast.
class
::
MyClass
:
public
java
::
lang
::
Object
@{
GcjRaw
string
;
gnu
.
gcj
.
RawData
string
;
MyClass
();
gnu
.
gcj
.
RawData
getText
();
...
...
@@ -1683,6 +1684,67 @@ of a synchronized native method to handle the synchronization
In
otherwords
,
you
need
to
manually
add
@
code
{
JvSynchronize
}
in
a
@
code
{
native
synchornized
}
method
.
@
node
Invocation
@
section
Invocation
CNI
permits
C
++
applications
to
make
calls
into
Java
classes
,
in
addition
to
allowing
Java
code
to
call
into
C
++.
Several
functions
,
known
as
the
@
dfn
{
invocation
API
},
are
provided
to
support
this
.
@
deftypefun
jint
JvCreateJavaVM
(
void
*
@
var
{
vm_args
})
Initializes
the
Java
runtime
.
This
function
performs
essential
initialization
of
the
threads
interface
,
garbage
collector
,
exception
handling
and
other
key
aspects
of
the
runtime
.
It
must
be
called
once
by
an
application
with
a
non
-
Java
@
code
{
main
()}
function
,
before
any
other
Java
or
CNI
calls
are
made
.
It
is
safe
,
but
not
recommended
,
to
call
@
code
{
JvCreateJavaVM
()}
more
than
once
provided
it
is
only
called
from
a
single
thread
.
The
@
var
{
vmargs
}
parameter
can
be
used
to
specify
initialization
parameters
for
the
Java
runtime
.
It
may
be
@
code
{
NULL
}.
This
function
returns
@
code
{
0
}
upon
success
,
or
@
code
{-
1
}
if
the
runtime
is
already
initialized
.
@
emph
{
Note
:}
In
GCJ
3.1
,
the
@
code
{
vm_args
}
parameter
is
ignored
.
It
may
be
used
in
a
future
release
.
@
end
deftypefun
@
deftypefun
java
::
lang
::
Thread
*
JvAttachCurrentThread
(
jstring
@
var
{
name
},
java
::
lang
::
ThreadGroup
*
@
var
{
group
})
Registers
an
existing
thread
with
the
Java
runtime
.
This
must
be
called
once
by
a
multi
-
threaded
C
++
application
for
each
thread
,
before
that
thread
makes
any
other
Java
or
CNI
calls
.
@
var
{
name
}
specifies
a
name
for
the
thread
.
It
may
be
@
code
{
NULL
},
in
which
case
a
name
will
be
generated
.
@
var
{
group
}
is
the
ThreadGroup
in
which
this
thread
will
be
a
member
.
If
it
is
@
code
{
NULL
},
the
thread
will
be
a
member
of
the
main
thread
group
.
The
return
value
is
the
Java
@
code
{
Thread
}
object
that
represents
the
thread
.
@
end
deftypefun
@
deftypefun
jint
JvDetachCurrentThread
()
Unregisters
a
thread
from
the
Java
runtime
.
This
should
be
called
by
threads
that
were
attached
using
@
code
{
JvAttachCurrentThread
()},
after
they
have
finished
making
calls
to
Java
code
.
This
ensures
that
any
resources
associated
with
the
thread
become
eligible
for
garbage
collection
.
This
function
returns
@
code
{
0
}
upon
success
.
@
end
deftypefun
The
following
example
demonstrates
the
use
of
@
code
{
JvCreateJavaVM
()}
from
a
simple
C
++
application
.
It
can
be
compiled
with
@
command
{
c
++
test
.
cc
-
lgcj
}.
@
example
//
test
.
cc
#
include
<
gcj
/
cni
.
h
>
#
include
<
java
/
lang
/
System
.
h
>
#
include
<
java
/
io
/
PrintStream
.
h
>
int
main
(
int
argc
,
char
*
argv
)
@{
using
namespace
java
::
lang
;
JvCreateJavaVM
(
NULL
);
String
*
hello
=
JvNewStringLatin1
(
"Hello from C++"
);
System
::
out
->
println
(
hello
);
@}
@
end
example
@
node
Reflection
@
section
Reflection
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment