skip to main content
research-article

Typed Architectures: Architectural Support for Lightweight Scripting

Authors Info & Claims
Published:04 April 2017Publication History
Skip Abstract Section

Abstract

Dynamic scripting languages are becoming more and more widely adopted not only for fast prototyping but also for developing production-grade applications. They provide high-productivity programming environments featuring high levels of abstraction with powerful built-in functions, automatic memory management, object-oriented programming paradigm and dynamic typing. However, their flexible, dynamic type systems easily become the source of inefficiency in terms of instruction count, memory footprint, and energy consumption. This overhead makes it challenging to deploy these high-productivity programming technologies on emerging single-board computers for IoT applications. Addressing this challenge, this paper introduces Typed Architectures, a high-efficiency, low-cost execution substrate for dynamic scripting languages, where each data variable retains high-level type information at an ISA level. Typed Architectures calculate and check the dynamic type of each variable implicitly in hardware, rather than explicitly in software, hence significantly reducing instruction count for dynamic type checking. Besides, Typed Architectures introduce polymorphic instructions (e.g., xadd), which are bound to the correct native instruction at runtime within the pipeline (e.g., add or fadd) to efficiently implement polymorphic operators. Finally, Typed Architectures provide hardware support for flexible yet efficient type tag extraction and insertion, capturing common data layout patterns of tag-value pairs. Our evaluation using a fully synthesizable RISC-V RTL design on FPGA shows that Typed Architectures achieve geomean speedups of 11.2% and 9.9% with maximum speedups of 32.6% and 43.5% for two production-grade scripting engines for JavaScript and Lua, respectively. Moreover, Typed Architectures improve the energy-delay product (EDP) by 19.3% for JavaScript and 16.5% for Lua with an area overhead of 1.6% at a 40nm technology node.

