Nothing Special   »   [go: up one dir, main page]

Skip to main content

A Language and Tool for Generating Efficient Virtual Machine Interpreters

  • Chapter
Domain-Specific Program Generation

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 3016))

Abstract

Stack-based virtual machines (VMs) are a popular representation for implementing programming languages, and for distributing programs in a target neutral form. VMs can be implemented with an interpreter to be simple, portable, quick to start and have low memory requirements. These advantages make VM interpreters especially useful for minority-use and domain-specific languages. VM interpreters contain large amounts of repeated or similar code. Furthermore, interpreter optimisations usually involve a large number of similar changes to many parts of the interpreter source code. We present a domain-specific language for describing the instruction set architecture of a VM. Our generator takes the instruction definition and produces C code for processing the instructions in several ways: execution, VM code generation and optimisation, disassembly, tracing and profiling. The generator can apply optimisations to the generated C code for each VM instruction, and across instructions. Using profile-directed feedback and experimentation the programmer can rapidly optimise the interpreter for new architectures, environments and applications.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

eBook
USD 15.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 15.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. Lindholm, T., Yellin, F.: The Java Virtual Machine Specification, 2nd edn. Addison-Wesley, Reading (1999)

    Google Scholar 

  2. Aït-Kaci, H.: The WAM: A (real) tutorial. Warren’s Abstract Machine: A Tutorial Reconstruction. MIT Press, Cambridge (1991)

    Google Scholar 

  3. Goldberg, A., Robson, D.: Smalltalk-80: The Language and its Implementation. Addison-Wesley, Reading (1983)

    MATH  Google Scholar 

  4. Weiss, D.M.: Family-oriented abstraction specification and translation: the FAST process. In: Proceedings of the 11th Annual Conference on Computer Assurance (COMPASS), Gaithersburg, Maryland, pp. 14–22. IEEE Press, Los Alamitos (1996)

    Google Scholar 

  5. Czarnecki, K., Eisenecker, U.: Generative programming – methods tools and applications. Addison-Wesley, Reading (2000)

    Google Scholar 

  6. Lengauer, C.: Program optimization in the domain of high-performance parallelism. In: Lengauer, C., Batory, D., Consel, C., Odersky, M. (eds.) Domain-Specific Program Generation. LNCS, vol. 3016, pp. 73–91. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  7. Grune, D., Bal, H., Jacobs, C., Langendoen, K.: Modern Compiler Design. Wiley, Chichester (2001)

    Google Scholar 

  8. Ertl, M.A.: Implementation of Stack-Based Languages on Register Machines. PhD thesis, Technische Universität Wien, Austria (1996)

    Google Scholar 

  9. Moore, C.H., Leach, G.C.: Forth – a language for interactive computing. Technical report, Mohasco Industries, Inc., Amsterdam, NY (1970)

    Google Scholar 

  10. Ertl, M.A., Gregg, D.: The behaviour of efficient virtual machine interpreters on modern architectures. In: Sakellariou, R., Keane, J.A., Gurd, J.R., Freeman, L. (eds.) Euro-Par 2001. LNCS, vol. 2150, pp. 403–412. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  11. Ertl, M.A.: A portable Forth engine. In: EuroFORTH 1993 conference proceedings, Mariánské Láznè (Marienbad) (1993)

    Google Scholar 

  12. Paysan, B.: Ein optimierender Forth-Compiler. Vierte Dimension 7, 22–25 (1991)

    Google Scholar 

  13. Ertl, M.A., Gregg, D., Krall, A., Paysan, B.: vmgen – A generator of efficient virtual machine interpreters. Software – Practice and Experience 32, 265–294 (2002)

    Article  MATH  Google Scholar 

  14. Krall, A., Grafl, R.: CACAO – a 64 bit JavaVM just-in-time compiler. Concurrency: Practice and Experience 9, 1017–1030 (1997)

    Article  Google Scholar 

  15. Casey, K., Gregg, D., Ertl, M.A., Nisbet, A.: Towards Superinstructions for Java Interpreters. In: Krall, A. (ed.) SCOPES 2003. LNCS, vol. 2826, pp. 329–343. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  16. Bell, J.R.: Threaded code. Communications of the ACM 16, 370–372 (1973)

    Article  Google Scholar 

  17. Ertl, M.A.: Stack caching for interpreters. In: SIGPLAN 1995 Conference on Programming Language Design and Implementation, pp. 315–327 (1995)

    Google Scholar 

  18. Ertl, M.A., Gregg, D.: Optimizing indirect branch prediction accuracy in virtual machine interpreters. In: Proceedings of the ACM SIGPLAN 2003 Conference on Programming Language Design and Implementation (PLDI 2003), San Diego, California, pp. 278–288. ACM, New York (2003)

    Chapter  Google Scholar 

  19. Proebsting, T.A.: Optimizing an ANSI C interpreter with superoperators. In: Principles of Programming Languages (POPL 1995), pp. 322–332 (1995)

    Google Scholar 

  20. Ernst, J., Evans, W., Fraser, C.W., Lucco, S., Proebsting, T.A.: Code compression. In: SIGPLAN 1997 Conference on Programming Language Design and Implementation, pp. 358–365 (1997)

    Google Scholar 

  21. Evans, W.S., Fraser, C.W.: Bytecode compression via profiled grammar rewriting. In: Proceedings of the ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 148–155 (2001)

    Google Scholar 

  22. Klint, P.: Interpretation techniques. Software – Practice and Experience 11, 963–973 (1981)

    Article  Google Scholar 

  23. Hoogerbrugge, J., Augusteijn, L.: Pipelined Java virtual machine interpreters. In: Watt, D.A. (ed.) CC 2000. LNCS, vol. 1781, p. 35. Springer, Heidelberg (2000)

    Chapter  Google Scholar 

  24. Hoogerbrugge, J., Augusteijn, L., Trum, J., van de Wiel, R.: A code compression system based on pipelined interpreters. Software – Practice and Experience 29, 1005–1023 (1999)

    Article  Google Scholar 

  25. Piumarta, I., Riccardi, F.: Optimizing direct threaded code by selective inlining. In: SIGPLAN 1998 Conference on Programming Language Design and Implementation, pp. 291–300 (1998)

    Google Scholar 

  26. Clausen, L., Schultz, U.P., Consel, C., Muller, G.: Java bytecode compression for low-end embedded systems. ACM Transactions on Programming Languages and Systems 22, 471–489 (2000)

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2004 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Gregg, D., Ertl, M.A. (2004). A Language and Tool for Generating Efficient Virtual Machine Interpreters. In: Lengauer, C., Batory, D., Consel, C., Odersky, M. (eds) Domain-Specific Program Generation. Lecture Notes in Computer Science, vol 3016. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-25935-0_12

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-25935-0_12

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-22119-7

  • Online ISBN: 978-3-540-25935-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics