Efficient Java exception handling in just-in-time compilation

  • Authors:
  • SeungIl Lee;Byung-Sun Yang;Soo-Mook Moon

  • Affiliations:
  • School of Electrical Engineering, Seoul National University, Seoul 151-742, South Korea;School of Electrical Engineering, Seoul National University, Seoul 151-742, South Korea;School of Electrical Engineering, Seoul National University, Seoul 151-742, South Korea

  • Venue:
  • Software—Practice & Experience - Research Articles
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

Java uses exceptions to provide elegant error handling capabilities during program execution. However, the presence of exception handlers complicates the job of the just-in-time (JIT) compiler, while exceptions are rarely used in most programs. This paper describes two techniques for reducing such complications. First, we delay the translation of an exception handler until the exception really occurs. This on-demand translation of exception handlers allows more optimizations when translating the main flow, without being hindered by constraints caused by the exception flows. Secondly, for those exceptions that are actually thrown during program execution we insert exception-type check code and a direct branch to the translated exception handlers. This exception handler prediction is motivated by an observation that frequently thrown exceptions are likely to be handled by the same exception handlers, so this will eliminate the exception processing overhead of the Java virtual machine. Our experiments indicate that the code quality of the main flow is no longer affected by the presence of exception handlers. Also, frequently thrown exceptions can be efficiently handled by the exception handler prediction. Copyright © 2004 John Wiley & Sons, Ltd.