skip to main content
A portable research framework for the execution of java bytecode
Publisher:
  • McGill University
  • 847 W. Sherbrooke St. Montreal P.Q. H3A 3N6
  • Canada
ISBN:978-0-612-88471-7
Order Number:AAINQ88471
Pages:
138
Bibliometrics
Skip Abstract Section
Abstract

Compilation to bytecode paired with interpretation is often used as a technique to easily build prototypes for new programming languages. Some languages, including Java, push this further and use the bytecode layer to isolate programs from the underlying platform. Current state-of-the-art commercial and research Java virtual machines implement advanced just-in-time and adaptive compilation techniques to deliver high-performance execution of Java bytecode. Yet, experimenting with new features such as adding new bytecodes or redesigning the type system can be a daunting task within these complex systems, when new features invalidate assumptions on which the internal dynamic optimizing compiler depends. On the other hand, simpler existing Java bytecode interpreters, written purely in high-level languages, deliver poor performance. The main motivation behind this thesis was to answer the question: How fast can a portable, easily modifiable Java bytecode interpreter be? In order to address this question, we have designed and developed the Sable VM research framework, a portable interpreter-based Java virtual machine written in portable C. In this thesis we introduce innovative techniques for implementing an efficient, yet portable Java bytecode interpreter. These techniques address three areas: instruction dispatch, memory management, and synchronization. Specifically, we show how to implement an inline-threaded engine in the presence of lazy code preparation, without incurring a high synchronization penalty. We then introduce a logical partitioning of runtime system memory that simplifies memory management, and a related sparse interface virtual table design for fast interface-method invocation. We show how to efficiently compute space-efficient garbage collection maps for verifiable bytecode. We also present a bidirectional object layout that simplifies garbage collection. Finally, we introduce an improvement to thin locks, eliminating busy-wait in case of contention. Our experiments within the Sable VM framework show that inline-threading [PR98] Java delivers significant performance improvement over switch and direct-threading, that sparse interface tables cause no memory loss, and that our map computation algorithm delivers a very small number of distinct garbage collection maps. Our overall performance measurements show that, using our techniques, a portable interpreter can deliver competitive interpretation performance, and even surpass that of a less-portable state-of-the-art interpreter on some benchmarks.

Cited By

  1. ACM
    Garner R, Blackburn S and Frampton D (2011). A comprehensive evaluation of object scanning techniques, ACM SIGPLAN Notices, 46:11, (33-42), Online publication date: 18-Nov-2011.
  2. ACM
    Garner R, Blackburn S and Frampton D A comprehensive evaluation of object scanning techniques Proceedings of the international symposium on Memory management, (33-42)
  3. Lambert J and Power J (2008). Platform Independent Timing of Java Virtual Machine Bytecode Instructions, Electronic Notes in Theoretical Computer Science (ENTCS), 220:3, (97-113), Online publication date: 1-Dec-2008.
  4. ACM
    Prokopski G and Verbrugge C (2008). Analyzing the performance of code-copying virtual machines, ACM SIGPLAN Notices, 43:10, (403-422), Online publication date: 27-Oct-2008.
  5. ACM
    Prokopski G and Verbrugge C Analyzing the performance of code-copying virtual machines Proceedings of the 23rd ACM SIGPLAN conference on Object-oriented programming systems languages and applications, (403-422)
  6. Prokopski G and Verbrugge C Compiler-guaranteed safety in code-copying virtual machines Proceedings of the Joint European Conferences on Theory and Practice of Software 17th international conference on Compiler construction, (163-177)
  7. ACM
    Casey K, Ertl M and Gregg D (2007). Optimizing indirect branch prediction accuracy in virtual machine interpreters, ACM Transactions on Programming Languages and Systems (TOPLAS), 29:6, (37-es), Online publication date: 1-Oct-2007.
  8. ACM
    Kågström S, Grahn H and Lundberg L Cibyl Proceedings of the 3rd international conference on Virtual execution environments, (75-82)
  9. ACM
    Xu H, Pickett C and Verbrugge C Dynamic purity analysis for java programs Proceedings of the 7th ACM SIGPLAN-SIGSOFT workshop on Program analysis for software tools and engineering, (75-82)
  10. ACM
    Agosta G, Reghizzi S and Svelto G Jelatine Proceedings of the 4th international workshop on Java technologies for real-time and embedded systems, (170-177)
  11. Vertanen O Java type confusion and fault attacks Proceedings of the Third international conference on Fault Diagnosis and Tolerance in Cryptography, (237-251)
  12. ACM
    Gu D, Verbrugge C and Gagnon E Relative factors in performance analysis of Java virtual machines Proceedings of the 2nd international conference on Virtual execution environments, (111-121)
  13. ACM
    Pickett C and Verbrugge C (2005). SableSpMT, ACM SIGSOFT Software Engineering Notes, 31:1, (59-66), Online publication date: 1-Jan-2006.
  14. Pickett C and Verbrugge C Software thread level speculation for the java language and virtual machine environment Proceedings of the 18th international conference on Languages and Compilers for Parallel Computing, (304-318)
  15. ACM
    Pickett C and Verbrugge C SableSpMT Proceedings of the 6th ACM SIGPLAN-SIGSOFT workshop on Program analysis for software tools and engineering, (59-66)
  16. ACM
    von Ronne J, Wang N and Franz M Interpreting programs in static single assignment form Proceedings of the 2004 workshop on Interpreters, virtual machines and emulators, (23-30)
  17. ACM
    Davis B, Beatty A, Casey K, Gregg D and Waldron J The case for virtual register machines Proceedings of the 2003 workshop on Interpreters, virtual machines and emulators, (41-49)
  18. Berndl M and Hendren L Dynamic profiling and trace cache generation Proceedings of the international symposium on Code generation and optimization: feedback-directed and runtime optimization, (276-285)
