An ad hoc approach to the implementation of polymorphism
ACM Transactions on Programming Languages and Systems (TOPLAS)
Unboxed objects and polymorphic typing
POPL '92 Proceedings of the 19th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Tag-free garbage collection using explicit type parameters
LFP '94 Proceedings of the 1994 ACM conference on LISP and functional programming
Compiling polymorphism using intensional type analysis
POPL '95 Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
TIL: a type-directed optimizing compiler for ML
PLDI '96 Proceedings of the ACM SIGPLAN 1996 conference on Programming language design and implementation
Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
Adding type parameterization to the Java language
Proceedings of the 12th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
Making the future safe for the past: adding genericity to the Java programming language
Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
Compatible genericity with run-time types for the Java programming language
Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
Parametric polymorphism in Java: an approach to translation based on reflective features
OOPSLA '00 Proceedings of the 15th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
Design and implementation of generics for the .NET Common language runtime
Proceedings of the ACM SIGPLAN 2001 conference on Programming language design and implementation
The C++ Programming Language, Third Edition
The C++ Programming Language, Third Edition
Java Virtual Machine Specification
Java Virtual Machine Specification
Overview of excelsior JET, a high performance alternative to java virtual machines
WOSP '02 Proceedings of the 3rd international workshop on Software and performance
Unboxed Values as First Class Citizens in a Non-Strict Functional Language
Proceedings of the 5th ACM Conference on Functional Programming Languages and Computer Architecture
The design of an instruction set for common LISP
LFP '84 Proceedings of the 1984 ACM Symposium on LISP and functional programming
A first-class approach to genericity
OOPSLA '03 Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications
Scalable component abstractions
OOPSLA '05 Proceedings of the 20th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
Efficient first-class generics on stock Java virtual machines
Proceedings of the 2006 ACM symposium on Applied computing
The java hotspotTM server compiler
JVM'01 Proceedings of the 2001 Symposium on JavaTM Virtual Machine Research and Technology Symposium - Volume 1
Statistically rigorous java performance evaluation
Proceedings of the 22nd annual ACM SIGPLAN conference on Object-oriented programming systems and applications
Design of the Java HotSpot™ client compiler for Java 6
ACM Transactions on Architecture and Code Optimization (TACO)
Trace-based just-in-time type specialization for dynamic languages
Proceedings of the 2009 ACM SIGPLAN conference on Programming language design and implementation
Efficient run-time dispatching in generic programming with minimal code bloat
Science of Computer Programming
A generic parallel collection framework
Euro-Par'11 Proceedings of the 17th international conference on Parallel processing - Volume Part II
Fast method dispatch and effective use of primitives for reified generics in managed X10
Proceedings of the 2012 ACM SIGPLAN X10 Workshop
Lightweight generics in embedded systems through static analysis
Proceedings of the 13th ACM SIGPLAN/SIGBED International Conference on Languages, Compilers, Tools and Theory for Embedded Systems
Self-optimizing AST interpreters
Proceedings of the 8th symposium on Dynamic languages
Bridging islands of specialized code using macros and reified types
Proceedings of the 4th Workshop on Scala
Hi-index | 0.00 |
Parametric polymorphism enables code reuse and type safety. Underneath the uniform interface exposed to programmers, however, its low level implementation has to cope with inherently non-uniform data: value types of different sizes and semantics (bytes, integers, floating point numbers) and reference types (pointers to heap objects). On the Java Virtual Machine, parametric polymorphism is currently translated to bytecode using two competing approaches: homogeneous and heterogeneous. Homogeneous translation requires boxing, and thus introduces indirect access delays. Heterogeneous translation duplicates and adapts code for each value type individually, producing more bytecode. Therefore bytecode speed and size are at odds with each other. This paper proposes a novel translation that significantly reduces the bytecode size without affecting the execution speed. The key insight is that larger value types (such as integers) can hold smaller ones (such as bytes) thus reducing the duplication necessary in heterogeneous translations. In our implementation, on the Scala compiler, we encode all primitive value types in long integers. The resulting bytecode approaches the performance of monomorphic code, matches the performance of the heterogeneous translation and obtains speedups of up to 22x over the homogeneous translation, all with modest increases in size.