[PATCH/RFA] libjava: SH support

kaz Kojima kkojima@rr.iij4u.or.jp
Fri Jul 26 20:23:00 GMT 2002


kaz Kojima <kkojima@rr.iij4u.or.jp> wrote:
>> Was the whole toolchain configured using sjlj exceptions?
> 
> Yep, though I'd like to check it again. Anyway, it's a great hint
> for me. Thanks a lot Andrew and Jeff.

I've found a cause of many gij failures on SH port.
Interpreter takes JVM stack and local variables as variable
sized arrays:

void
_Jv_InterpMethod::run (void *retp, ffi_raw *args)
{
  using namespace java::lang::reflect;

  _Jv_word stack[max_stack];
  _Jv_word *sp = stack;

  _Jv_word locals[max_locals];
  ...

and the compiler generates the code which _Unwind_SjLj_Register
is called _before_ allocating machine stack for these arrays.
So the stack pointer is set to the higher address than these
arrays when the exception threw, and the contents of these arrays
are clobbered. I don't know how to fix it.

As a test, if these arrays are allocated by GC_malloc_atomic,
then the remained failures are

FAIL: PR1343 compilation from bytecode
FAIL: PR1343 -O compilation from bytecode
FAIL: zeroexp compilation from source
FAIL: zeroexp byte compilation
FAIL: zeroexp -O compilation from source
FAIL: zeroexp byte compilation
FAIL: Array_3 execution - gij test
FAIL: Array_3 compilation from bytecode
FAIL: Array_3 execution - gij test
FAIL: Array_3 -O compilation from bytecode
FAIL: PR141 output - gij test
FAIL: PR141 output - gij test
FAIL: PR218 execution - gij test
FAIL: PR218 execution - gij test
FAIL: TLtest compilation from bytecode
FAIL: TLtest -O compilation from bytecode
FAIL: Throw_2 execution - source compiled test
FAIL: Throw_2 execution - gij test
FAIL: Throw_2 execution - bytecode->native test
FAIL: Throw_2 -O execution - source compiled test
FAIL: Throw_2 execution - gij test
FAIL: Throw_2 -O execution - bytecode->native test
FAIL: inner4 output - gij test
FAIL: inner4 output - gij test
FAIL: negzero output - gij test
FAIL: negzero output - gij test

Regards,
	kaz



More information about the Gcc-patches mailing list