References

  1. Angry Birds. https://www.angrybirds.com/games/.Google ScholarGoogle Scholar
  2. Arduino Yun. https://www.arduino.cc/en/Main/ArduinoBoardYun.Google ScholarGoogle Scholar
  3. Intel Edison. https://software.intel.com/en-us/iot/hardware/edison.Google ScholarGoogle Scholar
  4. Espruino. http://www.espruino.com.Google ScholarGoogle Scholar
  5. Intel Galileo. https://software.intel.com/en-us/iot/hardware/galileo.Google ScholarGoogle Scholar
  6. Introduction to Intel Memory Protection extensions. http://software.intel.com/en-us/articles/introduction-to-intel-memory-protection-extensions.Google ScholarGoogle Scholar
  7. JavaScript. https://developer.mozilla.org/en/docs/Web/JavaScript.Google ScholarGoogle Scholar
  8. TI LaunchPad. http://www.ti.com/ww/en/launchpad/launchpad.html.Google ScholarGoogle Scholar
  9. LowRISC. http://www.lowrisc.org.Google ScholarGoogle Scholar
  10. Matlab. http://www.mathworks.com/products/matlab/.Google ScholarGoogle Scholar
  11. Node.js-open-source, cross-platform runtime environment for developing server-side web applications. https://nodejs.org/.Google ScholarGoogle Scholar
  12. Perl. https://www.perl.org.Google ScholarGoogle Scholar
  13. Adobe's Photoshop Lightroom Developer Center. http://www.adobe.com/devnet/photoshoplightroom.html.Google ScholarGoogle Scholar
  14. Python. https://www.python.org.Google ScholarGoogle Scholar
  15. The R Project for Statistical Computing. http://www.r-project.org.Google ScholarGoogle Scholar
  16. Raspberry Pi. https://www.raspberrypi.org/.Google ScholarGoogle Scholar
  17. Rocket Core. http://riscv.org/download.html.Google ScholarGoogle Scholar
  18. Raspberry Pi. Usage documentation of Python. https://www.raspberrypi.org/documentation/usage/python/.Google ScholarGoogle Scholar
  19. Ruby. https://www.ruby-lang.org/en/.Google ScholarGoogle Scholar
  20. SAMA5D3 Series Datasheet. http://www.atmel.com/Images/Atmel-11121-32-bit-Cortex-A5-Microcontroller-SAMA5D3_Datasheet.pdf.Google ScholarGoogle Scholar
  21. SpiderMonkey 17. https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/17.Google ScholarGoogle Scholar
  22. World of Warcraft interface AddOn Kits. https://us.battle.net/support/en/article/download-the-world-of-warcraft-interface-addon-kit.Google ScholarGoogle Scholar
  23. Intel XDK. https://software.intel.com/en-us/intel-xdk.Google ScholarGoogle Scholar
  24. Arduino. an open-source electronics platform based on easy-to-use hardware and software. https://www.arduino.cc.Google ScholarGoogle Scholar
  25. Computer Language Benchmarks Game. http://benchmarksgame.alioth.debian.org/.Google ScholarGoogle Scholar
  26. Duktape. http://duktape.org.Google ScholarGoogle Scholar
  27. FTL: WebKit's LLVM based JIT. http://blog.llvm.org/2014/07/ftl-webkits-llvm-based-jit.html.Google ScholarGoogle Scholar
  28. The Programming Language Lua. http://lua.org.Google ScholarGoogle Scholar
  29. ARM mbed. https://www.mbed.com/en/.Google ScholarGoogle Scholar
  30. O. Anderson, E. Fortuna, L. Ceze, and S. Eggers. Checked Load: Architectural Support for JavaScript Type-checking on Mobile Processors. In Proceedings of the 17th IEEE International Symposium on High Performance Computer Architecture (HPCA), 2011. Google ScholarGoogle ScholarCross RefCross Ref
  31. P. W. Bosshart, C. R. Hewes, M. D. Ales, M. C. Chang, K. K. Chau, K. Fasham, C. C. Hoac, T. W. Houston, V. Kalyan, S. L. Lusky, S. S. Mahant-Shetti, D. J. Matzke, K. N. Ruparel, J. F. Sexton, C. H. Shaw, T. Shridhar, D. Stark, and A. L. Lee. A 553 k-transistor lisp processor chip. IEEE Journal of Solid-State Circuits (JSSC), 1987. Google ScholarGoogle ScholarCross RefCross Ref
  32. S. Chen, J. Xu, N. Nakka, Z. Kalbarczyk, and R. K. Iyer. Defeating memory corruption attacks via pointer taintedness detection. In Proceedings of the International Conference on Dependable Systems and Networks (DSN), 2005.Google ScholarGoogle Scholar
  33. C. J. Corley and J. A. Statz. LISP workstation brings AI power to a user's desk. In Computer Design, January, 1985.Google ScholarGoogle Scholar
  34. J. R. Crandall, S. F. Wu, and F. T. Chong. Minos: Architectural support for protecting control data. ACM Trans. Archit. Code Optim. (TACO), 2006.Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. M. Dalton, H. Kannan, and C. Kozyrakis. Raksha: A flexible information flow architecture for software security. In Proceedings of the 34th Annual International Symposium on Computer Architecture (ISCA), 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. D. Y. Deng and G. E. Suh. High-performance parallel accelerator for flexible and efficient run-time monitoring. In Proceedings of the International Conference on Dependable Systems and Networks (DSN), 2012. Google ScholarGoogle ScholarCross RefCross Ref
  37. J. Devietti, C. Blundell, M. M. K. Martin, and S. Zdancewic. Hardbound: Architectural Support for Spatial Safety of the C Programming Language. In Proceedings of the 13th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. U. Dhawan, C. Hritcu, R. Rubin, N. Vasilakis, S. Chiricescu, J. M. Smith, T. F. Knight, Jr., B. C. Pierce, and A. DeHon. Architectural Support for Software-Defined Metadata Processing. In Proceedings of the 20th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. G. Dot, A. Martínez, and A. González. Analysis and optimization of engines for dynamically typed languages. In Proceedings of the 27th International Symposium on Computer Architecture and High Performance Computing (SBAC-PAD), 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. B. Hackett and S.-y. Guo. Fast and Precise Hybrid Type Inference for JavaScript. In Proceedings of the 33rd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. M. E. Houdek, F. G. Soltis, and R. L. Hoffman. Ibm system/38 support for capability-based addressing. In Proceedings of the 8th Annual Symposium on Computer Architecture (ISCA), 1981.Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. M. N. Kedlaya, J. Roesch, B. Robatmili, M. Reshadi, and B. Hardekopf. Improved Type Specialization for Dynamic Scripting Languages. In Proceedings of the 9th Dynamic Languages Symposium (DLS), 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. C. Kim, S. Kim, H. G. Cho, D. Kim, J. Kim, Y. H. Oh, H. Jang, and J. W. Lee. Short-circuit dispatch: Accelerating virtual machine interpreters on embedded processors. In Proceedings of the 43rd Annual International Symposium on Computer Architecture (ISCA), 2016. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. A. Kwon, U. Dhawan, J. M. Smith, T. F. Knight, Jr., and A. DeHon. Low-fat pointers: Compact encoding and efficient gate-level implementation of fat pointers for spatial safety and capability-based security. In Proceedings of the 2013 ACM SIGSAC Conference on Computer and Communications Security (CCS), 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. F. McKeen, I. Alexandrovich, A. Berenzon, C. V. Rozas, H. Shafi, V. Shanbhogue, and U. R. Savagaonkar. Innovative instructions and software model for isolated execution. In Proceedings of the 2nd International Workshop on Hardware and Architectural Support for Security and Privacy (HASP), 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. D. A. Moon. Architecture of the symbolics 3600. In Proceedings of the 12nd Annual International Symposium on Computer Architecture (ISCA), 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. T. Oh, H. Kim, N. P. Johnson, J. W. Lee, and D. I. August. Practical Automatic Loop Specialization. In Proceedings of the 18th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. F. J. Pollack, G. W. Cox, D. W. Hammerstrom, K. C. Kahn, K. K. Lai, and J. R. Rattner. Supporting ada memory management in the iapx-432. In Proceedings of the 1st International Symposium on Architectural Support for Programming Languages and Operating Systems (ASPLOS), 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. P. Ratanaworabhan, B. Livshits, and B. G. Zorn. JSMeter: Comparing the behavior of JavaScript benchmarks with real web applications. In Proceedings of the 2010 USENIX Conference on Web Application Development (WebApps), 2010.Google ScholarGoogle Scholar
  50. P. Steenkiste and J. Hennessy. Tags and Type Checking in LISP: Hardware and Software Approaches. In Proceedings of the 2nd International Conference on Architectual Support for Programming Languages and Operating Systems (ASPLOS), 1987.Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. G. E. Suh, J. W. Lee, D. Zhang, and S. Devadas. Secure Program Execution via Dynamic Information Flow Tracking. In Proceedings of the 11th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS), 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. G. S. Taylor, P. N. Hilfinger, J. R. Larus, D. A. Patterson, and B. G. Zorn. Evaluation of the SPUR Lisp Architecture. In Proceedings of the 13rd Annual International Symposium on Computer Architecture (ISCA), 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. G. Venkataramani, I. Doudalis, Y. Solihin, and M. Prvulovic. Flexitaint: A programmable accelerator for dynamic taint propagation. In Proceedings of the 14th IEEE International Symposium on High Performance Computer Architecture (HPCA), 2008. Google ScholarGoogle ScholarCross RefCross Ref
  54. J. Woodruff, R. N. Watson, D. Chisnall, S. W. Moore, J. Anderson, B. Davis, B. Laurie, P. G. Neumann, R. Norton, and M. Roe. The cheri capability model: Revisiting risc in an age of risk. In Proceeding of the 41st Annual International Symposium on Computer Architecuture (ISCA), 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. A. Zakai. Emscripten: An LLVM-to-JavaScript Compiler. In Proceedings of the ACM International Conference on Object Oriented Programming Systems Languages and Applications (OOPSLA), 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Typed Architectures: Architectural Support for Lightweight Scripting

      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

      Full Access

      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!