Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mono/mini/exceptions-s390x.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ mono_arch_get_throw_exception_generic (int size, MonoTrampInfo **info,
s390_lgr (code, s390_r3, s390_r2);
if (corlib) {
S390_SET (code, s390_r1, (guint8 *)mono_exception_from_token);
S390_SET (code, s390_r2, (guint8 *)mono_defaults.exception_class->image);
S390_SET (code, s390_r2, (guint8 *)m_class_get_image (mono_defaults.exception_class));
s390_basr (code, s390_r14, s390_r1);
}

Expand Down
2 changes: 1 addition & 1 deletion mono/mini/exceptions-sparc.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot)

sparc_set (code, MONO_TOKEN_TYPE_DEF, sparc_o7);
sparc_add (code, FALSE, sparc_i0, sparc_o7, sparc_o1);
sparc_set (code, mono_defaults.exception_class->image, sparc_o0);
sparc_set (code, m_class_get_image (mono_defaults.exception_class), sparc_o0);
sparc_set (code, mono_exception_from_token, sparc_o7);
sparc_jmpl (code, sparc_o7, sparc_g0, sparc_callsite);
sparc_nop (code);
Expand Down
2 changes: 1 addition & 1 deletion mono/mini/exceptions-x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ mono_x86_throw_corlib_exception (mgreg_t *regs, guint32 ex_token_index,
guint32 ex_token = MONO_TOKEN_TYPE_DEF | ex_token_index;
MonoException *ex;

ex = mono_exception_from_token (mono_defaults.exception_class->image, ex_token);
ex = mono_exception_from_token (m_class_get_image (mono_defaults.exception_class), ex_token);

eip -= pc_offset;

Expand Down
30 changes: 15 additions & 15 deletions mono/mini/mini-arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1226,9 +1226,9 @@ is_hfa (MonoType *t, int *out_nfields, int *out_esize)
if (!is_hfa (ftype, &nested_nfields, &nested_esize))
return FALSE;
if (nested_esize == 4)
ftype = &mono_defaults.single_class->byval_arg;
ftype = m_class_get_byval_arg (mono_defaults.single_class);
else
ftype = &mono_defaults.double_class->byval_arg;
ftype = m_class_get_byval_arg (mono_defaults.double_class);
if (prev_ftype && prev_ftype->type != ftype->type)
return FALSE;
prev_ftype = ftype;
Expand Down Expand Up @@ -2142,7 +2142,7 @@ mono_arch_create_vars (MonoCompile *cfg)

if (IS_HARD_FLOAT) {
for (i = 0; i < 2; i++) {
MonoInst *inst = mono_compile_create_var (cfg, &mono_defaults.double_class->byval_arg, OP_LOCAL);
MonoInst *inst = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.double_class), OP_LOCAL);
inst->flags |= MONO_INST_VOLATILE;

cfg->arch.vfp_scratch_slots [i] = (gpointer) inst;
Expand All @@ -2153,7 +2153,7 @@ mono_arch_create_vars (MonoCompile *cfg)
cfg->ret_var_is_local = TRUE;

if (cinfo->ret.storage == RegTypeStructByAddr) {
cfg->vret_addr = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_ARG);
cfg->vret_addr = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.int_class), OP_ARG);
if (G_UNLIKELY (cfg->verbose_level > 1)) {
g_print ("vret_addr = ");
mono_print_ins (cfg->vret_addr);
Expand All @@ -2162,25 +2162,25 @@ mono_arch_create_vars (MonoCompile *cfg)

if (cfg->gen_sdb_seq_points) {
if (cfg->compile_aot) {
MonoInst *ins = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
MonoInst *ins = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.int_class), OP_LOCAL);
ins->flags |= MONO_INST_VOLATILE;
cfg->arch.seq_point_info_var = ins;

if (!cfg->soft_breakpoints) {
/* Allocate a separate variable for this to save 1 load per seq point */
ins = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
ins = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.int_class), OP_LOCAL);
ins->flags |= MONO_INST_VOLATILE;
cfg->arch.ss_trigger_page_var = ins;
}
}
if (cfg->soft_breakpoints) {
MonoInst *ins;

ins = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
ins = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.int_class), OP_LOCAL);
ins->flags |= MONO_INST_VOLATILE;
cfg->arch.seq_point_ss_method_var = ins;

ins = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
ins = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.int_class), OP_LOCAL);
ins->flags |= MONO_INST_VOLATILE;
cfg->arch.seq_point_bp_method_var = ins;
}
Expand Down Expand Up @@ -2343,7 +2343,7 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call)
* the location pointed to by it after call in emit_move_return_value ().
*/
if (!cfg->arch.vret_addr_loc) {
cfg->arch.vret_addr_loc = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
cfg->arch.vret_addr_loc = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.int_class), OP_LOCAL);
/* Prevent it from being register allocated or optimized away */
((MonoInst*)cfg->arch.vret_addr_loc)->flags |= MONO_INST_VOLATILE;
}
Expand Down Expand Up @@ -2371,7 +2371,7 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call)
if (i >= sig->hasthis)
t = sig->params [i - sig->hasthis];
else
t = &mono_defaults.int_class->byval_arg;
t = m_class_get_byval_arg (mono_defaults.int_class);
t = mini_get_underlying_type (t);

