|
From: | Paolo Bonzini |
Subject: | Re: [Lightning] On the benefits of inlining |
Date: | Mon, 05 Sep 2005 09:51:48 +0200 |
User-agent: | Mozilla Thunderbird 0.9 (Macintosh/20041103) |
That's why a register would be preferable. Patching is about as expensive as writing one instruction, or only slightly less. That is, jit_movi + jit_patch_movi is about as expensive as writing 2 movs.However, patching the `movi' instruction (in order to pass the input/output parameter) is done every time before the dynamically compiled code is used. I was assuming that patching was pretty lightweight, at least on RISC machines.
Yes... I have to think about it, I must admit I don't like the idea of providing asm statements within lightning.h. Even though the way you'd be using it is indeed cute.Instead of the goto you can put an asm ("jmp *%0" : : "r" (&&abc) : "eax", "ecx", "edx"); so you can avoid the push/pop and GCC does not think that no instruction will execute after the jump (which it does, if you have a goto). It is unportable, however. :-(Right, hence the need for a mapping of register names. And a mapping for some instructions (like `jmp') would come in handy as well. ;-)
... or it makes sense only for moderately large pieces of code. I see your point now.,This would *not* make sense for very small pieces of code like this one, or did I miss something?Well, so long as the inlined code has to save registers and so on, this doesn't make much sense anyway.
Paolo
[Prev in Thread] | Current Thread | [Next in Thread] |