skip to main content
10.1145/1167473.1167489acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
Article

Virgil: objects on the head of a pin

Published:16 October 2006Publication History

ABSTRACT

Embedded microcontrollers are becoming increasingly prolific, serving as the primary or auxiliary processor in products and research systems from microwaves to sensor networks. Microcontrollers represent perhaps the most severely resource-constrained embedded processors, often with as little as a few bytes of memory and a few kilobytes of code space. Language and compiler technology has so far been unable to bring the benefits of modern object-oriented languages to such processors. In this paper, I will present the design and implementation of Virgil, a lightweight object-oriented language designed with careful consideration for resource-limited domains. Virgil explicitly separates initialization time from runtime, allowing an application to build complex data structures during compilation and then run directly on the bare hardware without a virtual machine or any language runtime. This separation allows the entire program heap to be available at compile time and enables three new data-sensitive optimizations: reachable members analysis, reference compression, and ROM-ization. Experi-mental results demonstrate that Virgil is well suited for writing microcontroller programs, with five demonstrative applications fitting in less than 256 bytes of RAM with fewer than 50 bytes of metadata. Further results show that the optimizations presented in this paper reduced code size between 20% and 80% and RAM size by as much as 75%.

References

  1. ECMA Standard 334. C# Language Specification. Available at: http://www.ecma-international.org/]]Google ScholarGoogle Scholar
  2. Connected Limited Device Configuration (CLDC). http://java.sun.com/j2me]]Google ScholarGoogle Scholar
  3. B. Alpern, A. Cocchi, S. Fink, D. Grove, and D. Lieber. Efficient Implementation of Java Interfaces: Invokeinterface Considered Harmless. In Proceedings of the 16th Annual Conference on Object-Oriented Systems, Languages, and Applications (OOPSLA '01). Tampa, FL. Oct. 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. C. Ananian and M. Rinard. Data Size Optimizations for Java Programs. In 2003 Workshop on Languages, Compilers, and Tools for Embedded Systems (LCTES '03). San Diego, CA. June 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. D. Bacon. Kava: a Java Dialect with a Uniform Object Model for Lightweight Classes. Concurrency and Computation: Practice and Experience 15(3-5): 185--206. 2003.]]Google ScholarGoogle ScholarCross RefCross Ref
  6. D. Bacon, S. Fink, and D. Grove. Space- and Time-efficient Implementation of the Java Object Model. In the 16th European Conference on Object-Oriented Programming (ECOOP '02), University of Malaga, Spain, June 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. D. Bacon and P. Sweeney. Fast Static Analysis of C++ Virtual Calls. In Proceedings of the 11th Annual Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA '96). San Jose, CA. Oct. 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. G. Bracha, N. Cohen, C. Kemper, M. Odersky, D. Stoutamire, K. Thorup, and P. Wadler. Adding Generics to the Java Programming Language. Java Community Process JSR-000014, September 2004.]]Google ScholarGoogle Scholar
  9. M. Budiu, S. Goldstein, M. Sakr, and K. Walker. BitValue Inference: Detecting and Exploiting Narrow Bitwidth Computations. In Proceedings of the EuroPar 2000 European Conference on Parallel Computing. Munich, Germany. August 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. G. Chen, M. Kandemir, N. Vijaykrishnan, M. Irwin, B. Mathiske, and M. Wolczko. Heap Compression for Memory-constrained Java Environments. In Proceedings of the 18th Annual Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA '03). Anaheim, CA. Oct 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. N. Cohen. Type Extension Type Tests can be Performed in Constant Time. ACM Transactions on Programming Languages and Systems, 13(4), 626--629. 1991.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. J. Dean, D. Grove, and C. Chambers. Optimization of Object-Oriented Programs using Static Class Hierarchy Analysis. In the 9th European Conference on Object-Oriented Programming (ECOOP '95). Aarhus, Denmark. Aug. 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. A. Diwan, K. McKinley, and J. E. Moss. Using Types to Analyze and Optimize Object-Oriented Programs. In ACM Transactions on Programming Languages and Systems, 23(1), 30--72. 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. N. Eckel and J. Gil. Empirical Study of Object-layout Strategies and Optimization Techniques. In the 14th European Conference on Object-Oriented Programming (ECOOP '00). Sophia Antipolis and Cannes, France. June 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. D. Gay, P. Levis, R. von Behren, M. Welsh, E. Brewer, and D. Culler. The nesC Language: A Holistic Approach to Networked Embedded Systems. In Proceedings of the ACM Conference on Programming Language Design and Implementation (PLDI '03). San Diego, CA. June 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. M. Golm, M. Felser, C. Wawersich, and J. Kleinöder. The JX Operating System. In Proceedings of the 2002 USENIX Annual Technical Conference. Monterey, CA. June, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. Gosling, B. Joy, and G. Steele. The Java Language Specification. Addison-Wesley, 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. C. Han, R. Kumar, R. Shea, E. Kohler, and M. Srivastava. A Dynamic Operating System for Sensor Nodes. In Proceedings of the International Conference on Mobile Systems, Applications, and Services (MOBISYS '05). Seattle, WA. June 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. T. Harbaum. NanoVM: Java for the AVR. Available at: http://www.harbaum.org/till/nanovm/]]Google ScholarGoogle Scholar
  21. G. Hunt, et al. An Overview of the Singularity Project. Microsoft Technical Report MSR-TR-2005-135. October 2005.]]Google ScholarGoogle Scholar
  22. K. Ishizaki, M. Kawahito, T. Yasue, H. Komatsu, T. Nakatani. A Study of Devirtualization Techniques for a Java Just-in-time Compiler. In Proceedings of the 15th Annual Conference on Object-Oriented Systems, Languages, and Applications (OOPSLA '00). Minneapolis, MN. Oct. 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. P. Jain, and D. Schmidt. Service Configurator: A Pattern for Dynamic Configuration of Services. In Proceedings of the 3rd USENIX Conference on Object-Oriented Technologies and Systems. June 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. J. Koshy and R. Pandey. VM*: A Scalable Runtime Environment for Sensor Networks. In The 3rd annual conference on Embedded Network Sensor Systems (SENSYS '05). San Diego, CA. Nov. 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. R. Newton, Arvind, and M. Welsh. Building up to Macroprogramming: An Intermediate Language for Sensor Networks. In Proceedings of the Fourth International Conference on Information Processing in Sensor Networks (IPSN'05), April 2005.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. J. Palsberg. Type-based Analysis and Applications. In Proceedings of the ACM SIGPLAN/SIGSOFT Workshop on Program Analysis for Software Tools (PASTE '01). Snowbird, UT. June 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. M. Sakkinen. The darker side of C++ revisited. Structured Programming, 13:155--177, 1992.]]Google ScholarGoogle Scholar
  28. M. A. Schubert, L. K. Papalaskaris, and J. Taugher. Determining Type, Part, Colour, and Time Relationships. Computer, 16:53--60, October 1983.]]Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. D. Spoonhower, J. Auerbach, D. Bacon, P. Cheng, and D. Grove. Eventrons: A Safe Programming Construct for High-Frequency Hard Real-Time Applications. In Proceedings of the ACM Conference on Programming Language Design and Implementation (PLDI '06) Ottawa, CN. June 2006.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. B. Steensgard. Points-to Analysis in Almost Linear Time. Microsoft Technical Report, MSR-TR-95-08. 1995.]]Google ScholarGoogle Scholar
  31. V. Sundaresan, L. Hendren, C. Razafimahefa, R. Vallee-Rai, P. Lam, E. Gagnon, and C. Godin. Practical virtual method call resolution for Java. In the 15th Annual Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA '00). Minneapolis, MN. Oct. 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. P. Sweeney and F. Tip. A Study of Dead Data Members in C++ Applications. In Proceedings of the ACM Conference on Programming Language Design and Implementation (PLDI '98). Montreal, Canada. 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. W. Taha, S. Ellner, and H. Xi. Generating Imperative, Heap-Bounded Programs in a Functional Setting. In Proceedings of the 3rd Annual International Conference on Embedded Software (EMSOFT '03). Philadelphia, PA. October 2003.]]Google ScholarGoogle Scholar
  34. F. Tip and J. Palsberg. Scalable Propagation-based Call Graph Construction Algorithms. In the 15th Annual Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA '00). Minneapolis, MN. Oct. 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. F. Tip, P. Sweeney, C. Laffra, A. Eisma, and D. Streeter. Practical Extraction Techniques for Java. ACM Transactions on Programming Languages and Systems, 24(6): 625--666, 2002.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. P. Tyma. Optimizing Transforms for Java and .NET Closed Systems. Phd Thesis, Syracuse University. 2004.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. J. Vitek, B. Bokowski. Confined Types. In the 14th Annual Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA '99). Denver, CO. Oct. 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. J. Vitek, R. N. Horspool, and A. Krall. Efficient Type Inclusion Tests. In Proceedings of the 12th Annual Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA '97). Atlanta, GA. Oct. 1997.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. T. Zhao, J. Palsberg, and J. Vitek. Lightweight Confinement for Featherweight Java. In the 18th Annual Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA '03). Anaheim, CA. Oct 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Virgil: objects on the head of a pin

          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

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader
          About Cookies On This Site

          We use cookies to ensure that we give you the best experience on our website.

          Learn more

          Got it!