[Mono-devel-list] First CIL Regex performance result

Michal Moskal malekith at pld-linux.org
Sun Feb 29 16:02:26 EST 2004

On Sun, Feb 29, 2004 at 12:41:28PM -0500, Eric Durand Tremblay wrote:
> 	  There is an obvious optimization there, but am puzzled by why do 
> 	  you
> 	  have the beq there in the first place, there is no compare there, 
> 	  and
> 	  various nops before, which makes me wonder about the intent.
> *Here is the end of EmitCharacter it is dependent from the context ( what 
> called it).  For the nop, I really don't understand why they are there.  
> Reflection.Emit put them automatically.  The beq compare the char loaded at 
> IL_00a2 and the char loaded at IL_00b5(ldc.i4.s 0x61).  We will try to make 
> it more simple.*

,,nop'' can appear because you use wrong overload of Emit. For example
when you do something like

  gen.Emit (Ldc_I4_S, 13)

you will call Emit (OpCode, int) overload, so it will generate opcode
for ldc.i4.s (0x1f), and 32 bit integer constant 13, which is 0x0d 0x00
0x00 0x00 (little endian). And nop is 0x00. So you will get:

  ldc.i4.s 13

I haven't checked your code, but this was my problem once, at it might
be the case with you.

: Michal Moskal :: http://www.kernel.pl/~malekith :: GCS !tv h e>+++ b++
: When in doubt, use brute force. -- Ken Thompson :: UL++++$ C++ E--- a?

More information about the Mono-devel-list mailing list