[Mono-devel-list] [PATCH] Opcode decomposition
Ben Maurer
05mauben at hawken.edu
Mon Apr 5 13:50:02 EDT 2004
* inssel.brg
OP_{STRLEN,GETTYPE,LDLEN,ARRAY_RANK} -- these can no longer be
reached.
* mini.c
NEW_LOAD_MEMBASE -- a macro to emit the `->' operator in C.
decompose_foreach -- decompose the ops that were removed from the burg
file here.
>>> Ben Maurer <bmaurer at users.sourceforge.net> 04/01/04 17:09 PM >>>
Hello,
While doing some hacking on the jit, I noticed that some complex opcodes
such as strlen and cee_ldlen are being decomposed in the inssel.brg
file. This had a side effect that more advanced optimizations in the
burg file would be missed. For example, for the code:
if (str.Length > 10)
we would emit:
mov eax, [string + length_offset]
cmp eax,10
when we could emit
cmp [string + length_offset], 10
The attached patch moves the decomposition from the burg file into
decompose_foreach, which allows the burg file to see the true meaning of
these opcodes, and thus apply better optimizations.
For legalities sake:
This patch is submitted under the MIT/X11 License.
-- Ben
More information about the Mono-devel-list
mailing list