Automatically Reducing Repetitive Synchronization with a Just-in-Time Compiler for Java

  • Authors:
  • Mark Stoodley;Vijay Sundaresan

  • Affiliations:
  • Toronto Lab, IBM Canada Ltd.;Toronto Lab, IBM Canada Ltd.

  • Venue:
  • Proceedings of the international symposium on Code generation and optimization
  • Year:
  • 2005

Quantified Score

Hi-index 0.00

Visualization

Abstract

We describe an automatic technique to remove repetitivesynchronization in Java programs by removing selectedMONITORENTER/EXIT operations. Once these operations are removed,parts of a method that were not originally locked become protectedby a lock. If it is unsafe to synchronize the code between theoriginal locked regions, however, the code is not transformed.Scalability is also protected by not allowing a lock to be held fora significantly longer time than it would be held in the originalprogram code. Our base algorithm improved the throughput of theindustry-standard SPECjbb2000 benchmark by 2% to 5% for threedifferent platforms. We also describe an extension to our algorithmto better handle virtual calls, which are prevalent in Java code,and this extension provides up to a further 5% improvement. Ourcomputationally efficient algorithm was implemented and evaluatedin a production Just-In-Time (JIT) compiler.