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: need to focus on java performance?


Andrew Haley wrote:
Once the class was initialized, you'd need to rewrite the instructions
in the trampolines to point to the static methods that don't do class
initialization. While all this was going on, there still would be
threads jumping to these trampolines. However, these trampolines are
not themseolves protected by locks, and there's no guarantee that you
can rewrite the instructions atomically. So, you'd run the risk of a
partially rewritten instruction being executed. If you can rewrite
the trampolines atomically then I think you might be OK.

Why rewrite the trampolines? Once a class is initialized, its atable entries are updated to point to the real function. Swapping function pointers in the atable is atomic. Some threads might still see and call the trampolines even after the class is initialized, but this is fine, because _Jv_InitClass will lock. The trampolines themselves could be GC allocated, so freeing them wouldn't be an issue.


Bryce


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