{"title":"ejIP: a TCP/IP stack for embedded Java","authors":"Martin Schoeberl","doi":"10.1145/2093157.2093167","DOIUrl":"https://doi.org/10.1145/2093157.2093167","url":null,"abstract":"To enable Java on resource constraint embedded devices, the whole system should be implemented in a single programming language to avoid overheads on language boundaries. However, most of the functionality that is dedicated to the operating system layer is usually written in C. In this paper we present the design and implementation of a network stack written entirely in Java. This implementation serves as an example how to implement system functions in a safe language and gives evidence that Java can be used for operating system related functionality. The described TCP/IP stack ejIP has already been successfully used in industrial projects on pure Java embedded systems.","PeriodicalId":169989,"journal":{"name":"Principles and Practice of Programming in Java","volume":"7 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2011-08-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"116938446","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Fine-grained adaptive biased locking","authors":"F. Pizlo, Daniel Frampton, Antony Lloyd Hosking","doi":"10.1145/2093157.2093184","DOIUrl":"https://doi.org/10.1145/2093157.2093184","url":null,"abstract":"Mutual-exclusion locking is the prevailing technique for protecting shared resources in concurrent programs. Fine-grained locking maximizes the opportunities for concurrent execution while preserving correctness, but increases both the number of locks and the frequency of lock operations. Adding to the frequency of these operations is the practice of using locks defensively --- such as in library code designed for use in both concurrent and single-threaded scenarios. If the library does not protect itself with locks, an engineering burden is placed on the library's users; if the library does use locks, it punishes those who use it only from a single thread. Biased locking is a dynamic protocol for eliminating this trade-off, in which the underlying run-time system optimizes lock operations by biasing a lock to a specific thread when the lock is dynamically found to be thread-local. Biased locking protocols are distinguished by how many opportunities for optimization are found, and what performance trade-offs for non-local locks are experienced. Of particular concern is the relatively high cost involved in revoking the bias of a lock, which makes existing biased locking protocols susceptible to performance pathologies for programs with specific patterns of contention.\u0000 This work presents the biased locking protocol used in Jikes RVM, a high-throughput Java virtual machine. The protocol, dubbed Fable, builds on prior work by adding per-object-instance dynamic adaptation and inexpensive bias revocation. We describe the protocol, detail how it was implemented, and use it in offering the most thorough evaluation of Java locking protocols to date. Fable is shown to provide speed-ups over traditional Java locking across a broad spectrum of benchmarks while being robust to cases previous protocols handled poorly.","PeriodicalId":169989,"journal":{"name":"Principles and Practice of Programming in Java","volume":"52 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2011-08-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"133229318","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Jazz2: a flexible and extensible framework for structural testing in a Java VM","authors":"Jonathan Misurda, B. Childers, M. Soffa","doi":"10.1145/2093157.2093169","DOIUrl":"https://doi.org/10.1145/2093157.2093169","url":null,"abstract":"This paper describes a framework for structural testing in a Java Virtual Machine (JVM), called Jazz2. The framework provides instrumentation, memory management, control flow analysis, and callback handling services for structural tests, such as branch and node coverage. Additionally, it has a language for the specification of how and where to test. These facilities allow for the efficient implementation of demand-driven and static testing techniques. Jazz2 supports an extensible test library, where new tests can be easily added. The paper describes the framework, its implementation, and evaluates how the framework interacts with a JVM, the Jikes Research Virtual Machine (RVM). We demonstrate the ease of implementing a structural test in Jazz2, extending the test library, and specifying the use of these tests with our language. Our experimental results show that Jazz2 has low overhead in both time and memory, and has minimal interaction with the RVM's garbage collector.","PeriodicalId":169989,"journal":{"name":"Principles and Practice of Programming in Java","volume":"60 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2011-08-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"130139812","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Eliminating partially-redundant array-bounds check in the Android Dalvik JIT compiler","authors":"J. Absar, Deepak Shekhar","doi":"10.1145/2093157.2093175","DOIUrl":"https://doi.org/10.1145/2093157.2093175","url":null,"abstract":"The Android operating system has transformed the mobile software platform landscape significantly. A significant component of the Android is the Dalvik Virtual Machine (DVM) that interprets client applications' codes written in Java and compiled to dexcode. Since interpretation is inherently slow, virtual machines typically employ just-in-time (JIT) compilation. In the Froyo 2.2 release of Android, DVM added a JIT compiler that selectively compiles hot-traces to native ARM code. Some crucial optimizations such as array bounds-check optimization have been implemented in the DVM-JIT compiler. DVM implements an extension of the state-of-the-art in optimization of partially-redundant array-bounds check, which is the approach of Wurthinger et al. as implemented in Java Hot-Spot Compiler. That technique has a limitation that it can optimize bounds checks only for indices that are \"iterator plus a constant\". In this paper, we tackle that problem by proposing an extension that can handle indices that are \"affine functions of iterators, loop-invariants and literals\". Our extension is fast and is implemented into the DVM JIT compiler.","PeriodicalId":169989,"journal":{"name":"Principles and Practice of Programming in Java","volume":"23 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2011-08-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"121530453","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
M. Kaufmann, Matthias Häsing, Thomas B. Preußer, R. Spallek
{"title":"The Java Virtual Machine in retargetable, high-performance instruction set simulation","authors":"M. Kaufmann, Matthias Häsing, Thomas B. Preußer, R. Spallek","doi":"10.1145/2093157.2093161","DOIUrl":"https://doi.org/10.1145/2093157.2093161","url":null,"abstract":"Two main demands on instruction set simulation are portability and high simulation performance. For the testing and benchmarking of ISA prototypes such as in an ASIP design process, simulators are additionally required to offer retargetability for the rapid modeling and revisal of their simulation targets.\u0000 In this paper, we present the techniques applied in a full-system instruction set simulation framework that combines these three conflicting demands. Our framework is retargetable, portable and provides high simulation performance. It is entirely implemented in Java and features a two-stage dynamic binary translation (DBT) targeting Java Bytecode in the first stage and employing the Java Virtual Machine as an external code generation back end in the second stage. While the use of state-of-the-art techniques such as DBT generates high simulation performance, the framework is also platform independent and can run on any J2SE-compliant Java Runtime Environment. In spite of this platform independence, the native code generated in the second stage will even profit from the platform-specific optimizations performed by modern JVM implementations. Our second contribution is HPADL, the instruction set description language that provides the retargetability of our framework. HPADL is tailored for the specific needs of dynamically compiling full-system IS simulation. Due to its clean separation of concerns between the instruction decoding and instruction execution, it easily enables DBT. Also, it is not restricted to a specific range of target architectures such as RISC. In this paper, we will compare the modeling effort in HPADL to that of QEMU. For our experiments and in order to show the practicability and flexibility of our approach, we implemented HPADL models of the DLX, 8086, ARMv4 and PowerPC/PowerPC VLE ISA as well as some IO device models in Java. A comparison with the simulation performance of QEMU by reference of the EEMBC AutoBench 1.1 shows that we achieve 78% of the QEMU performance on average.","PeriodicalId":169989,"journal":{"name":"Principles and Practice of Programming in Java","volume":"32 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2011-08-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"129764218","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Optimized memory management for class metadata in a JVM","authors":"Thomas Schatzl, L. Daynès, H. Mössenböck","doi":"10.1145/2093157.2093182","DOIUrl":"https://doi.org/10.1145/2093157.2093182","url":null,"abstract":"A Java virtual machine (JVM) typically manages large amounts of class metadata (e.g. class descriptors, methods, byte codes) in main-memory. In this paper, we analyze the impact of metadata memory management on garbage collection costs in an industrial-strength JVM. We show that, for most applications in the latest DaCapo benchmark suite, the tracing of class metadata accounts for a significant part of full collection time.\u0000 We propose a novel approach to metadata memory management based on metaspaces and on a linkset graph. Metaspaces store class metadata segregated by their class loader and keep an exact record of references from class metadata to the heap. The linkset graph summarizes what metaspaces reference others via resolved symbolic links. Metaspaces allow en masse reclamation of the storage allocated to classes defined by a class loader when this class loader becomes unreachable. The linkset graph eliminates the need to trace references between metadata to determine the liveness of classes and of the heap objects they refer to.\u0000 This reduces the number of visited references in class metadata to less than 1% of the original amount and cuts down tracing time by up to 80%. Average full heap collection time improves by at least 35% for all but one of the Dacapo benchmarks, and by more than 70% for six of them.\u0000 Metaspace-based management of class metadata also extends well to multi-tasking implementations of the JVM. It enables tasks to unload classes independently of other tasks.","PeriodicalId":169989,"journal":{"name":"Principles and Practice of Programming in Java","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2011-08-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"128455581","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Coen De Roover, Carlos Noguera, Andy Kellens, V. Jonckers
{"title":"The SOUL tool suite for querying programs in symbiosis with Eclipse","authors":"Coen De Roover, Carlos Noguera, Andy Kellens, V. Jonckers","doi":"10.1145/2093157.2093168","DOIUrl":"https://doi.org/10.1145/2093157.2093168","url":null,"abstract":"Program queries can answer important software engineering questions that range from \"which expressions are cast to this type?\" over \"does my program attempt to read from a closed file?\" to \"does my code follow the prescribed design?\". In this paper, we present a comprehensive tool suite for querying Java programs. It consists of the logic program query language Soul, the Cava library of predicates for quantifying over an Eclipse workspace and the Eclipse plugin Barista for launching queries and inspecting their results. Barista allows other Eclipse plugins to peruse program query results which is facilitated by the symbiosis of Soul with Java -- setting Soul apart from other program query languages. This symbiosis enables the Cava library to forego the predominant transcription to logic facts of the queried program. Instead, the library queries the actual AST nodes used by Eclipse itself, making it trivial for any Eclipse plugin to find the AST nodes that correspond to a query result. Moreover, such plugins do not have to worry about having queried stale program information. We illustrate the extensibility of our suite by implementing a tool for co-evolving source code and annotations using program queries.","PeriodicalId":169989,"journal":{"name":"Principles and Practice of Programming in Java","volume":"74 3-4","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2011-08-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"132192101","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"DeepFJig: modular composition of nested classes","authors":"A. Corradi, M. Servetto, E. Zucca","doi":"10.1145/2093157.2093172","DOIUrl":"https://doi.org/10.1145/2093157.2093172","url":null,"abstract":"We present a new language design which smoothly integrates modular composition and nesting of Java-like classes. That is, inheritance has been replaced by an expressive set of composition operators, inspired by Bracha's Jigsaw framework, and these operators allow to manipulate (e.g., rename or duplicate) a nested class at any level of depth. Typing is nominal as characteristic of Java-like languages, so types are paths of the form outern. c1..... ck which, depending on the class (node) where they occur, denote another node in the nesting tree. However, paths denoting the same class are not equivalent, since they behave differently w.r.t. composition operators.\u0000 The resulting language, called DeepFJig, obtains a great expressive power, allowing, e.g., to solve the expression problem, encode basic AOP mechanisms, and bring some refactoring techniques at the language level, while keeping a very simple semantics and type system which represent a natural extension for, say, a Java programmer.","PeriodicalId":169989,"journal":{"name":"Principles and Practice of Programming in Java","volume":"118 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2011-08-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"132322034","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
{"title":"Optimizing interpreters by tuning opcode orderings on virtual machines for modern architectures: or: how I learned to stop worrying and love hill climbing","authors":"Jason McCandless, David Gregg","doi":"10.1145/2093157.2093183","DOIUrl":"https://doi.org/10.1145/2093157.2093183","url":null,"abstract":"Virtual machines (VMs) are commonly used to execute programs written in languages such as Java, Python and Lua. VMs are typically implemented using an interpreter, a JIT compiler, or some combination of the two. A long-standing question in the design of VM interpreters is whether it is worthwhile to reorder the cases in the main interpreter loop to improve code locality. We investigate this phenomenon using an iterative, feedback-directed approach. We show that the ordering of the cases in the interpreter loop has a significant impact on performance on recent processors. Using hardware performance counters, we demonstrate that the performance improvement is primarily the result of indirect branch prediction, not instruction cache locality. We propose a number of strategies to achieve better orderings, and evaluate these strategies in the Python and Lua virtual machine interpreters. We show speedups of up to 40%.","PeriodicalId":169989,"journal":{"name":"Principles and Practice of Programming in Java","volume":"14 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2011-08-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"115367483","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
Aibek Sarimbekov, Andreas Sewe, Walter Binder, Philippe Moret, Martin Schoeberl, M. Mezini
{"title":"Portable and accurate collection of calling-context-sensitive bytecode metrics for the Java virtual machine","authors":"Aibek Sarimbekov, Andreas Sewe, Walter Binder, Philippe Moret, Martin Schoeberl, M. Mezini","doi":"10.1145/2093157.2093160","DOIUrl":"https://doi.org/10.1145/2093157.2093160","url":null,"abstract":"Calling-context profiles and dynamic metrics at the bytecode level are important for profiling, workload characterization, program comprehension, and reverse engineering. Prevailing tools for collecting calling-context profiles or dynamic bytecode metrics often provide only incomplete information or suffer from limited compatibility with standard JVMs. However, completeness and accuracy of the profiles is essential for tasks such as workload characterization, and compatibility with standard JVMs is important to ensure that complex workloads can be executed. In this paper, we present the design and implementation of JP2, a new tool that profiles both the inter- and intra-procedural control flow of workloads on standard JVMs. JP2 produces calling-context profiles preserving callsite information, as well as execution statistics at the level of individual basic blocks of code. JP2 is complemented with scripts that compute various dynamic bytecode metrics from the profiles. As a case-study and tutorial on the use of JP2, we use it for cross-profiling for an embedded Java processor.","PeriodicalId":169989,"journal":{"name":"Principles and Practice of Programming in Java","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2011-08-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"121821439","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}