Fault-Safe Code Motion for Type-Safe Languages

被引:0
|
作者
Murphy, Brian R. [1 ]
Menon, Vijay [1 ]
Schneider, Florian T. [1 ]
Shpeisman, Tatiana [1 ]
Adl-Tabatabai, Ali-Reza [1 ]
机构
[1] Google, Beijing, Peoples R China
关键词
code motion; speculative code motion; safety dependences; intermediate representations;
D O I
暂无
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
Compilers for Java and other type-safe languages have historically worked to overcome overheads and constraints imposed by runtime safety checks and precise exception semantics. We instead exploit these safety properties to pet-form code motion optimizations that are even more aggressive than those possible in unsafe languages such as C++. We present a novel framework for speculative motion of dangerous (potentially faulting) instructions in safe, object-oriented languages such as Java and C#. Unlike earlier work, our approach requires no hardware or operating system support. We leverage the properties already provided by a safe language to define fault safety, a more precise notion of safety that guarantees that a dangerous operation (e.g., a memory load) will not fault at a given program point. We illustrate how typical code motion optimizations are easily adapted to exploit our safety framework. First, we modify the standard SSAPRE partial redundancy elimination (PRE) algorithm [18, 20] to use fault safety, rather than the traditional down safety property. Our modified algorithm better exploits profile information by inserting of dangerous instructions on new paths when it is profitable and provably safe. Second, we extend an instruction trace scheduler to use fault safety to safely schedule load instructions across branches to better tolerate memory latency and to more compactly target instruction slots. We implemented these optimizations in StarJIT [1], a dynamic compiler, and show performance benefits of Lip to 10% on a set of standard Java benchmarks.
引用
收藏
页码:144 / 154
页数:11
相关论文
共 50 条
  • [1] On Sapphire and type-safe languages
    Wright, A
    [J]. COMMUNICATIONS OF THE ACM, 2003, 46 (04) : 120 - 120
  • [2] Type-Safe Code Transformations in Haskell
    Guillemette, Louis-Julien
    Monnier, Stefan
    [J]. ELECTRONIC NOTES IN THEORETICAL COMPUTER SCIENCE, 2007, 174 (07) : 23 - 39
  • [3] WHAT IS TYPE-SAFE CODE REUSE
    PALSBERG, J
    SCHWARTZBACH, MI
    [J]. LECTURE NOTES IN COMPUTER SCIENCE, 1991, 512 : 325 - 341
  • [4] CCured: Type-safe retrofitting of legacy code
    Necula, GC
    McPeak, S
    Weimer, W
    [J]. ACM SIGPLAN NOTICES, 2002, 37 (01) : 128 - 139
  • [5] CCured: Type-Safe Retrofitting of Legacy Code
    Necula, George C.
    McPeak, Scott
    Weimer, Westley
    [J]. ACM SIGPLAN NOTICES, 2012, 47 (04) : 74 - 85
  • [6] Expressive and Strongly Type-Safe Code Generation
    Winant, Thomas
    Cockx, Jesper
    Devriese, Dominique
    [J]. PROCEEDINGS OF THE 19TH INTERNATIONAL SYMPOSIUM ON PRINCIPLES AND PRACTICE OF DECLARATIVE PROGRAMMING (PPDP 2017), 2017, : 199 - 210
  • [7] Type-safe Runtime Code Generation: Accelerate to LLVM
    McDonell, Trevor L.
    Chakravarty, Manuel M. T.
    Grover, Vinod
    Newton, Ryan R.
    [J]. ACM SIGPLAN NOTICES, 2015, 50 (12) : 201 - 212
  • [8] Generating type-safe script languages from functional APIs
    Horvath, Gabor
    Kozar, Gabor
    Szugyi, Zalan
    [J]. INFORMATICS 2013: PROCEEDINGS OF THE TWELFTH INTERNATIONAL CONFERENCE ON INFORMATICS, 2013, : 122 - 126
  • [9] Type-safe disks
    Sivathanu, Gopalan
    [J]. USENIX ASSOCIATION 7TH USENIX SYMPOSIUM ON OPERATING SYSTEMS DESIGN AND IMPLEMENTATION, 2006, : 15 - 28
  • [10] Type-safe cast
    Weirich, S
    [J]. JOURNAL OF FUNCTIONAL PROGRAMMING, 2004, 14 : 681 - 695