if ((sig->call_convention == MONO_CALL_VARARG) && (i == sig->sentinelpos)) {
Expand Down Expand Up @@ -2535,7 +2535,7 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call)
* This is not very nice, and we should really try to fix the allocator.
*/

MonoInst *float_arg = mono_compile_create_var (cfg, &mono_defaults.single_class->byval_arg, OP_LOCAL);
MonoInst *float_arg = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.single_class), OP_LOCAL);

/* Make sure the instruction isn't seen as pointless and removed.
*/
Expand Down Expand Up @@ -2626,7 +2626,7 @@ mono_arch_emit_outarg_vt (MonoCompile *cfg, MonoInst *ins, MonoInst *src)
FloatArgData *fad;

/* See RegTypeFP in mono_arch_emit_call () */
MonoInst *float_arg = mono_compile_create_var (cfg, &mono_defaults.single_class->byval_arg, OP_LOCAL);
MonoInst *float_arg = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.single_class), OP_LOCAL);
float_arg->flags |= MONO_INST_VOLATILE;
MONO_EMIT_NEW_UNALU (cfg, OP_FMOVE, float_arg->dreg, load->dreg);

Expand Down Expand Up @@ -6863,7 +6863,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg)
patch_info->ip.i = code - cfg->native_code;
ARM_BL (code, 0);
cfg->thunk_area += THUNK_SIZE;
*(guint32*)(gpointer)code = exc_class->type_token - MONO_TOKEN_TYPE_DEF;
*(guint32*)(gpointer)code = m_class_get_type_token (exc_class) - MONO_TOKEN_TYPE_DEF;
code += 4;
break;
}
Expand Down Expand Up @@ -7026,7 +7026,7 @@ mono_arch_build_imt_trampoline (MonoVTable *vtable, MonoDomain *domain, MonoIMTC
unwind_ops = mono_arch_get_cie_program ();

#ifdef DEBUG_IMT
g_print ("Building IMT trampoline for class %s %s entries %d code size %d code at %p end %p vtable %p fail_tramp %p\n", vtable->klass->name_space, vtable->klass->name, count, size, start, ((guint8*)start) + size, vtable, fail_tramp);
g_print ("Building IMT trampoline for class %s %s entries %d code size %d code at %p end %p vtable %p fail_tramp %p\n", m_class_get_name_space (vtable->klass), m_class_get_name (vtable->klass), count, size, start, ((guint8*)start) + size, vtable, fail_tramp);
for (i = 0; i < count; ++i) {
MonoIMTCheckItem *item = imt_entries [i];
g_print ("method %d (%p) %s vtable slot %p is_equals %d chunk size %d\n", i, item->key, ((MonoMethod*)item->key)->name, &vtable->vtable [item->value.vtable_slot], item->is_equals, item->chunk_size);
Expand Down Expand Up @@ -7182,7 +7182,7 @@ mono_arch_build_imt_trampoline (MonoVTable *vtable, MonoDomain *domain, MonoIMTC

#ifdef DEBUG_IMT
{
char *buff = g_strdup_printf ("thunk_for_class_%s_%s_entries_%d", vtable->klass->name_space, vtable->klass->name, count);
char *buff = g_strdup_printf ("thunk_for_class_%s_%s_entries_%d", m_class_get_name_space (vtable->klass), m_class_get_name (vtable->klass), count);
mono_disassemble_code (NULL, (guint8*)start, size, buff);
g_free (buff);
}
Expand Down
24 changes: 12 additions & 12 deletions mono/mini/mini-arm64.c
Original file line number Diff line number Diff line change
Expand Up @@ -1130,9 +1130,9 @@ is_hfa (MonoType *t, int *out_nfields, int *out_esize, int *field_offsets)
if (!is_hfa (ftype, &nested_nfields, &nested_esize, nested_field_offsets))
return FALSE;
if (nested_esize == 4)
ftype = &mono_defaults.single_class->byval_arg;
ftype = m_class_get_byval_arg (mono_defaults.single_class);
else
ftype = &mono_defaults.double_class->byval_arg;
ftype = m_class_get_byval_arg (mono_defaults.double_class);
if (prev_ftype && prev_ftype->type != ftype->type)
return FALSE;
prev_ftype = ftype;
Expand Down Expand Up @@ -1337,7 +1337,7 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig)
cinfo->gr = PARAM_REGS;
cinfo->fr = FP_PARAM_REGS;
/* Emit the signature cookie just before the implicit arguments */
add_param (cinfo, &cinfo->sig_cookie, &mono_defaults.int_class->byval_arg);
add_param (cinfo, &cinfo->sig_cookie, m_class_get_byval_arg (mono_defaults.int_class));
}

add_param (cinfo, ainfo, sig->params [pindex]);
Expand All @@ -1362,7 +1362,7 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig)
cinfo->gr = PARAM_REGS;
cinfo->fr = FP_PARAM_REGS;
/* Emit the signature cookie just before the implicit arguments */
add_param (cinfo, &cinfo->sig_cookie, &mono_defaults.int_class->byval_arg);
add_param (cinfo, &cinfo->sig_cookie, m_class_get_byval_arg (mono_defaults.int_class));
}

