skip to main content
10.1145/1254810.1254814acmconferencesArticle/Chapter ViewAbstractPublication PagesveeConference Proceedingsconference-collections
Article

Speculative optimization using hardware-monitored guarded regions for java virtual machines

Published: 13 June 2007 Publication History

Abstract

Aggressive dynamic optimization in high-performance Java Virtual Machines can be hampered by language features like Java's exception model, which requires precise detection and handling of program-generated exceptions. Furthermore, the compile-time overhead of guaranteeing correctness of code transformations precludes many effective optimizations from consideration. This paper describes a novel approach for circumventing the optimization-crippling effects of exception semantics and streamlining the implementation of aggressive optimizations at run time. Under a hardware-software hybrid model, the runtime system delineates guarded regions of code and specifies a contract--in the simplest case, one that requires exception-free execution--that must be adhered to in order to ensure that the aggressively optimized code within that region will behave as the programmer expects. The contracted runtime condition is assumed to be true, and code within a guarded region is aggressively optimized based on this assumption. Hardware monitors for exceptions throughout the region execution, and undoes the effects of the guarded region if an exception occurs, re-executing the region with a conventionally optimized version. Since exceptions are very rare, code can be optimized as if optimization-crippling conditions did not exist, leading to compile time reduction, code quality improvement, and potential performance improvement up to 67.7% and averaging 15.9% in our limit study of a set of Java benchmarks.

References

[1]
A.-R. Adl-Tabatabai et al. Compiler and Runtime Support for Efficient Software Transactional Memory. In PLDI 2006.
[2]
H. Akkary et al. Checkpoint processing and recovery. In Micro36 2003.
[3]
B. Alpern et al. The Jalapeno Virtual Machine. IBM Systems Journal, 39(1):211--221, 2000.
[4]
C. S. Ananian et al. Unbounded Transactional Memory. In HPCA2005.
[5]
V. Bala et al. Dynamo: A Transparent Dynamic Optimization system. In PLDI 2000.
[6]
R. Bodik et al. ABCD: Eliminating Array Bounds Checks on Demand. In PLDI 2000.
[7]
M. Burke et al. The Jalapeno Dynamic Optimizaing Compiler for Java. In ACM Java Grande Conference 1999.
[8]
A. Chang and M. Mergen. 801 Storage: Architecture and Programming. ACM Transactions on Computer Systems, 1988.
[9]
L. Chen & Y. Wu. Aggressive Compiler Optimization and Parallelization with Thread-Level Speculation. In ICPP 2003
[10]
J. Dehnert et al. The Transmeta Code Morphing Software. In CGO'03.
[11]
S. J. Fink & Q. Feng. Design, Implementation and Evaluation of Adaptive Recompilation with On-Stack Replacement. In CGO'03.
[12]
M. Gupta, J.-D. Choi, and M. Hind. Optimizing Java Programs in the Presence of Exceptions. In ECOOP 2000.
[13]
L. Hammond et al. Transactional Memory Coherence and Consistency. In ISCA 2004.
[14]
T. Harris et al. Optimizing Memory Transactions. In PLDI 2006.
[15]
W. H. Harrison. Compiler Analysis for the Value Ranges of Variables. IEEE Transactions on Software Engineering 1977.
[16]
M. Herlihy and J. E. B. Moss. Transactional Memory: Architectural Support for Lock-Free Data Structures. In ISCA 1993.
[17]
K. Ishizaki et al. Effectiveness of Cross-Platform Optimizations for a Java Just-In-Time Compiler. In OOPSLA 2003.
[18]
T. Knight. An Architecture for Mostly Functional Languages. In ACM Conference on LISP and Functional Programming 1986.
[19]
T. Lindholm and F. Yellin. The Java(TM) Virtual Machine Specification (2nd Edition). 1999. Addison-Wesley London.
[20]
V. Markstein et al. Optimization of Range Checking. In Proceedings of Symposium on Compiler Optimization 1982.
[21]
J. Martinez & J. Torrellas. Speculative Synchronization: Applying Thread-Level Speculation to Explicitly Parallel Applications. In ASPLOS'02.
[22]
A. McDonald et al. Architectural Semantics for Practical Transactional Memory. In ISCA 2006.
[23]
K. Moore et al. LogTM: Log-based Transactional Memory. In HPCA 2006.
[24]
J. Moreira et al. From Flop to Megaflops: Java for Technical Computing. In TOPLAS 2000.
[25]
M. Paleczny, et al. The Java HotSpot Server Compiler. In JVM 2001.
[26]
S. J. Patel and S. S. Lumetta. rePlay: A Hardware Framework for Dynamic Optimization. In MICRO 2000.
[27]
R. Rajwar et al. Virtualizing Transactional Memory. In ISCA 2005.
[28]
M. Spezialetti and R. Gupta. Loop Monotonic Statements. IEEE Transactions on Software Engineering, Vol. 21, No. 6, June 1995.
[29]
N. Suzuki and K. Ishihata. Implementation of an Array Bound Checker. In POPL 1977.
[30]
Java Grande. http://www.epcc.ed.ac.uk/javagrande/javag.html.
[31]
The Performance Counter Library (PCL). http://www.fz-juelich.de/zam/PCL/.
[32]
SPECJVM98 1998. http://www.spec.org/jvm98

Cited By

View all

Index Terms

  1. Speculative optimization using hardware-monitored guarded regions for java virtual machines

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    VEE '07: Proceedings of the 3rd international conference on Virtual execution environments
    June 2007
    210 pages
    ISBN:9781595936301
    DOI:10.1145/1254810
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 13 June 2007

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. java
    2. precise exceptions
    3. speculative processors
    4. transactional memory
    5. virtual machines

    Qualifiers

    • Article

    Conference

    VEE07
    VEE07: International Conference on Virtual Execution Environments
    June 13 - 15, 2007
    California, San Diego, USA

    Acceptance Rates

    Overall Acceptance Rate 80 of 235 submissions, 34%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)2
    • Downloads (Last 6 weeks)0
    Reflects downloads up to 15 Jan 2025

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media