Has anyone looked at using the memory protection hardware available on
most processors (i386, SPARC, and Alpha) to reduce the cost of method
invocation in Kaffe?  Every time a function is invoked in Kaffe, the
code in the prolog calls a function to check that the thread's stack
limits have not be exceeded.  This check adds a significant overhead
to every function invocation.  Given the frequency of method
invocations, reducing the overhead of this operation should
significantly improve the performance of Kaffe.

It is possible to make the memory protection hardware in the processor
perform the stack bounds check.  Before and after each stack have a
page of memory marked as unaccessable.  If there is an stack access
beyond the bounds of the stack it would fall on one of the
unaccessible pages, a SIGSEGV signal would occur.  Linux, Solaris, and
DEC Unix all have a function mprotect that can be used for that
purpose.  This approach uses more memory, but I think that most people
would be willing to trade memory for more speed.

-Will Cohen


 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   William Cohen                                 [EMAIL PROTECTED]
   Assistant Professor
   Electrical and Computer Engineering
   College of Engineering
   University of Alabama in Huntsville           voice: 256/890-6830
   Huntsville, AL 35899                          fax:   256/890-6803
   ECE Homepage: http://www.eb.uah.edu/ece/ecehome.html
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


Reply via email to