summaryrefslogtreecommitdiffstats
path: root/gcc/java
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-16 21:49:33 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-16 21:49:33 +0000
commite09764501edd5f7e8112b47c18d4ca5c359e112c (patch)
treea81a851051e84ed06c1f2de52ebdce8c9f6f65f9 /gcc/java
parentd8aff10854d37b0186980d6d3c0785d130f6322f (diff)
downloadppe42-gcc-e09764501edd5f7e8112b47c18d4ca5c359e112c.tar.gz
ppe42-gcc-e09764501edd5f7e8112b47c18d4ca5c359e112c.zip
* gcj.texi (Class Initialization): Mention class initialization of
arrays. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56386 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java')
-rw-r--r--gcc/java/ChangeLog5
-rw-r--r--gcc/java/gcj.texi21
2 files changed, 16 insertions, 10 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index 9f35084a236..962e409edc9 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,8 @@
+2002-08-16 Tom Tromey <tromey@redhat.com>
+
+ * gcj.texi (Class Initialization): Mention class initialization of
+ arrays.
+
2002-07-30 Andrew Haley <aph@cambridge.redhat.com>
* Make-lang.in (java-tree-inline.o): New.
diff --git a/gcc/java/gcj.texi b/gcc/java/gcj.texi
index 165f122118c..ac1702f2503 100644
--- a/gcc/java/gcj.texi
+++ b/gcc/java/gcj.texi
@@ -1316,16 +1316,17 @@ programmer's responsibility to make sure classes are initialized.
However, this is fairly painless because of the conventions assumed by
the Java system.
-First, @code{libgcj} will make sure a class is initialized
-before an instance of that object is created. This is one
-of the responsibilities of the @code{new} operation. This is
-taken care of both in Java code, and in C++ code. (When the G++
-compiler sees a @code{new} of a Java class, it will call
-a routine in @code{libgcj} to allocate the object, and that
-routine will take care of initializing the class.) It follows that you can
-access an instance field, or call an instance (non-static)
-method and be safe in the knowledge that the class and all
-of its base classes have been initialized.
+First, @code{libgcj} will make sure a class is initialized before an
+instance of that object is created. This is one of the
+responsibilities of the @code{new} operation. This is taken care of
+both in Java code, and in C++ code. When G++ sees a @code{new} of a
+Java class, it will call a routine in @code{libgcj} to allocate the
+object, and that routine will take care of initializing the class.
+Note however that this does not happen for Java arrays; you must
+allocate those using the appropriate CNI function. It follows that
+you can access an instance field, or call an instance (non-static)
+method and be safe in the knowledge that the class and all of its base
+classes have been initialized.
Invoking a static method is also safe. This is because the
Java compiler adds code to the start of a static method to make sure
OpenPOWER on IntegriCloud