This is the mail archive of the java@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: class initialization check overhead


On Wed, 30 Oct 2002 shudo@computer.org wrote:
> > This writes NOP instructions over the original call.  It did not prove
> > enormously helpful.  The real problem must be the memory and register
> > clobbers associated with a call, disrupting the instruction pipeline:
>
> There may be other problems including atomicity of the code patching.
> If there are threads just fetching around the code being patched,
> such threads can read inconsistent code just being modified.
> AFAIK, IBM JDK, Intel ORP and shuJIT take care of the consistency.
> Rewriting 1 byte is safe, but we have to give care to 2 byte
> rewriting, for example, by using XCHG instruction instead of MOV.

Good point.  I got away with it because that code is inherently
single-threaded.

My INT3 patch rewrites only one byte, but it makes the code undebuggable,
and probably only works on GNU/Linux for x86.

Anyway, I've satisifed myself now that these tricks aren't going to yield
any impressive speedup.  Kresten's suggestion is reasonable (and
portable).

Jeff



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