* Zoltan Varga (vargaz@gmail.com)
*
* (C) 2002 Ximian, Inc.
+ * Copyright 2011 Xamarin, Inc (http://www.xamarin.com)
*/
#include "mini.h"
MonoCallInst *call2;
MonoInst *iargs [1];
MonoInst *conv;
+ GSList *l;
/* Convert the call into a call returning an int */
MONO_INST_NEW_CALL (cfg, call2, OP_CALL);
call2->inst.dreg = mono_alloc_ireg (cfg);
MONO_ADD_INS (cfg->cbb, (MonoInst*)call2);
+ /* Remap OUTARG_VT instructions referencing this call */
+ for (l = call->outarg_vts; l; l = l->next)
+ ((MonoInst*)(l->data))->inst_p0 = call2;
+
/* FIXME: Optimize this */
/* Emit an r4->r8 conversion */
/* Convert fcompare+fbcc to icall+icompare+beq */
+ if (!ins->next) {
+ /* The branch might be optimized away */
+ NULLIFY_INS (ins);
+ break;
+ }
+
info = mono_find_jit_opcode_emulation (ins->next->opcode);
- g_assert (info);
+ if (!info) {
+ /* The branch might be optimized away */
+ NULLIFY_INS (ins);
+ break;
+ }
/* Create dummy MonoInst's for the arguments */
MONO_INST_NEW (cfg, iargs [0], OP_ARG);