This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: bytecode compilation
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- To: Richard Henderson <rth at redhat dot com>
- Cc: java at gcc dot gnu dot org
- Date: Sat, 22 Dec 2001 17:08:11 +1300
- Subject: Re: bytecode compilation
- References: <20011221190908.A30878@redhat.com>
Richard Henderson wrote:
>Method void main(java.lang.String[])
> 0 ldc #13 <String "stringconst2">
> 2 invokestatic #19 <Method java.lang.Class forName(java.lang.String)>
> 5 astore_1
> 6 aload_1
> 7 astore_2
> 8 getstatic #25 <Field java.io.PrintStream out>
> 11 goto 15
> 14 astore_1
> 15 return
>Exception table:
> from to target type
> 0 11 14 <Class java.lang.Throwable>
>
>which looks decidedly wrong. There's no call to println for one.
>
>Does this work properly on other machines?
>
Yes. On ppc "gcj -C stringconst2.java" gives me:
0: ldc #13=<String "stringconst2">
2: invokestatic #19=<Method java.lang.Class.forName
(java.lang.String)java.lang.Class>
5: astore_1
6: aload_1
7: ldc #20=<String "q">
9: invokevirtual #24=<Method java.lang.Class.getField
(java.lang.String)java.lang.reflect.Field>
12: astore_2
13: getstatic #30=<Field java.lang.System.out java.io.PrintStream>
16: aload_2
17: aconst_null
18: invokevirtual #36=<Method java.lang.reflect.Field.get
(java.lang.Object)java.lang.Object>
21: invokevirtual #42=<Method java.io.PrintStream.println
(java.lang.Object)void>
24: goto 28
27: astore_1
28: return
regards
Bryce.