Contributors
  • McGill University
  • McGill University

Recommendations

Sergei Gorlatch

This work presents the design of SableVM, an extensible Java Virtual Machine (JVM). The goal of SableVM, as stated by the author, is to provide a portable, easily modifiable bytecode interpreter that can serve as a research platform for investigating new interpretation techniques, or new garbage collection mechanisms. After a brief introduction to bytecode interpretation in general, and to SableVM in particular, the next seven chapters each present an important aspect of the VM in more detail. Each chapter contains a section on related work, and presents experimental results to justify the used algorithms. The second chapter discusses different techniques to reduce the overhead of bytecode interpretation: switching, direct threading, and inline threading. The inline threading method is explained in more detail, and is adjusted to the special needs of Java bytecode interpretation. The next chapter discusses the memory layout of SableVM, and presents a partitioning of the runtime system memory: instead of allocating all memory from a garbage-collected heap, memory is allocated from different partitions according to its usage, for example, stack, class loader, and so on. Each partition has its own memory manager, implementing efficient strategies of memory management that are tailored for the specific usage type expected for that particular partition. Chapter 4 presents sparse interface virtual tables for method invocation, which reduce the overhead for interface method lookup by assigning unique indices to methods. This leads to sparse method tables with large gaps, which would require compression to be memory efficient. However, in SableVM, the partition-specific memory management introduced in the previous section solves this problem very elegantly, by filling the gaps with class loader related memory. The two following chapters discuss two aspects of garbage collection: object layout and garbage collection maps. The proposed bidirectional object layout reduces the number of memory accesses required to trace an object, by grouping all reference fields consecutively. This is achieved by letting an instance grow toward lower addresses for nonreference fields, and toward higher addresses for references. Space-efficient garbage collection maps are computed using an algorithm that assumes verifiable bytecode and performs a simple analysis of the code to compute stack maps and split local variables into reference and nonreference versions. By reordering local variables in methods, a single local variable map per method is sufficient. The last design aspect, discussed in chapter 7, is the implementation of thin locks for Java's monitors. An improved version of Bacon's and Onodera's algorithms, which avoids object instance inflation by using thread-specific storage for contention-related data structures, is presented. After a chapter about the portability and extensibility of the SableVM, overall performance measurements are presented. The experimental results show very good performance, when compared to other interpreting JVMs, but also show that an interpretation-only VM cannot compete with just in time (JIT)-compiling VMs. The thesis concludes with future work and conclusions. In general, the thesis gives a very good overview of interpretation techniques for Java, and discusses many important issues in the design of JVMs, such as garbage collection and memory management. The work is quite interesting to read, both for researchers planning to use SableVM to experiment with new VM-related techniques, and for readers with a general interest in the field.

Access critical reviews of Computing literature here

Become a reviewer for Computing Reviews.