skip to main content
10.1145/1059579.1059591acmconferencesArticle/Chapter ViewAbstractPublication PagesivmeConference Proceedingsconference-collections
Article

Catenation and specialization for Tcl virtual machine performance

Published:07 June 2004Publication History

ABSTRACT

We present techniques for eliminating dispatch overhead in a virtual machine interpreter using a lightweight just-in-time native-code compilation. In the context of the Tcl VM, we convert bytecodes to native Sparc code, by concatenating the native instructions used by the VM to implement each bytecode instruction. We thus eliminate the dispatch loop. Furthermore, immediate arguments of bytecode instructions are substituted into the native code using runtime specialization. Native code output from the C compiler is not amenable to relocation by copying; fix-up of the code is required for correct execution. The dynamic instruction count improvement from eliding dispatch depends on the length in native instructions of each bytecode opcode implementation. These are relatively long in Tcl, but dispatch is still a significant overhead. However, their length also causes our technique to overflow the instruction cache. Furthermore, our native compilation consumes runtime. Some benchmarks run up to three times faster, but roughly half slow down, or exhibit little change.

References

  1. J. Aycock. Converting Python Virtual Machine Code to C. In Proc. of 7th Intl. Python Conf., 1998.Google ScholarGoogle Scholar
  2. V. Bala, E. Duesterwald, and S. Banerjia. Dynamo: a transparent dynamic optimization system. In Proc. of PLDI, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. J. R. Bell. Threaded code. Communications of the ACM, 16:370--372, 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. F. Bellard. Qemu x86 cpu emulator {online}. 2004. Available from: http://fabrice.bellard.free.fr/qemu/.Google ScholarGoogle Scholar
  5. D. Cuthbert. The Kanga Tcl to C converter {online}. 2000. Available from: http://sourceforge.net/projects/kt2c/.Google ScholarGoogle Scholar
  6. R. B. Dewar. Indirect threaded code. Communications of the ACM, 18:330--331, 1973. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. M. A. Ertl. Threaded code {online}. 1998. Available from: http://www.complang.tuwien.ac.at/forth/threaded-code.html/.Google ScholarGoogle Scholar
  8. M. A. Ertl and D. Gregg. Optimizing Indirect Branch Prediction Accuracy in Virtual Machine Interpreters. In Proc. of PLDI, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. M. A. Ertl and D. Gregg. The Structure and Performance of Efficient Interpreters. Journal of Instruction-Level Parallelism, 5:1--25, 2003.Google ScholarGoogle Scholar
  10. B. Grant, M. Mock, M. Philipose, C. Chambers, and S. J. Eggers. DyC: an expressive annotation-directed dynamic compiler for C. Theoretical Computer Science, 248(1-2):147--199, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. B. Lewis. An on-the-fly bytecode compiler for Tcl. In Proc. of the 4th Annual Tcl/Tk Workshop, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. P. S. Magnusson and F. L. et al. SimICS/sun4m: A Virtual Workstation. In Proc. of the Usenix Annual Technical Conference, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. E. Miranda. BrouHaHa - A Portable Smalltalk Interpreter. In Proc. of OOPSLA '87, pages 354--365. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. Muchnick. Advanced Compiler Design and Implementation. Morgan Kaufmann, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. I. Piumarta and F. Riccardi. Optimizing direct-threaded code by selective inlining. In Proc. of PLDI, pages 291--300, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. F. Rouse and W. Christopher. A Typing System for an Optimizing Multiple-Backend Tcl Compiler. In Proc. of the 5th Annual Tcl/Tk Workshop, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. M. Sofer. Tcl Engines {online}. Available from: http://sourceforge.net/projects/tclengine/.Google ScholarGoogle Scholar
  18. SPARC International Inc.A. The SPARC Architecture Manual, Version 8. 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. G. T. Sullivan, D. L. Bruening, I. Baron, T. Garnett, and S. Amarasinghe. Dynamic native optimization of interpreters. In Proc. of the 2003 workshop on Interpreters, Virtual Machines and Emulators. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Sun Microelectronics. UltraSPARC IIi User's Manual. 1997.Google ScholarGoogle Scholar
  21. Tcl Core Team. TclLib benchmarks {online}. 2003. Available from: http://www.tcl.tk/software/tcllib/.Google ScholarGoogle Scholar
  22. B. Vitale. Catenation and Operand Specialization for Tcl Virtual Machine Performance. Master's thesis, University of Toronto, 2004.Google ScholarGoogle Scholar

Index Terms

  1. Catenation and specialization for Tcl virtual machine performance

    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
      IVME '04: Proceedings of the 2004 workshop on Interpreters, virtual machines and emulators
      June 2004
      57 pages
      ISBN:1581139098
      DOI:10.1145/1059579

      Copyright © 2004 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: 7 June 2004

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • Article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader