1 Apr 21:19
Unusual techniques in HLVM and
Jon Harrop <jon <at> ffconsultancy.com>
2012-04-01 19:19:13 GMT
2012-04-01 19:19:13 GMT
I just wrote a blog post detailing some of the techniques I adopted in HLVM that appear to be unusual: http://flyingfrogblog.blogspot.co.uk/2012/03/gc-safe-points-mutator-suspensi on-and.html In particular, HLVM uses many techniques that are much simpler than existing alternatives but appear to be just as efficient. In the process of writing that I thought of an interesting way to avoid unnecessary pushes to the shadow stack. A previous benchmark indicated that shadow stack manipulations can account for up to 70% of the total running time of a program: http://flyingfrogblog.blogspot.co.uk/2009/03/current-shadow-stack-overheads- in-hlvm.html So this theoretically has the potential to dramatically improve HLVM's performance under certain circumstances (although I don't want to exaggerate the potential advantages because HLVM's current GC is poorly suited for allocation-intensive programs like that benchmark). I wanted to avoid both caller and callee pushing the same value onto the shadow stack. Obviously, there is no harm in just having the caller push. I thought of an interesting solution: add the ability to mark a reference type as "prepushed" and instantiate functions for any combination of prepushed reference arguments as required by callers. This is a conservative approximation so references default to non-prepushed. Between the push and pop of a reference inside the body of a function it becomes prepushed and,(Continue reading)
RSS Feed