From: Jay Krell Date: Tue, 14 Jan 2020 11:32:08 +0000 (-0800) Subject: [cxx] Fixes for all lanes to build as C++ but w/o configure.ac change. (mono/mono... X-Git-Tag: submit/tizen/20210909.063632~10331^2~5^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=11b903f72ef8a35dc51bc7ce9bbb3eca34d553ae;p=platform%2Fupstream%2Fdotnet%2Fruntime.git [cxx] Fixes for all lanes to build as C++ but w/o configure.ac change. (mono/mono#17452) * [cxx] dlmalloc remove extern "C" and remove NO_MALLINFO. * [cxx] Move CallInst bitfields to the end to minimize padding for alignment and fix an unexplained LLVM problem. Commit migrated from https://github.com/mono/mono/commit/dc866c2aadb6f6aba04ca0b5eb5799c4e5b7a0fd --- diff --git a/src/mono/mono/mini/mini.h b/src/mono/mono/mini/mini.h index 134adb7..6d51b73 100644 --- a/src/mono/mono/mini/mini.h +++ b/src/mono/mono/mini/mini.h @@ -783,16 +783,34 @@ struct MonoCallInst { MonoInst *out_args; MonoInst *vret_var; gconstpointer fptr; + MonoJitICallId jit_icall_id; guint stack_usage; guint stack_align_amount; + regmask_t used_iregs; + regmask_t used_fregs; + GSList *out_ireg_args; + GSList *out_freg_args; + GSList *outarg_vts; + CallInfo *call_info; +#ifdef ENABLE_LLVM + LLVMCallInfo *cinfo; + int rgctx_arg_reg, imt_arg_reg; +#endif +#ifdef TARGET_ARM + /* See the comment in mini-arm.c!mono_arch_emit_call for RegTypeFP. */ + GSList *float_args; +#endif + // Bitfields are at the end due to an unexplained problem with C++ and LLVM. + // This is also their ideal place to minimize padding for alignment, + // unless there is a placement to increase locality. + guint is_virtual : 1; // FIXME tailcall field is written after read; prefer MONO_IS_TAILCALL_OPCODE. guint tailcall : 1; /* If this is TRUE, 'fptr' points to a MonoJumpInfo instead of an address. */ guint fptr_is_patch : 1; - MonoJitICallId jit_icall_id; /* - * If this is true, then the call returns a vtype in a register using the same + * If this is true, then the call returns a vtype in a register using the same * calling convention as OP_CALL. */ guint vret_in_reg : 1; @@ -804,20 +822,6 @@ struct MonoCallInst { guint32 rgctx_reg : 1; /* Whenever the call will need an unbox trampoline */ guint need_unbox_trampoline : 1; - regmask_t used_iregs; - regmask_t used_fregs; - GSList *out_ireg_args; - GSList *out_freg_args; - GSList *outarg_vts; - CallInfo *call_info; -#ifdef ENABLE_LLVM - LLVMCallInfo *cinfo; - int rgctx_arg_reg, imt_arg_reg; -#endif -#ifdef TARGET_ARM - /* See the comment in mini-arm.c!mono_arch_emit_call for RegTypeFP. */ - GSList *float_args; -#endif }; struct MonoCallArgParm { diff --git a/src/mono/mono/utils/dlmalloc.c b/src/mono/mono/utils/dlmalloc.c index 4201044..ed68e41 100644 --- a/src/mono/mono/utils/dlmalloc.c +++ b/src/mono/mono/utils/dlmalloc.c @@ -652,10 +652,6 @@ struct mallinfo { #endif /* HAVE_USR_INCLUDE_MALLOC_H */ #endif /* NO_MALLINFO */ -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - #if !ONLY_MSPACES /* ------------------- Declarations of public routines ------------------- */ @@ -1146,10 +1142,6 @@ int mspace_mallopt(int, int); #endif /* MSPACES */ -#ifdef __cplusplus -}; /* end of extern "C" */ -#endif /* __cplusplus */ - /* ======================================================================== To make a fully customizable malloc.h header file, cut everything diff --git a/src/mono/mono/utils/dlmalloc.h b/src/mono/mono/utils/dlmalloc.h index 5619215..327cc4c 100644 --- a/src/mono/mono/utils/dlmalloc.h +++ b/src/mono/mono/utils/dlmalloc.h @@ -28,26 +28,6 @@ #include /* for size_t */ #include -// Returning an undefined struct by value from extern "C" -// is sometimes an error. Mono does not use the code (dlmallinfo).. -// -// Other fixes: -// - define the struct -// - #if __cplusplus -// - #if HOST_WASM -// - #ifndef HAVE_USR_INCLUDE_MALLOC_H -// - Make it not extern "C". -// - Return the struct through an out parameter. -// - remove extern "C" entirely in dlmalloc. -// -// Mono does not use the function (dlmallinfo). -// -#define NO_MALLINFO 1 /* mono */ - -#ifdef __cplusplus -extern "C" { -#endif - #if !ONLY_MSPACES #ifndef USE_DL_PREFIX @@ -554,8 +534,4 @@ int mspace_mallopt(int, int); #endif /* MSPACES */ -#ifdef __cplusplus -}; /* end of extern "C" */ -#endif - #endif /* MALLOC_280_H */