Translating G-Machine source to LLVM IR

二次信任 提交于 2019-12-05 04:29:57

Don't do linked list stacks, that's crazy. Used fixed memory blocks. You can use a pointer stack and a non-pointer stack, and by pointer I mean something pointing into the heap. Then it's pretty easy to do garbage collection since all the GC roots are on the pointer stack.

Keep a few things in LLVM registers: heap pointer, heap limit pointer, the two stack pointers.

If you are lucky the LLVM optimizer will turn the inefficient stack operations into efficient register operations.

there is simple tutorial

http://llvm.org/releases/2.0/docs/Stacker.html

HTH

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!