Trace-based Just-in-Time Type Specialization for Dynamic Languages

被引:55
作者
Gal, Andreas [2 ]
Eich, Brendan
Shaver, Mike
Anderson, David
Mandelin, David
Haghighat, Mohammad R. [1 ]
Kaplan, Blake
Hoare, Graydon
Zbarsky, Boris
Orendorff, Jason
Ruderman, Jesse
Smith, Edwin
Reitmaier, Rick
Bebenita, Michael [2 ]
Chang, Mason [2 ]
Franz, Michael [2 ]
机构
[1] Intel Corp, Santa Clara, CA 95051 USA
[2] Univ Calif Irvine, Irvine, CA USA
关键词
Design; Experimentation; Measurement; Performance; !text type='Java']Java[!/text]Script; just-in-time compilation; trace trees;
D O I
10.1145/1543135.1542528
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Dynamic languages such as JavaScript are more difficult to compile than statically typed ones. Since no concrete type information is available, traditional compilers need to emit generic code that can handle all possible type combinations at runtime. We present an alternative compilation technique for dynamically-typed languages that identifies frequently executed loop traces at run-time and then generates machine code on the fly that is specialized for the actual dynamic types occurring on each path through the loop. Our method provides cheap inter-procedural type specialization, and an elegant and efficient way of incrementally compiling lazily discovered alternative paths through nested loops. We have implemented a dynamic compiler for JavaScript based on our technique and we have measured speedups of 10x and more for certain benchmark programs.
引用
收藏
页码:465 / 478
页数:14
相关论文
共 19 条
[1]  
[Anonymous], 2000, PLDI '00
[2]  
[Anonymous], SPECJVM98
[3]   Context threading: A flexible and efficient dispatch technique for virtual machine interpreters [J].
Berndl, M ;
Vitale, B ;
Zaleski, M ;
Brown, AD .
CGO 2005: INTERNATIONAL SYMPOSIUM ON CODE GENERATION AND OPTIMIZATION, 2005, :15-26
[4]  
Chambers C., 1989, PLDI '89, P146
[5]  
Gal A., 2006, THESIS U CALIFORNIA
[6]  
Gal Andreas, 2006, P 2 INT C VIRT EX EN, P144, DOI [10.1145/1134760.1134780, DOI 10.1145/1134760.1134780]
[7]  
Garrett CharlesD., 1994, Measurement and application of dynamic receiver class distributions
[8]  
HA J, 2009, TR0906 U TEX AUST
[9]  
McCloskey, COMMUNICATION
[10]  
*MOZ, FIR WEB BROWS THUND