[Mono-devel-list] [mini] problem with CEE_NEWARR and OP_OUTARG

Laurent Morichetti l_m at pacbell.net
Thu Nov 6 08:28:41 EST 2003


Hi,
                                                      
                         
I'm having a problem with the decomposition of
CEE_NEWARR inside OP_OUTARG instructions. The
emulation call will clobber the outgoing registers
when inserted in between outarg opcodes.
                                                      
                         
Is it possible to emit the emulation call right when
we parse CEE_NEWARR? Another solution would be to
spill CEE_NEWARR at the IR parsing and not spill the
emulation call (since it's already been done).
                                                      
                         
converting (in B2: stack: 0) IL_0000: ldc.i4.s  10
converting (in B2: stack: 1) IL_0002: newarr   
0x01000001
converting (in B2: stack: 1) IL_0007: ldc.i4.s  10
converting (in B2: stack: 2) IL_0009: newarr   
0x01000001
converting (in B2: stack: 2) IL_000e: newobj   
0x0a000002
converting (in B2: stack: 1) IL_0013: stloc.0
converting (in B2: stack: 0) IL_0014: ret
                                                      
                         
before decompose:
                                                      
                         
CODE BLOCK 3 (nesting 0):
 (stind.ref local[0] iconst[0])
CODE BLOCK 2 (nesting 0):
 (outarg pconst[0x60000000001ae2f8])
 (stind.ref local[1] pcall)
 (outarg (newarr[Object] iconst[10]))
 (outarg (newarr[Object] iconst[10]))
 (voidcallvirt[.ctor])
 (stind.ref local[0] (ldind.ref local[1]))
 br[B1]
                                                      
                         
after decompose:
                                                      
                         
DUMP BLOCK 3:
 (stind.ref regoffset[0xfffffff0(r33)] iconst[0])
 (outarg pconst[0x60000000001ae2f8])
 (stind.ref regoffset[0xfffffff8(r33)] pcall)
 (outarg iconst[10])
 (outarg pconst[0x60000000001ae458])
 (stind.ref regptr[r37] pcall)
 (outarg (ldind.ref regptr[r37]))    <------ *** This
is the problem ***
 (outarg iconst[10])                          r37 is
killed by the call
 (outarg pconst[0x60000000001ae458])
 (stind.ref regptr[r37] pcall)
 (outarg (ldind.ref regptr[r37]))
 (voidcallvirt[.ctor])
 (stind.ref regoffset[0xfffffff0(r33)] (ldind.ref
regoffset[0xfffffff8(r33)]))
                                                      
                         
-Laurent




More information about the Mono-devel-list mailing list