skip to main content
10.1145/1411732.1411746acmconferencesArticle/Chapter ViewAbstractPublication PagespppjConference Proceedingsconference-collections
research-article

Constraint based optimization of stationary fields

Authors Info & Claims
Published:09 September 2008Publication History

ABSTRACT

In many scenarios a field holds a value that is constant beyond a certain point in the execution of the program. However, Java only allows it to be marked as being final in relation to the control-flow of the program. We present a language extension whereby the programmer can express that a field will have an unchanging value once it satisfies a given constraint. That is the constraint is the guarantee of finality as opposed to the particular code region. A field holding an unchanging value is said to be stationary. The resulting change of the language has similar pitfalls to keywords that express immutability in a dynamic system. However, it provides a number of advantages: ability for improved partial evaluation and specialisation in dynamic compilation, simple inspection to show thread safety and richer information to the runtime environment.

We present an implementation of our proposed language extension to Java in the Jikes Research Virtual Machine (RVM). We use class loading as a case study of where lazy initialisation occurs. In code that is frequently executed the probability of a referenced class being uninitialised is less than 1% for method accesses and for fields typically 0%. We create an optimization framework that uses this information to perform specialisation and partial evaluation. We demonstrate that on average 61.32% of accesses occur to fields in their stationary state. We demonstrate that stationary information allows optimizations achieving a best case 3.90% speedup of benchmark applications, and 1.67% speedup on average.

References

  1. Alpern, B., Attanasio, C. R., Barton, J. J., Burke, M. G., P. Cheng, Choi, J.-D., Cocchi, A., Fink, S. J., Grove, D., Hind, M., Hummel, S. F., Libber, D., Litvinov, V., Mergen, M. F., Ngo, T., Russell, J. R., Sarkar, V., Serrano, M. J., Shepherd, J. C., Smith, S. E., Sreedhar, V. C., Srinivasan, H., and Whaley, J. The Jalapeño virtual machine. The IBM Systems Journal 39, 1 (2000). Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Arnold, M., Fink, S., Grove, D., Hind, M., and Sweeney, P. F. Adaptive optimization in the Jalapeño JVM. ACM SIGPLAN Notices 35, 10 (2000), 47--65. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Bilianou, P. Runtime value specialization. M.phil., School of Computer Science, The University of Manchester., 2007.Google ScholarGoogle Scholar
  4. Blackburn, S. M., Garner, R., Hoffman, C., Khan, A. M., McKinley, K. S., Bentzur, R., Diwan, A., Feinberg, D., Frampton, D., Guyer, S. Z., Hirzel, M., Hosking, A., Jump, M., Lee, H., Moss, J. E. B., Phansalkar, A., Stefanović, D., VanDrunen, T., von Dincklage, D., and Wiedermann, B. The DaCapo benchmarks: Java benchmarking development and analysis. In OOPSLA '06: Proceedings of the 21st annual ACM SIGPLAN conference on Object-Oriented Programing, Systems, Languages, and Applications (New York, NY, USA, Oct. 2006), ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Charles, P., Grothoff, C., Saraswat, V., Donawa, C., Kielstra, A., Ebcioglu, K., von Praun, C., and Sarkar, V. X10: an object-oriented approach to non-uniform cluster computing. In OOPSLA '05: Proceedings of the 20th annual ACM SIGPLAN conference on Object oriented programming, systems, languages, and applications (New York, NY, USA, 2005), ACM, pp. 519--538. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Goetz, B., Peierls, T., Bloch, J., Bowbeer, J., Holmes, D., and Lea, D. Java Concurrency in Practice. Addison-Wesley, September 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Gosling, J., Joy, B., Steele, G., and Bracha, G. The Java Language Specification, third ed. Addison-Wesley, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Jones, R., and Lins, R. Garbage Collection: Algorithms for Automatic Dynamic Memory Management. John Wiley & Sons, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Kniesel, G., and Theisen, D. JAC - Java with transitive readonly access control. In Intercontinental Workshop on Aliasing in Object-Oriented Systems (IWAOOS) (1999).Google ScholarGoogle Scholar
  10. Lindholm, T., And Yellin, F. The Java Virtual Machine Specification, second ed. Addison-Wesley, Reading, MA, USA, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. MA, M. J. M., Wang, G.-L., And Lau, F. C. M. Jessica: Java-enabled single-system-image computing architecture. Journal of Parallel and Distributed Computing 60, 10 (2000), 1194--1222. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Muchnick, S. S. Advanced compiler design and implementation. Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Pechtchanski, I., And Sarkar, V. Immutability specification and its applications. Concurrency and Computation: Practice and Experience 17, 5--6 (April/May 2005), 639--662. Special Issue: Java Grande/Iscope 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Pugh, W. JSR 305: Annotations for software defect detection. http://jcp.org/en/jsr/detail?id=305, September 2006.Google ScholarGoogle Scholar
  15. Röjemo, N. Garbage collection, and memory efficiency, in lazy funclional languages. PhD thesis, Chalmers Univ. of Technology, Göteburg, 1995.Google ScholarGoogle Scholar
  16. Singer, J., Brown, G., Watson, I., And Cavazos, J. Intelligent selection of application-specific garbage collectors. In International Symposium on Memory Management (Oct. 2007), pp. 91--102. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Spec Jvm98 benchmarks. http://www.spec.org/osg/jvm98/, 1998.Google ScholarGoogle Scholar
  18. Tschantz, M. S., And Ernst, M. D. Javari: Adding reference immutability to Java. In Object-Oriented Programming Systems, Languages, and Applications (OOPSLA) (San Diego, CA, USA, October 18--20, 2005), pp. 211--230. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Unkel, C., And Lam, M. S. Automatic inference of stationary fields: a generalization of java's final fields. In POPL '08: Proceedings of the 35th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages (New York, NY, USA, 2008), ACM, pp. 183--195. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Constraint based optimization of stationary fields

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        PPPJ '08: Proceedings of the 6th international symposium on Principles and practice of programming in Java
        September 2008
        198 pages
        ISBN:9781605582238
        DOI:10.1145/1411732
        • Conference Chairs:
        • Luis Veiga,
        • Vasco Amaral

        Copyright © 2008 ACM

        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]

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 9 September 2008

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        Overall Acceptance Rate29of58submissions,50%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader