case OP_X86_LEA: {
LLVMValueRef v1, v2;
+ rhs = LLVMBuildSExt (builder, convert (ctx, rhs, LLVMInt32Type ()), LLVMInt64Type (), "");
+
v1 = LLVMBuildMul (builder, convert (ctx, rhs, IntPtrType ()), LLVMConstInt (IntPtrType (), (1 << ins->backend.shift_amount), FALSE), "");
v2 = LLVMBuildAdd (builder, convert (ctx, lhs, IntPtrType ()), v1, "");
values [ins->dreg] = LLVMBuildAdd (builder, v2, LLVMConstInt (IntPtrType (), ins->inst_imm, FALSE), dname);
guint32 ei_len, i, nested_len;
gpointer *type_info;
gint32 *table;
+ guint8 *unw_info;
/*
* Decode the one element EH table emitted by the MonoException class
fde = (guint8*)eh_frame + fde_offset;
cie = (guint8*)table;
- mono_unwind_decode_llvm_mono_fde (fde, fde_len, cie, cfg->native_code, &info);
+ /* Compute lengths */
+ mono_unwind_decode_llvm_mono_fde (fde, fde_len, cie, cfg->native_code, &info, NULL, NULL, NULL);
+
+ ei = (MonoJitExceptionInfo *)g_malloc0 (info.ex_info_len * sizeof (MonoJitExceptionInfo));
+ type_info = (gpointer *)g_malloc0 (info.ex_info_len * sizeof (gpointer));
+ unw_info = (guint8*)g_malloc0 (info.unw_info_len);
+
+ mono_unwind_decode_llvm_mono_fde (fde, fde_len, cie, cfg->native_code, &info, ei, type_info, unw_info);
- cfg->encoded_unwind_ops = info.unw_info;
+ cfg->encoded_unwind_ops = unw_info;
cfg->encoded_unwind_ops_len = info.unw_info_len;
if (cfg->verbose_level > 1)
mono_print_unwind_info (cfg->encoded_unwind_ops, cfg->encoded_unwind_ops_len);
cfg->llvm_this_offset = info.this_offset;
}
- ei = info.ex_info;
ei_len = info.ex_info_len;
- type_info = info.type_info;
// Nested clauses are currently disabled
nested_len = 0;
The mono JIT uses pointer sized iregs/double fregs, while LLVM uses precisely
typed registers, so we have to keep track of the precise LLVM type of each vreg.
This is made easier because the IR is already in SSA form.
- An additional problem is that our IR is not consistent with types, i.e. i32/ia64
+ An additional problem is that our IR is not consistent with types, i.e. i32/i64
types are frequently used incorrectly.
*/