diff --git a/src/mono/mono/metadata/sysmath.c b/src/mono/mono/metadata/sysmath.c index 47a6c370c6b1d6..ec25a20fc0025f 100644 --- a/src/mono/mono/metadata/sysmath.c +++ b/src/mono/mono/metadata/sysmath.c @@ -1,6 +1,6 @@ /** * \file - * these are based on bob smith's csharp routines + * these are based on bob smith's csharp routines * * Author: * Mono Project (http://www.mono-project.com) @@ -55,49 +55,49 @@ ves_icall_System_Math_ModF (gdouble x, gdouble *d) return modf (x, d); } -gdouble +gdouble ves_icall_System_Math_Sin (gdouble x) { return sin (x); } -gdouble +gdouble ves_icall_System_Math_Cos (gdouble x) { return cos (x); } -gdouble +gdouble ves_icall_System_Math_Cbrt (gdouble x) { return cbrt (x); } -gdouble +gdouble ves_icall_System_Math_Tan (gdouble x) { return tan (x); } -gdouble +gdouble ves_icall_System_Math_Sinh (gdouble x) { return sinh (x); } -gdouble +gdouble ves_icall_System_Math_Cosh (gdouble x) { return cosh (x); } -gdouble +gdouble ves_icall_System_Math_Tanh (gdouble x) { return tanh (x); } -gdouble +gdouble ves_icall_System_Math_Acos (gdouble x) { return acos (x); @@ -109,61 +109,61 @@ ves_icall_System_Math_Acosh (gdouble x) return acosh (x); } -gdouble +gdouble ves_icall_System_Math_Asin (gdouble x) { return asin (x); } -gdouble +gdouble ves_icall_System_Math_Asinh (gdouble x) { return asinh (x); } -gdouble +gdouble ves_icall_System_Math_Atan (gdouble x) { return atan (x); } -gdouble +gdouble ves_icall_System_Math_Atan2 (gdouble y, gdouble x) { return atan2 (y, x); } -gdouble +gdouble ves_icall_System_Math_Atanh (gdouble x) { return atanh (x); } -gdouble +gdouble ves_icall_System_Math_Exp (gdouble x) { return exp (x); } -gdouble +gdouble ves_icall_System_Math_Log (gdouble x) { return log (x); } -gdouble +gdouble ves_icall_System_Math_Log10 (gdouble x) { return log10 (x); } -gdouble +gdouble ves_icall_System_Math_Pow (gdouble x, gdouble y) { return pow (x, y); } -gdouble +gdouble ves_icall_System_Math_Sqrt (gdouble x) { return sqrt (x); diff --git a/src/mono/mono/mini/interp/interp.c b/src/mono/mono/mini/interp/interp.c index 4e978aabbe1979..099c70695c1386 100644 --- a/src/mono/mono/mini/interp/interp.c +++ b/src/mono/mono/mini/interp/interp.c @@ -1930,7 +1930,7 @@ dump_args (InterpFrame *inv) GString *str = g_string_new (""); int i; MonoMethodSignature *signature = mono_method_signature_internal (inv->imethod->method); - + if (signature->param_count == 0 && !signature->hasthis) return g_string_free (str, FALSE); @@ -3232,7 +3232,7 @@ static long opcode_counts[MINT_LASTOP]; #define COUNT_OP(op) opcode_counts[op]++ #else -#define COUNT_OP(op) +#define COUNT_OP(op) #endif #if DEBUG_INTERP @@ -3478,7 +3478,7 @@ interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClauseArgs #endif main_loop: /* - * using while (ip < end) may result in a 15% performance drop, + * using while (ip < end) may result in a 15% performance drop, * but it may be useful for debug */ while (1) { @@ -3559,7 +3559,7 @@ interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClauseArgs MINT_IN_CASE(MINT_LDC_I4_8) LDC(8); MINT_IN_BREAK; - MINT_IN_CASE(MINT_LDC_I4_S) + MINT_IN_CASE(MINT_LDC_I4_S) LOCAL_VAR (ip [1], gint32) = (short)ip [2]; ip += 3; MINT_IN_BREAK; @@ -3584,7 +3584,7 @@ interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClauseArgs ip += 4; MINT_IN_BREAK; } - MINT_IN_CASE(MINT_LDC_R8) + MINT_IN_CASE(MINT_LDC_R8) LOCAL_VAR (ip [1], gint64) = READ64 (ip + 2); /* note union usage */ ip += 6; MINT_IN_BREAK; @@ -3720,7 +3720,7 @@ interp_exec_method (InterpFrame *frame, ThreadContext *context, FrameClauseArgs call_args_offset = ip [3]; if (need_unbox) { - MonoObject *this_arg = LOCAL_VAR (call_args_offset, MonoObject*); + MonoObject *this_arg = LOCAL_VAR (call_args_offset, MonoObject*); LOCAL_VAR (call_args_offset, gpointer) = mono_object_unbox_internal (this_arg); } ip += 4; @@ -6450,8 +6450,8 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; ip += short_offset ? (gint16)*(ip + 1) : (gint32)READ32 (ip + 1); MINT_IN_BREAK; } - MINT_IN_CASE(MINT_ICALL_V_V) - MINT_IN_CASE(MINT_ICALL_P_V) + MINT_IN_CASE(MINT_ICALL_V_V) + MINT_IN_CASE(MINT_ICALL_P_V) MINT_IN_CASE(MINT_ICALL_PP_V) MINT_IN_CASE(MINT_ICALL_PPP_V) MINT_IN_CASE(MINT_ICALL_PPPP_V) @@ -6476,7 +6476,7 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; CHECK_RESUME_STATE (context); ip += 4; MINT_IN_BREAK; - MINT_IN_CASE(MINT_MONO_LDPTR) + MINT_IN_CASE(MINT_MONO_LDPTR) LOCAL_VAR (ip [1], gpointer) = frame->imethod->data_items [ip [2]]; ip += 3; MINT_IN_BREAK; @@ -6912,12 +6912,12 @@ MINT_IN_CASE(MINT_BRTRUE_I8_SP) ZEROP_SP(gint64, !=); MINT_IN_BREAK; MINT_IN_BREAK; } MINT_IN_CASE(MINT_MONO_RETHROW) { - /* + /* * need to clarify what this should actually do: * * Takes an exception from the stack and rethrows it. * This is useful for wrappers that don't want to have to - * use CEE_THROW and lose the exception stacktrace. + * use CEE_THROW and lose the exception stacktrace. */ MonoException *exc = LOCAL_VAR (ip [1], MonoException*); diff --git a/src/mono/mono/mini/interp/transform.c b/src/mono/mono/mini/interp/transform.c index 0fb4bb0f78e2b2..a5d57007d885fb 100644 --- a/src/mono/mono/mini/interp/transform.c +++ b/src/mono/mono/mini/interp/transform.c @@ -778,7 +778,7 @@ init_bb_stack_state (TransformData *td, InterpBasicBlock *bb) } } -static void +static void handle_branch (TransformData *td, int long_op, int offset) { int target = td->ip + offset - td->il_code; @@ -806,7 +806,7 @@ handle_branch (TransformData *td, int long_op, int offset) td->last_ins->info.target_bb = target_bb; } -static void +static void one_arg_branch(TransformData *td, int mint_op, int offset, int inst_size) { int type = td->sp [-1].type == STACK_TYPE_O || td->sp [-1].type == STACK_TYPE_MP ? STACK_TYPE_I : td->sp [-1].type; @@ -835,7 +835,7 @@ interp_add_conv (TransformData *td, StackInfo *sp, InterpInst *prev_ins, int typ interp_ins_set_dreg (new_inst, sp->local); } -static void +static void two_arg_branch(TransformData *td, int mint_op, int offset, int inst_size) { int type1 = td->sp [-1].type == STACK_TYPE_O || td->sp [-1].type == STACK_TYPE_MP ? STACK_TYPE_I : td->sp [-1].type; @@ -854,7 +854,7 @@ two_arg_branch(TransformData *td, int mint_op, int offset, int inst_size) } else if (type1 == STACK_TYPE_R8 && type2 == STACK_TYPE_R4) { interp_add_conv (td, td->sp - 2, td->last_ins, STACK_TYPE_R8, MINT_CONV_R8_R4); } else if (type1 != type2) { - g_warning("%s.%s: branch type mismatch %d %d", + g_warning("%s.%s: branch type mismatch %d %d", m_class_get_name (td->method->klass), td->method->name, td->sp [-1].type, td->sp [-2].type); } @@ -910,7 +910,7 @@ binary_arith_op(TransformData *td, int mint_op) if (type2 == STACK_TYPE_MP) type2 = STACK_TYPE_I; if (type1 != type2) { - g_warning("%s.%s: %04x arith type mismatch %s %d %d", + g_warning("%s.%s: %04x arith type mismatch %s %d %d", m_class_get_name (td->method->klass), td->method->name, td->ip - td->il_code, mono_interp_opname (mint_op), type1, type2); } @@ -929,7 +929,7 @@ shift_op(TransformData *td, int mint_op) int op = mint_op + td->sp [-2].type - STACK_TYPE_I4; CHECK_STACK(td, 2); if (td->sp [-1].type != STACK_TYPE_I4) { - g_warning("%s.%s: shift type mismatch %d", + g_warning("%s.%s: shift type mismatch %d", m_class_get_name (td->method->klass), td->method->name, td->sp [-2].type); } @@ -940,7 +940,7 @@ shift_op(TransformData *td, int mint_op) interp_ins_set_dreg (td->last_ins, td->sp [-1].local); } -static int +static int can_store (int st_value, int vt_value) { if (st_value == STACK_TYPE_O || st_value == STACK_TYPE_MP) @@ -967,7 +967,7 @@ get_arg_type_exact (TransformData *td, int n, int *mt) return type; } -static void +static void load_arg(TransformData *td, int n) { gint32 size = 0; @@ -1006,12 +1006,12 @@ load_arg(TransformData *td, int n) } interp_add_ins (td, get_mov_for_type (mt, TRUE)); interp_ins_set_sreg (td->last_ins, n); - interp_ins_set_dreg (td->last_ins, td->sp [-1].local); + interp_ins_set_dreg (td->last_ins, td->sp [-1].local); if (mt == MINT_TYPE_VT) td->last_ins->data [0] = size; } -static void +static void store_arg(TransformData *td, int n) { gint32 size = 0; @@ -1060,7 +1060,7 @@ load_local (TransformData *td, int local) td->last_ins->data [0] = size; } -static void +static void store_local (TransformData *td, int local) { int mt = td->locals [local].mt; @@ -1070,7 +1070,7 @@ store_local (TransformData *td, int local) interp_add_conv (td, td->sp - 1, NULL, STACK_TYPE_I8, MINT_CONV_I8_I4); #endif if (!can_store(td->sp [-1].type, stack_type [mt])) { - g_warning("%s.%s: Store local stack type mismatch %d %d", + g_warning("%s.%s: Store local stack type mismatch %d %d", m_class_get_name (td->method->klass), td->method->name, stack_type [mt], td->sp [-1].type); } @@ -2828,7 +2828,7 @@ interp_inline_method (TransformData *td, MonoMethod *target_method, MonoMethodHe gboolean ret; unsigned int prev_max_stack_height, prev_locals_size; int prev_n_data_items; - int i; + int i; int prev_sp_offset; int prev_aggressive_inlining; MonoGenericContext *generic_context = NULL; @@ -3291,7 +3291,7 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target CHECK_STACK (td, csignature->param_count + csignature->hasthis); if (tailcall && !td->gen_sdb_seq_points && !calli && op == -1 && - (target_method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) == 0 && + (target_method->flags & METHOD_ATTRIBUTE_PINVOKE_IMPL) == 0 && (target_method->iflags & METHOD_IMPL_ATTRIBUTE_INTERNAL_CALL) == 0 && !(target_method->iflags & METHOD_IMPL_ATTRIBUTE_NOINLINING)) { (void)mono_class_vtable_checked (target_method->klass, error); @@ -3330,7 +3330,7 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target int in_offset = td->ip - td->il_code; if (interp_ip_in_cbb (td, in_offset + 5)) - ++td->ip; /* gobble the CEE_RET if it isn't branched to */ + ++td->ip; /* gobble the CEE_RET if it isn't branched to */ td->ip += 5; return TRUE; } @@ -3436,7 +3436,7 @@ interp_transform_call (TransformData *td, MonoMethod *method, MonoMethod *target else g_error ("Unsupported opcode"); } - + if (op == MINT_LDLEN) { #ifdef MONO_BIG_ARRAYS SET_SIMPLE_TYPE (td->sp - 1, STACK_TYPE_I8); @@ -4656,7 +4656,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, } switch (*td->ip) { - case CEE_NOP: + case CEE_NOP: /* lose it */ emitted_funccall_seq_point = FALSE; ++td->ip; @@ -4826,7 +4826,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, interp_ins_set_dreg (td->last_ins, td->sp [-1].local); ++td->ip; break; - case CEE_LDC_I4_S: + case CEE_LDC_I4_S: interp_add_ins (td, MINT_LDC_I4_S); td->last_ins->data [0] = ((gint8 *) td->ip) [1]; push_simple_type (td, STACK_TYPE_I4); @@ -4931,7 +4931,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, last_seq_point->flags |= INTERP_INST_FLAG_SEQ_POINT_NESTED_CALL; } else - emitted_funccall_seq_point = TRUE; + emitted_funccall_seq_point = TRUE; } last_seq_point = interp_add_ins (td, MINT_SDB_SEQ_POINT); // This seq point is actually associated with the instruction following the call @@ -5395,7 +5395,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, } ++td->ip; break; - case CEE_CONV_I: + case CEE_CONV_I: CHECK_STACK (td, 1); switch (td->sp [-1].type) { case STACK_TYPE_R8: @@ -5869,7 +5869,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, case CEE_UNBOX: CHECK_STACK (td, 1); token = read32 (td->ip + 1); - + if (method->wrapper_type != MONO_WRAPPER_NONE) klass = (MonoClass *)mono_method_get_wrapper_data (method, token); else { @@ -6946,7 +6946,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, interp_add_ins (td, MINT_LD_DELEGATE_METHOD_PTR); interp_ins_set_sreg (td->last_ins, td->sp [0].local); push_simple_type (td, STACK_TYPE_I); - interp_ins_set_dreg (td->last_ins, td->sp [-1].local); + interp_ins_set_dreg (td->last_ins, td->sp [-1].local); break; case CEE_MONO_CALLI_EXTRA_ARG: { int saved_local = td->sp [-1].local; @@ -7079,7 +7079,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, td->sp--; interp_ins_set_sreg (td->last_ins, td->sp [0].local); klass = (MonoClass *)mono_method_get_wrapper_data (method, token); - + /*stackval_from_data (signature->ret, frame->retval, sp->data.vt, signature->pinvoke);*/ if (td->sp > td->stack) @@ -7182,7 +7182,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, * to take into account the number of prefix bytes (usually the * throw point is just (ip - n_prefix_bytes). */ - case CEE_PREFIX1: + case CEE_PREFIX1: ++td->ip; switch (*td->ip) { case CEE_ARGLIST: @@ -7331,7 +7331,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, td->ip += 5; break; } - + int index = get_data_item_index (td, mono_interp_get_imethod (m, error)); goto_if_nok (error, exit); if (*td->ip == CEE_LDVIRTFTN) { @@ -7424,7 +7424,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, #if SIZEOF_VOID_P == 8 if (td->sp [-1].type == STACK_TYPE_I8) interp_add_conv (td, td->sp - 1, NULL, STACK_TYPE_I4, MINT_MOV_8); -#endif +#endif interp_add_ins (td, MINT_LOCALLOC); if (td->sp != td->stack + 1) g_warning("CEE_LOCALLOC: stack not empty"); @@ -7540,7 +7540,7 @@ generate_code (TransformData *td, MonoMethod *method, MonoMethodHeader *header, THROW_EX (mono_exception_from_name (mono_defaults.corlib, "System", "InvalidProgramException"), ip - 5); #endif size = mono_type_size (m_class_get_byval_arg (szclass), &align); - } + } interp_add_ins (td, MINT_LDC_I4); WRITE32_INS (td->last_ins, 0, &size); push_simple_type (td, STACK_TYPE_I4); @@ -9131,7 +9131,7 @@ static void initialize_global_var_cb (TransformData *td, int var, gpointer data) { initialize_global_var (td, var, (int)(gsize)data); -} +} static void initialize_global_vars (TransformData *td) @@ -9550,7 +9550,7 @@ interp_fix_localloc_ret (TransformData *td) g_assert (td->has_localloc); for (InterpBasicBlock *bb = td->entry_bb; bb != NULL; bb = bb->next_bb) { InterpInst *ins = bb->first_ins; - while (ins) { + while (ins) { if (ins->opcode >= MINT_RET && ins->opcode <= MINT_RET_VT) ins->opcode += MINT_RET_LOCALLOC - MINT_RET; ins = ins->next; @@ -9804,7 +9804,7 @@ tiered_patcher (MiniTieredPatchPointContext *ctx, gpointer patchsite) #endif -void +void mono_interp_transform_init (void) { mono_os_mutex_init_recursive(&calc_section);