cinfo->stack_usage = ALIGN_TO (cinfo->stack_usage, MONO_ARCH_FRAME_ALIGNMENT);
Expand Down Expand Up @@ -1991,24 +1991,24 @@ mono_arch_create_vars (MonoCompile *cfg)
cinfo = cfg->arch.cinfo;

if (cinfo->ret.storage == ArgVtypeByRef) {
cfg->vret_addr = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
cfg->vret_addr = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.int_class), OP_LOCAL);
cfg->vret_addr->flags |= MONO_INST_VOLATILE;
}

if (cfg->gen_sdb_seq_points) {
MonoInst *ins;

if (cfg->compile_aot) {
ins = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
ins = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.int_class), OP_LOCAL);
ins->flags |= MONO_INST_VOLATILE;
cfg->arch.seq_point_info_var = ins;
}

ins = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
ins = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.int_class), OP_LOCAL);
ins->flags |= MONO_INST_VOLATILE;
cfg->arch.ss_tramp_var = ins;

ins = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
ins = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.int_class), OP_LOCAL);
ins->flags |= MONO_INST_VOLATILE;
cfg->arch.bp_tramp_var = ins;
}
Expand Down Expand Up @@ -2457,7 +2457,7 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call)
* the location pointed to by it after call in emit_move_return_value ().
*/
if (!cfg->arch.vret_addr_loc) {
cfg->arch.vret_addr_loc = mono_compile_create_var (cfg, &mono_defaults.int_class->byval_arg, OP_LOCAL);
cfg->arch.vret_addr_loc = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.int_class), OP_LOCAL);
/* Prevent it from being register allocated or optimized away */
((MonoInst*)cfg->arch.vret_addr_loc)->flags |= MONO_INST_VOLATILE;
}
Expand Down Expand Up @@ -2597,7 +2597,7 @@ mono_arch_emit_outarg_vt (MonoCompile *cfg, MonoInst *ins, MonoInst *src)
load = src;
} else {
/* Make a copy of the argument */
vtaddr = mono_compile_create_var (cfg, &ins->klass->byval_arg, OP_LOCAL);
vtaddr = mono_compile_create_var (cfg, m_class_get_byval_arg (ins->klass), OP_LOCAL);

MONO_INST_NEW (cfg, load, OP_LDADDR);
load->inst_p0 = vtaddr;
Expand Down Expand Up @@ -5075,7 +5075,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg)

/* r0 = type token */
exc_class = mono_class_load_from_name (mono_defaults.corlib, "System", ji->data.name);
code = emit_imm (code, ARMREG_R0, exc_class->type_token - MONO_TOKEN_TYPE_DEF);
code = emit_imm (code, ARMREG_R0, m_class_get_type_token (exc_class) - MONO_TOKEN_TYPE_DEF);
/* r1 = throw ip */
arm_movx (code, ARMREG_R1, ARMREG_IP1);
/* Branch to the corlib exception throwing trampoline */
Expand Down Expand Up @@ -5112,7 +5112,7 @@ mono_arch_build_imt_trampoline (MonoVTable *vtable, MonoDomain *domain, MonoIMTC
guint8 *buf, *code;

#if DEBUG_IMT
printf ("building IMT trampoline for class %s %s entries %d code size %d code at %p end %p vtable %p\n", vtable->klass->name_space, vtable->klass->name, count, size, start, ((guint8*)start) + size, vtable);
printf ("building IMT trampoline for class %s %s entries %d code size %d code at %p end %p vtable %p\n", m_class_get_name_space (vtable->klass), m_class_get_name (vtable->klass), count, size, start, ((guint8*)start) + size, vtable);
for (i = 0; i < count; ++i) {
MonoIMTCheckItem *item = imt_entries [i];
printf ("method %d (%p) %s vtable slot %p is_equals %d chunk size %d\n", i, item->key, item->key->name, &vtable->vtable [item->value.vtable_slot], item->is_equals, item->chunk_size);
Expand Down
Loading