/* The address of the return value is passed in %o0 */
add_general (&gr, &stack_size, &cinfo->ret, FALSE);
cinfo->ret.reg += sparc_i0;
+ /* FIXME: Pass this after this as on other platforms */
+ NOT_IMPLEMENTED;
}
#endif
return FALSE;
}
-/*
- * mono_arch_get_vcall_slot:
- *
- * Determine the vtable slot used by a virtual call.
- */
-gpointer
-mono_arch_get_vcall_slot (guint8 *code8, mgreg_t *regs, int *displacement)
-{
- guint32 *code = (guint32*)(gpointer)code8;
- guint32 ins = code [0];
- guint32 prev_ins = code [-1];
-
- mono_sparc_flushw ();
-
- *displacement = 0;
-
- if (!mono_sparc_is_virtual_call (code))
- return NULL;
-
- if ((sparc_inst_op (ins) == 0x2) && (sparc_inst_op3 (ins) == 0x38)) {
- if ((sparc_inst_op (prev_ins) == 0x3) && (sparc_inst_i (prev_ins) == 1) && (sparc_inst_op3 (prev_ins) == 0 || sparc_inst_op3 (prev_ins) == 0xb)) {
- /* ld [r1 + CONST ], r2; call r2 */
- guint32 base = sparc_inst_rs1 (prev_ins);
- gint32 disp = (((gint32)(sparc_inst_imm13 (prev_ins))) << 19) >> 19;
- gpointer base_val;
-
- g_assert (sparc_inst_rd (prev_ins) == sparc_inst_rs1 (ins));
-
- g_assert ((base >= sparc_o0) && (base <= sparc_i7));
-
- base_val = regs [base];
-
- *displacement = disp;
-
- return (gpointer)base_val;
- }
- else if ((sparc_inst_op (prev_ins) == 0x3) && (sparc_inst_i (prev_ins) == 0) && (sparc_inst_op3 (prev_ins) == 0)) {
- /* set r1, ICONST; ld [r1 + r2], r2; call r2 */
- /* Decode a sparc_set32 */
- guint32 base = sparc_inst_rs1 (prev_ins);
- guint32 disp;
- gpointer base_val;
- guint32 s1 = code [-3];
- guint32 s2 = code [-2];
-
-#ifdef SPARCV9
- NOT_IMPLEMENTED;
-#endif
-
- /* sparc_sethi */
- g_assert (sparc_inst_op (s1) == 0);
- g_assert (sparc_inst_op2 (s1) == 4);
-
- /* sparc_or_imm */
- g_assert (sparc_inst_op (s2) == 2);
- g_assert (sparc_inst_op3 (s2) == 2);
- g_assert (sparc_inst_i (s2) == 1);
- g_assert (sparc_inst_rs1 (s2) == sparc_inst_rd (s2));
- g_assert (sparc_inst_rd (s1) == sparc_inst_rs1 (s2));
-
- disp = ((s1 & 0x3fffff) << 10) | sparc_inst_imm13 (s2);
-
- g_assert ((base >= sparc_o0) && (base <= sparc_i7));
-
- base_val = regs [base];
-
- *displacement = disp;
-
- return (gpointer)base_val;
- } else
- g_assert_not_reached ();
- }
- else
- g_assert_not_reached ();
-
- return NULL;
-}
-
#define CMP_SIZE 3
#define BR_SMALL_SIZE 2
#define BR_LARGE_SIZE 2
item->jmp_code = (guint8*)code;
sparc_branch (code, 0, sparc_bne, 0);
sparc_nop (code);
- sparc_set (code, ((guint32)(&(vtable->vtable [item->value.vtable_slot]))), sparc_g5);
- sparc_ld (code, sparc_g5, 0, sparc_g5);
+ if (item->has_target_code) {
+ sparc_set (code, item->value.target_code, sparc_f5);
+ } else {
+ sparc_set (code, ((guint32)(&(vtable->vtable [item->value.vtable_slot]))), sparc_g5);
+ sparc_ld (code, sparc_g5, 0, sparc_g5);
+ }
sparc_jmpl (code, sparc_g5, sparc_g0, sparc_g0);
sparc_nop (code);
}
gpointer
-mono_arch_get_this_arg_from_call (MonoGenericSharingContext *gsctx, MonoMethodSignature *sig, mgreg_t *regs, guint8 *code)
+mono_arch_get_this_arg_from_call (mgreg_t *regs, guint8 *code)
{
mono_sparc_flushw ();
}
void
-mono_arch_patch_code (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *ji, gboolean run_cctors)
+mono_arch_patch_code (MonoMethod *method, MonoDomain *domain, guint8 *code, MonoJumpInfo *ji, MonoCodeManager *dyn_code_mp, gboolean run_cctors)
{
MonoJumpInfo *patch_info;
while (cfg->code_len + max_epilog_size > (cfg->code_size - 16)) {
cfg->code_size *= 2;
cfg->native_code = g_realloc (cfg->native_code, cfg->code_size);
- mono_jit_stats.code_reallocs++;
+ cfg->stat_code_reallocs++;
}
code = (guint32*)(cfg->native_code + cfg->code_len);
while (cfg->code_len + code_size > (cfg->code_size - 16)) {
cfg->code_size *= 2;
cfg->native_code = g_realloc (cfg->native_code, cfg->code_size);
- mono_jit_stats.code_reallocs++;
+ cfg->stat_code_reallocs++;
}
code = (guint32*)(cfg->native_code + cfg->code_len);
return NULL;
}
-gpointer
+mgreg_t
mono_arch_context_get_int_reg (MonoContext *ctx, int reg)
{
/* FIXME: implement */