(fyi) SEGV in jc1 for java.util.Date (from jikes bytecode only)

Godmar Back gback@cs.utah.edu
Sun May 9 12:03:00 GMT 1999


> 
> It's likely that Jikes is doing something we do not expect.  A better
> solution would be to try to reproduce this problem with Jikes and some
> Free code.
> 

FWIW, jikes is known to put nops in certain places where other
compilers don't.

For instance,

    static void test() {
        try {
            segv();
        }
        catch (NullPointerException ex) {
            System.out.println("FAIL");
        }
    }

is compiled to:

Method void test()
   0 invokestatic #35 <Method void segv()>
   3 goto 19
   6 nop
   7 astore_0
   8 getstatic #22 <Field java.io.PrintStream out>
  11 ldc #37 <String "FAIL">
  13 invokevirtual #30 <Method void println(java.lang.String)>
  16 goto 19
  19 nop
  20 return
Exception table:
   from   to  target type
     0     6     7   <Class java.lang.NullPointerException>

If your compiler would happen to rely on the fact that
the end range of an exception handler range is a non-nop instruction,
it would fail.  Only jikes seems to generate code for which this is
possible.  We had to fix Kaffe's jit accordingly last year to accommodate
this behavior.

That's probably not your problem: I thought you might find this
pecularity interesting anyway.

	- Godmar



More information about the Java mailing list