Current shadow stack overheads in HLVM

Many people, including the developers of Haskell (see here ) and OCaml (see here ) compilers, have been quick to dismiss the shadow stack algorithm for performance reasons. Despite these concerns, we chose to use a shadow stack in HLVM for several reasons: GC performance is low on the list of priorities for HLVM. Shadow stacks are easy to implement entirely from within HLVM whereas conventional strategies entail injecting stack maps into stack frames on the normal stack and that requires low-level hacking with LLVM's experimental GC API in C++. Shadow stacks are easy to debug because they are just another data structure in the heap. HLVM provides typed nulls and the ability to read array lengths or type constructor tags without an indirection. This requires the use of an unconventional struct-based reference type that is incompatible with LLVM's current GC API that can only handle individual pointers. Consequently, it is interesting to use HLVM to measure just how expensive it...