This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: RFC: make linking BC-compiled classes more lazy - part one
- From: Andrew Haley <aph at redhat dot com>
- To: Robert Schuster <theBohemian at gmx dot net>
- Cc: java-patches at gcc dot gnu dot org
- Date: Fri, 2 Dec 2005 18:02:47 +0000
- Subject: Re: RFC: make linking BC-compiled classes more lazy - part one
- References: <43847056.7090600@gmx.net>
Robert Schuster writes:
>
> Hi,
> this patch fixes half of the problems I mentioned in bug 24616[0]. For further
> details about the approach taken see the bug report. Another patch which fixes
> the remaining bits is already prepared.
>
> This patch makes a lot more sense with my previous fixes for the verifier[1]. :)
This looks basically OK, and I'm still looking at it.
FYI:
Some of the code layout is non-GNU. No big deal, but needs fixing.
We need to make sure that any closure has exec permission turned on.
To test your code, I used
void *p = (void*)_Jv_Malloc(sizeof (ffi_closure) + PAGESIZE-1);
/* Align to a multiple of PAGESIZE, assumed to be a power of two */
p = (void*)(((intptr_t) p + PAGESIZE-1) & ~(PAGESIZE-1));
int retcode = mprotect(p, sizeof (ffi_closure),
PROT_READ | PROT_WRITE | PROT_EXEC);
ffi_closure *closure = (ffi_closure *) p;
but we need a better solution than that: we should probably allocate
the closure on the heap and garbage collect that memory with the class
in which it occurs.
Andrew.