-/*
- * decompose.c: Functions to decompose complex IR instructions into simpler ones.
+/**
+ * \file
+ * Functions to decompose complex IR instructions into simpler ones.
*
* Author:
* Zoltan Varga (vargaz@gmail.com)
#ifndef DISABLE_JIT
-/* FIXME: This conflicts with the definition in mini.c, so it cannot be moved to mini.h */
-MONO_API MonoInst* mono_emit_native_call (MonoCompile *cfg, gconstpointer func, MonoMethodSignature *sig, MonoInst **args);
-void mini_emit_stobj (MonoCompile *cfg, MonoInst *dest, MonoInst *src, MonoClass *klass, gboolean native);
-void mini_emit_initobj (MonoCompile *cfg, MonoInst *dest, const guchar *ip, MonoClass *klass);
-
/*
* Decompose complex long opcodes on 64 bit machines.
* This is also used on 32 bit machines when using LLVM, so it needs to handle I/U correctly.
break;
case OP_BOUNDS_CHECK:
MONO_EMIT_NULL_CHECK (cfg, ins->sreg1);
- if (COMPILE_LLVM (cfg))
- MONO_EMIT_DEFAULT_BOUNDS_CHECK (cfg, ins->sreg1, ins->inst_imm, ins->sreg2, ins->flags & MONO_INST_FAULT);
- else
+ if (COMPILE_LLVM (cfg)) {
+ int index2_reg = alloc_preg (cfg);
+ MONO_EMIT_NEW_UNALU (cfg, OP_SEXT_I4, index2_reg, ins->sreg2);
+ MONO_EMIT_DEFAULT_BOUNDS_CHECK (cfg, ins->sreg1, ins->inst_imm, index2_reg, ins->flags & MONO_INST_FAULT);
+ } else {
MONO_ARCH_EMIT_BOUNDS_CHECK (cfg, ins->sreg1, ins->inst_imm, ins->sreg2);
+ }
break;
case OP_NEWARR:
if (cfg->opt & MONO_OPT_SHARED) {