This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: Linker + Verifier fixes


Robert,

Could you explain what FFIBucket is for? I can't see that this has any effect since the closure is allocated with _Jv_Malloc - the GC will neither collect nor scan malloc'ed memory. I suspect the important thing is to make sure that the String for sym.class_name gets marked somehow, and I don't think that is happening with the current patch.

Ideally the closures should be collectable - if the class for which they are allocated were collected then the closures should as well, but since FFIBucket is static, it would prevent this even if the closures were allocated with JvAllocBytes(). It would probably be better to allocate the closures with JvAllocBytes and mark them as part _Jv_MarkObj when the class is being marked.

Casting native types to jByteArray and treating them as if they were Java objects isn't advised - use RawDataManaged if neccessary. Also, "cif" and "arg_types" shouldn't be constructed as jbyteArrays.

Cheers,

Bryce


Robert Schuster wrote:
Hi,
Mark Wielaard said my copyright assignment for GCC is done and I got the reply
from the FSF's CA clerk.

Tested on last time on x86 against my testsuite (see bug report) and it still
works. :)

-- What I wrote the last time (2006-01-04) still applies:

I have applied all of Andrew's wishes regarding my last patch for the linker and
verifier and fixed merge conflicts in some files.

I excluded a regenerated aclocal.m4 and some Makefile.ins from the actual patch
file to make it easier to review the interesting bits.

--

The original mail for this patch is here:
http://gcc.gnu.org/ml/java-patches/2005-q4/msg00221.html

and the corresponding bug report: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24616

Due to some circumstances it was decided to merge two big patches into one. The
mail about the verifier fix is here:

http://gcc.gnu.org/ml/java-patches/2005-q4/msg00213.html

--

If there are no further requests for changes someone with write permission may
apply it. :)

--

The ChangeLog:

2006-01-11 Robert Schuster <robertschuster@fsfe.org>

        * link.cc:
        (_Jv_Linker::find_field_helper): Added checks.
        (_Jv_Linker::find_field): Use exception swallowing class resolution
        and added early return.
        (_Jv_ThrowNoClassDefFoundErrorTrampoline): New function.
        (_Jv_Linker::link_symbol_table):  Use exception swallowing class
        resolution, added ffi_closure installation routine.
        (_Jv_Linker::ensure_class_linked): Added string check which does
        not trigger class resolution.
        * java/lang/natClassLoader.cc:
        (_Jv_FindClassNoException): New method.
        * java/lang/Class.h:
        (_Jv_FindClassNoException): New method declaration.
        * include/jvm.h:
        (_Jv_FindClassNoException): New method declaration.
        (_Jv_FindClassFromSignatureNoException): New method declaration.
        * prims.cc:
        (_Jv_FindClassFromSignatureNoException): New method.
        * gnu/gcj/runtime/FFIBucket.java: New file.
        * gcj/javaprims.h:
        (_Jv_equalsUtf8Classname): New method declaration.
        (_Jv_isPrimitiveOrDerived): Dito.
        * prims.cc:
        (_Jv_equalsUtf8Classnames): New method.
        (_Jv_isPrimitiveOrDerived): New method.
        * verify.cc:
        (ref_intersection::equals): Use new classname comparison method.
        (type::compatible): Use new classname comparison method. Added
        check whether LHS' type is java.lang.Object .
        (type::resolve): Added new optional debug message and simplified
        if-expression.
        (type::to_array): Added codepath that generates an array type
        without resolving the element type.
        * sources.am: Added gnu/gcj/runtime/FFIBucket.java
        * Makefile.in, testsuite/Makefile.in, gcj/Makefile.in, aclocal.m4:
	Rebuilt.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]