[llvm-commits] gc-5-shadowstack.patch [5 of 6]

Gordon Henriksen gordonhenriksen at mac.com
Mon Sep 3 23:37:52 PDT 2007

• gc-5-shadowstack.patch (+59, -406 lines)
With this patch, the LowerGC transformation is adapted to become the  

$ llvm-as < simple_ocaml.ll | llc -gc=shadow-stack

         .align  4,0x90
         .globl  _fun
         subl    $44, %esp
         movl    L_llvm_gc_root_chain$non_lazy_ptr, %eax
         movl    (%eax), %ecx
         movl    %ecx, 16(%esp)
         movl    $2, 20(%esp)
         movl    $0, 28(%esp)
         movl    $0, 24(%esp)
         movl    $0, 12(%esp)
         leal    12(%esp), %ecx
         movl    %ecx, 24(%esp)
         movl    $0, 36(%esp)
         movl    $0, 32(%esp)
         leal    16(%esp), %ecx
         movl    %ecx, (%eax)
         movl    $0, 8(%esp)
         leal    8(%esp), %eax
         movl    %eax, 32(%esp)
         movl    48(%esp), %eax
         movl    %eax, 12(%esp)
LBB1_1: # bb.loop
         movl    12(%esp), %eax
         movl    4(%eax), %eax
         testl   %eax, %eax
         je      LBB1_1  # bb.loop
LBB1_2: # bb.end
         movl    $8, (%esp)
         call    L_malloc$stub
         movl    12(%esp), %ecx
         movl    %ecx, 4(%ecx)
         movl    L_llvm_gc_root_chain$non_lazy_ptr, %ecx
         movl    16(%esp), %edx
         movl    %edx, (%ecx)
         addl    $44, %esp
         .comm   _llvm_gc_root_chain,4           # llvm_gc_root_chain
.section __IMPORT,__jump_table,symbol_stubs,self_modifying_code 
         .indirect_symbol _malloc
         hlt ; hlt ; hlt ; hlt ; hlt

.section __IMPORT,__pointers,non_lazy_symbol_pointers
         .indirect_symbol _llvm_gc_root_chain
         .long   0

— Gordon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20070904/a4c08798/attachment.html>

More information about the llvm-commits mailing list