Jonathan S. Shapiro via llvm-dev
2015-Aug-07 23:43 UTC
[llvm-dev] Creating a virtual machine: stack, regs alloc & other problems
Alex: I'm not sure you're taking the right approach with this. You can either have portability or you can play games with the calling convention assumed by the back end, or you can modify the compiler to suit your desired calling convention, but you probably can't get all three. I'm the guy behind HDTrans (dynamic binrary translation for x86), and we used direct x86 instruction emission as well, and we cheated like crazy on calling conventions, stacks, you name it. So I understand where you are coming from. I've also done some bytecode VM work. You just aren't going to get a portable result that way, and as others have said already, using llvm-il isn't going to get you there. I think you are better off stepping back and looking at this as a new engineering problem rather than trying to translate your existing solution piece by piece. The bad news is that this infrastructure my not let you get quite as far down toward the bare metal. The good news is that it can be exploited to do more in the way of dynamic optimization than is typically feasible with directly hand-generated machine code. If you like, get in touch with me off-line. I don't want to go spouting off useless ideas here, because I don't understand what you are trying to do yet. But I'd be happy to talk with you to get a slightly better sense and see if I can offer some practical help. Jonathan shap (at) eros-osdogorg Dog should be dot, of course. :-) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150807/37359f19/attachment.html>
Jonathan S. Shapiro via llvm-dev
2015-Aug-07 23:47 UTC
[llvm-dev] Creating a virtual machine: stack, regs alloc & other problems
Philip: And just as an aside, I suspect I understand why the register spill issue is important. My guess would be that you have a need to keep your VM stack in a state that is bitwise compliant with some external specification at every point where a sequence point potentially exists? shap -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150807/8cf21724/attachment.html>
Philip Reames via llvm-dev
2015-Aug-08 01:11 UTC
[llvm-dev] Creating a virtual machine: stack, regs alloc & other problems
I'm not sure what the OP requirements are. That's what I was trying to clarify/understand. I certainly don't have that requirement for my VM, but I can't speak for the OP. Philip On 08/07/2015 04:47 PM, Jonathan S. Shapiro via llvm-dev wrote:> Philip: > > And just as an aside, I suspect I understand why the register spill > issue is important. My guess would be that you have a need to keep > your VM stack in a state that is bitwise compliant with some external > specification at every point where a sequence point potentially exists? > > shap > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org http://llvm.cs.uiuc.edu > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150807/68daaa96/attachment.html>