Brief summary of my Master’s thesis

I got my Master’s degree from Virtual Machine & Optimization Laboratory(advisor: Soo-mook Moon) in Seoul National University.

My research involved speeding up JavaScript engine. My thesis is written in Korea, so I am briefly summarizing my work in English here.

Thesis : Recycling Optimized Machine Codes Generated by JavaScript Engine

In a virtual machine of dynamic languages, machine codes generated by optimizing just-in-time(JIT) compiler are recyclable, and they can enhance the execution speed of a program, if recycled judiciously. Machine codes are recyclable if they can be reused in the subsequent executions of the same program. They need to be cached in the first run, and pointers they contain must be adjusted in the later runs.

Traditional recycling techniques were limited to non-optimizing JIT compilers, whose generated codes only contain easy-to-patch pointers. To handle pointers in optimized machine codes, I classified the pointers into 3 groups: (1) recognizable from the original source program; (2) recognizable only by tracing the optimization processes; (3) unrecognizable. The unrecognizable ones are created by dynamic profiles in the virtual machines. First group is handled by the usual table keeping method. Table containing the pairs of pointer location and pointer identity is created during compilation. Second group is also treated using the same table, but additional identity transmitting is necessary during the optimization phases. Third group is simply removed from creation. The compiler is modified to remove such pointers.

We implemented this idea to one of commercial JavaScript engines called JavaScriptCore, which is powering the WebKit framework. Experiment with Sunspider benchmark showed at most 29% improvement in speed and on average 11%.

Leave a Reply