skip to main content
10.1145/2843915.2843921acmotherconferencesArticle/Chapter ViewAbstractPublication PagesecoopConference Proceedingsconference-collections
research-article

Techniques and applications for guest-language safepoints

Published:04 July 2015Publication History

ABSTRACT

Safepoints are a virtual machine mechanism that allows one thread to suspend other threads in a known state so that runtime actions can be performed without interruption and with data structures in a consistent state. Many virtual machines use safepoints as a mechanism to provide services such as stop-the-world garbage collection, debugging, and modification to running code such as installing or replacing classes. Languages implemented on these virtual machines may have access to these services, but not directly to the safepoint mechanism itself. We show that safepoints have many useful applications for the implementation of guest languages running on a virtual machine. We describe an API for using safepoints in languages that were implemented under the Truffle language implementation framework on the Java Virtual Machine and show several applications of the API to implement useful guest-language functionality. We present an efficient implementation of this API, when running in combination with the Graal dynamic compiler. We also demonstrate that our safepoints cause zero overhead with respect to peak performance and statistically insignificant overhead with respect to compilation time. We compare this to other techniques that could be used to implement the same functionality and demonstrate the large overhead that they incur.

References

  1. H. -J. Boehm and M. Weiser. Garbage Collection in an Uncooperative Environment. Softw., Pract. Exper., 18(9):807--820, 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. M. D. Bond, M. Kulkarni, M. Cao, M. Zhang, M. Fathi Salmi, S. Biswas, A. Sengupta, and J. Huang. Octet: Capturing and controlling cross-thread dependences efficiently. In ACM SIGPLAN Notices, volume 48, pages 693--712, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. L. P. Deutsch and A. M. Schiffman. Efficient Implementation of the Smalltalk-80 System, 1984.Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. R. Forax. JSR 292 Goodness: Almost static final field., 2011. https://weblogs.java.net/blog/forax/archive/2011/12/17/jsr-292-goodness-almost-static-final-field.Google ScholarGoogle Scholar
  5. M. Grimmer, C. Seaton, T. Würthinger, and H. Mössenböck. Dynamically composing languages in a modular way: supporting C extensions for dynamic languages. In Proc. of Modularity, pages 1--13, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. S. Herhut, R. L. Hudson, T. Shpeisman, and J. Sreeram. River Trail: A path to parallelism in JavaScript. In ACM SIGPLAN Notices, volume 48, pages 729--744, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. U. Hölzle, C. Chambers, and D. Ungar. Debugging optimized code with dynamic deoptimization. In Proc. of PLDI, pages 32--43, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. M. N. Kedlaya, B. Robatmili, C. Caşcaval, and B. Hardekopf. Deoptimization for dynamic language JITs on typed, stack-based virtual machines. In Proc. of VEE, pages 103--114, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. F. Khan, V. Foley-Bourgon, S. Kathrotia, E. Lavoie, and L. Hendren. Using JavaScript and WebCL for Numerical Computations: A Comparative Study of Native and Web Technologies. In Proc. of DLS, pages 91--102, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. L. Lu, W. Ji, and M. L. Scott. Dynamic enforcement of determinism in a parallel scripting language. In Proc. of PLDI, page 53, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. N. D. Matsakis. Parallel Closures: A New Twist on an Old Idea. In Proc. of USENIX HotPar, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. Nutter, T. Enebo, O. Bini, N. Sieger, et al. JRuby, 2015. http://jruby.org/.Google ScholarGoogle Scholar
  13. Oracle. OpenJDK, 2015. http://openjdk.java.net/.Google ScholarGoogle Scholar
  14. Oracle. Class SwitchPoint, 2015. http://docs.oracle.com/javase/8/docs/api/java/lang/invoke/SwitchPoint.html.Google ScholarGoogle Scholar
  15. Oracle Labs. GraalJS - High-Performance JavaScript Engine, 2015. http://www.oracle.com/technetwork/oracle-labs/program-languages.Google ScholarGoogle Scholar
  16. J. Rose et al. JSR 292: Supporting Dynamically Typed Languages on the Java Platform, 2011. https://jcp.org/en/jsr/detail?id=292.Google ScholarGoogle Scholar
  17. K. Russell and D. Detlefs. Eliminating synchronization-related atomic operations with biased locking and bulk rebiasing. ACM SIGPLAN Notices, 41(10):263--272, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. C. Seaton, M. L. Van De Vanter, and M. Haupt. Debugging at Full Speed. In Proc. of Dynamic Languages and Applications (DYLA), 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. C. Seaton, B. Daloze, K. Menard, T. Würthinger, et al. JRuby+Truffle - a High-Performance Truffle Backend for JRuby, 2015. https://github.com/jruby/jruby/wiki/Truffle.Google ScholarGoogle Scholar
  20. C. Seaton, B. Daloze, K. Menard, T. Würthinger, et al. A JRuby+Truffle fork with the branches used for evaluation, 2015. https://github.com/eregon/jruby/tree/safepoint.Google ScholarGoogle Scholar
  21. C. Seaton et al. Bench9000, 2014. https://github.com/jruby/bench9000.Google ScholarGoogle Scholar
  22. T. Würthinger, C. Wimmer, A. Wöß, L. Stadler, G. Duboscq, C. Humer, G. Richards, D. Simon, and M. Wolczko. One VM to rule them all. In Proc. of Onward!, pages 187--204, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. T. Würthinger, A. Wöß, L. Stadler, G. Duboscq, D. Simon, and C. Wimmer. Self-optimizing AST interpreters. In Proc. of DLS, page 73, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. M. Zhang, J. Huang, M. Cao, and M. D. Bond. Low-overhead Software Transactional Memory with Progress Guarantees and Strong Semantics. In Proc. of PPoPP, pages 97--108, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Techniques and applications for guest-language safepoints

    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 Other conferences
      ICOOOLPS '15: Proceedings of the 10th Workshop on Implementation, Compilation, Optimization of Object-Oriented Languages, Programs and Systems
      July 2015
      51 pages
      ISBN:9781450336574
      DOI:10.1145/2843915

      Copyright © 2015 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 the author(s) 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: 4 July 2015

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate11of14submissions,79%

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader