Computer Software
Print ISSN : 0289-6540
Safe Implementation of C Pointer Arithmetics by Translation to Java
Yuhki KAMIJIMAEijiro SUMII
Author information
JOURNAL FREE ACCESS

2009 Volume 26 Issue 1 Pages 1_139-1_154

Details
Abstract

We implemented a translator from a subset of C to Java that guarantees safety. For such translation, we need to emulate C's pointer arithmetics in Java. We thus defined Java classes to represent C's pointers and memory blocks. Next, we defined translation rules which use these classes, and implemented a translator following the rules. We also need to translate integers as pointers, because they can be cast to each other in C. However, representing all integers as pointers incurs too much overhead. We therefore implemented optimizations, including a data flow analysis for translating C's integer variables (to which no pointers are assigned) to Java's integer variables. We conducted experiments with 9 benchmark programs. Without optimizations, the translated programs were 3.3–585 times slower than the original C programs. After the optimizations, those numbers improved to 1.3–5.9.

Content from these authors
© Japan Society for Software Science and Technology 2009
Previous article
feedback
Top