REUSE OF JIT COMPILED CODE BASED ON BINARY CODE PATCHING IN JAVASCRIPT ENGINE
Keywords:
JavaScript engine, JIT compiler, binary code patchingAbstract
JavaScript is a core language of web applications. As the most frequently used web language, it is used in more than 90% of web pages around the world. As a result, the performance of JavaScript engines becomes an important issue. In order to increase the execution speed of web applications, many JavaScript engines are embedded in JIT (Just-in-time) Compiler. However, JIT compilers are required to execute and compile applications at the same time. Therefore, this technique has been hardly applicable to embedded systems, in which system resources are limited. In this paper, we present a reusing technique of JIT compiled code in the JavaScript engine to reduce compilation overhead. In order to reuse JIT compiled code, problems for runtime dependency in JIT compiled binary code must be resolved. We used a direct binary code patching method on Squirrel FisheXtreme (SFX) JavaScript engine of WebKit for the experiment. Through the experiment, we showed that the total compilation time of the modified SFX JavaScript engine was slightly increased up to 9.4% by saving codes, but the time was reduced up to 49%, averagely 44%, depending on web services when the code was reused.
Downloads
References
Wikipedia, AJAX (programming), from http://en.wikipedia.org/wiki/Ajax_(programming), 2010.
JavaScript Usage Statistics, from http://trends.builtwith.com/docinfo/Javascript, 2010.
Boerop, R. The Future of JavaScript Engines: Replace Them with JavaScript Compiler, from
http://shorestreet.com/node/43, 2009.
JavaScript: TraceMonkey, from https://wiki.mozilla.org/JavaScript:TraceMonkey.
Aycock, J. A brief history of just-in-time, ACM Computing Surveys (CSUR), 35(2), pp.97-113,
Hölzle, U. Adaptive Optimization for SELF: Reconciling High Performance with Exploratory
Programming, Computer Science, Stanford University, Doctor of Philosophy: 181, 1994.
Joisha, P., Midkiff, S., Serrano, M. and Gupta, M. A framework for efficient reuse of binary code
in Java, The 15th International Conference on Supercomputing, Sorrento, Italy, ACM, 2001.
Hong, S., Kim, J., Shin, J., Moon, S., Oh, H., Lee, J. and Choi, J. Java Client Ahead-of-Time
Compiler for Embedded Systems, Proceedings of the 2007 ACM SIGPLAN/SIGBED Conference
on Languages, Compilers, and Tools for Embedded Systems (LCTES), pp.63-72, San Diego,
California, USA, 2007.
Google, V8 JavaScript Engine, from http://code.google.com/intl/ko/apis/v8/intro.html, 2010.
Stachowiak, M. Introducing SquirrelFish Extreme, from http://webkit.org/blog/214/introducingsquirrelfish-
extreme/, 2008.
Blizzard, C. Improving JavaScript performance with JägerMonkey, from
http://hacks.mozilla.org/2010/03/improving-javascript-performance-with-jagermonkey/, 2010.
Keller R. and Hölzle, U. Binary Component Adaptation, ECOOP'98 - Object Oriented
Programming, Berlin/Heidelberg, Germany, Springer, 1997.
Conte, M., Trick, A., Gyllenhaal, J. and Hwu, W. A Study of Code Reuse and Sharing
Characteristics of Java Applications, WWC'98, Dallas, Texas, IEEE, 1998.
Serrano, M., Bordawekar, R., Midkiff, S. and Gupta, M. Quicksilver: a quasi-static compiler for
Java, ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and
Applications, Minneapolis, Minnesota, USA, ACM, 2000.
Wikipedia, IBM J9, from http://en.wikipedia.org/wiki/IBM_J9, 2010.
Gal, A., Probst, C. and Franz, M. Hotpath VM: An Efficient JIT Compiler for Resourceconstrained
Devices, VEE 06, Ottawa, Canada, ACM, 2006.
Mozilla, Tracing JIT, from https://developer.mozilla.org/En/SpiderMonkey/Internals/Tracing_JIT,
Chang, M. etc, Tracing for web 3.0: trace compilation for the next generation web applications,
VEE 09, Washington, DC, USA, ACM, 2009.
Almaer, D. V8 Internals by Kevin Millikin, from http://ajaxian.com/archives/v8-internals,2008.
Ager, M. Google I/O 2009: V8 Internals: Building a High Performance JavaScript Engine, from
http://www.bestechvideos.com/-2009/06/04/google-i-o-2009-v8-internals-building-a-highperformance-
javascript-engine, 2009.
Nikkel Electronics, Why Is the New Google V8 Engine So Fast? from
http://techon.nikkeibp.co.jp/article/HONSHI/20090106/163617/, 2009.
Jeun, S. and Choi, J. Repository Design for Reusing Binary JavaScript Code, (in preparation).