[Fwd: RE: [Sablevm-developer] reflection classes for constant pool and bytecode data]
Brought to you by:
egagnon
From: Andrew P. <apu...@ac...> - 2000-08-22 03:54:38
|
> From: "John Leuner" <je...@pi...> > I was wondering if this interface needs to be sablevm > specific? All JVMs will be able to provide the information > you're asking for here, and probably in exactly the same format. No, generally this interface is not SableVM-specific, and should be easily ported to any VM. The obvious exception is the method(s) which prompt the VM to replace a method with new native code. > I'm thinking here of cloning this work with my JVM, ultimately > I would like to have whatever JIT framework we develop here > running on both JVMs. That would be great. Also, I expect there are useful things in your JVM which could be rolled in as well. > access flags. But if you're only looking for the standard ACC_PUBLIC, > ACC_PROTECTED etc, it should be ok. Yes, and the ACC_* flag values will be static constants. > > public int exception_table[][]; > > How does this store the exception type? for (int i = 0; i < exception_table.length; i++) { int ia[] = exception_table[i]; String name; if (ia[3] == 0) { name = "all"; } else { int name_index = ((Constant_Class)clazz.getConstant(ia[3])).name_index; name = ((Constant_UTF8)clazz.getConstant(name_index)).value; } System.out.println( "catch " + name + " from L" + ia[0] + " to L" + ia[1] + " using L" + ia[2] ); } > As regards my own work on my primitive bytecode-to-assembly > translator, I've managed to encode exception handlers within > the native(optimised) code now. Very cool. Andy |