Browse Prior Art Database

Offset-safe Compilation Method for Fixed-size Code Area Management

IP.com Disclosure Number: IPCOM000123445D
Original Publication Date: 1998-Nov-01
Included in the Prior Art Database: 2005-Apr-04
Document File: 2 page(s) / 96K

Publishing Venue

IBM

Related People

Konno, K: AUTHOR [+3]

Abstract

This article describes a method that saves optimization information from the first compilation of a function and uses that information in recompilation of the function so that it can determine the address of execution resumption, in a memory-constrained environment.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 53% of the total text.

Offset-safe Compilation Method for Fixed-size Code Area Management

   This article describes a method that saves optimization
information from the first compilation of a function and uses that
information in recompilation of the function so that it can determine
the address of execution resumption, in a memory-constrained
environment.

   To execute programs with on-the-fly compilers (like Java*
Just-in-time compilers) in such an environment, a certain limit need
to be set to the size of the buffer for native codes generated by the
compiler.  When the buffer gets filled and there is no room for
additional compilation of functions, the buffer is purged of native
codes of some (or all) functions generated so far.  In purging the
buffer, the stack areas are scanned, and the caller function and the
return address in each stack frame is recorded.  On return to a
purged function, the function is recompiled and the resumption
address is calculated from the return address recorded.

   Calculation of the resumption address can be difficult with
compilers which use dynamic (run-time) information in optimization,
because the code generated in the second compilation may be
different from that of the first compilation due to changes in the
optimization information.  Resolution in Java language is an example
of possible chances of optimization by run-time information.  A Java
compiler can generate native codes which always resolve symbolic
references dynamically, but in general, better performance will be
achieved if it uses information of references already resolved by the
time a method is compiled.

   If the optimization information from the first compilation
is saved for later use in recompilation, the compiler can generate
the same code as that from the first compilation, and the resumption
address is easily calculated using the offset of the recorded return
address from the top of the compiled code of the caller function.
This is called offset-safe compilation, an...