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: RFC: make linking BC-compiled classes more lazy - part one


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.


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