diff --git a/src/mono/mono/arch/amd64/amd64-codegen.h b/src/mono/mono/arch/amd64/amd64-codegen.h index f0ae81aa23d0f1..2b1cd7eb2d3c35 100644 --- a/src/mono/mono/arch/amd64/amd64-codegen.h +++ b/src/mono/mono/arch/amd64/amd64-codegen.h @@ -8,7 +8,7 @@ * Dietmar Maurer (dietmar@ximian.com) * Patrik Torstensson * Zalman Stern - * + * * Copyright (C) 2000 Intel Corporation. All rights reserved. * Copyright (C) 2001, 2002 Ximian, Inc. * Licensed under the MIT license. See LICENSE file in the project root for full license information. @@ -652,7 +652,7 @@ typedef union { #define amd64_call_membase_size(inst,basereg,disp,size) do { amd64_emit_rex ((inst),0,0,0,(basereg)); *(inst)++ = (unsigned char)0xff; amd64_membase_emit ((inst),2, (basereg),(disp)); } while (0) #define amd64_jump_membase_size(inst,basereg,disp,size) do { amd64_emit_rex ((inst),0,0,0,(basereg)); *(inst)++ = (unsigned char)0xff; amd64_membase_emit ((inst), 4, (basereg), (disp)); } while (0) - + #define amd64_jump_code_size(inst,target,size) do { \ if (amd64_is_imm32 ((gint64)(target) - (gint64)(inst))) { \ x86_jump_code((inst),(target)); \ @@ -777,7 +777,7 @@ typedef union { } while (0) /* specific SSE opcode defines */ - + #define amd64_sse_xorpd_reg_reg(inst,dreg,reg) emit_sse_reg_reg ((inst),(dreg),(reg), 0x66, 0x0f, 0x57) #define amd64_sse_xorpd_reg_membase(inst,dreg,basereg,disp) emit_sse_reg_membase ((inst),(dreg),(basereg), (disp), 0x66, 0x0f, 0x57) @@ -1203,7 +1203,7 @@ typedef union { //#define amd64_alu_reg_imm_size(inst,opc,reg,imm,size) do { amd64_codegen_pre(inst); amd64_emit_rex ((inst),(size),0,0,(reg)); x86_alu_reg_imm((inst),(opc),((reg)&0x7),(imm)); amd64_codegen_post(inst); } while (0) #define amd64_alu_mem_imm_size(inst,opc,mem,imm,size) do { amd64_codegen_pre(inst); amd64_emit_rex ((inst),(size),0,0,0); x86_alu_mem_imm((inst),(opc),(mem),(imm)); amd64_codegen_post(inst); } while (0) #define amd64_alu_membase_imm_size(inst,opc,basereg,disp,imm,size) do { amd64_codegen_pre(inst); amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_alu_membase_imm((inst),(opc),((basereg)&0x7),(disp),(imm)); amd64_codegen_post(inst); } while (0) -#define amd64_alu_membase8_imm_size(inst,opc,basereg,disp,imm,size) do { amd64_codegen_pre(inst); amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_alu_membase8_imm((inst),(opc),((basereg)&0x7),(disp),(imm)); amd64_codegen_post(inst); } while (0) +#define amd64_alu_membase8_imm_size(inst,opc,basereg,disp,imm,size) do { amd64_codegen_pre(inst); amd64_emit_rex ((inst),(size),0,0,(basereg)); x86_alu_membase8_imm((inst),(opc),((basereg)&0x7),(disp),(imm)); amd64_codegen_post(inst); } while (0) #define amd64_alu_mem_reg_size(inst,opc,mem,reg,size) do { amd64_codegen_pre(inst); amd64_emit_rex ((inst),(size),0,0,(reg)); x86_alu_mem_reg((inst),(opc),(mem),((reg)&0x7)); amd64_codegen_post(inst); } while (0) #define amd64_alu_membase_reg_size(inst,opc,basereg,disp,reg,size) do { amd64_codegen_pre(inst); amd64_emit_rex ((inst),(size),(reg),0,(basereg)); x86_alu_membase_reg((inst),(opc),((basereg)&0x7),(disp),((reg)&0x7)); amd64_codegen_post(inst); } while (0) //#define amd64_alu_reg_reg_size(inst,opc,dreg,reg,size) do { amd64_codegen_pre(inst); amd64_emit_rex ((inst),(size),(dreg),0,(reg)); x86_alu_reg_reg((inst),(opc),((dreg)&0x7),((reg)&0x7)); amd64_codegen_post(inst); } while (0) @@ -1475,7 +1475,7 @@ typedef union { #define amd64_fucomi(inst,index) amd64_fucomi_size(inst,index,8) #define amd64_fucomip(inst,index) amd64_fucomip_size(inst,index,8) #define amd64_fld(inst,mem,is_double) amd64_fld_size(inst,mem,is_double,8) -#define amd64_fld_membase(inst,basereg,disp,is_double) amd64_fld_membase_size(inst,basereg,disp,is_double,8) +#define amd64_fld_membase(inst,basereg,disp,is_double) amd64_fld_membase_size(inst,basereg,disp,is_double,8) #define amd64_fld80_mem(inst,mem) amd64_fld80_mem_size(inst,mem,8) #define amd64_fld80_membase(inst,basereg,disp) amd64_fld80_membase_size(inst,basereg,disp,8) #define amd64_fild(inst,mem,is_long) amd64_fild_size(inst,mem,is_long,8) diff --git a/src/mono/mono/arch/arm/arm-codegen.h b/src/mono/mono/arch/arm/arm-codegen.h index eb63f596fc3d0a..3f0e9a17b3bb90 100644 --- a/src/mono/mono/arch/arm/arm-codegen.h +++ b/src/mono/mono/arch/arm/arm-codegen.h @@ -27,7 +27,7 @@ typedef unsigned int armword_t; #if defined(_MSC_VER) && !defined(ARM_NOIASM) # define ARM_IASM(_expr) __emit (_expr) #else -# define ARM_IASM(_expr) +# define ARM_IASM(_expr) #endif /* even_scale = rot << 1 */ diff --git a/src/mono/mono/arch/arm/arm-wmmx.h b/src/mono/mono/arch/arm/arm-wmmx.h index 6f2fc785dca9a4..b9dc023ce5ab63 100644 --- a/src/mono/mono/arch/arm/arm-wmmx.h +++ b/src/mono/mono/arch/arm/arm-wmmx.h @@ -21,7 +21,7 @@ #if defined(ARM_EMIT) # define WM_EMIT(p, i) ARM_EMIT(p, i) #else -# define WM_EMIT(p, i) +# define WM_EMIT(p, i) #endif enum { diff --git a/src/mono/mono/arch/mips/test.c b/src/mono/mono/arch/mips/test.c index 4f5e1adee1f1d0..c7b324f08630dd 100644 --- a/src/mono/mono/arch/mips/test.c +++ b/src/mono/mono/arch/mips/test.c @@ -15,7 +15,7 @@ int main (int argc, char *argv[]) { guint32 *code, * p; code = p = (guint32 *) malloc (sizeof (guint32) * 1024); - + mips_add (p, 3, 4, 5); mips_addi (p, 3, 4, 5); mips_addu (p, 3, 4, 5); diff --git a/src/mono/mono/arch/ppc/ppc-codegen.h b/src/mono/mono/arch/ppc/ppc-codegen.h index 83d366acc83abc..a52d17ab767f0c 100644 --- a/src/mono/mono/arch/ppc/ppc-codegen.h +++ b/src/mono/mono/arch/ppc/ppc-codegen.h @@ -274,7 +274,7 @@ from 18 November 2002 to 19 December 2002. Special thanks to rodo, lupus, dietmar, miguel, and duncan for patience, and motivation. -The macros found in this file are based on the assembler instructions found +The macros found in this file are based on the assembler instructions found in Motorola and Digital DNA's: "Programming Enviornments Manual For 32-bit Implementations of the PowerPC Architecture" @@ -334,7 +334,7 @@ my and Ximian's copyright to this code. ;) #define ppc_andisd(c,S,A,ui) ppc_emit32(c, (29 << 26) | ((S) << 21 ) | ((A) << 16) | ((guint16)(ui))) #define ppc_bcx(c,BO,BI,BD,AA,LK) ppc_emit32(c, (16 << 26) | ((BO) << 21 )| ((BI) << 16) | (BD << 2) | ((AA) << 1) | LK) -#define ppc_bc(c,BO,BI,BD) ppc_bcx(c,BO,BI,BD,0,0) +#define ppc_bc(c,BO,BI,BD) ppc_bcx(c,BO,BI,BD,0,0) #define ppc_bca(c,BO,BI,BD) ppc_bcx(c,BO,BI,BD,1,0) #define ppc_bcl(c,BO,BI,BD) ppc_bcx(c,BO,BI,BD,0,1) #define ppc_bcla(c,BO,BI,BD) ppc_bcx(c,BO,BI,BD,1,1) @@ -400,15 +400,15 @@ my and Ximian's copyright to this code. ;) #define ppc_eqv(c,A,S,B) ppc_eqvx(c,A,S,B,0) #define ppc_eqvd(c,A,S,B) ppc_eqvx(c,A,S,B,1) -#define ppc_extsbx(c,A,S,Rc) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (0 << 11) | (954 << 1) | Rc) +#define ppc_extsbx(c,A,S,Rc) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (0 << 11) | (954 << 1) | Rc) #define ppc_extsb(c,A,S) ppc_extsbx(c,A,S,0) #define ppc_extsbd(c,A,S) ppc_extsbx(c,A,S,1) -#define ppc_extshx(c,A,S,Rc) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (0 << 11) | (922 << 1) | Rc) +#define ppc_extshx(c,A,S,Rc) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (0 << 11) | (922 << 1) | Rc) #define ppc_extsh(c,A,S) ppc_extshx(c,A,S,0) #define ppc_extshd(c,A,S) ppc_extshx(c,A,S,1) -#define ppc_fabsx(c,D,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (0 << 16) | (B << 11) | (264 << 1) | Rc) +#define ppc_fabsx(c,D,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (0 << 16) | (B << 11) | (264 << 1) | Rc) #define ppc_fabs(c,D,B) ppc_fabsx(c,D,B,0) #define ppc_fabsd(c,D,B) ppc_fabsx(c,D,B,1) @@ -441,11 +441,11 @@ my and Ximian's copyright to this code. ;) #define ppc_fmaddx(c,D,A,B,C,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (A << 16) | (B << 11) | (C << 6) | (29 << 1) | Rc) #define ppc_fmadd(c,D,A,B,C) ppc_fmaddx(c,D,A,B,C,0) -#define ppc_fmaddd(c,D,A,B,C) ppc_fmaddx(c,D,A,B,C,1) +#define ppc_fmaddd(c,D,A,B,C) ppc_fmaddx(c,D,A,B,C,1) #define ppc_fmaddsx(c,D,A,B,C,Rc) ppc_emit32(c, (59 << 26) | (D << 21) | (A << 16) | (B << 11) | (C << 6) | (29 << 1) | Rc) #define ppc_fmadds(c,D,A,B,C) ppc_fmaddsx(c,D,A,B,C,0) -#define ppc_fmaddsd(c,D,A,B,C) ppc_fmaddsx(c,D,A,B,C,1) +#define ppc_fmaddsd(c,D,A,B,C) ppc_fmaddsx(c,D,A,B,C,1) #define ppc_fmrx(c,D,B,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (0 << 16) | (B << 11) | (72 << 1) | Rc) #define ppc_fmr(c,D,B) ppc_fmrx(c,D,B,0) @@ -459,11 +459,11 @@ my and Ximian's copyright to this code. ;) #define ppc_fmsubs(c,D,A,C,B) ppc_fmsubsx(c,D,A,C,B,0) #define ppc_fmsubsd(c,D,A,C,B) ppc_fmsubsx(c,D,A,C,B,1) -#define ppc_fmulx(c,D,A,C,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (A << 16) | (0 << 11) | (C << 6) | (25 << 1) | Rc) +#define ppc_fmulx(c,D,A,C,Rc) ppc_emit32(c, (63 << 26) | (D << 21) | (A << 16) | (0 << 11) | (C << 6) | (25 << 1) | Rc) #define ppc_fmul(c,D,A,C) ppc_fmulx(c,D,A,C,0) #define ppc_fmuld(c,D,A,C) ppc_fmulx(c,D,A,C,1) -#define ppc_fmulsx(c,D,A,C,Rc) ppc_emit32(c, (59 << 26) | (D << 21) | (A << 16) | (0 << 11) | (C << 6) | (25 << 1) | Rc) +#define ppc_fmulsx(c,D,A,C,Rc) ppc_emit32(c, (59 << 26) | (D << 21) | (A << 16) | (0 << 11) | (C << 6) | (25 << 1) | Rc) #define ppc_fmuls(c,D,A,C) ppc_fmulsx(c,D,A,C,0) #define ppc_fmulsd(c,D,A,C) ppc_fmulsx(c,D,A,C,1) @@ -689,9 +689,9 @@ my and Ximian's copyright to this code. ;) #define ppc_stfiwx(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (983 << 1) | 0) #define ppc_stfsu(c,S,d,A) ppc_emit32(c, (53 << 26) | (S << 21) | (A << 16) | (guint16)(d)) -#define ppc_stfsux(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (695 << 1) | 0) -#define ppc_stfsx(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (663 << 1) | 0) -#define ppc_sthbrx(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (918 << 1) | 0) +#define ppc_stfsux(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (695 << 1) | 0) +#define ppc_stfsx(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (663 << 1) | 0) +#define ppc_sthbrx(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (918 << 1) | 0) #define ppc_sthu(c,S,d,A) ppc_emit32(c, (45 << 26) | (S << 21) | (A << 16) | (guint16)(d)) #define ppc_sthux(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (439 << 1) | 0) #define ppc_sthx(c,S,A,B) ppc_emit32(c, (31 << 26) | (S << 21) | (A << 16) | (B << 11) | (407 << 1) | 0) diff --git a/src/mono/mono/arch/s390x/s390x-codegen.h b/src/mono/mono/arch/s390x/s390x-codegen.h index ec9562a0e04744..cd96c9f2f331ff 100644 --- a/src/mono/mono/arch/s390x/s390x-codegen.h +++ b/src/mono/mono/arch/s390x/s390x-codegen.h @@ -254,7 +254,7 @@ typedef struct { short op; short m1 : 4; short ri2 : 12; - short i3; + short i3; } MII_Format; typedef struct { @@ -569,7 +569,7 @@ typedef struct { char op; char l1 : 4; char l2 : 4; - short b1 : 4; + short b1 : 4; short d1 : 12; short b2 : 4; short d2 : 12; @@ -579,21 +579,21 @@ typedef struct { char op; char r1 : 4; char r3 : 4; - short b1 : 4; + short b1 : 4; short d1 : 12; short b2 : 4; short d2 : 12; -} __attribute__ ((__packed__)) SS_Format_3; +} __attribute__ ((__packed__)) SS_Format_3; typedef struct { char op; char r1 : 4; char r3 : 4; - short b2 : 4; + short b2 : 4; short d2 : 12; short b4 : 4; short d4 : 12; -} __attribute__ ((__packed__)) SS_Format_4; +} __attribute__ ((__packed__)) SS_Format_4; typedef struct { short op; @@ -814,7 +814,7 @@ typedef struct { #define S390_RR(c,opc,g1,g2) s390_emit16(c, (opc << 8 | (g1) << 4 | g2)) -#define S390_RRE(c,opc,g1,g2) s390_emit32(c, (opc << 16 | (g1) << 4 | g2)) +#define S390_RRE(c,opc,g1,g2) s390_emit32(c, (opc << 16 | (g1) << 4 | g2)) #define S390_RRF_1(c,opc,g1,g2,g3) s390_emit32(c, (opc << 16 | (g3) << 12 | (g1) << 4 | g2)) @@ -841,7 +841,7 @@ typedef struct { (opc & 0xff))); \ } while (0) -#define S390_RS_1(c,opc,g1,g3,s2,p2) s390_emit32(c, (opc << 24 | (g1) << 20 | (g3) << 16 | (s2) << 12 | ((p2) & 0xfff))) +#define S390_RS_1(c,opc,g1,g3,s2,p2) s390_emit32(c, (opc << 24 | (g1) << 20 | (g3) << 16 | (s2) << 12 | ((p2) & 0xfff))) #define S390_RS_2(c,opc,g1,k3,s2,p2) s390_emit32(c, (opc << 24 | (g1) << 20 | (k3) << 16 | (s2) << 12 | ((p2) & 0xfff))) @@ -1450,7 +1450,7 @@ typedef struct { #define s390_msr(c, r1, r2) S390_RRE(c, 0xb252, r1, r2) #define s390_msrkc(c, r1, r2, r3) S390_RRF_1(c, 0xb9fd, r1, r2, r3) #define s390_mvc(c, l, b1, d1, b2, d2) S390_SS_1(c, 0xd2, l, b1, d1, b2, d2) -#define s390_mvghi(c, b1, d1, i2) S390_SIL(c, 0xe548, b1, d1, i2) +#define s390_mvghi(c, b1, d1, i2) S390_SIL(c, 0xe548, b1, d1, i2) #define s390_mvcl(c, r1, r2) S390_RR(c, 0x0e, r1, r2) #define s390_mvcle(c, r1, r3, d2, b2) S390_RS_1(c, 0xa8, r1, r3, d2, b2) #define s390_mvi(c, b, d, v) S390_SI(c, 0x92, b, d, v) @@ -1459,14 +1459,14 @@ typedef struct { #define s390_ng(c, r, x, b, d) S390_RXY(c, 0xe380, r, x, b, d) #define s390_ngr(c, r1, r2) S390_RRE(c, 0xb980, r1, r2) #define s390_ngrk(c, r1, r2, r3) S390_RRF_1(c, 0xb9e4, r1, r2, r3) -#define s390_ni(c, b, d, v) S390_SI(c, 0x94, b, d, v) +#define s390_ni(c, b, d, v) S390_SI(c, 0x94, b, d, v) #define s390_nihf(c, r, v) S390_RIL_1(c, 0xc0a, r, v) #define s390_nihh(c, r, v) S390_RI(c, 0xa54, r, v) #define s390_nihl(c, r, v) S390_RI(c, 0xa55, r, v) #define s390_nilf(c, r, v) S390_RIL_1(c, 0xc0b, r, v) #define s390_nilh(c, r, v) S390_RI(c, 0xa56, r, v) #define s390_nill(c, r, v) S390_RI(c, 0xa57, r, v) -#define s390_niy(c, b, d, v) S390_SIY(c, 0xeb54, b, d, v) +#define s390_niy(c, b, d, v) S390_SIY(c, 0xeb54, b, d, v) #define s390_nop(c) S390_RR(c, 0x07, 0x0, 0) #define s390_mem(c) S390_RR(c, 0x07, 0xe, 0) #define s390_nr(c, r1, r2) S390_RR(c, 0x14, r1, r2) @@ -1479,7 +1479,7 @@ typedef struct { #define s390_oilf(c, r, v) S390_RIL_1(c, 0xc0d, r, v) #define s390_oilh(c, r, v) S390_RI(c, 0xa5a, r, v) #define s390_oill(c, r, v) S390_RI(c, 0xa5b, r, v) -#define s390_oiy(c, b, d, v) S390_SIY(c, 0xeb56 b, d, v) +#define s390_oiy(c, b, d, v) S390_SIY(c, 0xeb56 b, d, v) #define s390_og(c, r, x, b, d) S390_RXY(c, 0xe381, r, x, b, d) #define s390_ogr(c, r1, r2) S390_RRE(c, 0xb981, r1, r2) #define s390_ogrk(c, r1, r2, r3) S390_RRF_1(c, 0xb9e6, r1, r2, r3) @@ -1497,13 +1497,13 @@ typedef struct { #define s390_sgr(c, r1, r2) S390_RRE(c, 0xb909, r1, r2) #define s390_sgrk(c, r1, r2, r3) S390_RRF_1(c, 0xb9e9, r1, r2, r3) #define s390_sl(c, r, x, b, d) S390_RX(c, 0x5f, r, x, b, d) -#define s390_sla(c, r, b, d) S390_RS_3(c, 0x8b, r, b, d) -#define s390_slag(c, r1, r2, b, d) S390_RSY_1(c, 0xeb0b, r1, r2, b, d) +#define s390_sla(c, r, b, d) S390_RS_3(c, 0x8b, r, b, d) +#define s390_slag(c, r1, r2, b, d) S390_RSY_1(c, 0xeb0b, r1, r2, b, d) #define s390_slbg(c, r, x, b, d) S390_RXY(c, 0xe389, r, x, b, d) #define s390_slbgr(c, r1, r2) S390_RRE(c, 0xb989, r1, r2) #define s390_slbr(c, r1, r2) S390_RRE(c, 0xb999, r1, r2) -#define s390_slda(c, r, b, d) S390_RS_3(c, 0x8f, r, b, d) -#define s390_sldl(c, r, b, d) S390_RS_3(c, 0x8d, r, b, d) +#define s390_slda(c, r, b, d) S390_RS_3(c, 0x8f, r, b, d) +#define s390_sldl(c, r, b, d) S390_RS_3(c, 0x8d, r, b, d) #define s390_slfi(c, r, v) S390_RIL_1(c, 0xc25, r, v) #define s390_slg(c, r, x, b, d) S390_RXY(c, 0xe30b, r, x, b, d) #define s390_slgf(c, r, x, b, d) S390_RXY(c, 0xe31b, r, x, b, d) @@ -1511,20 +1511,20 @@ typedef struct { #define s390_slgfi(c, r, v) S390_RIL_1(c, 0xc24, r, v) #define s390_slgr(c, r1, r2) S390_RRE(c, 0xb90b, r1, r2) #define s390_slgrk(c, r1, r2, r3) S390_RRF_1(c, 0xb9eb, r1, r2, r3) -#define s390_sll(c, r, b, d) S390_RS_3(c, 0x89, r, b, d) -#define s390_sllg(c, r1, r2, b, d) S390_RSY_1(c, 0xeb0d, r1, r2, b, d) +#define s390_sll(c, r, b, d) S390_RS_3(c, 0x89, r, b, d) +#define s390_sllg(c, r1, r2, b, d) S390_RSY_1(c, 0xeb0d, r1, r2, b, d) #define s390_slr(c, r1, r2) S390_RR(c, 0x1f, r1, r2) #define s390_slrk(c, r1, r2, r3) S390_RRF_1(c, 0xb9fb, r1, r2, r3) #define s390_sqdbr(c, r1, r2) S390_RRE(c, 0xb315, r1, r2) #define s390_sqebr(c, r1, r2) S390_RRE(c, 0xb314, r1, r2) -#define s390_sra(c, r, b, d) S390_RS_3(c, 0x8a, r, b, d) -#define s390_srag(c, r1, r2, b, d) S390_RSY_1(c, 0xeb0a, r1, r2, b, d) +#define s390_sra(c, r, b, d) S390_RS_3(c, 0x8a, r, b, d) +#define s390_srag(c, r1, r2, b, d) S390_RSY_1(c, 0xeb0a, r1, r2, b, d) #define s390_sr(c, r1, r2) S390_RR(c, 0x1b, r1, r2) -#define s390_srda(c, r, b, d) S390_RS_3(c, 0x8e, r, b, d) -#define s390_srdl(c, r, b, d) S390_RS_3(c, 0x8c, r, b, d) +#define s390_srda(c, r, b, d) S390_RS_3(c, 0x8e, r, b, d) +#define s390_srdl(c, r, b, d) S390_RS_3(c, 0x8c, r, b, d) #define s390_srk(c, r1, r2, r3) S390_RRF_1(c, 0xb9f9, r1, r2, r3) -#define s390_srl(c, r, b, d) S390_RS_3(c, 0x88, r, b, d) -#define s390_srlg(c, r1, r2, b, d) S390_RSY_1(c, 0xeb0c, r1, r2, b, d) +#define s390_srl(c, r, b, d) S390_RS_3(c, 0x88, r, b, d) +#define s390_srlg(c, r1, r2, b, d) S390_RSY_1(c, 0xeb0c, r1, r2, b, d) #define s390_st(c, r, x, b, d) S390_RX(c, 0x50, r, x, b, d) #define s390_stam(c, r1, r2, b, d) S390_RS_1(c, 0x9b, r1, r2, b, d) #define s390_stamy(c, r1, r2, b, d) S390_RSY_1(c, 0xeb9b, r1, r2, b, d) diff --git a/src/mono/mono/arch/s390x/tramp.c b/src/mono/mono/arch/s390x/tramp.c index 451511dfc53e53..9d38d9380b93e9 100644 --- a/src/mono/mono/arch/s390x/tramp.c +++ b/src/mono/mono/arch/s390x/tramp.c @@ -59,7 +59,7 @@ typedef struct { local_size, code_size, retStruct; -} size_data; +} size_data; /*========================= End of Typedefs ========================*/ @@ -78,14 +78,14 @@ add_general (guint *gr, size_data *sz, gboolean simple) if (simple) { if (*gr >= GENERAL_REGS) { sz->stack_size += sizeof(long); - sz->code_size += 12; + sz->code_size += 12; } else { - sz->code_size += 8; + sz->code_size += 8; } } else { if (*gr >= GENERAL_REGS - 1) { sz->stack_size += 8 + (sz->stack_size % 8); - sz->code_size += 10; + sz->code_size += 10; } else { sz->code_size += 8; } @@ -108,7 +108,7 @@ add_general (guint *gr, size_data *sz, gboolean simple) /*------------------------------------------------------------------*/ static void inline -calculate_sizes (MonoMethodSignature *sig, size_data *sz, +calculate_sizes (MonoMethodSignature *sig, size_data *sz, gboolean string_ctor) { guint i, fr, gr, size; @@ -290,9 +290,9 @@ calculate_sizes (MonoMethodSignature *sig, size_data *sz, /* align stack size to 8 */ DEBUG (printf (" stack size: %d (%d)\n" - " code size: %d\n" + " code size: %d\n" " local size: %d\n", - (sz->stack_size + 8) & ~8, sz->stack_size, + (sz->stack_size + 8) & ~8, sz->stack_size, (sz->code_size),(sz->local_size + 8) & ~8)); sz->stack_size = (sz->stack_size + 8) & ~8; sz->local_size = (sz->local_size + 8) & ~8; @@ -342,7 +342,7 @@ emit_prolog (guint8 *p, MonoMethodSignature *sig, size_data *sz) /* */ /* Name - emit_save_parameters */ /* */ -/* Function - Create the instructions that load registers with */ +/* Function - Create the instructions that load registers with */ /* parameters, place others on the stack according */ /* to the S/390 ABI. */ /* */ @@ -355,12 +355,12 @@ emit_prolog (guint8 *p, MonoMethodSignature *sig, size_data *sz) inline static guint8* emit_save_parameters (guint8 *p, MonoMethodSignature *sig, size_data *sz) { - guint i, fr, gr, act_strs, align, + guint i, fr, gr, act_strs, align, stack_par_pos, size, local_pos; guint32 simpletype; /*----------------------------------------------------------*/ - /* If a structure on stack is being returned, reserve r2 */ + /* If a structure on stack is being returned, reserve r2 */ /* to point to an area where it can be passed. */ /*----------------------------------------------------------*/ if (sz->retStruct) @@ -423,7 +423,7 @@ emit_save_parameters (guint8 *p, MonoMethodSignature *sig, size_data *sz) simpletype = sig->params [i]->data.klass->enum_basetype->type; goto enum_calc_size; } - if (sig->pinvoke && !sig->marshalling_disabled) + if (sig->pinvoke && !sig->marshalling_disabled) size = mono_class_native_size (sig->params [i]->data.klass, &align); else size = mono_class_value_size (sig->params [i]->data.klass, &align); @@ -455,7 +455,7 @@ emit_save_parameters (guint8 *p, MonoMethodSignature *sig, size_data *sz) s390_mvc (p, sizeof(long long), STK_BASE, stack_par_pos, s390_r10, 0); stack_par_pos += sizeof(long long); } - break; + break; default: if (size <= 256) { local_pos += (local_pos % align); @@ -488,12 +488,12 @@ emit_save_parameters (guint8 *p, MonoMethodSignature *sig, size_data *sz) break; case MONO_TYPE_I8: if (gr < GENERAL_REGS) { - s390_lg (p, s390_r2 + gr, 0, ARG_BASE, STKARG); + s390_lg (p, s390_r2 + gr, 0, ARG_BASE, STKARG); gr += 2; } else { *(guint32 *) p += 7; *(guint32 *) p &= ~7; - s390_mvc (p, sizeof(long long), STK_BASE, stack_par_pos, ARG_BASE, STKARG); + s390_mvc (p, sizeof(long long), STK_BASE, stack_par_pos, ARG_BASE, STKARG); stack_par_pos += sizeof(long long) + (stack_par_pos % sizeof(long long)); } break; @@ -523,7 +523,7 @@ emit_save_parameters (guint8 *p, MonoMethodSignature *sig, size_data *sz) } /*----------------------------------------------------------*/ - /* If we're returning a structure but not in a register */ + /* If we're returning a structure but not in a register */ /* then point the result area for the called routine */ /*----------------------------------------------------------*/ if (sz->retStruct) { @@ -574,14 +574,14 @@ alloc_code_memory (guint code_size) /*------------------------------------------------------------------*/ static guint8 * -emit_call_and_store_retval (guint8 *p, MonoMethodSignature *sig, +emit_call_and_store_retval (guint8 *p, MonoMethodSignature *sig, size_data *sz, gboolean string_ctor) { guint32 simpletype; guint retSize, align; /* call "callme" */ - s390_basr (p, s390_r14, s390_r9); + s390_basr (p, s390_r14, s390_r9); /* get return value */ if (m_type_is_byref (sig->ret) || string_ctor) { @@ -625,7 +625,7 @@ emit_call_and_store_retval (guint8 *p, MonoMethodSignature *sig, simpletype = sig->ret->data.klass->enum_basetype->type; goto enum_retvalue; } - if (sig->pinvoke && !sig->marshalling_disabled) + if (sig->pinvoke && !sig->marshalling_disabled) retSize = mono_class_native_size (sig->ret->data.klass, &align); else retSize = mono_class_value_size (sig->ret->data.klass, &align); @@ -655,7 +655,7 @@ printf("Returning %d bytes for type %d (%d)\n",retSize,simpletype,sig->pinvoke); case MONO_TYPE_VOID: break; default: - g_error ("Can't handle as return value 0x%x", + g_error ("Can't handle as return value 0x%x", sig->ret->type); } } @@ -803,12 +803,12 @@ mono_arch_create_method_pointer (MonoMethod *method) p = code_buffer = g_malloc (sz.code_size); - DEBUG (printf ("\nDelegate [start emiting] %s at 0x%08x\n", + DEBUG (printf ("\nDelegate [start emiting] %s at 0x%08x\n", method->name,p)); - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ /* prolog */ - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ s390_stmg(p, s390_r6, STK_BASE, STK_BASE, S390_REG_SAVE_OFFSET); s390_lg (p, s390_r7, 0, STK_BASE, MINV_POS); s390_lgr (p, s390_r0, STK_BASE); @@ -820,9 +820,9 @@ mono_arch_create_method_pointer (MonoMethod *method) s390_lghi(p, s390_r11, 0); s390_mvcl(p, s390_r8, s390_r10); - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ /* Let's fill MonoInvocation - first zero some fields */ - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ s390_lghi (p, s390_r0, 0); s390_stg (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex))); s390_stg (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, ex_handler))); @@ -830,15 +830,15 @@ mono_arch_create_method_pointer (MonoMethod *method) s390_lghi (p, s390_r0, 1); s390_stg (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, invoke_trap))); - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ /* set method pointer */ - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ s390_bras (p, s390_r13, 4); s390_llong(p, method); s390_lg (p, s390_r0, 0, s390_r13, 0); s390_stg (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, method))); - local_start = local_pos = MINV_POS + + local_start = local_pos = MINV_POS + sizeof (MonoInvocation) + (sig->param_count + 1) * sizeof (stackval); this_flag = (sig->hasthis ? 1 : 0); @@ -848,7 +848,7 @@ mono_arch_create_method_pointer (MonoMethod *method) /* area. If necessary save this hidden parameter for later */ /*----------------------------------------------------------*/ if (MONO_TYPE_ISSTRUCT(sig->ret)) { - if (sig->pinvoke && !sig->marshalling_disabled) + if (sig->pinvoke && !sig->marshalling_disabled) retSize = mono_class_native_size (sig->ret->data.klass, &align); else retSize = mono_class_value_size (sig->ret->data.klass, &align); @@ -870,13 +870,13 @@ mono_arch_create_method_pointer (MonoMethod *method) } if (this_flag) { - s390_stg (p, s390_r2 + reg_save, 0, STK_BASE, + s390_stg (p, s390_r2 + reg_save, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, obj))); reg_param++; } else { s390_stg (p, s390_r2 + reg_save, 0, STK_BASE, local_pos); local_pos += sizeof(int); - s390_stg (p, s390_r0, 0, STK_BASE, + s390_stg (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, obj))); } @@ -888,9 +888,9 @@ mono_arch_create_method_pointer (MonoMethod *method) s390_std (p, s390_f2, 0, STK_BASE, local_pos); local_pos += sizeof(double); - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ /* prepare space for valuetypes */ - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ vt_cur = local_pos; vtbuf = alloca (sizeof(int)*sig->param_count); cpos = 0; @@ -904,7 +904,7 @@ mono_arch_create_method_pointer (MonoMethod *method) if (klass->enumtype) continue; - if (sig->pinvoke && !sig->marshalling_disabled) + if (sig->pinvoke && !sig->marshalling_disabled) size = mono_class_native_size (sig->ret->data.klass, &align); else size = mono_class_value_size (sig->ret->data.klass, &align); @@ -919,16 +919,16 @@ mono_arch_create_method_pointer (MonoMethod *method) local_pos += cpos; - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ /* set MonoInvocation::stack_args */ - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ stackval_arg_pos = MINV_POS + sizeof (MonoInvocation); s390_la (p, s390_r0, 0, STK_BASE, stackval_arg_pos); s390_stg (p, s390_r0, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, stack_args))); - /*----------------------------------------------------------*/ - /* add stackval arguments */ - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ + /* add stackval arguments */ + /*----------------------------------------------------------*/ for (i = 0; i < sig->param_count; ++i) { if (m_type_is_byref (sig->params [i])) { ADD_ISTACK_PARM(0, 1); @@ -972,7 +972,7 @@ mono_arch_create_method_pointer (MonoMethod *method) ADD_ISTACK_PARM(0, 1); } } - + if (vtbuf [i] >= 0) { s390_la (p, s390_r3, 0, STK_BASE, vt_cur); s390_stg (p, s390_r3, 0, STK_BASE, stackval_arg_pos); @@ -1003,13 +1003,13 @@ mono_arch_create_method_pointer (MonoMethod *method) arg_pos += mono_type_native_stack_size (sig->params [i], &align); else arg_pos += mono_type_stack_size (sig->params [i], &align); - + DEBUG (printf ("%d\n", stackval_arg_pos)); } - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ /* Set return area pointer. */ - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ s390_la (p, s390_r10, 0, STK_BASE, stackval_arg_pos); s390_stg(p, s390_r10, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, retval))); if (sig->ret->type == MONO_TYPE_VALUETYPE && !m_type_is_byref (sig->ret)) { @@ -1021,18 +1021,18 @@ mono_arch_create_method_pointer (MonoMethod *method) } } - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ /* call ves_exec_method */ - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ s390_bras (p, s390_r13, 4); s390_llong(p, ves_exec_method); s390_lg (p, s390_r1, 0, s390_r13, 0); s390_la (p, s390_r2, 0, STK_BASE, MINV_POS); s390_basr (p, s390_r14, s390_r1); - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ /* move retval from stackval to proper place (r3/r4/...) */ - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ DEBUG(printf("retType: %d byRef: %d\n",sig->ret->type,m_type_is_byref (sig->ret))); if (m_type_is_byref (sig->ret)) { DEBUG (printf ("ret by ref\n")); @@ -1084,15 +1084,15 @@ mono_arch_create_method_pointer (MonoMethod *method) s390_llong(p, stackval_to_data); s390_lg (p, s390_r2, 0, s390_r13, 0); s390_lg (p, s390_r3, 0, STK_BASE, (MINV_POS + G_STRUCT_OFFSET (MonoInvocation, retval))); - if (sz.retStruct) { + if (sz.retStruct) { /*------------------------------------------*/ /* Get stackval_to_data to set result area */ /*------------------------------------------*/ s390_lgr (p, s390_r4, s390_r8); - } else { + } else { /*------------------------------------------*/ /* Give stackval_to_data a temp result area */ - /*------------------------------------------*/ + /*------------------------------------------*/ s390_la (p, s390_r4, 0, STK_BASE, stackval_arg_pos); } s390_lg (p, s390_r5, 0,s390_r13, 4); @@ -1121,15 +1121,15 @@ mono_arch_create_method_pointer (MonoMethod *method) } break; default: - g_error ("Type 0x%x not handled yet in thunk creation", + g_error ("Type 0x%x not handled yet in thunk creation", sig->ret->type); break; } } - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ /* epilog */ - /*----------------------------------------------------------*/ + /*----------------------------------------------------------*/ s390_lg (p, STK_BASE, 0, STK_BASE, 0); s390_lg (p, s390_r4, 0, STK_BASE, S390_RET_ADDR_OFFSET); s390_lmg (p, s390_r6, STK_BASE, STK_BASE, S390_REG_SAVE_OFFSET); diff --git a/src/mono/mono/arch/sparc/sparc-codegen.h b/src/mono/mono/arch/sparc/sparc-codegen.h index eb421bbcf9a6fc..b8c478c473bbd6 100644 --- a/src/mono/mono/arch/sparc/sparc-codegen.h +++ b/src/mono/mono/arch/sparc/sparc-codegen.h @@ -224,7 +224,7 @@ typedef enum { sparc_membar_store_load = 0x2, sparc_membar_load_store = 0x4, sparc_membar_store_store = 0x8, - + sparc_membar_lookaside = 0x10, sparc_membar_memissue = 0x20, sparc_membar_sync = 0x40, @@ -680,9 +680,9 @@ typedef struct { #define sparc_faddd(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_faddd_val, r2, dest ) #define sparc_faddq(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_faddq_val, r2, dest ) -#define sparc_fsubs(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_fsubs_val, r2, dest ) -#define sparc_fsubd(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_fsubd_val, r2, dest ) -#define sparc_fsubq(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_fsubq_val, r2, dest ) +#define sparc_fsubs(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_fsubs_val, r2, dest ) +#define sparc_fsubd(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_fsubd_val, r2, dest ) +#define sparc_fsubq(ins, r1, r2, dest) sparc_fop( ins, r1, sparc_fsubq_val, r2, dest ) #define sparc_fmuls( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fmuls_val, r2, dest ) #define sparc_fmuld( ins, r1, r2, dest ) sparc_fop( ins, r1, sparc_fmuld_val, r2, dest ) @@ -735,7 +735,7 @@ typedef struct { #define sparc_fcmpq( ins, r1, r2 ) sparc_fcmp( ins, r1, sparc_fcmpq_val, r2 ) #define sparc_fcmpes( ins, r1, r2 ) sparc_fcmpes( ins, r1, sparc_fcmpes_val, r2 ) #define sparc_fcmped( ins, r1, r2 ) sparc_fcmped( ins, r1, sparc_fcmped_val, r2 ) -#define sparc_fcmpeq( ins, r1, r2 ) sparc_fcmpeq( ins, r1, sparc_fcmpeq_val, r2 ) +#define sparc_fcmpeq( ins, r1, r2 ) sparc_fcmpeq( ins, r1, sparc_fcmpeq_val, r2 ) /* logical */ diff --git a/src/mono/mono/arch/sparc/test.c b/src/mono/mono/arch/sparc/test.c index 0d4ad1869b99ee..8bfeb56544c57d 100644 --- a/src/mono/mono/arch/sparc/test.c +++ b/src/mono/mono/arch/sparc/test.c @@ -35,8 +35,8 @@ main () ++cur_out_reg; sparc_ld_imm (p, sparc_i3, arg_pos+4, cur_out_reg); ++cur_out_reg; - /* - * Insert call to function + /* + * Insert call to function */ sparc_jmpl (p, sparc_i0, 0, sparc_callsite); sparc_nop (p); diff --git a/src/mono/mono/arch/x86/x86-codegen.h b/src/mono/mono/arch/x86/x86-codegen.h index 86a051cbcc9390..c4edb3c1e2d62f 100644 --- a/src/mono/mono/arch/x86/x86-codegen.h +++ b/src/mono/mono/arch/x86/x86-codegen.h @@ -7,7 +7,7 @@ * Sergey Chaban (serge@wildwestsoftware.com) * Dietmar Maurer (dietmar@ximian.com) * Patrik Torstensson - * + * * Copyright (C) 2000 Intel Corporation. All rights reserved. * Copyright (C) 2001, 2002 Ximian, Inc. * Licensed under the MIT license. See LICENSE file in the project root for full license information. @@ -151,7 +151,7 @@ enum { typedef enum { X86_LOCK_PREFIX = 0xF0, X86_REPNZ_PREFIX = 0xF2, - X86_REPZ_PREFIX = 0xF3, + X86_REPZ_PREFIX = 0xF3, X86_REP_PREFIX = 0xF3, X86_CS_PREFIX = 0x2E, X86_SS_PREFIX = 0x36, @@ -165,7 +165,7 @@ typedef enum { X86_ADDRESS_PREFIX = 0x67 } X86_Prefix; -static const unsigned char +static const unsigned char x86_cc_unsigned_map [X86_NCC] = { 0x74, /* eq */ 0x75, /* ne */ @@ -181,7 +181,7 @@ x86_cc_unsigned_map [X86_NCC] = { 0x71, /* no */ }; -static const unsigned char +static const unsigned char x86_cc_signed_map [X86_NCC] = { 0x74, /* eq */ 0x75, /* ne */ @@ -239,10 +239,10 @@ typedef union { // | var[n_arg] | // | var[n_arg+1] | local variables area // | . . . | -// | var[n_var-1] | +// | var[n_var-1] | // +--------------------------------+ // | | -// | | +// | | // | spill area | area for spilling mimic stack // | | // +--------------------------------| @@ -453,7 +453,7 @@ mono_x86_patch_inline (guchar* code, gpointer target) x86_byte (inst, 0xb1); \ x86_reg_emit ((inst), (reg), (dreg)); \ } while (0) - + #define x86_cmpxchg_mem_reg(inst,mem,reg) \ do { \ x86_codegen_pre(&(inst), 7); \ @@ -461,7 +461,7 @@ mono_x86_patch_inline (guchar* code, gpointer target) x86_byte (inst, 0xb1); \ x86_mem_emit ((inst), (reg), (mem)); \ } while (0) - + #define x86_cmpxchg_membase_reg(inst,basereg,disp,reg) \ do { \ x86_codegen_pre(&(inst), 2 + kMaxMembaseEmitPadding); \ @@ -659,7 +659,7 @@ mono_x86_patch_inline (guchar* code, gpointer target) x86_imm_emit32 ((inst), (imm)); \ } \ } while (0) - + #define x86_alu_membase8_imm(inst,opc,basereg,disp,imm) \ do { \ x86_codegen_pre(&(inst), 2 + kMaxMembaseEmitPadding); \ @@ -1597,7 +1597,7 @@ mono_x86_patch_inline (guchar* code, gpointer target) } while (0) #define x86_push_imm_template(inst) x86_push_imm (inst, 0xf0f0f0f0) - + #define x86_push_imm(inst,imm) \ do { \ int _imm = (int) (imm); \ @@ -1952,7 +1952,7 @@ mono_x86_patch_inline (guchar* code, gpointer target) x86_imm_emit16 ((inst), (framesize)); \ x86_byte(inst, 0); \ } while (0) - + #define x86_leave(inst) do { x86_byte (inst, 0xc9); } while (0) #define x86_sahf(inst) do { x86_byte (inst, 0x9e); } while (0) @@ -2040,16 +2040,16 @@ typedef enum { X86_SSE_MOVSHDUP = 0x16, X86_SSE_MOVSLDUP = 0x12, X86_SSE_MOVDDUP = 0x12, - + X86_SSE_PAND = 0xDB, X86_SSE_POR = 0xEB, X86_SSE_PXOR = 0xEF, - + X86_SSE_PADDB = 0xFC, X86_SSE_PADDW = 0xFD, X86_SSE_PADDD = 0xFE, X86_SSE_PADDQ = 0xD4, - + X86_SSE_PSUBB = 0xF8, X86_SSE_PSUBW = 0xF9, X86_SSE_PSUBD = 0xFA, @@ -2064,7 +2064,7 @@ typedef enum { X86_SSE_PMAXUD = 0x3F, /*sse41*/ X86_SSE_PMINSB = 0x38, /*sse41*/ - X86_SSE_PMINSW = 0xEA, + X86_SSE_PMINSW = 0xEA, X86_SSE_PMINSD = 0x39,/*sse41*/ X86_SSE_PMINUB = 0xDA, @@ -2085,9 +2085,9 @@ typedef enum { X86_SSE_PCMPGTQ = 0x37, /*sse42*/ X86_SSE_PSADBW = 0xf6, - + X86_SSE_PSHUFD = 0x70, - + X86_SSE_PUNPCKLBW = 0x60, X86_SSE_PUNPCKLWD = 0x61, X86_SSE_PUNPCKLDQ = 0x62, @@ -2121,14 +2121,14 @@ typedef enum { X86_SSE_PMULUDQ = 0xF4, X86_SSE_PMOVMSKB = 0xD7, - + X86_SSE_PSHIFTW = 0x71, X86_SSE_PSHIFTD = 0x72, X86_SSE_PSHIFTQ = 0x73, X86_SSE_SHR = 2, X86_SSE_SAR = 4, X86_SSE_SHL = 6, - + X86_SSE_PSRLW_REG = 0xD1, X86_SSE_PSRAW_REG = 0xE1, X86_SSE_PSLLW_REG = 0xF1, @@ -2136,7 +2136,7 @@ typedef enum { X86_SSE_PSRLD_REG = 0xD2, X86_SSE_PSRAD_REG = 0xE2, X86_SSE_PSLLD_REG = 0xF2, - + X86_SSE_PSRLQ_REG = 0xD3, X86_SSE_PSLLQ_REG = 0xF3, @@ -2156,7 +2156,7 @@ typedef enum { X86_SSE_PEXTRW = 0xC5, X86_SSE_PEXTRD = 0x16,/*sse41*/ - X86_SSE_SHUFP = 0xC6, + X86_SSE_SHUFP = 0xC6, X86_SSE_CVTDQ2PD = 0xE6, X86_SSE_CVTDQ2PS = 0x5B, diff --git a/src/mono/mono/component/debugger-agent.h b/src/mono/mono/component/debugger-agent.h index ad5a0cb1d0b1d4..8ff34438d54da2 100644 --- a/src/mono/mono/component/debugger-agent.h +++ b/src/mono/mono/component/debugger-agent.h @@ -12,7 +12,7 @@ void debugger_agent_add_function_pointers (MonoComponentDebugger* fn_table); -void +void mono_ss_calculate_framecount (void *the_tls, MonoContext *ctx, gboolean force_use_ctx, DbgEngineStackFrame ***frames, int *nframes); void @@ -22,10 +22,10 @@ mono_ss_discard_frame_context (void *the_tls); DebuggerTlsData* mono_wasm_get_tls (void); -void +void mono_init_debugger_agent_for_wasm (int log_level, MonoProfilerHandle *prof); -void +void mono_wasm_save_thread_context (void); #endif @@ -33,10 +33,10 @@ mono_wasm_save_thread_context (void); void mini_wasm_debugger_add_function_pointers (MonoComponentDebugger* fn_table); -MdbgProtErrorCode +MdbgProtErrorCode mono_do_invoke_method (DebuggerTlsData *tls, MdbgProtBuffer *buf, InvokeData *invoke, guint8 *p, guint8 **endp); -MdbgProtErrorCode +MdbgProtErrorCode mono_process_dbg_packet (int id, MdbgProtCommandSet command_set, int command, gboolean *no_reply, guint8 *p, guint8 *end, MdbgProtBuffer *buf); void @@ -45,12 +45,12 @@ mono_dbg_process_breakpoint_events (void *_evts, MonoMethod *method, MonoContext void* mono_dbg_create_breakpoint_events (GPtrArray *ss_reqs, GPtrArray *bp_reqs, MonoJitInfo *ji, MdbgProtEventKind kind); -int +int mono_ss_create_init_args (SingleStepReq *ss_req, SingleStepArgs *args); -void +void mono_ss_args_destroy (SingleStepArgs *ss_args); -int +int mono_de_frame_async_id (DbgEngineStackFrame *frame); #endif diff --git a/src/mono/mono/component/debugger-engine.c b/src/mono/mono/component/debugger-engine.c index 5083e3b68c8193..ce0cc5eb65745a 100644 --- a/src/mono/mono/component/debugger-engine.c +++ b/src/mono/mono/component/debugger-engine.c @@ -807,7 +807,7 @@ mono_de_process_single_step (void *tls, gboolean from_signal) if (method->wrapper_type && method->wrapper_type != MONO_WRAPPER_DYNAMIC_METHOD) goto exit; - /* + /* * FIXME: * Stopping in memset makes half-initialized vtypes visible. * Stopping in memcpy makes half-copied vtypes visible. @@ -999,7 +999,7 @@ mono_de_ss_update (SingleStepReq *req, MonoJitInfo *ji, SeqPoint *sp, void *tls, hit = FALSE; } } - + if (loc) { req->last_method = method; req->last_line = loc->row; @@ -1498,7 +1498,7 @@ mono_de_ss_create (MonoInternalThread *thread, StepSize size, StepDepth depth, S err = rt_callbacks.handle_multiple_ss_requests (); if (err == DE_ERR_NOT_IMPLEMENTED) { - PRINT_DEBUG_MSG (0, "Received a single step request while the previous one was still active.\n"); + PRINT_DEBUG_MSG (0, "Received a single step request while the previous one was still active.\n"); return DE_ERR_NOT_IMPLEMENTED; } } @@ -1596,7 +1596,7 @@ get_class_to_get_builder_field (DbgEngineStackFrame *frame) if (!this_obj) return NULL; - + context = mono_get_generic_context_from_stack_frame (frame->ji, mono_get_generic_info_from_stack_frame (frame->ji, &the_frame->ctx)); inflated_type = mono_class_inflate_generic_type_checked (m_class_get_byval_arg (original_class), &context, error); mono_error_assert_ok (error); /* FIXME don't swallow the error */ diff --git a/src/mono/mono/component/debugger-engine.h b/src/mono/mono/component/debugger-engine.h index a3c30d6d995cc3..e6e47280e50b08 100644 --- a/src/mono/mono/component/debugger-engine.h +++ b/src/mono/mono/component/debugger-engine.h @@ -107,7 +107,7 @@ #define CMD_TYPE_GET_VALUE_SIZE MDBGPROT_CMD_TYPE_GET_VALUE_SIZE #define CMD_METHOD_GET_NAME MDBGPROT_CMD_METHOD_GET_NAME -#define CMD_METHOD_GET_DECLARING_TYPE MDBGPROT_CMD_METHOD_GET_DECLARING_TYPE +#define CMD_METHOD_GET_DECLARING_TYPE MDBGPROT_CMD_METHOD_GET_DECLARING_TYPE #define CMD_METHOD_GET_DEBUG_INFO MDBGPROT_CMD_METHOD_GET_DEBUG_INFO #define CMD_METHOD_GET_PARAM_INFO MDBGPROT_CMD_METHOD_GET_PARAM_INFO #define CMD_METHOD_GET_LOCALS_INFO MDBGPROT_CMD_METHOD_GET_LOCALS_INFO @@ -263,7 +263,7 @@ #define FRAME_FLAG_DEBUGGER_INVOKE MDBGPROT_FRAME_FLAG_DEBUGGER_INVOKE #define FRAME_FLAG_NATIVE_TRANSITION MDBGPROT_FRAME_FLAG_NATIVE_TRANSITION -/* +/* * Contains information about an inserted breakpoint. */ typedef struct { @@ -284,7 +284,7 @@ typedef struct { /* Unique id used in the wire protocol to refer to objects */ int id; /* - * A weakref gc handle pointing to the object. The gc handle is used to + * A weakref gc handle pointing to the object. The gc handle is used to * detect if the object was garbage collected. */ MonoGCHandle handle; @@ -403,5 +403,5 @@ void win32_debugger_log(FILE *stream, const gchar *format, ...); #define PRINT_MSG(...) g_print (__VA_ARGS__) #endif -void +void mono_de_init(DebuggerEngineCallbacks* cbs); diff --git a/src/mono/mono/component/debugger-mono-compat.h b/src/mono/mono/component/debugger-mono-compat.h index 0492a71f3468cf..565dc81b2fb939 100644 --- a/src/mono/mono/component/debugger-mono-compat.h +++ b/src/mono/mono/component/debugger-mono-compat.h @@ -18,4 +18,4 @@ dbg_rt_atomic_inc_int32_t (volatile int32_t *value) return (int32_t)mono_atomic_inc_i32 ((volatile gint32 *)value); } -#endif \ No newline at end of file +#endif diff --git a/src/mono/mono/component/debugger-protocol.c b/src/mono/mono/component/debugger-protocol.c index 2fe3096608a511..a63b92d1ee3816 100644 --- a/src/mono/mono/component/debugger-protocol.c +++ b/src/mono/mono/component/debugger-protocol.c @@ -11,7 +11,7 @@ static int32_t packet_id = 0; /* * Functions to decode protocol data */ -int +int m_dbgprot_buffer_add_command_header (MdbgProtBuffer *data, int command_set, int command, MdbgProtBuffer *out) { int id = dbg_rt_atomic_inc_int32_t ((volatile int32_t *)&packet_id); @@ -27,7 +27,7 @@ m_dbgprot_buffer_add_command_header (MdbgProtBuffer *data, int command_set, int return id; } -void +void m_dbgprot_decode_command_header (MdbgProtBuffer *recvbuf, MdbgProtHeader *header) { header->len = m_dbgprot_decode_int (recvbuf->p, &recvbuf->p, recvbuf->end); diff --git a/src/mono/mono/component/debugger-protocol.h b/src/mono/mono/component/debugger-protocol.h index 2aa52c2a857ffe..af28674c42d52f 100644 --- a/src/mono/mono/component/debugger-protocol.h +++ b/src/mono/mono/component/debugger-protocol.h @@ -6,7 +6,7 @@ #define HEADER_LENGTH 11 #define REPLY_PACKET 0x80 -/* +/* * Wire Protocol definitions */ diff --git a/src/mono/mono/component/debugger-state-machine.h b/src/mono/mono/component/debugger-state-machine.h index 5002467b93264b..9a549401dc6999 100644 --- a/src/mono/mono/component/debugger-state-machine.h +++ b/src/mono/mono/component/debugger-state-machine.h @@ -66,4 +66,4 @@ mono_debugger_state (JsonWriter *writer); char * mono_debugger_state_str (void); -#endif // __MONO_DEBUGGER_STATE_MACHINE__ +#endif // __MONO_DEBUGGER_STATE_MACHINE__ diff --git a/src/mono/mono/component/debugger-stub.c b/src/mono/mono/component/debugger-stub.c index 4235a97eb50177..c6a6a445b41d7c 100644 --- a/src/mono/mono/component/debugger-stub.c +++ b/src/mono/mono/component/debugger-stub.c @@ -54,7 +54,7 @@ stub_debugger_single_step_from_context (MonoContext *ctx); static void stub_debugger_breakpoint_from_context (MonoContext *ctx); -static gboolean +static gboolean stub_debugger_transport_handshake (void); static void @@ -63,13 +63,13 @@ stub_mono_wasm_breakpoint_hit (void); static void stub_mono_wasm_single_step_hit (void); -static void +static void stub_send_enc_delta (MonoImage *image, gconstpointer dmeta_bytes, int32_t dmeta_len, gconstpointer dpdb_bytes, int32_t dpdb_len); static MonoComponentDebugger fn_table = { { MONO_COMPONENT_ITF_VERSION, &debugger_avaliable }, &stub_debugger_init, - &stub_debugger_user_break, + &stub_debugger_user_break, &stub_debugger_parse_options, &stub_debugger_breakpoint_hit, &stub_debugger_single_step_event, @@ -183,7 +183,7 @@ stub_debugger_breakpoint_from_context (MonoContext *ctx) g_assert_not_reached (); } -static gboolean +static gboolean stub_debugger_transport_handshake (void) { g_assert_not_reached(); @@ -199,7 +199,7 @@ stub_mono_wasm_single_step_hit (void) { } -static void +static void stub_send_enc_delta (MonoImage *image, gconstpointer dmeta_bytes, int32_t dmeta_len, gconstpointer dpdb_bytes, int32_t dpdb_len) { } @@ -217,13 +217,13 @@ EMSCRIPTEN_KEEPALIVE gboolean mono_wasm_send_dbg_command_with_parms (int id, int G_END_DECLS -EMSCRIPTEN_KEEPALIVE gboolean +EMSCRIPTEN_KEEPALIVE gboolean mono_wasm_send_dbg_command_with_parms (int id, int command_set, int command, guint8* data, unsigned int size, int valtype, char* newvalue) { return false; } -EMSCRIPTEN_KEEPALIVE gboolean +EMSCRIPTEN_KEEPALIVE gboolean mono_wasm_send_dbg_command (int id, int command_set, int command, guint8* data, unsigned int size) { return false; diff --git a/src/mono/mono/component/debugger.c b/src/mono/mono/component/debugger.c index 2ebb4f46aae91a..5187d70a8954c4 100644 --- a/src/mono/mono/component/debugger.c +++ b/src/mono/mono/component/debugger.c @@ -28,8 +28,8 @@ MonoComponentDebugger * mono_component_debugger_init (void) { debugger_agent_add_function_pointers (&fn_table); -#ifdef TARGET_WASM +#ifdef TARGET_WASM mini_wasm_debugger_add_function_pointers (&fn_table); -#endif +#endif return &fn_table; } diff --git a/src/mono/mono/component/hot_reload.c b/src/mono/mono/component/hot_reload.c index e44ae56e5f4afe..155dcdf6f2c9ab 100644 --- a/src/mono/mono/component/hot_reload.c +++ b/src/mono/mono/component/hot_reload.c @@ -87,7 +87,7 @@ hot_reload_table_bounds_check (MonoImage *base_image, int table_index, int token static gboolean hot_reload_delta_heap_lookup (MonoImage *base_image, MetadataHeapGetterFunc get_heap, uint32_t orig_index, MonoImage **image_out, uint32_t *index_out); -static gpointer +static gpointer hot_reload_get_updated_method_ppdb (MonoImage *base_image, uint32_t idx); static gboolean @@ -188,14 +188,14 @@ static MonoNativeTlsKey exposed_generation_id; * In each delta, the physical tables contain the rows that modify existing rows of a prior generation, * followed by inserted rows. * https://github.com/dotnet/runtime/blob/6072e4d3a7a2a1493f514cdf4be75a3d56580e84/src/libraries/System.Reflection.Metadata/src/System/Reflection/Metadata/Ecma335/MetadataAggregator.cs#L324 - * + * * The total logical number of rows in a table for a particular generation is * prev_gen_rows + inserted_rows. */ typedef struct _delta_row_count { guint32 prev_gen_rows; guint32 modified_rows; - guint32 inserted_rows; + guint32 inserted_rows; } delta_row_count; /* Additional informaiton for MonoImages representing deltas */ @@ -212,7 +212,7 @@ struct _DeltaInfo { // for each table, the row in the EncMap table that has the first token for remapping it? uint32_t enc_recs [MONO_TABLE_NUM]; delta_row_count count [MONO_TABLE_NUM]; - + MonoPPDBFile *ppdb_file; MonoMemPool *pool; /* mutated tables are allocated here */ @@ -1607,7 +1607,7 @@ set_update_method (MonoImage *image_base, BaselineInfo *base_info, uint32_t gene /* FIXME: this is a race if other threads are doing a lookup. */ g_hash_table_insert (base_info->method_table_update, GUINT_TO_POINTER (token_index), GUINT_TO_POINTER (generation)); g_hash_table_insert (delta_info->method_table_update, GUINT_TO_POINTER (token_index), (gpointer) il_address); - set_delta_method_debug_info (delta_info, token_index, pdb_address); + set_delta_method_debug_info (delta_info, token_index, pdb_address); } static MonoDebugInformationEnc * @@ -1813,7 +1813,7 @@ apply_enclog_pass2 (MonoImage *image_base, BaselineInfo *base_info, uint32_t gen if (!delta_info->method_table_update) delta_info->method_table_update = g_hash_table_new (g_direct_hash, g_direct_equal); if (!delta_info->method_ppdb_table_update) - + delta_info->method_ppdb_table_update = g_hash_table_new (g_direct_hash, g_direct_equal); int mapped_token = hot_reload_relative_delta_index (image_dmeta, delta_info, mono_metadata_make_token (token_table, token_index)); @@ -2089,7 +2089,7 @@ get_method_update_rva (MonoImage *image_base, BaselineInfo *base_info, uint32_t gpointer loc = NULL; uint32_t cur = hot_reload_get_thread_generation (); int generation = -1; - + /* Go through all the updates that the current thread can see and see * if they updated the method. Keep the latest visible update */ for (GList *ptr = base_info->delta_info; ptr != NULL; ptr = ptr->next) { @@ -2117,7 +2117,7 @@ get_method_update_rva (MonoImage *image_base, BaselineInfo *base_info, uint32_t return loc; } -gpointer +gpointer hot_reload_get_updated_method_ppdb (MonoImage *base_image, uint32_t idx) { BaselineInfo *info = baseline_info_lookup (base_image); diff --git a/src/mono/mono/component/mini-wasm-debugger.c b/src/mono/mono/component/mini-wasm-debugger.c index 81a2011e1ef546..33728e8ca06092 100644 --- a/src/mono/mono/component/mini-wasm-debugger.c +++ b/src/mono/mono/component/mini-wasm-debugger.c @@ -174,7 +174,7 @@ mono_wasm_debugger_init (void) mono_profiler_set_domain_loaded_callback (prof, appdomain_load); mono_profiler_set_assembly_loaded_callback (prof, assembly_loaded); -//debugger-agent initialization +//debugger-agent initialization DebuggerTransport trans; trans.name = "buffer-wasm-communication"; trans.send = receive_debugger_agent_message; @@ -202,7 +202,7 @@ assembly_loaded (MonoProfiler *prof, MonoAssembly *assembly) MonoDebugHandle *handle = mono_debug_get_handle (assembly_image); if (handle) { MonoPPDBFile *ppdb = handle->ppdb; - if (ppdb && !mono_ppdb_is_embedded (ppdb)) { //if it's an embedded pdb we don't need to send pdb extrated to DebuggerProxy. + if (ppdb && !mono_ppdb_is_embedded (ppdb)) { //if it's an embedded pdb we don't need to send pdb extrated to DebuggerProxy. pdb_image = mono_ppdb_get_image (ppdb); mono_wasm_asm_loaded (assembly_image->assembly_name, assembly_image->raw_data, assembly_image->raw_data_len, pdb_image->raw_data, pdb_image->raw_data_len); return; @@ -339,7 +339,7 @@ write_value_to_buffer (MdbgProtBuffer *buf, MonoTypeEnum type, const char* varia return TRUE; } -EMSCRIPTEN_KEEPALIVE void +EMSCRIPTEN_KEEPALIVE void mono_wasm_set_is_debugger_attached (gboolean is_attached) { mono_set_is_debugger_attached (is_attached); @@ -357,7 +357,7 @@ mono_wasm_set_is_debugger_attached (gboolean is_attached) extern void mono_wasm_add_dbg_command_received(mono_bool res_ok, int id, void* buffer, int buffer_len); -EMSCRIPTEN_KEEPALIVE gboolean +EMSCRIPTEN_KEEPALIVE gboolean mono_wasm_send_dbg_command_with_parms (int id, MdbgProtCommandSet command_set, int command, guint8* data, unsigned int size, int valtype, char* newvalue) { if (!debugger_enabled) { @@ -378,7 +378,7 @@ mono_wasm_send_dbg_command_with_parms (int id, MdbgProtCommandSet command_set, i return TRUE; } -EMSCRIPTEN_KEEPALIVE gboolean +EMSCRIPTEN_KEEPALIVE gboolean mono_wasm_send_dbg_command (int id, MdbgProtCommandSet command_set, int command, guint8* data, unsigned int size) { if (!debugger_enabled) { @@ -392,7 +392,7 @@ mono_wasm_send_dbg_command (int id, MdbgProtCommandSet command_set, int command, buffer_init (&buf, 128); gboolean no_reply; MdbgProtErrorCode error = 0; - if (command_set == MDBGPROT_CMD_SET_VM && command == MDBGPROT_CMD_VM_INVOKE_METHOD ) + if (command_set == MDBGPROT_CMD_SET_VM && command == MDBGPROT_CMD_VM_INVOKE_METHOD ) { DebuggerTlsData* tls = mono_wasm_get_tls (); InvokeData invoke_data; @@ -409,12 +409,12 @@ mono_wasm_send_dbg_command (int id, MdbgProtCommandSet command_set, int command, return TRUE; } -static gboolean +static gboolean receive_debugger_agent_message (void *data, int len) { mono_wasm_add_dbg_command_received(1, -1, data, len); mono_wasm_save_thread_context(); - mono_wasm_fire_debugger_agent_message (); + mono_wasm_fire_debugger_agent_message (); return FALSE; } diff --git a/src/mono/mono/eglib/garray.c b/src/mono/mono/eglib/garray.c index 97df96736a14f5..212179043bb03a 100644 --- a/src/mono/mono/eglib/garray.c +++ b/src/mono/mono/eglib/garray.c @@ -46,20 +46,20 @@ static void ensure_capacity (GArrayPriv *priv, guint capacity) { guint new_capacity; - + if (capacity <= priv->capacity) return; - + new_capacity = (capacity + (capacity >> 1) + 63) & ~63; - + priv->array.data = g_realloc (priv->array.data, element_length (priv, new_capacity)); - + if (priv->clear_) { memset (element_offset (priv, priv->capacity), 0, element_length (priv, new_capacity - priv->capacity)); } - + priv->capacity = new_capacity; } @@ -122,7 +122,7 @@ g_array_append_vals (GArray *array, g_return_val_if_fail (array != NULL, NULL); ensure_capacity (priv, priv->array.len + len + (priv->zero_terminated ? 1 : 0)); - + memmove (element_offset (priv, priv->array.len), data, element_length (priv, len)); @@ -150,7 +150,7 @@ g_array_insert_vals (GArray *array, g_return_val_if_fail (array != NULL, NULL); ensure_capacity (priv, array->len + len + extra); - + /* first move the existing elements out of the way */ memmove (element_offset (priv, index_ + len), element_offset (priv, index_), diff --git a/src/mono/mono/eglib/gdir-unix.c b/src/mono/mono/eglib/gdir-unix.c index fe27306f6252af..10b15e7bc24e42 100644 --- a/src/mono/mono/eglib/gdir-unix.c +++ b/src/mono/mono/eglib/gdir-unix.c @@ -112,16 +112,16 @@ g_mkdir_with_parents (const gchar *pathname, int mode) { char *path, *d; int rv; - + if (!pathname || *pathname == '\0') { mono_set_errno (EINVAL); return -1; } - + d = path = g_strdup (pathname); if (*d == '/') d++; - + while (TRUE) { if (*d == '/' || *d == '\0') { char orig = *d; @@ -141,8 +141,8 @@ g_mkdir_with_parents (const gchar *pathname, int mode) d++; } } - + g_free (path); - + return 0; } diff --git a/src/mono/mono/eglib/gdir-win32.c b/src/mono/mono/eglib/gdir-win32.c index 5683c499236af2..30004642361fd8 100644 --- a/src/mono/mono/eglib/gdir-win32.c +++ b/src/mono/mono/eglib/gdir-win32.c @@ -127,7 +127,7 @@ void g_dir_close (GDir *dir) { g_return_if_fail (dir != NULL && dir->handle != 0); - + if (dir->current) g_free (dir->current); dir->current = NULL; diff --git a/src/mono/mono/eglib/gerror.c b/src/mono/mono/eglib/gerror.c index f767f95bc27115..b68d4ccb4121ad 100644 --- a/src/mono/mono/eglib/gerror.c +++ b/src/mono/mono/eglib/gerror.c @@ -35,13 +35,13 @@ g_error_new (gpointer domain, gint code, const char *format, ...) { va_list args; GError *err = g_new (GError, 1); - + err->domain = domain; err->code = code; va_start (args, format); if (g_vasprintf (&err->message, format, args) == -1) - err->message = g_strdup_printf ("internal: invalid format string %s", format); + err->message = g_strdup_printf ("internal: invalid format string %s", format); va_end (args); return err; @@ -51,12 +51,12 @@ static GError * g_error_vnew (gpointer domain, gint code, const char *format, va_list ap) { GError *err = g_new (GError, 1); - + err->domain = domain; err->code = code; if (g_vasprintf (&err->message, format, ap) == -1) - err->message = g_strdup_printf ("internal: invalid format string %s", format); + err->message = g_strdup_printf ("internal: invalid format string %s", format); return err; } @@ -75,7 +75,7 @@ g_error_free (GError *gerror) { if (!gerror) return; - + g_free (gerror->message); g_free (gerror); } diff --git a/src/mono/mono/eglib/gfile-win32.c b/src/mono/mono/eglib/gfile-win32.c index f7195444860f54..2d86027d164fc5 100644 --- a/src/mono/mono/eglib/gfile-win32.c +++ b/src/mono/mono/eglib/gfile-win32.c @@ -94,14 +94,14 @@ g_file_test (const gchar *filename, GFileTest test) { gunichar2* utf16_filename = NULL; DWORD attr; - + if (filename == NULL || test == 0) return FALSE; utf16_filename = u8to16 (filename); attr = GetFileAttributesW (utf16_filename); g_free (utf16_filename); - + if (attr == INVALID_FILE_ATTRIBUTES) return FALSE; diff --git a/src/mono/mono/eglib/gfile.c b/src/mono/mono/eglib/gfile.c index a0222ccbbd3c66..75f9ccfa47cf45 100644 --- a/src/mono/mono/eglib/gfile.c +++ b/src/mono/mono/eglib/gfile.c @@ -117,41 +117,41 @@ g_file_set_contents (const gchar *filename, const gchar *contents, gssize length const char *name; char *path; FILE *fp; - + if (!(name = strrchr (filename, G_DIR_SEPARATOR))) name = filename; else name++; - + path = g_strdup_printf (TMP_FILE_FORMAT, (int)(name - filename), filename, name); if (!(fp = fopen (path, "wb"))) { g_set_error (err, G_FILE_ERROR, g_file_error_from_errno (errno), "%s", g_strerror (errno)); g_free (path); return FALSE; } - + if (length < 0) length = strlen (contents); - + if (fwrite (contents, 1, length, fp) < length) { g_set_error (err, G_FILE_ERROR, g_file_error_from_errno (ferror (fp)), "%s", g_strerror (ferror (fp))); g_unlink (path); g_free (path); fclose (fp); - + return FALSE; } - + fclose (fp); - + if (g_rename (path, filename) != 0) { g_set_error (err, G_FILE_ERROR, g_file_error_from_errno (errno), "%s", g_strerror (errno)); g_unlink (path); g_free (path); return FALSE; } - + g_free (path); - + return TRUE; } diff --git a/src/mono/mono/eglib/glist.c b/src/mono/mono/eglib/glist.c index 9fe17481338577..6a05f96a511e3b 100644 --- a/src/mono/mono/eglib/glist.c +++ b/src/mono/mono/eglib/glist.c @@ -12,10 +12,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -185,14 +185,14 @@ g_list_find_custom (GList *list, gconstpointer data, GCompareFunc func) { if (!func) return NULL; - + while (list) { if (func (list->data, data) == 0) return list; - + list = list->next; } - + return NULL; } diff --git a/src/mono/mono/eglib/gmarkup.c b/src/mono/mono/eglib/gmarkup.c index 826854a1ed3460..6639ec2aa83ea9 100644 --- a/src/mono/mono/eglib/gmarkup.c +++ b/src/mono/mono/eglib/gmarkup.c @@ -87,12 +87,12 @@ void g_markup_parse_context_free (GMarkupParseContext *context) { GSList *l; - + g_return_if_fail (context != NULL); if (context->user_data_dnotify != NULL) (context->user_data_dnotify) (context->user_data); - + if (context->text != NULL) g_string_free (context->text, TRUE); for (l = context->level; l; l = l->next) @@ -159,7 +159,7 @@ parse_value (const char *p, const char *end, char **value, GError **gerror) { const char *start; int l; - + if (*p != '"'){ set_error ("%s", "Expected the attribute value to start with a quote"); return end; @@ -184,7 +184,7 @@ parse_name (const char *p, const char *end, char **value) { const char *start = p; int l; - + if (p < end && my_isnamestartchar (*p)) for (; p < end && my_isnamechar (*p); p++) ; @@ -209,22 +209,22 @@ parse_attributes (const char *p, const char *end, char ***names, char ***values, p = skip_space (p, end); if (p == end) return end; - + if (*p == '>'){ *full_stop = 0; - return p; + return p; } if (state == SKIP_XML_DECLARATION && *p == '?' && ((p+1) < end) && *(p+1) == '>'){ *full_stop = 0; return p+1; } - + if (*p == '/' && ((p+1) < end && *(p+1) == '>')){ *full_stop = 1; return p+1; } else { char *name, *value; - + p = parse_name (p, end, &name); if (p == end) return p; @@ -258,9 +258,9 @@ parse_attributes (const char *p, const char *end, char ***names, char ***values, (*names) [nnames-1] = name; (*values) [nnames-1] = value; (*names) [nnames] = NULL; - (*values) [nnames] = NULL; + (*values) [nnames] = NULL; } - } + } } static void @@ -270,7 +270,7 @@ destroy_parse_state (GMarkupParseContext *context) for (p = context->level; p != NULL; p = p->next) g_free (p->data); - + g_slist_free (context->level); if (context->text != NULL) g_string_free (context->text, TRUE); @@ -284,13 +284,13 @@ g_markup_parse_context_parse (GMarkupParseContext *context, GError **gerror) { const char *p, *end; - + g_return_val_if_fail (context != NULL, FALSE); g_return_val_if_fail (text != NULL, FALSE); g_return_val_if_fail (text_len >= 0, FALSE); end = text + text_len; - + for (p = text; p < end; p++){ char c = *p; @@ -328,12 +328,12 @@ g_markup_parse_context_parse (GMarkupParseContext *context, p += 2; break; } - + if (!my_isnamestartchar (*p)){ set_error ("%s", "Expected an element name"); goto fail; } - + for (++p; p < end && my_isnamechar (*p); p++) ; if (p == end){ @@ -341,7 +341,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context, goto fail; } element_end = p; - + for (; p < end && my_isspace (*p); p++) ; if (p == end){ @@ -382,7 +382,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context, g_free (ename); goto fail; } - + if (full_stop){ if (context->parser.end_element != NULL && context->state == START_ELEMENT){ context->parser.end_element (context, ename, context->user_data, gerror); @@ -395,7 +395,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context, } else { context->level = g_slist_prepend (context->level, ename); } - + context->state = TEXT; break; } /* case START_ELEMENT */ @@ -422,7 +422,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context, break; } break; - + case FLUSH_TEXT: if (context->parser.text != NULL && context->text != NULL){ context->parser.text (context, context->text->str, context->text->len, @@ -430,7 +430,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context, if (gerror != NULL && *gerror != NULL) goto fail; } - + if (c == '/') context->state = CLOSING_ELEMENT; else { @@ -447,7 +447,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context, set_error ("%s", "Too many closing tags, not enough open tags"); goto fail; } - + text = (char*)current->data; if (context->parser.end_element != NULL){ context->parser.end_element (context, text, context->user_data, gerror); @@ -460,13 +460,13 @@ g_markup_parse_context_parse (GMarkupParseContext *context, while (p < end && *p != '>') p++; - + context->level = context->level->next; g_slist_free_1 (current); context->state = TEXT; break; } /* case CLOSING_ELEMENT */ - + } /* switch */ } @@ -475,7 +475,7 @@ g_markup_parse_context_parse (GMarkupParseContext *context, fail: if (context->parser.error && gerror != NULL && *gerror) context->parser.error (context, *gerror, context->user_data); - + destroy_parse_state (context); return FALSE; } diff --git a/src/mono/mono/eglib/gmem.c b/src/mono/mono/eglib/gmem.c index 11d117bb60944e..b50a241571504e 100644 --- a/src/mono/mono/eglib/gmem.c +++ b/src/mono/mono/eglib/gmem.c @@ -111,14 +111,14 @@ gpointer g_realloc (gpointer obj, gsize size) g_error ("Could not allocate %i bytes", size); } -gpointer -g_malloc (gsize x) -{ +gpointer +g_malloc (gsize x) +{ gpointer ptr; if (!x) return 0; ptr = G_MALLOC_INTERNAL (x); - if (ptr) + if (ptr) return ptr; g_error ("Could not allocate %i bytes", x); } @@ -133,12 +133,12 @@ gpointer g_calloc (gsize n, gsize x) return ptr; g_error ("Could not allocate %i (%i * %i) bytes", x*n, n, x); } -gpointer g_malloc0 (gsize x) -{ +gpointer g_malloc0 (gsize x) +{ return g_calloc (1,x); } -gpointer g_try_malloc (gsize x) +gpointer g_try_malloc (gsize x) { if (x) return G_MALLOC_INTERNAL (x); @@ -147,10 +147,10 @@ gpointer g_try_malloc (gsize x) gpointer g_try_realloc (gpointer obj, gsize size) -{ +{ if (!size) { G_FREE_INTERNAL (obj); return 0; - } + } return G_REALLOC_INTERNAL (obj, size); } diff --git a/src/mono/mono/eglib/gmisc-unix.c b/src/mono/mono/eglib/gmisc-unix.c index 2630d515fda5f8..0c8ec6bec8d478 100644 --- a/src/mono/mono/eglib/gmisc-unix.c +++ b/src/mono/mono/eglib/gmisc-unix.c @@ -43,8 +43,8 @@ static pthread_mutex_t env_lock = PTHREAD_MUTEX_INITIALIZER; /* MONO Comment - * - * As per the UNIX spec, + * + * As per the UNIX spec, * "The return value from getenv() may point to static data which may be overwritten by subsequent calls to getenv(), setenv(), or unsetenv()." * Source: Unix Manual Pages for getenv, IEEE Std 1003.1 * @@ -56,7 +56,7 @@ static pthread_mutex_t env_lock = PTHREAD_MUTEX_INITIALIZER; * g_getenv does not mimic the behavior of POSIX getenv anymore. * * The memory address returned will be unique to the invocaton, and must be freed. - * */ + * */ gchar * g_getenv (const gchar *variable) { diff --git a/src/mono/mono/eglib/gmisc-win32.c b/src/mono/mono/eglib/gmisc-win32.c index 82860a575ed12d..0c2f6e12f2a4dd 100644 --- a/src/mono/mono/eglib/gmisc-win32.c +++ b/src/mono/mono/eglib/gmisc-win32.c @@ -48,7 +48,7 @@ g_getenv(const gchar *variable) gchar* val = NULL; gint32 buffer_size = 1024; gint32 retval; - var = u8to16(variable); + var = u8to16(variable); // FIXME This should loop in case another thread is growing the data. buffer = g_new (gunichar2, buffer_size); retval = GetEnvironmentVariableW (var, buffer, buffer_size); @@ -68,7 +68,7 @@ g_getenv(const gchar *variable) } g_free(var); g_free(buffer); - return val; + return val; } gboolean @@ -76,7 +76,7 @@ g_setenv(const gchar *variable, const gchar *value, gboolean overwrite) { gunichar2 *var, *val; gboolean result; - var = u8to16(variable); + var = u8to16(variable); val = u8to16(value); result = (SetEnvironmentVariableW(var, val) != 0) ? TRUE : FALSE; g_free(var); @@ -88,7 +88,7 @@ void g_unsetenv(const gchar *variable) { gunichar2 *var; - var = u8to16(variable); + var = u8to16(variable); SetEnvironmentVariableW(var, L""); g_free(var); } @@ -141,7 +141,7 @@ g_path_is_absolute (const char *filename) (filename[2] == '\\' || filename[2] == '/')) return TRUE; /* UNC paths */ - else if (filename[0] == '\\' && filename[1] == '\\' && + else if (filename[0] == '\\' && filename[1] == '\\' && filename[2] != '\0') return TRUE; } diff --git a/src/mono/mono/eglib/gmodule-unix.c b/src/mono/mono/eglib/gmodule-unix.c index 24b3a3023b114a..bd5cc2648d80e4 100644 --- a/src/mono/mono/eglib/gmodule-unix.c +++ b/src/mono/mono/eglib/gmodule-unix.c @@ -50,7 +50,7 @@ g_module_open (const gchar *file, GModuleFlags flags) int f = 0; GModule *module; void *handle; - + flags &= G_MODULE_BIND_MASK; if ((flags & G_MODULE_BIND_LAZY) != 0) f |= RTLD_LAZY; @@ -60,10 +60,10 @@ g_module_open (const gchar *file, GModuleFlags flags) handle = dlopen (file, f); if (handle == NULL) return NULL; - + module = g_new (GModule,1); module->handle = handle; - + return module; } @@ -167,7 +167,7 @@ g_module_open (const gchar *file, GModuleFlags flags) if (file != NULL) { gunichar2 *file16; - file16 = u8to16(file); + file16 = u8to16(file); module->main_module = FALSE; module->handle = LoadLibrary (file16); g_free(file16); @@ -175,7 +175,7 @@ g_module_open (const gchar *file, GModuleFlags flags) g_free (module); return NULL; } - + } else { module->main_module = TRUE; module->handle = GetModuleHandle (NULL); @@ -257,7 +257,7 @@ g_module_error (void) TCHAR* buf = NULL; DWORD code = GetLastError (); - FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, + FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL, code, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, 0, NULL); ret = u16to8 (buf); @@ -320,15 +320,15 @@ gchar * g_module_build_path (const gchar *directory, const gchar *module_name) { const char *lib_prefix = ""; - + if (module_name == NULL) return NULL; if (strncmp (module_name, "lib", 3) != 0) lib_prefix = LIBPREFIX; - + if (directory && *directory) return g_strdup_printf ("%s/%s%s" LIBSUFFIX, directory, lib_prefix, module_name); - return g_strdup_printf ("%s%s" LIBSUFFIX, lib_prefix, module_name); + return g_strdup_printf ("%s%s" LIBSUFFIX, lib_prefix, module_name); } diff --git a/src/mono/mono/eglib/goutput.c b/src/mono/mono/eglib/goutput.c index 82ba7c09d03d0b..bee7f9446a6b38 100644 --- a/src/mono/mono/eglib/goutput.c +++ b/src/mono/mono/eglib/goutput.c @@ -124,7 +124,7 @@ g_log_set_always_fatal (GLogLevelFlags fatal_mask) GLogLevelFlags old_fatal = fatal; fatal |= fatal_mask; - + return old_fatal; } @@ -147,7 +147,7 @@ g_logstr (const gchar *log_domain, GLogLevelFlags log_level, const gchar *msg) { if (!default_log_func) default_log_func = g_log_default_handler; - + default_log_func (log_domain, log_level, msg, default_log_func_user_data); } diff --git a/src/mono/mono/eglib/gpath.c b/src/mono/mono/eglib/gpath.c index e6ec47b05f1eea..96f67f27388bbd 100644 --- a/src/mono/mono/eglib/gpath.c +++ b/src/mono/mono/eglib/gpath.c @@ -32,7 +32,7 @@ #include #ifdef G_OS_WIN32 -#include +#include #endif #ifdef HAVE_UNISTD_H @@ -47,45 +47,45 @@ g_build_path (const gchar *separator, const gchar *first_element, ...) GString *path; va_list args; size_t slen; - + g_return_val_if_fail (separator != NULL, NULL); - + path = g_string_sized_new (48); slen = strlen (separator); - + va_start (args, first_element); for (elem = first_element; elem != NULL; elem = next) { /* trim any trailing separators from @elem */ endptr = elem + strlen (elem); trimmed = FALSE; - + while (endptr >= elem + slen) { if (strncmp (endptr - slen, separator, slen) != 0) break; - + endptr -= slen; trimmed = TRUE; } - + /* append elem, not including any trailing separators */ if (endptr > elem) g_string_append_len (path, elem, endptr - elem); - + /* get the next element */ do { if (!(next = va_arg (args, char *))) break; - + /* remove leading separators */ while (!strncmp (next, separator, slen)) next += slen; } while (*next == '\0'); - + if (next || trimmed) g_string_append_len (path, separator, slen); } va_end (args); - + return g_string_free (path, FALSE); } @@ -149,7 +149,7 @@ g_path_get_basename (const char *filename) r = strrchr_seperator (copy); if (r == NULL){ - g_free (copy); + g_free (copy); return g_strdup ("/"); } r = g_strdup (&r[1]); @@ -170,10 +170,10 @@ strtok_r(char *s, const char *delim, char **last) char *spanp; int c, sc; char *tok; - + if (s == NULL && (s = *last) == NULL) return NULL; - + /* * Skip (span) leading delimiters (s += strspn(s, delim), sort of). */ @@ -247,8 +247,8 @@ g_find_program_in_path (const gchar *program) #endif while ((l = strtok_r (x, G_SEARCHPATH_SEPARATOR_S, &save)) != NULL){ - char *probe_path; - + char *probe_path; + x = NULL; probe_path = g_build_path (G_DIR_SEPARATOR_S, l, program, NULL); #ifdef HAVE_ACCESS @@ -309,7 +309,7 @@ g_ensure_directory_exists (const gchar *filename) gunichar2 *p; gunichar2 *dir_utf16 = NULL; int retval; - + if (!dir_utf8 || !dir_utf8 [0]) return FALSE; @@ -332,7 +332,7 @@ g_ensure_directory_exists (const gchar *filename) p = dir_utf16; /* get past C:\ )*/ - while (*p++ != '\\') + while (*p++ != '\\') { } @@ -349,7 +349,7 @@ g_ensure_directory_exists (const gchar *filename) break; *p++ = '\\'; } - + g_free (dir_utf16); return TRUE; #else @@ -357,17 +357,17 @@ g_ensure_directory_exists (const gchar *filename) gchar *dir = g_path_get_dirname (filename); int retval; struct stat sbuf; - + if (!dir || !dir [0]) { g_free (dir); return FALSE; } - + if (stat (dir, &sbuf) == 0 && S_ISDIR (sbuf.st_mode)) { g_free (dir); return TRUE; } - + p = dir; while (*p == '/') p++; @@ -385,7 +385,7 @@ g_ensure_directory_exists (const gchar *filename) break; *p++ = '/'; } - + g_free (dir); return TRUE; #endif diff --git a/src/mono/mono/eglib/gpattern.c b/src/mono/mono/eglib/gpattern.c index 1bece4df7726e9..1ddbdb18f6263a 100644 --- a/src/mono/mono/eglib/gpattern.c +++ b/src/mono/mono/eglib/gpattern.c @@ -176,7 +176,7 @@ match_string (GSList *list, const gchar *str, size_t idx, size_t max) idx += len; list = list->next; if (list) { - /* + /* * When recursing, we need this to avoid returning FALSE * because 'list' will not be NULL */ diff --git a/src/mono/mono/eglib/gptrarray.c b/src/mono/mono/eglib/gptrarray.c index 18509bc4accf3e..a22288b09895ee 100644 --- a/src/mono/mono/eglib/gptrarray.c +++ b/src/mono/mono/eglib/gptrarray.c @@ -37,7 +37,7 @@ typedef struct _GPtrArrayPriv { guint size; } GPtrArrayPriv; -static void +static void g_ptr_array_grow(GPtrArrayPriv *array, guint length) { g_assert (array); @@ -93,7 +93,7 @@ g_ptr_array_free(GPtrArray *array, gboolean free_seg) } g_free(array); - + return data; } @@ -104,7 +104,7 @@ g_ptr_array_set_size(GPtrArray *array, gint length) if((size_t)length > array->len) { g_ptr_array_grow((GPtrArrayPriv *)array, length); - memset(array->pdata + array->len, 0, (length - array->len) + memset(array->pdata + array->len, 0, (length - array->len) * sizeof(gpointer)); } @@ -133,7 +133,7 @@ g_ptr_array_remove_index(GPtrArray *array, guint index) g_memmove(array->pdata + index, array->pdata + index + 1, (array->len - index - 1) * sizeof(gpointer)); } - + array->len--; array->pdata[array->len] = NULL; @@ -199,7 +199,7 @@ g_ptr_array_remove_fast(GPtrArray *array, gpointer data) return FALSE; } -void +void g_ptr_array_foreach(GPtrArray *array, GFunc func, gpointer user_data) { guint i; @@ -220,7 +220,7 @@ void g_ptr_array_sort_with_data (GPtrArray *array, GCompareDataFunc compare, gpointer user_data) { g_assert (array); - + g_qsort_with_data (array->pdata, array->len, sizeof (gpointer), compare, user_data); } diff --git a/src/mono/mono/eglib/gqsort.c b/src/mono/mono/eglib/gqsort.c index cbc9089d331754..f06a3e2efe043b 100644 --- a/src/mono/mono/eglib/gqsort.c +++ b/src/mono/mono/eglib/gqsort.c @@ -73,85 +73,85 @@ g_qsort_with_data (gpointer base, size_t nmemb, size_t size, GCompareDataFunc co size_t n, n1, n2; char *lo, *hi; int swaplong; - + if (nmemb <= 1) return; - + SWAP_INIT (); - + /* initialize our stack */ sp = stack; QSORT_PUSH (sp, base, nmemb); - + do { QSORT_POP (sp, lo, n); - + hi = lo + (n - 1) * size; - + if (n < MAX_THRESHOLD) { /* switch to insertion sort */ for (i = lo + size; i <= hi; i += size) for (k = i; k > lo && compare (k - size, k, user_data) > 0; k -= size) SWAP (k - size, k); - + continue; } - + /* calculate the middle element */ mid = lo + (n / 2) * size; - + /* once we re-order the lo, mid, and hi elements to be in * ascending order, we'll use mid as our pivot. */ if (compare (mid, lo, user_data) < 0) { SWAP (mid, lo); } - + if (compare (hi, mid, user_data) < 0) { SWAP (mid, hi); if (compare (mid, lo, user_data) < 0) { SWAP (mid, lo); } } - + /* since we've already guaranteed that lo <= mid and mid <= hi, * we can skip comparing them again */ i = lo + size; k = hi - size; - + do { /* find the first element with a value > pivot value */ while (i < k && compare (i, mid, user_data) <= 0) i += size; - + /* find the last element with a value <= pivot value */ while (k >= i && compare (mid, k, user_data) < 0) k -= size; - + if (k <= i) break; - + SWAP (i, k); - + /* make sure we keep track of our pivot element */ if (mid == i) { mid = k; } else if (mid == k) { mid = i; } - + i += size; k -= size; } while (1); - + if (k != mid) { /* swap the pivot with the last element in the first partition */ SWAP (mid, k); } - + /* calculate segment sizes */ n2 = (hi - k) / size; n1 = (k - lo) / size; - + /* push our partitions onto the stack, largest first * (to make sure we don't run out of stack space) */ if (n2 > n1) { diff --git a/src/mono/mono/eglib/gqueue.c b/src/mono/mono/eglib/gqueue.c index f9bba47aee4ba1..adf5700b7c5df3 100644 --- a/src/mono/mono/eglib/gqueue.c +++ b/src/mono/mono/eglib/gqueue.c @@ -12,10 +12,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -58,7 +58,7 @@ g_queue_is_empty (GQueue *queue) { if (!queue) return TRUE; - + return queue->length == 0; } @@ -67,9 +67,9 @@ g_queue_push_head (GQueue *queue, gpointer head) { if (!queue) return; - + queue->head = g_list_prepend (queue->head, head); - + if (!queue->tail) queue->tail = queue->head; @@ -101,12 +101,12 @@ g_queue_free (GQueue *queue) { if (!queue) return; - + g_list_free (queue->head); g_free (queue); } -void +void g_queue_foreach (GQueue *queue, GFunc func, gpointer user_data) { g_list_foreach (queue->head, func, user_data); diff --git a/src/mono/mono/eglib/gshell.c b/src/mono/mono/eglib/gshell.c index 820ac46c2fff8d..5fdf99d35c0949 100644 --- a/src/mono/mono/eglib/gshell.c +++ b/src/mono/mono/eglib/gshell.c @@ -64,7 +64,7 @@ split_cmdline (const gchar *cmdline, GPtrArray *array, GError **gerror) } } else if (c == '\\' && quote_char == '\"'){ escaped = TRUE; - } else + } else g_string_append_c (str, c); } else if (g_ascii_isspace (c)) { if (str->len > 0) { @@ -150,7 +150,7 @@ g_shell_quote (const gchar *unquoted_string) { GString *result = g_string_new ("'"); const gchar *p; - + for (p = unquoted_string; *p; p++){ if (*p == '\'') g_string_append (result, "'\\'"); @@ -169,7 +169,7 @@ g_shell_unquote (const gchar *quoted_string, GError **gerror) if (quoted_string == NULL) return NULL; - + /* Quickly try to determine if we need to unquote or not */ for (p = quoted_string; *p; p++){ if (*p == '\'' || *p == '"' || *p == '\\'){ @@ -177,7 +177,7 @@ g_shell_unquote (const gchar *quoted_string, GError **gerror) break; } } - + if (!do_unquote) return g_strdup (quoted_string); @@ -217,7 +217,7 @@ g_shell_unquote (const gchar *quoted_string, GError **gerror) g_string_append_c (result, '\\'); break; } - } + } g_string_append_c (result, *p); } if (!*p){ @@ -257,8 +257,8 @@ char *args [] = { "\\\\", "'\\\\'", "\"f\\$\"\\\"\\\\", // /\\\"\\\\" - "'f\\$'\\\"\\\\", - "'f\\$\\\\'", + "'f\\$'\\\"\\\\", + "'f\\$\\\\'", NULL }; @@ -268,12 +268,12 @@ main () { char **s = args; int i; - + while (*s){ char *r1 = g_shell_unquote (*s, NULL); char *r2 = g2_shell_unquote (*s, NULL); char *ok = r1 == r2 ? "ok" : (r1 != NULL && r2 != NULL && strcmp (r1, r2) == 0) ? "ok" : "fail"; - + printf ("%s [%s] -> [%s] - [%s]\n", ok, *s, r1, r2); s++; } @@ -283,7 +283,7 @@ main () buffer [1] = '\\'; buffer [3] = '\"'; buffer [4] = 0; - + for (i = 32; i < 255; i++){ buffer [2] = i; printf ("%d [%s] -> [%s]\n", i, buffer, g_shell_unquote (buffer, NULL)); diff --git a/src/mono/mono/eglib/gslist.c b/src/mono/mono/eglib/gslist.c index 65744eaa73b72b..71cd6dfd972e97 100644 --- a/src/mono/mono/eglib/gslist.c +++ b/src/mono/mono/eglib/gslist.c @@ -12,10 +12,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -60,7 +60,7 @@ g_slist_prepend (GSList *list, gpointer data) } /* - * Insert the given data in a new node after the current node. + * Insert the given data in a new node after the current node. * Return new node. */ static GSList * @@ -186,14 +186,14 @@ g_slist_find_custom (GSList *list, gconstpointer data, GCompareFunc func) { if (!func) return NULL; - + while (list) { if (func (list->data, data) == 0) return list; - + list = list->next; } - + return NULL; } @@ -299,7 +299,7 @@ GSList* g_slist_insert_sorted (GSList *list, gpointer data, GCompareFunc func) { GSList *prev = NULL; - + if (!func) return list; @@ -320,15 +320,15 @@ gint g_slist_index (GSList *list, gconstpointer data) { gint index = 0; - + while (list) { if (list->data == data) return index; - + index++; list = list->next; } - + return -1; } diff --git a/src/mono/mono/eglib/gspawn.c b/src/mono/mono/eglib/gspawn.c index 03711f9affd060..7dc6fbcd8c7fff 100644 --- a/src/mono/mono/eglib/gspawn.c +++ b/src/mono/mono/eglib/gspawn.c @@ -84,9 +84,9 @@ mono_close_pipe (int p [2]) #if defined(__APPLE__) #if defined (TARGET_OSX) -/* Apple defines this in crt_externs.h but doesn't provide that header for +/* Apple defines this in crt_externs.h but doesn't provide that header for * arm-apple-darwin9. We'll manually define the symbol on Apple as it does - * in fact exist on all implementations (so far) + * in fact exist on all implementations (so far) */ G_BEGIN_DECLS gchar ***_NSGetEnviron(void); @@ -131,12 +131,12 @@ read_pipes (int outfd, gchar **out_str, int errfd, gchar **err_str, GError **ger if (out_str) { *out_str = NULL; out = g_string_new (""); - } + } if (err_str) { *err_str = NULL; err = g_string_new (""); - } + } do { if (out_closed && err_closed) @@ -208,18 +208,18 @@ write_all (int fd, const void *vbuf, size_t n) const char *buf = (const char *) vbuf; size_t nwritten = 0; int w; - + do { do { w = write (fd, buf + nwritten, n - nwritten); } while (w == -1 && errno == EINTR); - + if (w == -1) return -1; - + nwritten += w; } while (nwritten < n); - + return nwritten; } @@ -264,7 +264,7 @@ g_spawn_command_line_sync (const gchar *command_line, int stderr_pipe [2] = { -1, -1 }; int status; int res; - + if (!g_shell_parse_argv (command_line, &argc, &argv, gerror)) return FALSE; diff --git a/src/mono/mono/eglib/gstr.c b/src/mono/mono/eglib/gstr.c index cbf63d8f02b979..8e03bf7e2e4655 100644 --- a/src/mono/mono/eglib/gstr.c +++ b/src/mono/mono/eglib/gstr.c @@ -38,9 +38,9 @@ #include -/* - * g_strndup and g_vasprintf need to allocate memory with g_malloc if - * ENABLE_OVERRIDABLE_ALLOCATORS is defined so that it can be safely freed with g_free +/* + * g_strndup and g_vasprintf need to allocate memory with g_malloc if + * ENABLE_OVERRIDABLE_ALLOCATORS is defined so that it can be safely freed with g_free * rather than free. */ @@ -71,7 +71,7 @@ gint g_vasprintf (gchar **ret, const gchar *fmt, va_list ap) int len; size_t buflen; va_list ap2; - + #if defined(_MSC_VER) || defined(__MINGW64_VERSION_MAJOR) ap2 = ap; len = _vscprintf(fmt, ap2); // NOTE MS specific extension ( :-( ) @@ -139,7 +139,7 @@ g_str_has_suffix(const gchar *str, const gchar *suffix) { size_t str_length; size_t suffix_length; - + g_return_val_if_fail(str != NULL, FALSE); g_return_val_if_fail(suffix != NULL, FALSE); @@ -156,7 +156,7 @@ g_str_has_prefix(const gchar *str, const gchar *prefix) { size_t str_length; size_t prefix_length; - + g_return_val_if_fail(str != NULL, FALSE); g_return_val_if_fail(prefix != NULL, FALSE); @@ -173,7 +173,7 @@ g_strdup_vprintf (const gchar *format, va_list args) { int n; char *ret; - + n = g_vasprintf (&ret, format, args); if (n == -1) return NULL; @@ -301,7 +301,7 @@ g_strconcat (const gchar *first, ...) len += strlen (s); } va_end (args); - + ret = (char*)g_malloc (len + 1); if (ret == NULL) return NULL; @@ -323,24 +323,24 @@ g_strconcat (const gchar *first, ...) static void add_to_vector (gchar ***vector, int size, gchar *token) { - *vector = *vector == NULL ? + *vector = *vector == NULL ? (gchar **)g_malloc(2 * sizeof(*vector)) : (gchar **)g_realloc(*vector, (size + 1) * sizeof(*vector)); - + (*vector)[size - 1] = token; } -gchar ** +gchar ** g_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens) { const gchar *c; gchar *token, **vector; gint size = 1; - + g_return_val_if_fail (string != NULL, NULL); g_return_val_if_fail (delimiter != NULL, NULL); g_return_val_if_fail (delimiter[0] != 0, NULL); - + if (strncmp (string, delimiter, strlen (delimiter)) == 0) { vector = (gchar **)g_malloc (2 * sizeof(vector)); vector[0] = g_strdup (""); @@ -375,7 +375,7 @@ g_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens) token = g_strdup (c); } } - + add_to_vector (&vector, size, token); size++; } @@ -389,14 +389,14 @@ g_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens) } size++; } - + if (vector == NULL) { vector = (gchar **) g_malloc (2 * sizeof (vector)); vector [0] = NULL; } else if (size > 0) { vector[size - 1] = NULL; } - + return vector; } @@ -409,21 +409,21 @@ charcmp (gchar testchar, const gchar *compare) } compare++; } - + return FALSE; } -gchar ** +gchar ** g_strsplit_set (const gchar *string, const gchar *delimiter, gint max_tokens) { const gchar *c; gchar *token, **vector; gint size = 1; - + g_return_val_if_fail (string != NULL, NULL); g_return_val_if_fail (delimiter != NULL, NULL); g_return_val_if_fail (delimiter[0] != 0, NULL); - + if (charcmp (*string, delimiter)) { vector = (gchar **)g_malloc (2 * sizeof(vector)); vector[0] = g_strdup (""); @@ -442,16 +442,16 @@ g_strsplit_set (const gchar *string, const gchar *delimiter, gint max_tokens) } else { token = g_strndup (c, toklen); } - + c = string + 1; - + add_to_vector (&vector, size, token); size++; } string++; } - + if (max_tokens > 0 && size >= max_tokens) { if (*string) { /* Add the rest of the string as the last element */ @@ -471,14 +471,14 @@ g_strsplit_set (const gchar *string, const gchar *delimiter, gint max_tokens) size++; } } - + if (vector == NULL) { vector = (gchar **) g_malloc (2 * sizeof (vector)); vector [0] = NULL; } else if (size > 0) { vector[size - 1] = NULL; } - + return vector; } @@ -514,7 +514,7 @@ g_strjoin (const gchar *separator, ...) slen = strlen (separator); else slen = 0; - + len = 0; va_start (args, separator); for (s = va_arg (args, char *); s != NULL; s = va_arg (args, char *)){ @@ -525,7 +525,7 @@ g_strjoin (const gchar *separator, ...) if (len == 0) return g_strdup (""); - + /* Remove the last separator */ if (slen > 0 && len > 0) len -= slen; @@ -549,12 +549,12 @@ g_strjoinv (const gchar *separator, gchar **str_array) { char *res, *r; size_t slen, len, i; - + if (separator != NULL) slen = strlen (separator); else slen = 0; - + len = 0; for (i = 0; str_array [i] != NULL; i++){ len += strlen (str_array [i]); @@ -641,7 +641,7 @@ g_snprintf(gchar *string, gulong n, gchar const *format, ...) { va_list args; gint ret; - + va_start(args, format); ret = vsnprintf(string, n, format, args); va_end(args); @@ -657,7 +657,7 @@ char_needs_encoding (char c) { if (((unsigned char)c) >= 0x80) return TRUE; - + if ((c >= '@' && c <= 'Z') || (c >= 'a' && c <= 'z') || (c >= '&' && c < 0x3b) || @@ -677,7 +677,7 @@ g_filename_to_uri (const gchar *filename, const gchar *hostname, GError **gerror #else const char *uriPrefix = "file://"; #endif - + g_return_val_if_fail (filename != NULL, NULL); if (hostname != NULL) @@ -686,10 +686,10 @@ g_filename_to_uri (const gchar *filename, const gchar *hostname, GError **gerror if (!g_path_is_absolute (filename)){ if (gerror != NULL) *gerror = g_error_new (NULL, 2, "Not an absolute filename"); - + return NULL; } - + n = strlen (uriPrefix) + 1; for (p = filename; *p; p++){ #ifdef G_OS_WIN32 @@ -742,7 +742,7 @@ g_filename_from_uri (const gchar *uri, gchar **hostname, GError **gerror) const char *p; char *r, *result; int flen = 0; - + g_return_val_if_fail (uri != NULL, NULL); if (hostname != NULL) @@ -763,7 +763,7 @@ g_filename_from_uri (const gchar *uri, gchar **hostname, GError **gerror) *gerror = g_error_new (NULL, 2, "URI contains an invalid escape sequence"); return NULL; } - } + } flen++; } #ifndef G_OS_WIN32 @@ -822,16 +822,16 @@ gchar * g_ascii_strdown (const gchar *str, gssize len) { char *ret; - + g_return_val_if_fail (str != NULL, NULL); if (len == -1) len = strlen (str); - + ret = g_malloc (len + 1); g_ascii_strdown_no_alloc (ret, str, len); ret [len] = 0; - + return ret; } @@ -846,17 +846,17 @@ g_ascii_strup (const gchar *str, gssize len) { char *ret; int i; - + g_return_val_if_fail (str != NULL, NULL); if (len == -1) len = strlen (str); - + ret = g_malloc (len + 1); for (i = 0; i < len; i++) ret [i] = g_ascii_toupper (str [i]); ret [i] = 0; - + return ret; } @@ -899,7 +899,7 @@ g_ascii_strncasecmp (const gchar *s1, const gchar *s2, gsize n) if (j) return j; } - + return 0; } @@ -965,7 +965,7 @@ g_strdelimit (gchar *string, gchar delimiter, gchar new_delimiter) } } -gsize +gsize g_strlcpy (gchar *dest, const gchar *src, gsize dest_size) { g_assert (src); @@ -1011,9 +1011,9 @@ g_stpcpy (gchar *dest, const char *src) #else while (*src) *dest++ = *src++; - + *dest = '\0'; - + return dest; #endif } @@ -1128,7 +1128,7 @@ g_str_from_file_region (int fd, guint64 offset, gsize size) char *buffer; off_t loc; int status; - + do { loc = lseek (fd, offset, SEEK_SET); } while (loc == -1 && errno == EINTR); diff --git a/src/mono/mono/eglib/gstring.c b/src/mono/mono/eglib/gstring.c index 403b3ec416736e..de3f0658de4c64 100644 --- a/src/mono/mono/eglib/gstring.c +++ b/src/mono/mono/eglib/gstring.c @@ -78,12 +78,12 @@ gchar * g_string_free (GString *string, gboolean free_segment) { gchar *data; - + g_return_val_if_fail (string != NULL, NULL); data = string->str; g_free(string); - + if(!free_segment) { return data; } @@ -125,7 +125,7 @@ g_string_append_c (GString *string, gchar c) g_return_val_if_fail(string != NULL, NULL); GROW_IF_NECESSARY(string, 1); - + string->str[string->len] = c; string->str[string->len + 1] = 0; string->len++; @@ -138,12 +138,12 @@ g_string_append_unichar (GString *string, gunichar c) { gchar utf8[6]; gint len; - + g_return_val_if_fail (string != NULL, NULL); - + if ((len = g_unichar_to_utf8 (c, utf8)) <= 0) return string; - + return g_string_append_len (string, utf8, len); } @@ -152,7 +152,7 @@ g_string_append_printf (GString *string, const gchar *format, ...) { char *ret; va_list args; - + g_return_if_fail (string != NULL); g_return_if_fail (format != NULL); @@ -181,12 +181,12 @@ void g_string_printf (GString *string, const gchar *format, ...) { va_list args; - + g_return_if_fail (string != NULL); g_return_if_fail (format != NULL); g_free (string->str); - + va_start (args, format); string->str = g_strdup_vprintf (format, args); va_end (args); @@ -203,7 +203,7 @@ g_string_truncate (GString *string, gsize len) /* Silent return */ if (len >= string->len) return string; - + string->len = len; string->str[len] = 0; return string; @@ -215,7 +215,7 @@ g_string_set_size (GString *string, gsize len) g_return_val_if_fail (string != NULL, string); GROW_IF_NECESSARY(string, len); - + string->len = len; string->str[len] = 0; return string; diff --git a/src/mono/mono/eglib/gunicode-win32.c b/src/mono/mono/eglib/gunicode-win32.c index bbae5972f318d1..c402b6301c4e56 100644 --- a/src/mono/mono/eglib/gunicode-win32.c +++ b/src/mono/mono/eglib/gunicode-win32.c @@ -30,7 +30,7 @@ g_get_charset (G_CONST_RETURN char **charset) eg_my_charset = buf; is_utf8 = FALSE; } - + if (charset != NULL) *charset = eg_my_charset; diff --git a/src/mono/mono/eglib/gutf8.c b/src/mono/mono/eglib/gutf8.c index ab6e190b91dfef..8be331aaae774d 100644 --- a/src/mono/mono/eglib/gutf8.c +++ b/src/mono/mono/eglib/gutf8.c @@ -36,13 +36,13 @@ utf8_case_conv (const gchar *str, gssize len, gboolean upper) gunichar *ustr; glong i, ulen; gchar *utf8; - + ustr = g_utf8_to_ucs4_fast (str, (glong) len, &ulen); for (i = 0; i < ulen; i++) ustr[i] = upper ? g_unichar_toupper (ustr[i]) : g_unichar_tolower (ustr[i]); utf8 = g_ucs4_to_utf8 (ustr, ulen, NULL, NULL, NULL); g_free (ustr); - + return utf8; } @@ -63,7 +63,7 @@ utf8_validate (const unsigned char *inptr, size_t len) { const unsigned char *ptr = inptr + len; unsigned char c; - + /* Everything falls through when TRUE... */ switch (len) { default: @@ -71,7 +71,7 @@ utf8_validate (const unsigned char *inptr, size_t len) case 4: if ((c = (*--ptr)) < 0x80 || c > 0xBF) return FALSE; - + if ((c == 0xBF || c == 0xBE) && ptr[-1] == 0xBF) { if (ptr[-2] == 0x8F || ptr[-2] == 0x9F || ptr[-2] == 0xAF || ptr[-2] == 0xBF) @@ -83,7 +83,7 @@ utf8_validate (const unsigned char *inptr, size_t len) case 2: if ((c = (*--ptr)) < 0x80 || c > 0xBF) return FALSE; - + /* no fall-through in this inner switch */ switch (*inptr) { case 0xE0: if (c < 0xA0) return FALSE; break; @@ -97,10 +97,10 @@ utf8_validate (const unsigned char *inptr, size_t len) } case 1: if (*inptr >= 0x80 && *inptr < 0xC2) return FALSE; } - + if (*inptr > 0xF4) return FALSE; - + return TRUE; } @@ -126,10 +126,10 @@ g_utf8_validate (const gchar *str, gssize max_len, const gchar **end) gboolean valid = TRUE; guint length, min; gssize n = 0; - + if (max_len == 0) return FALSE; - + if (max_len < 0) { while (*inptr != 0) { length = g_utf8_jump_table[*inptr]; @@ -137,7 +137,7 @@ g_utf8_validate (const gchar *str, gssize max_len, const gchar **end) valid = FALSE; break; } - + inptr += length; } } else { @@ -148,28 +148,28 @@ g_utf8_validate (const gchar *str, gssize max_len, const gchar **end) valid = FALSE; break; } - + length = g_utf8_jump_table[*inptr]; min = MIN (length, max_len - n); - + if (!utf8_validate (inptr, min)) { valid = FALSE; break; } - + if (min < length) { valid = FALSE; break; } - + inptr += length; n += length; } } - + if (end != NULL) *end = (gchar *) inptr; - + return valid; } @@ -179,10 +179,10 @@ g_utf8_get_char_validated (const gchar *str, gssize max_len) unsigned char *inptr = (unsigned char *) str; gunichar u = *inptr; int n, i; - + if (max_len == 0) return -2; - + if (u < 0x80) { /* simple ascii case */ return u; @@ -206,21 +206,21 @@ g_utf8_get_char_validated (const gchar *str, gssize max_len) } else { return -1; } - + if (max_len > 0) { if (!utf8_validate (inptr, MIN (max_len, n))) return -1; - + if (max_len < n) return -2; } else { if (!utf8_validate (inptr, n)) return -1; } - + for (i = 1; i < n; i++) u = (u << 6) | (*++inptr ^ 0x80); - + return u; } @@ -229,10 +229,10 @@ g_utf8_strlen (const gchar *str, gssize max_len) { const guchar *inptr = (const guchar *) str; glong clen = 0, len = 0, n; - + if (max_len == 0) return 0; - + if (max_len < 0) { while (*inptr) { inptr += g_utf8_jump_table[*inptr]; @@ -243,13 +243,13 @@ g_utf8_strlen (const gchar *str, gssize max_len) n = g_utf8_jump_table[*inptr]; if ((clen + n) > max_len) break; - + inptr += n; clen += n; len++; } } - + return len; } @@ -259,7 +259,7 @@ g_utf8_get_char (const gchar *src) unsigned char *inptr = (unsigned char *) src; gunichar u = *inptr; int n, i; - + if (u < 0x80) { /* simple ascii case */ return u; @@ -279,10 +279,10 @@ g_utf8_get_char (const gchar *src) u &= 0x01; n = 6; } - + for (i = 1; i < n; i++) u = (u << 6) | (*++inptr ^ 0x80); - + return u; } @@ -303,12 +303,12 @@ g_utf8_offset_to_pointer (const gchar *str, glong offset) // since the minimum size of a character is 1 // we know we can step back at least offset bytes jump = jump + offset; - + // if we land in the middle of a character // walk to the beginning while ((*jump & 0xc0) == 0x80) jump --; - + // count how many characters we've actually walked // by going forward p = jump; @@ -316,10 +316,10 @@ g_utf8_offset_to_pointer (const gchar *str, glong offset) p = g_utf8_next_char (p); offset ++; } while (p < jump); - + } while (offset < 0); } - + return (gchar *)p; } @@ -329,10 +329,10 @@ g_utf8_pointer_to_offset (const gchar *str, const gchar *pos) const gchar *inptr, *inend; glong offset = 0; glong sign = 1; - + if (pos == str) return 0; - + if (str < pos) { inptr = str; inend = pos; @@ -341,11 +341,11 @@ g_utf8_pointer_to_offset (const gchar *str, const gchar *pos) inend = str; sign = -1; } - + do { inptr = g_utf8_next_char (inptr); offset++; } while (inptr < inend); - + return offset * sign; } diff --git a/src/mono/mono/eglib/sort.frag.h b/src/mono/mono/eglib/sort.frag.h index 6dc1950ae4e9a9..10ff451d4e6e8a 100644 --- a/src/mono/mono/eglib/sort.frag.h +++ b/src/mono/mono/eglib/sort.frag.h @@ -11,10 +11,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND diff --git a/src/mono/mono/eglib/test/array.c b/src/mono/mono/eglib/test/array.c index 20865dadbe8cb0..305c2f317396b0 100644 --- a/src/mono/mono/eglib/test/array.c +++ b/src/mono/mono/eglib/test/array.c @@ -19,7 +19,7 @@ test_array_big (void) for (i = 0; i < 10000; i++) if (g_array_index (garray, gint, i) != i) return FAILED ("array value didn't match"); - + g_array_free (garray, TRUE); return NULL; @@ -101,7 +101,7 @@ test_array_insert_val (void) g_array_insert_val (array, 2, array); if (array != g_array_index (array, gpointer, 2)) return FAILED ("3 The value in the array is incorrect"); - + g_array_free (array, TRUE); array = g_array_new (FALSE, FALSE, sizeof (gpointer)); ptr0 = array; diff --git a/src/mono/mono/eglib/test/assertf.c b/src/mono/mono/eglib/test/assertf.c index 05484adb91d8b7..3a844d75e1776c 100644 --- a/src/mono/mono/eglib/test/assertf.c +++ b/src/mono/mono/eglib/test/assertf.c @@ -5,7 +5,7 @@ f is for format, like printf Previously one would say like: if (!expr) g_error(...) - + now: g_assertf(expr, ...); */ diff --git a/src/mono/mono/eglib/test/endian.c b/src/mono/mono/eglib/test/endian.c index d70c7c68c906f4..ff40b7d2fce526 100644 --- a/src/mono/mono/eglib/test/endian.c +++ b/src/mono/mono/eglib/test/endian.c @@ -7,7 +7,7 @@ test_swap (void) guint64 b = (((guint64)a) << 32) | a, res64; guint64 b_expect = (((guint64)0x1efcdab) << 32) | 0x01efcdab; guint16 c = 0xabcd, res16; - + res32 = GUINT32_SWAP_LE_BE (a); if (res32 != 0x01efcdab) return FAILED ("GUINT32_SWAP_LE_BE returned 0x%x", res32); @@ -20,8 +20,8 @@ test_swap (void) return FAILED ("GUINT64_SWAP_LE_BE returned 0x%" PRIx64 " (had=0x%" PRIx64 ")", (guint64)res64, (guint64)b); res16 = GUINT16_SWAP_LE_BE(c); if (res16 != 0xcdab) - return FAILED ("GUINT16_SWAP_LE_BE returned 0x%x", (guint32) res16); - + return FAILED ("GUINT16_SWAP_LE_BE returned 0x%x", (guint32) res16); + return OK; } diff --git a/src/mono/mono/eglib/test/fake.c b/src/mono/mono/eglib/test/fake.c index 96e85541182abe..07f511f966216a 100644 --- a/src/mono/mono/eglib/test/fake.c +++ b/src/mono/mono/eglib/test/fake.c @@ -1,7 +1,7 @@ /* * Fake test allows debugging of the driver itself */ - + #include "test.h" static RESULT diff --git a/src/mono/mono/eglib/test/hashtable.c b/src/mono/mono/eglib/test/hashtable.c index 94878f3fa8e1c7..7ec13baefb9953 100644 --- a/src/mono/mono/eglib/test/hashtable.c +++ b/src/mono/mono/eglib/test/hashtable.c @@ -29,7 +29,7 @@ hash_t1 (void) return FAILED ("did not find all keys, got %d expected 2", foreach_count); if (foreach_fail) return FAILED("failed to pass the user-data to foreach"); - + if (!g_hash_table_remove (t, (char*)"my")) return FAILED ("did not find known key"); if (g_hash_table_size (t) != 1) @@ -37,7 +37,7 @@ hash_t1 (void) g_hash_table_insert(t, (char*)"hello", (char*)"moon"); if (strcmp (g_hash_table_lookup (t, (char*)"hello"), (char*)"moon") != 0) return FAILED ("did not replace world with moon"); - + if (!g_hash_table_remove (t, (char*)"hello")) return FAILED ("did not find known key"); if (g_hash_table_size (t) != 0) @@ -70,7 +70,7 @@ hash_null_lookup (void) { GHashTable *hash = g_hash_table_new (NULL, NULL); gpointer ok, ov; - + g_hash_table_insert (hash, NULL, GINT_TO_POINTER (1)); g_hash_table_insert (hash, GINT_TO_POINTER(1), GINT_TO_POINTER(2)); @@ -87,7 +87,7 @@ hash_null_lookup (void) return FAILED ("Incorrect key found"); if (ov != GINT_TO_POINTER (2)) return FAILED ("Got wrong value %p\n", ov); - + g_hash_table_destroy (hash); return NULL; @@ -106,14 +106,14 @@ hash_grow (void) { GHashTable *hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); int i, count = 0; - + for (i = 0; i < 1000; i++) g_hash_table_insert (hash, g_strdup_printf ("%d", i), g_strdup_printf ("x-%d", i)); for (i = 0; i < 1000; i++){ char buffer [30]; gpointer value; - + sprintf (buffer, "%d", i); value = g_hash_table_lookup (hash, buffer); diff --git a/src/mono/mono/eglib/test/list.c b/src/mono/mono/eglib/test/list.c index b428e2d8dd422b..98b2182924cd09 100644 --- a/src/mono/mono/eglib/test/list.c +++ b/src/mono/mono/eglib/test/list.c @@ -41,7 +41,7 @@ test_list_nth (void) nth = g_list_nth (list, 1); if (nth->data != bar) return FAILED ("nth failed. #1"); - + nth = g_list_nth (list, 2); if (nth->data != baz) return FAILED ("nth failed. #2"); @@ -73,7 +73,7 @@ test_list_index (void) i = g_list_index (list, bar); if (i != 1) return FAILED ("index failed. #1: %d", i); - + i = g_list_index (list, baz); if (i != 2) return FAILED ("index failed. #2: %d", i); @@ -104,7 +104,7 @@ test_list_last (void) GList *foo = g_list_prepend (NULL, (char*)"foo"); GList *bar = g_list_prepend (NULL, (char*)"bar"); GList *last; - + foo = g_list_concat (foo, bar); last = g_list_last (foo); @@ -114,7 +114,7 @@ test_list_last (void) foo = g_list_concat (foo, g_list_prepend (NULL, (char*)"baz")); foo = g_list_concat (foo, g_list_prepend (NULL, (char*)"quux")); - last = g_list_last (foo); + last = g_list_last (foo); if (strcmp ("quux", last->data)) return FAILED ("last failed. #2"); @@ -141,7 +141,7 @@ test_list_concat (void) if (g_list_first (list) != foo) return FAILED ("Concat failed. #4"); - + if (g_list_last (list) != bar) return FAILED ("Concat failed. #5"); @@ -176,7 +176,7 @@ test_list_insert_sorted (void) /* insert at the beginning */ list = g_list_insert_sorted (list, (char*)"", compare); if (strcmp ("", list->data)) - return FAILED ("insert_sorted failed. #2"); + return FAILED ("insert_sorted failed. #2"); /* insert at the end */ list = g_list_insert_sorted (list, (char*)"aaaa", compare); @@ -206,7 +206,7 @@ test_list_copy (void) return FAILED ("copy failed."); g_list_free (list); - g_list_free (copy); + g_list_free (copy); return OK; } @@ -234,7 +234,7 @@ test_list_reverse (void) } g_list_free (list); - g_list_free (reverse); + g_list_free (reverse); return OK; } @@ -267,7 +267,7 @@ test_list_remove_link (void) GList *list = foo; foo = g_list_concat (foo, bar); - foo = g_list_concat (foo, baz); + foo = g_list_concat (foo, baz); list = g_list_remove_link (list, bar); @@ -277,7 +277,7 @@ test_list_remove_link (void) if (bar->next != NULL) return FAILED ("remove_link failed #2"); - g_list_free (list); + g_list_free (list); g_list_free (bar); return OK; } @@ -299,7 +299,7 @@ test_list_insert_before (void) return FAILED ("2"); if (strcmp (g_list_nth_data (foo, 1), (char*)"baz")) - return FAILED ("3: %s", g_list_nth_data (foo, 1)); + return FAILED ("3: %s", g_list_nth_data (foo, 1)); g_list_free (foo); return OK; @@ -400,26 +400,26 @@ test_list_find_custom (void) char *foo = (char*)"foo"; char *bar = (char*)"bar"; char *baz = (char*)"baz"; - + list = g_list_prepend (list, baz); list = g_list_prepend (list, bar); list = g_list_prepend (list, foo); - + found = g_list_find_custom (list, baz, find_custom); - + if (found == NULL) return FAILED ("Find failed"); - + g_list_free (list); - + return OK; } static Test list_tests [] = { { "length", test_list_length}, { "nth", test_list_nth}, - { "index", test_list_index}, - { "last", test_list_last}, + { "index", test_list_index}, + { "last", test_list_last}, { "append", test_list_append}, { "concat", test_list_concat}, {"insert_sorted", test_list_insert_sorted}, diff --git a/src/mono/mono/eglib/test/markup.c b/src/mono/mono/eglib/test/markup.c index b7700615a710c6..7dd3ca3ea1546a 100644 --- a/src/mono/mono/eglib/test/markup.c +++ b/src/mono/mono/eglib/test/markup.c @@ -12,7 +12,7 @@ markup_test (const char *s) GMarkupParser *parser = g_new0 (GMarkupParser, 1); GMarkupParseContext *context; GError *gerror = NULL; - + context = g_markup_parse_context_new (parser, 0, 0, 0); g_markup_parse_context_parse (context, s, strlen (s), &gerror); @@ -39,7 +39,7 @@ invalid_documents (void) do_bad_test (""); do_bad_test (""); do_bad_test (""); - + return OK; } @@ -49,7 +49,7 @@ valid_documents (void) /* These should fail */ do_ok_test (""); do_ok_test (""); - + return OK; } @@ -114,7 +114,7 @@ end_element (GMarkupParseContext *context, GError **gerror) { AppConfigInfo* app_config = (AppConfigInfo*) user_data; - + if (strcmp (element_name, "configuration") == 0) { app_config->configuration_count--; } else if (strcmp (element_name, "startup") == 0) { @@ -136,7 +136,7 @@ domain_test (const char *text) { AppConfigInfo *app_config = g_new0 (AppConfigInfo, 1); GMarkupParseContext *context; - + context = g_markup_parse_context_new (&mono_parser, 0, app_config, NULL); if (g_markup_parse_context_parse (context, text, strlen (text), NULL)) { g_markup_parse_context_end_parse (context, NULL); @@ -164,7 +164,7 @@ mono_domain (void) { AppConfigInfo *info; - info = domain_test (""); + info = domain_test (""); if (info->required_runtime == NULL) return FAILED ("No required runtime section"); if (strcmp (info->required_runtime, "v1") != 0) @@ -182,7 +182,7 @@ mono_domain (void) if ((strcmp ((char*)info->supported_runtimes->data, "v1") == 0)){ if (info->supported_runtimes->next == NULL) return FAILED ("Expected 2 supported runtimes"); - + if ((strcmp ((char*)info->supported_runtimes->next->data, "v2") != 0)) return FAILED ("Expected v1, v2, got %s", info->supported_runtimes->next->data); if (info->supported_runtimes->next->next != NULL) @@ -212,7 +212,7 @@ machine_config (void) { char *data; gsize size; - + if (g_file_get_contents ("../../data/net_1_1/machine.config", &data, &size, NULL)){ return markup_test (data); } diff --git a/src/mono/mono/eglib/test/path.c b/src/mono/mono/eglib/test/path.c index 3af25b13b9f6cd..a0c2f272289dd8 100644 --- a/src/mono/mono/eglib/test/path.c +++ b/src/mono/mono/eglib/test/path.c @@ -22,7 +22,7 @@ test_buildpath (void) char *s; const char *buffer = "var/private"; const char *dir = "/"; - + s = g_build_path ("/", "hola///", "//mundo", (const char*)NULL); if (strcmp (s, "hola/mundo") != 0) return FAILED ("1 Got wrong result, got: %s", s); @@ -47,7 +47,7 @@ test_buildpath (void) if (strcmp (s, "/hello/world/") != 0) return FAILED ("5 Got wrong result, got: %s", s); g_free (s); - + /* Now test multi-char-separators */ s = g_build_path ("**", "hello", "world", (const char*)NULL); if (strcmp (s, "hello**world") != 0) @@ -63,7 +63,7 @@ test_buildpath (void) if (strcmp (s, "hello**world") != 0) return FAILED ("8 Got wrong result, got: %s", s); g_free (s); - + s = g_build_path ("**", "hello**", "**world", (const char*)NULL); if (strcmp (s, "hello**world") != 0) return FAILED ("9 Got wrong result, got: %s", s); @@ -119,7 +119,7 @@ static RESULT test_buildfname (void) { char *s; - + s = g_build_filename ("a", "b", "c", "d", (const char*)NULL); #ifdef G_OS_WIN32 if (strcmp (s, "a\\b\\c\\d") != 0) @@ -143,7 +143,7 @@ test_buildfname (void) if (strcmp (s, "/foo/bar/tolo/meo/") != 0) return FAILED ("1 Got wrong result, got: %s", s); #endif - + return OK; } @@ -195,7 +195,7 @@ test_dirname (void) s = g_path_get_dirname ("/index.html"); if (strcmp (s, "/") != 0) return FAILED ("Expected [/], got [%s]", s); -#endif +#endif return OK; } @@ -274,7 +274,7 @@ test_ppath2 (void) #else const gchar *searchfor = "test-eglib"; #endif - + g_setenv ("PATH", "", TRUE); s = g_find_program_in_path ("ls"); if (s != NULL) { @@ -310,15 +310,15 @@ test_cwd (void) if (dir == NULL) return FAILED ("No current directory?"); g_free (dir); - + if (chdir (newdir) == -1) return FAILED ("No %s?", newdir); - + dir = g_get_current_dir (); if (strcmp (dir, newdir) != 0) return FAILED("Did not go to %s? Instead in %s", newdir, dir); g_free (dir); - + return OK; } #else @@ -334,7 +334,7 @@ test_misc (void) { const char *home = g_get_home_dir (); const char *tmp = g_get_tmp_dir (); - + if (home == NULL) return FAILED ("Where did my home go?"); diff --git a/src/mono/mono/eglib/test/ptrarray.c b/src/mono/mono/eglib/test/ptrarray.c index 51a1396f4c8612..f90899814a596a 100644 --- a/src/mono/mono/eglib/test/ptrarray.c +++ b/src/mono/mono/eglib/test/ptrarray.c @@ -11,7 +11,7 @@ typedef struct _GPtrArrayPriv { /* Don't add more than 32 items to this please */ static const char *items [] = { - "Apples", "Oranges", "Plumbs", "Goats", "Snorps", "Grapes", + "Apples", "Oranges", "Plumbs", "Goats", "Snorps", "Grapes", "Tickle", "Place", "Coffee", "Cookies", "Cake", "Cheese", "Tseng", "Holiday", "Avenue", "Smashing", "Water", "Toilet", NULL @@ -21,7 +21,7 @@ static GPtrArray *ptrarray_alloc_and_fill(guint *item_count) { GPtrArray *array = g_ptr_array_new(); gint i; - + for(i = 0; items[i] != NULL; i++) { g_ptr_array_add(array, (gpointer)items[i]); } @@ -29,7 +29,7 @@ static GPtrArray *ptrarray_alloc_and_fill(guint *item_count) if (item_count != NULL) { *item_count = i; } - + return array; } @@ -49,18 +49,18 @@ ptrarray_alloc (void) { GPtrArrayPriv *array; guint i; - + array = (GPtrArrayPriv *)ptrarray_alloc_and_fill(&i); - + if (array->size != guess_size(array->len)) { - return FAILED("Size should be %d, but it is %d", + return FAILED("Size should be %d, but it is %d", guess_size(array->len), array->size); } - + if (array->len != i) { return FAILED("Expected %d node(s) in the array", i); } - + g_ptr_array_free((GPtrArray *)array, TRUE); return OK; @@ -76,7 +76,7 @@ RESULT ptrarray_for_iterate (void) char *item = (char *)g_ptr_array_index(array, i); if (item != items[i]) { return FAILED( - "Expected item at %d to be %s, but it was %s", + "Expected item at %d to be %s, but it was %s", i, items[i], item); } } @@ -101,7 +101,7 @@ foreach_callback (gpointer data, gpointer user_data) if (item != item_cmp) { foreach_iterate_error = FAILED( - "Expected item at %d to be %s, but it was %s", + "Expected item at %d to be %s, but it was %s", foreach_iterate_index - 1, item_cmp, item); } } @@ -110,12 +110,12 @@ static RESULT ptrarray_foreach_iterate (void) { GPtrArray *array = ptrarray_alloc_and_fill(NULL); - + foreach_iterate_index = 0; foreach_iterate_error = NULL; - + g_ptr_array_foreach(array, foreach_callback, array); - + g_ptr_array_free(array, TRUE); return foreach_iterate_error; @@ -126,7 +126,7 @@ ptrarray_set_size (void) { GPtrArray *array = g_ptr_array_new(); guint i, grow_length = 50; - + g_ptr_array_add(array, (gpointer)items[0]); g_ptr_array_add(array, (gpointer)items[1]); g_ptr_array_set_size(array, grow_length); @@ -155,9 +155,9 @@ ptrarray_remove_index (void) { GPtrArray *array; guint i; - + array = ptrarray_alloc_and_fill(&i); - + g_ptr_array_remove_index(array, 0); if (array->pdata[0] != items[1]) { return FAILED("First item is not %s, it is %s", items[1], @@ -165,9 +165,9 @@ ptrarray_remove_index (void) } g_ptr_array_remove_index(array, array->len - 1); - + if (array->pdata[array->len - 1] != items[array->len]) { - return FAILED("Last item is not %s, it is %s", + return FAILED("Last item is not %s, it is %s", items[array->len - 2], array->pdata[array->len - 1]); } @@ -206,7 +206,7 @@ ptrarray_remove (void) { GPtrArray *array; guint i; - + array = ptrarray_alloc_and_fill(&i); g_ptr_array_remove(array, (gpointer)items[7]); @@ -242,13 +242,13 @@ ptrarray_sort (void) GPtrArray *array = g_ptr_array_new(); guint i; static gchar * const letters [] = { (char*)"A", (char*)"B", (char*)"C", (char*)"D", (char*)"E" }; - + g_ptr_array_add(array, letters[0]); g_ptr_array_add(array, letters[1]); g_ptr_array_add(array, letters[2]); g_ptr_array_add(array, letters[3]); g_ptr_array_add(array, letters[4]); - + g_ptr_array_sort(array, ptrarray_sort_compare); for (i = 0; i < array->len; i++) { @@ -259,7 +259,7 @@ ptrarray_sort (void) } g_ptr_array_free(array, TRUE); - + return OK; } @@ -307,7 +307,7 @@ ptrarray_remove_fast (void) { GPtrArray *array = g_ptr_array_new(); static gchar * const letters [] = { (char*)"A", (char*)"B", (char*)"C", (char*)"D", (char*)"E" }; - + if (g_ptr_array_remove_fast (array, NULL)) return FAILED ("Removing NULL succeeded"); @@ -339,7 +339,7 @@ ptrarray_remove_fast (void) if (array->pdata [0] != letters [4] || array->pdata [1] != letters [2]) return FAILED ("Last two elements are wrong"); g_ptr_array_free(array, TRUE); - + return OK; } diff --git a/src/mono/mono/eglib/test/queue.c b/src/mono/mono/eglib/test/queue.c index 200952199a8de9..f267cb86c82367 100644 --- a/src/mono/mono/eglib/test/queue.c +++ b/src/mono/mono/eglib/test/queue.c @@ -95,12 +95,12 @@ test_queue_pop (void) data = g_queue_pop_head (queue); if (strcmp ("bar", data)) - return FAILED ("expect bar."); + return FAILED ("expect bar."); data = g_queue_pop_head (queue); if (strcmp ("foo", data)) return FAILED ("expect foo."); - + if (g_queue_is_empty (queue) == FALSE) return FAILED ("expect is_empty."); diff --git a/src/mono/mono/eglib/test/shell.c b/src/mono/mono/eglib/test/shell.c index d464f98aed067e..4b32f08672571e 100644 --- a/src/mono/mono/eglib/test/shell.c +++ b/src/mono/mono/eglib/test/shell.c @@ -11,7 +11,7 @@ test_shell_argv1 (void) gchar **argv; gboolean ret; - /* The next line prints a critical error and returns FALSE + /* The next line prints a critical error and returns FALSE ret = g_shell_parse_argv (NULL, NULL, NULL, NULL); */ ret = g_shell_parse_argv ("", NULL, NULL, NULL); @@ -97,7 +97,7 @@ test_shell_argv1 (void) return FAILED ("24. argv[2] was %s", argv [1]); if (gerror != NULL) return FAILED ("25. error is not null"); - + return OK; } @@ -268,7 +268,7 @@ test_shell_argv4 (void) return FAILED ("6. Expected -e, got: %s", argv [1]); if (strcmp (argv [2], "bash -c 'read -p \"Press any key to continue...\" -n1;'")) return FAILED ("7. Got unexpected result: %s\n", argv [2]); - + return OK; } @@ -299,7 +299,7 @@ test_shell_argv5 (void) return FAILED ("5. Expected echo got %s", argv [0]); if (strcmp (argv [1], "foo,bar")) return FAILED ("6. Expected foo,bar, got: %s", argv [1]); - + return OK; } diff --git a/src/mono/mono/eglib/test/sizes.c b/src/mono/mono/eglib/test/sizes.c index 1f3861fc99a40f..cdfab0e95190a4 100644 --- a/src/mono/mono/eglib/test/sizes.c +++ b/src/mono/mono/eglib/test/sizes.c @@ -16,7 +16,7 @@ test_formats (void) { char buffer [1024]; gsize a = 1; - + sprintf (buffer, "%" G_GSIZE_FORMAT, a); return NULL; @@ -64,7 +64,7 @@ test_ptrconv (void) uv2 = GPOINTER_TO_UINT (ptr); if (uv != uv2) return FAILED ("uint to pointer and back conversions fail %u != %d", uv, uv2); - + uv = 1; ptr = GUINT_TO_POINTER (uv); uv2 = GPOINTER_TO_UINT (ptr); @@ -78,7 +78,7 @@ test_ptrconv (void) return FAILED ("uint to pointer and back conversions fail %u != %d", uv, uv2); return NULL; - + } typedef struct { @@ -91,7 +91,7 @@ test_offset (void) { if (G_STRUCT_OFFSET (my_struct, a) != 0) return FAILED ("offset of a is not zero"); - + if (G_STRUCT_OFFSET (my_struct, b) != 4 && G_STRUCT_OFFSET (my_struct, b) != 8) return FAILED ("offset of b is 4 or 8, macro might be busted"); diff --git a/src/mono/mono/eglib/test/slist.c b/src/mono/mono/eglib/test/slist.c index b36a9a9c7b5254..b678b5427d3651 100644 --- a/src/mono/mono/eglib/test/slist.c +++ b/src/mono/mono/eglib/test/slist.c @@ -21,7 +21,7 @@ test_slist_nth (void) nth = g_slist_nth (list, 1); if (nth->data != bar) return FAILED ("nth failed. #1"); - + nth = g_slist_nth (list, 2); if (nth->data != baz) return FAILED ("nth failed. #2"); @@ -53,7 +53,7 @@ test_slist_index (void) i = g_slist_index (list, bar); if (i != 1) return FAILED ("index failed. #1: %d", i); - + i = g_slist_index (list, baz); if (i != 2) return FAILED ("index failed. #2: %d", i); @@ -102,7 +102,7 @@ test_slist_find (void) GSList *list = g_slist_prepend (NULL, (char*)"three"); GSList *found; char *data; - + list = g_slist_prepend (list, (char*)"two"); list = g_slist_prepend (list, (char*)"one"); @@ -131,18 +131,18 @@ test_slist_find_custom (void) char *foo = (char*)"foo"; char *bar = (char*)"bar"; char *baz = (char*)"baz"; - + list = g_slist_prepend (list, baz); list = g_slist_prepend (list, bar); list = g_slist_prepend (list, foo); - + found = g_slist_find_custom (list, baz, find_custom); - + if (found == NULL) return FAILED ("Find failed"); - + g_slist_free (list); - + return OK; } @@ -175,7 +175,7 @@ test_slist_remove_link (void) GSList *list = foo; foo = g_slist_concat (foo, bar); - foo = g_slist_concat (foo, baz); + foo = g_slist_concat (foo, baz); list = g_slist_remove_link (list, bar); @@ -185,7 +185,7 @@ test_slist_remove_link (void) if (bar->next != NULL) return FAILED ("remove_link failed #2"); - g_slist_free (list); + g_slist_free (list); g_slist_free (bar); return OK; @@ -224,7 +224,7 @@ test_slist_insert_sorted (void) if (strcmp ("aaaa", g_slist_last (list)->data)) return FAILED ("insert_sorted failed #3"); - g_slist_free (list); + g_slist_free (list); return OK; } diff --git a/src/mono/mono/eglib/test/string-util.c b/src/mono/mono/eglib/test/string-util.c index fb447229ef4046..5c5c445b16c506 100644 --- a/src/mono/mono/eglib/test/string-util.c +++ b/src/mono/mono/eglib/test/string-util.c @@ -12,7 +12,7 @@ test_strfreev (void) array [1] = g_strdup ("two"); array [2] = g_strdup ("three"); array [3] = NULL; - + g_strfreev (array); g_strfreev (NULL); @@ -35,18 +35,18 @@ test_split (void) const gchar *to_split = "Hello world, how are we doing today?"; gint i; gchar **v; - + v= g_strsplit(to_split, " ", 0); - + if(v == NULL) { return FAILED("split failed, got NULL vector (1)"); } - + for(i = 0; v[i] != NULL; i++); if(i != 7) { return FAILED("split failed, expected 7 tokens, got %d", i); } - + g_strfreev(v); v = g_strsplit(to_split, ":", -1); @@ -78,22 +78,22 @@ test_split (void) v = g_strsplit ("appdomain1, Version=0.0.0.0, Culture=neutral", ",", 4); if (strcmp (v [0], "appdomain1") != 0) return FAILED ("Invalid value"); - + if (strcmp (v [1], " Version=0.0.0.0") != 0) return FAILED ("Invalid value"); - + if (strcmp (v [2], " Culture=neutral") != 0) return FAILED ("Invalid value"); if (v [3] != NULL) return FAILED ("Expected only 3 elements"); - + g_strfreev (v); v = g_strsplit ("abcXYdefXghiXYjklYmno", "XY", 4); if (strcmp (v [0], "abc") != 0) return FAILED ("Invalid value 0"); - + if (strcmp (v [1], "defXghi") != 0) return FAILED ("Invalid value 1"); @@ -102,25 +102,25 @@ test_split (void) if (v [3] != NULL) return FAILED ("Expected only 3 elements (1)"); - + g_strfreev (v); v = g_strsplit ("abcXYdefXghiXYjklYmno", "XY", 2); if (strcmp (v [0], "abc") != 0) return FAILED ("Invalid value 3"); - + if (strcmp (v [1], "defXghiXYjklYmno") != 0) return FAILED ("Invalid value 4"); if (v [2] != NULL) return FAILED ("Expected only 2 elements (2)"); - + g_strfreev (v); v = g_strsplit ("abcXYdefXghiXYjklYmnoXY", "XY", 3); if (strcmp (v [0], "abc") != 0) return FAILED ("Invalid value 5"); - + if (strcmp (v [1], "defXghi") != 0) return FAILED ("Invalid value 6"); @@ -129,7 +129,7 @@ test_split (void) if (v [3] != NULL) return FAILED ("Expected only 3 elements (3)"); - + g_strfreev (v); v = g_strsplit ("abcXYXYXYdefXY", "XY", -1); @@ -141,7 +141,7 @@ test_split (void) if (strcmp (v [2], "") != 0) return FAILED ("Invalid value 10"); - + if (strcmp (v [3], "def") != 0) return FAILED ("Invalid value 11"); @@ -150,28 +150,28 @@ test_split (void) if (v [5] != NULL) return FAILED ("Expected only 5 elements (4)"); - + g_strfreev (v); v = g_strsplit ("XYXYXYabcXYdef", "XY", -1); if (strcmp (v [0], "") != 0) return FAILED ("Invalid value 13"); - + if (strcmp (v [1], "") != 0) return FAILED ("Invalid value 14"); - + if (strcmp (v [2], "") != 0) return FAILED ("Invalid value 15"); - + if (strcmp (v [3], "abc") != 0) return FAILED ("Invalid value 16"); - + if (strcmp (v [4], "def") != 0) return FAILED ("Invalid value 17"); if (v [5] != NULL) return FAILED ("Expected only 5 elements (5)"); - + g_strfreev (v); v = g_strsplit ("value=", "=", 2); @@ -191,14 +191,14 @@ static RESULT test_split_set (void) { gchar **v; - + v = g_strsplit_set ("abcXYdefXghiXYjklYmno", "XY", 6); if (strcmp (v [0], "abc") != 0) return FAILED ("Invalid value 0"); if (strcmp (v [1], "") != 0) return FAILED ("Invalid value 1"); - + if (strcmp (v [2], "def") != 0) return FAILED ("Invalid value 2"); @@ -222,19 +222,19 @@ test_split_set (void) if (strcmp (v [1], "") != 0) return FAILED ("Invalid value 7"); - + if (strcmp (v [2], "defXghiXYjklYmno") != 0) return FAILED ("Invalid value 8"); if (v [3] != NULL) return FAILED ("Expected only 3 elements (2)"); - + g_strfreev (v); v = g_strsplit_set ("abcXdefYghiXjklYmnoX", "XY", 5); if (strcmp (v [0], "abc") != 0) return FAILED ("Invalid value 9"); - + if (strcmp (v [1], "def") != 0) return FAILED ("Invalid value 10"); @@ -249,7 +249,7 @@ test_split_set (void) if (v [5] != NULL) return FAILED ("Expected only 5 elements (5)"); - + g_strfreev (v); v = g_strsplit_set ("abcXYXdefXY", "XY", -1); @@ -261,7 +261,7 @@ test_split_set (void) if (strcmp (v [2], "") != 0) return FAILED ("Invalid value 16"); - + if (strcmp (v [3], "def") != 0) return FAILED ("Invalid value 17"); @@ -273,31 +273,31 @@ test_split_set (void) if (v [6] != NULL) return FAILED ("Expected only 6 elements (4)"); - + g_strfreev (v); v = g_strsplit_set ("XYXabcXYdef", "XY", -1); if (strcmp (v [0], "") != 0) return FAILED ("Invalid value 20"); - + if (strcmp (v [1], "") != 0) return FAILED ("Invalid value 21"); - + if (strcmp (v [2], "") != 0) return FAILED ("Invalid value 22"); - + if (strcmp (v [3], "abc") != 0) return FAILED ("Invalid value 23"); if (strcmp (v [4], "") != 0) return FAILED ("Invalid value 24"); - + if (strcmp (v [5], "def") != 0) return FAILED ("Invalid value 25"); if (v [6] != NULL) return FAILED ("Expected only 6 elements (5)"); - + g_strfreev (v); return OK; @@ -343,7 +343,7 @@ static RESULT test_strjoin (void) { char *s; - + s = g_strjoin (NULL, "a", "b", (const char*)NULL); if (strcmp (s, "ab") != 0) return FAILED ("Join of two strings with no separator fails"); @@ -445,7 +445,7 @@ test_filename_to_uri (void) errit ("a"); errit ("./hola"); #endif - + return OK; } @@ -473,7 +473,7 @@ test_filename_from_uri (void) ferrit ("file:///%0"); ferrit ("file:///%jj"); #endif - + return OK; } @@ -590,7 +590,7 @@ test_strlcpy (void) if (0 != strcmp (dest, NUMBERS)) return FAILED ("problem [%s] and [%s]", dest, NUMBERS); g_free (dest); - + return OK; } @@ -622,7 +622,7 @@ test_ascii_strncasecmp (void) n = g_ascii_strncasecmp ("123", "123", 1); if (n != 0) return FAILED ("Should have been 0"); - + n = g_ascii_strncasecmp ("423", "123", 1); if (n <= 0) return FAILED ("Should have been > 0, got %d", n); diff --git a/src/mono/mono/eglib/test/string.c b/src/mono/mono/eglib/test/string.c index c2cc5f37317e2c..8b2281b538530c 100644 --- a/src/mono/mono/eglib/test/string.c +++ b/src/mono/mono/eglib/test/string.c @@ -10,16 +10,16 @@ test_append_speed (void) { GString *s = g_string_new(""); gint i; - + for(i = 0; i < 1024; i++) { g_string_append(s, "x"); } - + if(strlen (s->str) != 1024) { - return FAILED("Incorrect string size, got: %s %d", + return FAILED("Incorrect string size, got: %s %d", s->str, strlen(s->str)); } - + g_string_free (s, TRUE); return OK; @@ -30,16 +30,16 @@ test_append_c_speed (void) { GString *s = g_string_new(""); gint i; - + for(i = 0; i < 1024; i++) { g_string_append_c(s, 'x'); } - + if(strlen(s->str) != 1024) { - return FAILED("Incorrect string size, got: %s %d", s->str, + return FAILED("Incorrect string size, got: %s %d", s->str, strlen(s->str)); } - + g_string_free(s, TRUE); return OK; @@ -90,7 +90,7 @@ test_gstring (void) s = g_string_new ("Hola"); g_string_printf (s, "Dingus"); - + /* Test that it does not release it */ ret = g_string_free (s, FALSE); g_free (ret); @@ -104,7 +104,7 @@ test_gstring (void) sfail ( 0, 4); sfail ('2', 5); g_string_free (s, TRUE); - + return OK; } @@ -119,7 +119,7 @@ test_sized (void) return FAILED ("Expected an empty len"); g_string_free (s, TRUE); - + return NULL; } @@ -132,7 +132,7 @@ test_truncate (void) if (strlen (s->str) != 3) return FAILED ("size of string should have been 3, instead it is [%s]\n", s->str); g_string_free (s, TRUE); - + s = g_string_new ("a"); s = g_string_truncate (s, 10); if (strlen (s->str) != 1) @@ -143,7 +143,7 @@ test_truncate (void) g_string_truncate (s, 0); if (strlen (s->str) != 0) return FAILED ("The size is not 0"); - + g_string_free (s, TRUE); return NULL; @@ -163,7 +163,7 @@ test_appendlen (void) g_string_append_len (s, "ha", -1); if (s->len != 7) return FAILED ("The length is not seven %d", s->len); - + g_string_free (s, TRUE); return NULL; @@ -175,7 +175,7 @@ test_macros (void) char *s = g_strdup (G_STRLOC); char *p = strchr (s + 2, ':'); int n; - + if (p == NULL) return FAILED ("Did not find a separator"); n = atoi (p+1); @@ -185,7 +185,7 @@ test_macros (void) *p = 0; if (strcmp (s + strlen(s) - 8 , "string.c") != 0) return FAILED ("This did not store the filename on G_STRLOC"); - + g_free (s); return NULL; } diff --git a/src/mono/mono/eglib/test/test.c b/src/mono/mono/eglib/test/test.c index 426812df62c8c5..d614e4e3e965b4 100644 --- a/src/mono/mono/eglib/test/test.c +++ b/src/mono/mono/eglib/test/test.c @@ -48,16 +48,16 @@ extern gint global_passed, global_tests; static gchar *last_result = NULL; -static gboolean +static gboolean run_test(const Test *test, char **result_out) { - gchar *result; + gchar *result; if((result = test->handler()) == NULL) { *result_out = NULL; return TRUE; } else { - *result_out = result; + *result_out = result; return FALSE; } } @@ -88,7 +88,7 @@ run_group(const Group *group, gint iterations, gboolean quiet, for(i = 0; tests[i].name != NULL; i++) { gchar *result = (char*)""; gboolean iter_pass, run; - + iter_pass = FALSE; if(tests_to_run != NULL) { gint j; @@ -106,15 +106,15 @@ run_group(const Group *group, gint iterations, gboolean quiet, if(!run) { continue; } - + total++; - + if(!quiet) { printf(" %s: ", tests[i].name); } start_time_test = get_timestamp(); - + for(j = 0; j < iterations; j++) { iter_pass = run_test(&(tests[i]), &result); if(!iter_pass) { @@ -131,11 +131,11 @@ run_group(const Group *group, gint iterations, gboolean quiet, printf("OK\n"); } } - } else { + } else { if(!quiet) { printf("FAILED (%s)\n", result); } - + if(last_result == result) { last_result = NULL; g_free(result); @@ -198,12 +198,12 @@ get_timestamp (void) return res.tv_sec + (1.e-6) * res.tv_usec; } -/* +/* * Duplicating code here from EGlib to avoid g_strsplit skew between * EGLib and GLib */ - -gchar ** + +gchar ** eg_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens) { gchar *string_c; @@ -215,12 +215,12 @@ eg_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens) g_return_val_if_fail(string != NULL, NULL); g_return_val_if_fail(delimiter != NULL, NULL); g_return_val_if_fail(delimiter[0] != 0, NULL); - + token_length = strlen(string); string_c = (gchar *)g_malloc(token_length + 1); memcpy(string_c, string, token_length); string_c[token_length] = 0; - + vector = NULL; token = (gchar *)strtok_r(string_c, delimiter, &strtok_save); @@ -230,11 +230,11 @@ eg_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens) memcpy(token_c, token, token_length); token_c[token_length] = 0; - vector = vector == NULL ? + vector = vector == NULL ? (gchar **)g_malloc(2 * sizeof(vector)) : (gchar **)g_realloc(vector, (size + 1) * sizeof(vector)); - - vector[size - 1] = token_c; + + vector[size - 1] = token_c; size++; if(max_tokens > 0 && size >= max_tokens) { @@ -251,7 +251,7 @@ eg_strsplit (const gchar *string, const gchar *delimiter, gint max_tokens) if(vector != NULL && size > 0) { vector[size - 1] = NULL; } - + g_free(string_c); string_c = NULL; diff --git a/src/mono/mono/eglib/test/test.h b/src/mono/mono/eglib/test/test.h index a2003211ee574e..d807e6c0839ce9 100644 --- a/src/mono/mono/eglib/test/test.h +++ b/src/mono/mono/eglib/test/test.h @@ -25,7 +25,7 @@ * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - + #ifndef _TEST_H #define _TEST_H @@ -36,8 +36,8 @@ #include #ifdef _MSC_VER -/* disable the following warnings - * C4100: The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored. +/* disable the following warnings + * C4100: The formal parameter is not referenced in the body of the function. The unreferenced parameter is ignored. * C4127: conditional expression is constant (test macros produce a lot of these) */ #pragma warning(disable:4100 4127) diff --git a/src/mono/mono/eglib/test/tests.h b/src/mono/mono/eglib/test/tests.h index 885d87a7caf4f2..445552c9dc43b8 100644 --- a/src/mono/mono/eglib/test/tests.h +++ b/src/mono/mono/eglib/test/tests.h @@ -26,8 +26,8 @@ DEFINE_TEST_GROUP_INIT_H(memory_tests_init); DEFINE_TEST_GROUP_INIT_H(enum_tests_init); const -static Group test_groups [] = { - {"string", string_tests_init}, +static Group test_groups [] = { + {"string", string_tests_init}, {"strutil", strutil_tests_init}, {"ptrarray", ptrarray_tests_init}, {"slist", slist_tests_init}, @@ -40,7 +40,7 @@ static Group test_groups [] = { {"path", path_tests_init}, {"shell", shell_tests_init}, {"markup", markup_tests_init}, -#if !DISABLE_PROCESS_TESTS +#if !DISABLE_PROCESS_TESTS {"spawn", spawn_tests_init}, {"module", module_tests_init}, #endif diff --git a/src/mono/mono/eventpipe/ep-rt-mono.c b/src/mono/mono/eventpipe/ep-rt-mono.c index c78ab44b56dfd5..b50c78617ea8b9 100644 --- a/src/mono/mono/eventpipe/ep-rt-mono.c +++ b/src/mono/mono/eventpipe/ep-rt-mono.c @@ -5245,7 +5245,7 @@ mono_profiler_class_loading ( uint64_t class_id; uint64_t module_id; - + mono_profiler_get_class_data (klass, &class_id, &module_id, NULL, NULL, NULL); mono_profiler_fire_event_enter (); @@ -5428,7 +5428,7 @@ mono_profiler_module_loading ( { if (!EventEnabledMonoProfilerModuleLoading ()) return; - + mono_profiler_fire_event_enter (); FireEtwMonoProfilerModuleLoading ( @@ -5466,7 +5466,7 @@ mono_profiler_module_loaded ( { if (!EventEnabledMonoProfilerModuleLoaded ()) return; - + uint64_t module_id = (uint64_t)image; const ep_char8_t *module_path = NULL; const ep_char8_t *module_guid = NULL; @@ -5517,7 +5517,7 @@ mono_profiler_module_unloaded ( { if (!EventEnabledMonoProfilerModuleUnloaded ()) return; - + uint64_t module_id = (uint64_t)image; const ep_char8_t *module_path = NULL; const ep_char8_t *module_guid = NULL; @@ -5570,7 +5570,7 @@ mono_profiler_assembly_loading ( { if (!EventEnabledMonoProfilerAssemblyLoading ()) return; - + uint64_t assembly_id; uint64_t module_id; @@ -5624,7 +5624,7 @@ mono_profiler_assembly_unloading ( { if (!EventEnabledMonoProfilerAssemblyUnloading ()) return; - + uint64_t assembly_id; uint64_t module_id; @@ -6039,7 +6039,7 @@ mono_profiler_gc_allocation ( if (object) { vtable_id = (uint64_t)mono_object_get_vtable_internal (object); object_size = (uint64_t)mono_object_get_size_internal (object); - + /* account for object alignment */ object_size += 7; object_size &= ~7; diff --git a/src/mono/mono/eventpipe/test/ep-fastserializer-tests.c b/src/mono/mono/eventpipe/test/ep-fastserializer-tests.c index 6df68f607785db..9a00736612a56e 100644 --- a/src/mono/mono/eventpipe/test/ep-fastserializer-tests.c +++ b/src/mono/mono/eventpipe/test/ep-fastserializer-tests.c @@ -80,7 +80,7 @@ test_fast_serializer_object_fast_serialize (void) ep_raise_error_if_nok (provider != NULL); test_location = 3; - + ep_event = ep_event_alloc (provider, 1, 1, 1, EP_EVENT_LEVEL_VERBOSE, false, NULL, 0); ep_raise_error_if_nok (ep_event != NULL); diff --git a/src/mono/mono/metadata/appdomain.c b/src/mono/mono/metadata/appdomain.c index eed7c2012e126f..a717c205f79106 100644 --- a/src/mono/mono/metadata/appdomain.c +++ b/src/mono/mono/metadata/appdomain.c @@ -195,7 +195,7 @@ create_domain_objects (MonoDomain *domain) domain->out_of_memory_ex = MONO_HANDLE_RAW (mono_exception_from_name_two_strings_checked (mono_defaults.corlib, "System", "OutOfMemoryException", arg, NULL_HANDLE_STRING, error)); mono_error_assert_ok (error); - /* + /* * These two are needed because the signal handlers might be executing on * an alternate stack, and Boehm GC can't handle that. */ @@ -212,7 +212,7 @@ create_domain_objects (MonoDomain *domain) domain->ephemeron_tombstone = MONO_HANDLE_RAW (mono_object_new_handle (mono_defaults.object_class, error)); mono_error_assert_ok (error); - /* + /* * This class is used during exception handling, so initialize it here, to prevent * stack overflows while handling stack overflows. */ @@ -225,7 +225,7 @@ create_domain_objects (MonoDomain *domain) * \param domain domain returned by \c mono_init * * Initialize the core AppDomain: this function will run also some - * IL initialization code, so it needs the execution engine to be fully + * IL initialization code, so it needs the execution engine to be fully * operational. * * \c AppDomain.SetupInformation is set up in \c mono_runtime_exec_main, where @@ -377,7 +377,7 @@ mono_runtime_quit (void) (void) mono_threads_enter_gc_unsafe_region_unbalanced_internal (&dummy); // after quit_function (in particular, mini_cleanup) everything is // cleaned up so MONO_EXIT_GC_UNSAFE can't work and doesn't make sense. - + mono_runtime_quit_internal (); } @@ -390,7 +390,7 @@ mono_runtime_quit_internal (void) MONO_REQ_GC_UNSAFE_MODE; // but note that when we return, we're not in GC Unsafe mode anymore. // After clean up threads don't _have_ a thread state anymore. - + if (quit_function != NULL) quit_function (mono_get_root_domain (), NULL); } @@ -613,12 +613,12 @@ try_load_from (MonoAssembly **assembly, { gchar *fullpath; gboolean found = FALSE; - + *assembly = NULL; fullpath = g_build_filename (path1, path2, path3, path4, (const char*)NULL); found = g_file_test (fullpath, G_FILE_TEST_IS_REGULAR); - + if (found) { *assembly = mono_assembly_request_open (fullpath, req, NULL); } @@ -698,7 +698,7 @@ get_app_context_base_directory (MonoError *error) } /* - * Try loading the assembly from ApplicationBase and PrivateBinPath + * Try loading the assembly from ApplicationBase and PrivateBinPath * and then from assemblies_path if any. * LOCKING: This is called from the assembly loading code, which means the caller * might hold the loader lock. Thus, this function must not acquire the domain lock. @@ -778,7 +778,7 @@ ves_icall_System_Reflection_Assembly_InternalLoad (MonoStringHandle name_handle, alc = mono_assembly_get_alc (requesting_assembly); if (!alc) g_assert_not_reached (); - + g_assert (alc); mono_assembly_request_prepare_byname (&req, alc); req.basedir = NULL; @@ -948,7 +948,7 @@ runtimeconfig_json_get_buffer (MonovmRuntimeConfigArguments *arg, MonoFileMap ** *file_map = NULL; *buf_handle = NULL; - return NULL; + return NULL; } static void diff --git a/src/mono/mono/metadata/assembly-load-context.c b/src/mono/mono/metadata/assembly-load-context.c index 627086e3f5dfdc..f3ce63deb4314d 100644 --- a/src/mono/mono/metadata/assembly-load-context.c +++ b/src/mono/mono/metadata/assembly-load-context.c @@ -95,7 +95,7 @@ mono_alc_create_individual (MonoGCHandle this_gchandle, gboolean collectible, Mo static void mono_alc_cleanup_assemblies (MonoAssemblyLoadContext *alc) { - // The minimum refcount on assemblies is 2: one for the domain and one for the ALC. + // The minimum refcount on assemblies is 2: one for the domain and one for the ALC. // The domain refcount might be less than optimal on netcore, but its removal is too likely to cause issues for now. GSList *tmp; @@ -425,7 +425,7 @@ mono_alc_from_gchandle (MonoGCHandle alc_gchandle) return default_alc; MONO_STATIC_POINTER_INIT (MonoClassField, resolve) - + MonoClass *alc_class = mono_class_get_assembly_load_context_class (); g_assert (alc_class); resolve = mono_class_get_field_from_name_full (alc_class, "_nativeAssemblyLoadContext", NULL); @@ -436,7 +436,7 @@ mono_alc_from_gchandle (MonoGCHandle alc_gchandle) MonoAssemblyLoadContext *alc = NULL; mono_field_get_value_internal (mono_gchandle_get_target_internal (alc_gchandle), resolve, &alc); - return alc; + return alc; } MonoGCHandle diff --git a/src/mono/mono/metadata/assembly.h b/src/mono/mono/metadata/assembly.h index bffe668a053332..9f55a3db8114c0 100644 --- a/src/mono/mono/metadata/assembly.h +++ b/src/mono/mono/metadata/assembly.h @@ -2,7 +2,7 @@ * \file */ -#ifndef _MONONET_METADATA_ASSEMBLY_H_ +#ifndef _MONONET_METADATA_ASSEMBLY_H_ #define _MONONET_METADATA_ASSEMBLY_H_ #include @@ -21,12 +21,12 @@ MonoAssembly *mono_assembly_open_full (const char *filename, MonoImageOpenStatus *status, mono_bool refonly); MONO_API MONO_RT_EXTERNAL_ONLY -MonoAssembly* mono_assembly_load (MonoAssemblyName *aname, - const char *basedir, +MonoAssembly* mono_assembly_load (MonoAssemblyName *aname, + const char *basedir, MonoImageOpenStatus *status); MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly* mono_assembly_load_full (MonoAssemblyName *aname, - const char *basedir, + const char *basedir, MonoImageOpenStatus *status, mono_bool refonly); MONO_API MONO_RT_EXTERNAL_ONLY @@ -68,8 +68,8 @@ typedef void (*MonoAssemblyLoadFunc) (MonoAssembly *assembly, void* use MONO_API MONO_RT_EXTERNAL_ONLY void mono_install_assembly_load_hook (MonoAssemblyLoadFunc func, void* user_data); -/* - * Installs a new function which is used to search the list of loaded +/* + * Installs a new function which is used to search the list of loaded * assemblies for a given assembly name. */ typedef MonoAssembly *(*MonoAssemblySearchFunc) (MonoAssemblyName *aname, void* user_data); @@ -82,7 +82,7 @@ MONO_API MONO_RT_EXTERNAL_ONLY MonoAssembly* mono_assembly_invoke_search_hook (MonoAssemblyName *aname); /* - * Installs a new search function which is used as a last resort when loading + * Installs a new search function which is used as a last resort when loading * an assembly fails. This could invoke AssemblyResolve events. */ MONO_API MONO_RT_EXTERNAL_ONLY diff --git a/src/mono/mono/metadata/attrdefs.h b/src/mono/mono/metadata/attrdefs.h index 504c6c65fc6d2e..a3a47493e2a5a3 100644 --- a/src/mono/mono/metadata/attrdefs.h +++ b/src/mono/mono/metadata/attrdefs.h @@ -12,12 +12,12 @@ * * From the ECMA documentation */ - + #ifndef _MONO_METADATA_ATTRDEFS_H_ #define _MONO_METADATA_ATTRDEFS_H_ /* - * 23.1.1 Values for AssemblyHashAlgorithm + * 23.1.1 Values for AssemblyHashAlgorithm */ enum { MONO_ASSEMBLY_HASH_NONE, @@ -186,7 +186,7 @@ enum { MONO_METHOD_IMPL_ATTR_INTERNAL_CALL = 0x1000, MONO_METHOD_IMPL_ATTR_SYNCHRONIZED = 0x0020, MONO_METHOD_IMPL_ATTR_NOINLINING = 0x0008, - MONO_METHOD_IMPL_ATTR_NOOPTIMIZATION = 0x0040, + MONO_METHOD_IMPL_ATTR_NOOPTIMIZATION = 0x0040, MONO_METHOD_IMPL_ATTR_MAX_METHOD_IMPL_VAL = 0xffff }; diff --git a/src/mono/mono/metadata/boehm-gc.c b/src/mono/mono/metadata/boehm-gc.c index bdda3e69b8b028..34c85e2a84ec05 100644 --- a/src/mono/mono/metadata/boehm-gc.c +++ b/src/mono/mono/metadata/boehm-gc.c @@ -89,7 +89,7 @@ typedef struct { #define EMPTY_HANDLE_DATA(type) {NULL, NULL, 0, (type), 0, NULL} -/* weak and weak-track arrays will be allocated in malloc memory +/* weak and weak-track arrays will be allocated in malloc memory */ static HandleData gc_handles [] = { EMPTY_HANDLE_DATA (HANDLE_WEAK), @@ -254,7 +254,7 @@ mono_gc_max_generation (void) } guint64 -mono_gc_get_allocated_bytes_for_current_thread (void) +mono_gc_get_allocated_bytes_for_current_thread (void) { return 0; } @@ -1226,10 +1226,10 @@ void mono_gc_set_string_length (MonoString *str, gint32 new_length) { mono_unichar2 *new_end = str->chars + new_length; - - /* zero the discarded string. This null-delimits the string and allows + + /* zero the discarded string. This null-delimits the string and allows * the space to be reclaimed by SGen. */ - + memset (new_end, 0, (str->length - new_length + 1) * sizeof (mono_unichar2)); str->length = new_length; } @@ -1468,12 +1468,12 @@ alloc_handle (HandleData *handles, MonoObject *obj, gboolean track) * This returns a handle that wraps the object, this is used to keep a * reference to a managed object from the unmanaged world and preventing the * object from being disposed. - * + * * If \p pinned is false the address of the object can not be obtained, if it is * true the address of the object can be obtained. This will also pin the * object so it will not be possible by a moving garbage collector to move the - * object. - * + * object. + * * \returns a handle that can be used to access the object from * unmanaged code. */ @@ -1493,14 +1493,14 @@ mono_gchandle_new_internal (MonoObject *obj, gboolean pinned) * Unlike the \c mono_gchandle_new_internal the object can be reclaimed by the * garbage collector. In this case the value of the GCHandle will be * set to zero. - * + * * If \p track_resurrection is TRUE the object will be tracked through * finalization and if the object is resurrected during the execution * of the finalizer, then the returned weakref will continue to hold * a reference to the object. If \p track_resurrection is FALSE, then * the weak reference's target will become NULL as soon as the object * is passed on to the finalizer. - * + * * \returns a handle that can be used to access the object from * unmanaged code. */ @@ -1589,7 +1589,7 @@ mono_gc_is_null (void) * * Frees the \p gchandle handle. If there are no outstanding * references, the garbage collector can reclaim the memory of the - * object wrapped. + * object wrapped. */ void mono_gchandle_free_internal (MonoGCHandle gch) @@ -1625,7 +1625,7 @@ mono_gchandle_free_internal (MonoGCHandle gch) } guint64 -mono_gc_get_total_allocated_bytes (MonoBoolean precise) +mono_gc_get_total_allocated_bytes (MonoBoolean precise) { return 0; } diff --git a/src/mono/mono/metadata/cil-coff.h b/src/mono/mono/metadata/cil-coff.h index d6e966ee83c70a..8751f8daa5614a 100644 --- a/src/mono/mono/metadata/cil-coff.h +++ b/src/mono/mono/metadata/cil-coff.h @@ -186,7 +186,7 @@ typedef struct { #define MONO_PE_RES_DIR_ENTRY_DIR_OFFSET(d) (GUINT32_FROM_LE((d).dir) & 0x7fffffff) #define MONO_PE_RES_DIR_ENTRY_SET_DIR(d,i,o) ((d).dir = GUINT32_TO_LE(((guint32)((i)?1:0) << 31) | ((o) & 0x7fffffff))) -typedef struct +typedef struct { guint32 res_characteristics; guint32 res_date_stamp; diff --git a/src/mono/mono/metadata/class-accessors.c b/src/mono/mono/metadata/class-accessors.c index a9d950d9e0fa07..9042a0ebe5b8d3 100644 --- a/src/mono/mono/metadata/class-accessors.c +++ b/src/mono/mono/metadata/class-accessors.c @@ -26,8 +26,8 @@ typedef enum { PROP_DECLSEC_FLAGS = 8, /* guint32 */ PROP_WEAK_BITMAP = 9, PROP_DIM_CONFLICTS = 10, /* GSList of MonoMethod* */ - PROP_FIELD_DEF_VALUES_2BYTESWIZZLE = 11, /* MonoFieldDefaultValue* with default values swizzled at 2 byte boundaries*/ - PROP_FIELD_DEF_VALUES_4BYTESWIZZLE = 12, /* MonoFieldDefaultValue* with default values swizzled at 4 byte boundaries*/ + PROP_FIELD_DEF_VALUES_2BYTESWIZZLE = 11, /* MonoFieldDefaultValue* with default values swizzled at 2 byte boundaries*/ + PROP_FIELD_DEF_VALUES_4BYTESWIZZLE = 12, /* MonoFieldDefaultValue* with default values swizzled at 4 byte boundaries*/ PROP_FIELD_DEF_VALUES_8BYTESWIZZLE = 13, /* MonoFieldDefaultValue* with default values swizzled at 8 byte boundaries*/ PROP_METADATA_UPDATE_INFO = 14, /* MonoClassMetadataUpdateInfo* */ } InfrequentDataKind; diff --git a/src/mono/mono/metadata/class-getters.h b/src/mono/mono/metadata/class-getters.h index 7f88b78780142d..98363a33952aa0 100644 --- a/src/mono/mono/metadata/class-getters.h +++ b/src/mono/mono/metadata/class-getters.h @@ -1,4 +1,4 @@ -/* +/* * \file Definitions of getters for the fields of struct _MonoClass * * Copyright 2018 Microsoft @@ -8,7 +8,7 @@ /* No include guards - this file is meant to be included multiple times. * Before including the file define the following macros: * MONO_CLASS_GETTER(funcname, rettype, optref, argtype, fieldname) - * + * * MONO_CLASS_OFFSET(funcname, argtype, fieldname) */ diff --git a/src/mono/mono/metadata/class-init.c b/src/mono/mono/metadata/class-init.c index 58b95248ba828d..2ae4f39dab8554 100644 --- a/src/mono/mono/metadata/class-init.c +++ b/src/mono/mono/metadata/class-init.c @@ -96,7 +96,7 @@ To load TextBoxBase<> to do so it must resolve the parent which is TextInput it must resolve TextInput<> and TextBox. To load TextBox it must resolve the parent which is TextBoxBase. -At this point the runtime must instantiate TextBoxBase. Both types are partially loaded +At this point the runtime must instantiate TextBoxBase. Both types are partially loaded at this point, iow, both are registered in the type map and both and a NULL parent. This means that the resulting generic instance will have a NULL parent, which is wrong and will cause breakage. @@ -108,7 +108,7 @@ static int record_gclass_instantiation; static GSList *gclass_recorded_list; typedef gboolean (*gclass_record_func) (MonoClass*, void*); -/* +/* * LOCKING: loader lock must be held until pairing disable_gclass_recording is called. */ static void @@ -117,7 +117,7 @@ enable_gclass_recording (void) ++record_gclass_instantiation; } -/* +/* * LOCKING: loader lock must be held since pairing enable_gclass_recording was called. */ static void @@ -426,7 +426,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError guint tidx = mono_metadata_token_index (type_token); MonoGenericContext *context = NULL; const char *name, *nspace; - guint icount = 0; + guint icount = 0; MonoClass **interfaces; guint32 field_last, method_last; guint32 nesting_tokeen; @@ -447,7 +447,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError } mono_metadata_decode_row (tt, tidx - 1, cols, MONO_TYPEDEF_SIZE); - + name = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAME]); nspace = mono_metadata_string_heap (image, cols [MONO_TYPEDEF_NAMESPACE]); @@ -528,7 +528,7 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError if (mono_class_is_gtd (klass)) disable_gclass_recording (fix_gclass_incomplete_instantiation, klass); - /* + /* * This might access klass->_byval_arg for recursion generated by generic constraints, * so it has to come after setup_mono_type (). */ @@ -686,8 +686,8 @@ mono_class_create_from_typedef (MonoImage *image, guint32 type_token, MonoError // compute is_byreflike if (m_class_is_valuetype (klass)) if (class_has_isbyreflike_attribute (klass)) - klass->is_byreflike = 1; - + klass->is_byreflike = 1; + mono_loader_unlock (); MONO_PROFILER_RAISE (class_loaded, (klass)); @@ -841,7 +841,7 @@ mono_class_create_generic_inst (MonoGenericClass *gclass) klass->name = gklass->name; klass->name_space = gklass->name_space; - + klass->image = gklass->image; klass->type_token = gklass->type_token; @@ -889,7 +889,7 @@ mono_class_create_generic_inst (MonoGenericClass *gclass) if (klass->enumtype) { /* - * For enums, gklass->fields might not been set, but instance_size etc. is + * For enums, gklass->fields might not been set, but instance_size etc. is * already set in mono_reflection_create_internal_class (). For non-enums, * these will be computed normally in mono_class_layout_fields (). */ @@ -936,7 +936,7 @@ mono_class_create_generic_inst (MonoGenericClass *gclass) ++class_ginst_count; inflated_classes_size += sizeof (MonoClassGenericInst); - + mono_loader_unlock (); return klass; @@ -994,10 +994,10 @@ class_kind_may_contain_generic_instances (MonoTypeKind kind) /** * mono_class_create_bounded_array: - * \param element_class element class + * \param element_class element class * \param rank the dimension of the array class * \param bounded whenever the array has non-zero bounds - * \returns A class object describing the array with element type \p element_type and + * \returns A class object describing the array with element type \p element_type and * dimension \p rank. */ MonoClass * @@ -1243,9 +1243,9 @@ mono_class_create_bounded_array (MonoClass *eclass, guint32 rank, gboolean bound /** * mono_class_create_array: - * \param element_class element class + * \param element_class element class * \param rank the dimension of the array class - * \returns A class object describing the array with element type \p element_type and + * \returns A class object describing the array with element type \p element_type and * dimension \p rank. */ MonoClass * @@ -1440,7 +1440,7 @@ mono_class_create_ptr (MonoType *type) } mono_image_unlock (image); } - + result = mm ? (MonoClass *)mono_mem_manager_alloc0 (mm, sizeof (MonoClassPointer)) : (MonoClass *)mono_image_alloc0 (image, sizeof (MonoClassPointer)); UnlockedAdd (&classes_size, sizeof (MonoClassPointer)); @@ -1565,7 +1565,7 @@ mono_class_create_fnptr (MonoMethodSignature *sig) } -static gboolean +static gboolean method_is_reabstracted (guint16 flags) { if ((flags & METHOD_ATTRIBUTE_ABSTRACT && flags & METHOD_ATTRIBUTE_FINAL)) @@ -1880,7 +1880,7 @@ mono_class_is_gparam_with_nonblittable_parent (MonoClass *klass) * \param field_offsets Offsets of the klass' fields relative to the start of layout_check * \param field_count Count of klass fields * \param invalid_field_offset When the layout is invalid it will be set to the offset of the field which is invalid - * + * * \return True if the layout of the struct is valid, otherwise false. */ static gboolean @@ -2033,7 +2033,7 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_ /* * Enable GC aware auto layout: in this mode, reference - * fields are grouped together inside objects, increasing collector + * fields are grouped together inside objects, increasing collector * performance. * Requires that all classes whose layout is known to native code be annotated * with [StructLayout (LayoutKind.Sequential)] @@ -2099,7 +2099,7 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_ blittable = FALSE; /* Compute klass->has_references */ - /* + /* * Process non-static fields first, since static fields might recursively * refer to the class itself. */ @@ -2175,7 +2175,7 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_ } size = mono_type_size (field->type, &align); - + /* FIXME (LAMESPEC): should we also change the min alignment according to pack? */ align = packing_size ? MIN (packing_size, align): align; /* if the field has managed references, we need to force-align it @@ -2196,7 +2196,7 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_ } instance_size = MAX (real_size, instance_size); - + if (instance_size & (min_align - 1)) { instance_size += min_align - 1; instance_size &= ~(min_align - 1); @@ -2276,7 +2276,7 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_ * enable it when a MONO_DEBUG property is set. * * For small structs, set min_align to at least the struct size to improve - * performance, and since the JIT memset/memcpy code assumes this and generates + * performance, and since the JIT memset/memcpy code assumes this and generates * unaligned accesses otherwise. See #78990 for a testcase. */ if (mono_align_small_structs && top) { @@ -2343,7 +2343,7 @@ mono_class_layout_fields (MonoClass *klass, int base_instance_size, int packing_ guint32 size; field = &klass->fields [i]; - + if (!(field->type->attrs & FIELD_ATTRIBUTE_STATIC) || field->type->attrs & FIELD_ATTRIBUTE_LITERAL) continue; if (mono_field_is_deleted (field)) @@ -2630,7 +2630,7 @@ generic_array_methods (MonoClass *klass) if (!iface || !check_method_exists (iface, mname)) continue; - + generic_array_method_info [i].array_method = m; name = (gchar *)mono_image_alloc (mono_defaults.corlib, strlen (iname) + strlen (mname) + 1); @@ -2736,7 +2736,7 @@ static guint32 mono_get_unique_iid (MonoClass *klass) { int iid; - + g_assert (MONO_CLASS_IS_INTERFACE_INTERNAL (klass)); classes_lock (); @@ -2797,8 +2797,8 @@ mono_get_unique_iid (MonoClass *klass) * mono_class_init_internal: * \param klass the class to initialize * - * Compute the \c instance_size, \c class_size and other infos that cannot be - * computed at \c mono_class_get time. Also compute vtable_size if possible. + * Compute the \c instance_size, \c class_size and other infos that cannot be + * computed at \c mono_class_get time. Also compute vtable_size if possible. * Initializes the following fields in \p klass: * - all the fields initialized by \c mono_class_init_sizes * - has_cctor @@ -2820,7 +2820,7 @@ mono_class_init_internal (MonoClass *klass) gboolean ghcimpl = FALSE; gboolean has_cctor = FALSE; int first_iface_slot = 0; - + g_assert (klass); /* Double-checking locking pattern */ @@ -2851,7 +2851,7 @@ mono_class_init_internal (MonoClass *klass) MonoClass *element_class = klass->element_class; MonoClass *cast_class = klass->cast_class; - if (!element_class->inited) + if (!element_class->inited) mono_class_init_internal (element_class); if (mono_class_set_type_load_failure_causedby_class (klass, element_class, "Could not load array element class")) goto leave; @@ -2888,7 +2888,7 @@ mono_class_init_internal (MonoClass *klass) initialize_object_slots (klass); - /* + /* * Initialize the rest of the data without creating a generic vtable if possible. * If possible, also compute vtable_size, so mono_class_create_runtime_vtable () can * also avoid computing a generic vtable. @@ -2959,7 +2959,7 @@ mono_class_init_internal (MonoClass *klass) int mcount = mono_class_get_method_count (klass); for (i = 0; i < mcount; ++i) { MonoMethod *method = klass->methods [i]; - if ((method->flags & METHOD_ATTRIBUTE_SPECIAL_NAME) && + if ((method->flags & METHOD_ATTRIBUTE_SPECIAL_NAME) && (strcmp (".cctor", method->name) == 0)) { has_cctor = 1; break; @@ -3059,7 +3059,7 @@ mono_class_init_checked (MonoClass *klass, MonoError *error) /* * COM initialization is delayed until needed. * However when a [ComImport] attribute is present on a type it will trigger - * the initialization. This is not a problem unless the BCL being executed + * the initialization. This is not a problem unless the BCL being executed * lacks the types that COM depends on (e.g. Variant on Silverlight). */ static void @@ -3123,13 +3123,13 @@ mono_class_setup_parent (MonoClass *klass, MonoClass *parent) if (MONO_CLASS_IS_IMPORT (klass) || mono_class_is_com_object (parent)) mono_class_set_is_com_object (klass); - + if (system_namespace) { - if (klass->name [0] == 'D' && !strcmp (klass->name, "Delegate")) + if (klass->name [0] == 'D' && !strcmp (klass->name, "Delegate")) klass->delegate = 1; } - if (klass->parent->enumtype || (mono_is_corlib_image (klass->parent->image) && (strcmp (klass->parent->name, "ValueType") == 0) && + if (klass->parent->enumtype || (mono_is_corlib_image (klass->parent->image) && (strcmp (klass->parent->name, "ValueType") == 0) && (strcmp (klass->parent->name_space, "System") == 0))) klass->valuetype = 1; if (mono_is_corlib_image (klass->parent->image) && ((strcmp (klass->parent->name, "Enum") == 0) && (strcmp (klass->parent->name_space, "System") == 0))) { @@ -3223,7 +3223,7 @@ mono_class_setup_mono_type (MonoClass *klass) t = MONO_TYPE_BOOLEAN; } else if (!strcmp(name, "Byte")) { t = MONO_TYPE_U1; - klass->blittable = TRUE; + klass->blittable = TRUE; } break; case 'C': @@ -3234,7 +3234,7 @@ mono_class_setup_mono_type (MonoClass *klass) case 'D': if (!strcmp (name, "Double")) { t = MONO_TYPE_R8; - klass->blittable = TRUE; + klass->blittable = TRUE; } break; case 'I': @@ -3255,7 +3255,7 @@ mono_class_setup_mono_type (MonoClass *klass) case 'S': if (!strcmp (name, "Single")) { t = MONO_TYPE_R4; - klass->blittable = TRUE; + klass->blittable = TRUE; } else if (!strcmp(name, "SByte")) { t = MONO_TYPE_I1; klass->blittable = TRUE; @@ -3324,7 +3324,7 @@ create_array_method (MonoClass *klass, const char *name, MonoMethodSignature *si * @class: a class * * Initializes the 'methods' array in CLASS. - * Calling this method should be avoided if possible since it allocates a lot + * Calling this method should be avoided if possible since it allocates a lot * of long-living MonoMethod structures. * Methods belonging to an interface are assigned a sequential slot starting * from 0. @@ -3363,7 +3363,7 @@ mono_class_setup_methods (MonoClass *klass) g_free (method); mono_error_cleanup (error); - return; + return; } } } else if (klass->rank) { @@ -3936,7 +3936,7 @@ mono_class_setup_has_finalizer (MonoClass *klass) * hierarchy + 1 * - supertypes: array of classes: each element has a class in the hierarchy * starting from @class up to System.Object - * + * * LOCKING: Acquires the loader lock. */ void diff --git a/src/mono/mono/metadata/class-internals.h b/src/mono/mono/metadata/class-internals.h index 4a7992875bf684..c45c242393e2d5 100644 --- a/src/mono/mono/metadata/class-internals.h +++ b/src/mono/mono/metadata/class-internals.h @@ -35,7 +35,7 @@ typedef struct _MonoDynamicMethod MonoDynamicMethod; /* Properties that applies to a group of structs should better use a higher number * to avoid colision with type specific properties. - * + * * This prop applies to class, method, property, event, assembly and image. */ #define MONO_PROP_DYNAMIC_CATTR 0x1000 @@ -87,7 +87,7 @@ struct _MonoMethod { signed int slot : 16; /* - * If is_generic is TRUE, the generic_container is stored in image->property_hash, + * If is_generic is TRUE, the generic_container is stored in image->property_hash, * using the key MONO_METHOD_PROP_GENERIC_CONTAINER. */ }; @@ -115,9 +115,9 @@ struct _MonoMethodPInvoke { guint32 implmap_idx; /* index into IMPLMAP */ }; -/* +/* * Stores the default value / RVA of fields. - * This information is rarely needed, so it is stored separately from + * This information is rarely needed, so it is stored separately from * MonoClassField. */ typedef struct MonoFieldDefaultValue { @@ -358,7 +358,7 @@ struct MonoVTable { /* do not add any fields after vtable, the structure is dynamically extended */ /* vtable contains function pointers to methods or their trampolines, at the end there may be a slot containing the pointer to the static fields */ - gpointer vtable [MONO_ZERO_LEN_ARRAY]; + gpointer vtable [MONO_ZERO_LEN_ARRAY]; }; #define MONO_SIZEOF_VTABLE (sizeof (MonoVTable) - MONO_ZERO_LEN_ARRAY * SIZEOF_VOID_P) @@ -647,7 +647,7 @@ typedef struct { gboolean enabled; } MonoStats; -/* +/* * new structure to hold performace counters values that are exported * to managed code. * Note: never remove fields from this structure and only add them to the end. @@ -802,7 +802,7 @@ mono_class_has_special_static_fields (MonoClass *klass); const char* mono_class_get_field_default_value (MonoClassField *field, MonoTypeEnum *def_type); -MONO_COMPONENT_API MonoProperty* +MONO_COMPONENT_API MonoProperty* mono_class_get_property_from_name_internal (MonoClass *klass, const char *name); const char* @@ -1260,7 +1260,7 @@ mono_class_has_variant_generic_params (MonoClass *klass); gboolean mono_class_is_variant_compatible (MonoClass *klass, MonoClass *oklass, gboolean check_for_reference_conv); -gboolean +gboolean mono_class_is_subclass_of_internal (MonoClass *klass, MonoClass *klassc, gboolean check_interfaces); MONO_COMPONENT_API mono_bool diff --git a/src/mono/mono/metadata/class-private-definition.h b/src/mono/mono/metadata/class-private-definition.h index a1b8432d690ce3..949c71d71f6e25 100644 --- a/src/mono/mono/metadata/class-private-definition.h +++ b/src/mono/mono/metadata/class-private-definition.h @@ -13,9 +13,9 @@ struct _MonoClass { /* element class for arrays and enum basetype for enums */ - MonoClass *element_class; + MonoClass *element_class; /* used for subtype checks */ - MonoClass *cast_class; + MonoClass *cast_class; /* for fast subtype checks */ MonoClass **supertypes; @@ -33,10 +33,10 @@ struct _MonoClass { /* A class contains static and non static data. Static data can be * of the same type as the class itselfs, but it does not influence - * the instance size of the class. To avoid cyclic calls to + * the instance size of the class. To avoid cyclic calls to * mono_class_init_internal (from mono_class_instance_size ()) we first - * initialise all non static fields. After that we set size_inited - * to 1, because we know the instance size now. After that we + * initialise all non static fields. After that we set size_inited + * to 1, because we know the instance size now. After that we * initialise all static fields. */ @@ -55,8 +55,8 @@ struct _MonoClass { /* next byte */ guint packing_size : 4; - guint ghcimpl : 1; /* class has its own GetHashCode impl */ - guint has_finalize : 1; /* class has its own Finalize impl */ + guint ghcimpl : 1; /* class has its own GetHashCode impl */ + guint has_finalize : 1; /* class has its own Finalize impl */ /* next byte */ guint delegate : 1; /* class is a Delegate */ guint gc_descr_inited : 1; /* gc_descr is initialized */ @@ -69,7 +69,7 @@ struct _MonoClass { * for COM Interop. set this flag on loading so all we need is a quick check * during object creation rather than having to traverse supertypes */ - guint is_com_object : 1; + guint is_com_object : 1; guint nested_classes_inited : 1; /* Whenever nested_class is initialized */ /* next byte*/ @@ -95,7 +95,7 @@ struct _MonoClass { guint16 interface_count; guint32 interface_id; /* unique inderface id (for interfaces) */ guint32 max_interface_id; - + guint16 interface_offsets_count; MonoClass **interfaces_packed; guint16 *interface_offsets_packed; diff --git a/src/mono/mono/metadata/class-setup-vtable.c b/src/mono/mono/metadata/class-setup-vtable.c index e1d66fe05eb1e2..a0b7128ce0705d 100644 --- a/src/mono/mono/metadata/class-setup-vtable.c +++ b/src/mono/mono/metadata/class-setup-vtable.c @@ -242,7 +242,7 @@ mono_class_setup_interface_offsets_internal (MonoClass *klass, int cur_slot, gbo for (i = 0; i < ifaces->len; ++i) { int io; ic = (MonoClass *)g_ptr_array_index (ifaces, i); - + /*Force the sharing of interface offsets between parent and subtypes.*/ io = mono_class_interface_offset (k, ic); g_assertf (io >= 0, "class %s parent %s has no offset for iface %s", @@ -337,7 +337,7 @@ mono_class_setup_interface_offsets_internal (MonoClass *klass, int cur_slot, gbo } g_free (ifaces_array); } - + //printf ("JUST DONE: "); //print_implemented_interfaces (klass); @@ -345,7 +345,7 @@ mono_class_setup_interface_offsets_internal (MonoClass *klass, int cur_slot, gbo } /* - * Setup interface offsets for interfaces. + * Setup interface offsets for interfaces. * Initializes: * - klass->max_interface_id * - klass->interface_offsets_count @@ -409,7 +409,7 @@ mono_signature_get_full_desc (MonoMethodSignature *sig, gboolean include_namespa int i; char *result; GString *res = g_string_new (""); - + g_string_append_c (res, '('); for (i = 0; i < sig->param_count; ++i) { if (i > 0) @@ -433,7 +433,7 @@ print_method_signatures (MonoMethod *im, MonoMethod *cm) { printf ("(IM \"%s\", CM \"%s\")", im_sig, cm_sig); g_free (im_sig); g_free (cm_sig); - + } #endif @@ -545,7 +545,7 @@ check_interface_method_override (MonoClass *klass, MonoMethod *im, MonoMethod *c const char *ic_name_space = ic->name_space; const char *ic_name = ic->name; char *subname; - + if (! require_newslot) { TRACE_INTERFACE_VTABLE (printf ("[INJECTED METHOD REFUSED]")); return FALSE; @@ -579,7 +579,7 @@ check_interface_method_override (MonoClass *klass, MonoMethod *im, MonoMethod *c TRACE_INTERFACE_VTABLE (printf ("[INTERFACE NAME CHECK FAILED]")); return FALSE; } - + subname = (char*)strstr (cm->name, ic_name_space); if (subname != cm->name) { TRACE_INTERFACE_VTABLE (printf ("[ACTUAL NAMESPACE CHECK FAILED]")); @@ -615,7 +615,7 @@ check_interface_method_override (MonoClass *klass, MonoMethod *im, MonoMethod *c g_free (decl_name); return FALSE; } - + return TRUE; } } @@ -652,14 +652,14 @@ print_vtable_full (MonoClass *klass, MonoMethod** vtable, int size, int first_no char *full_name = mono_type_full_name (m_class_get_byval_arg (klass)); int i; int parent_size; - + printf ("*** Vtable for class '%s' at \"%s\" (size %d)\n", full_name, message, size); - + if (print_interfaces) { print_implemented_interfaces (klass); printf ("* Interfaces for class '%s' done.\nStarting vtable (size %d):\n", full_name, size); } - + if (klass->parent) { parent_size = klass->parent->vtable_size; } else { @@ -699,7 +699,7 @@ mono_class_verify_vtable (MonoClass *klass) printf ("*** Verifying VTable of class '%s' \n", full_name); g_free (full_name); full_name = NULL; - + if (!klass->methods) return; @@ -840,7 +840,7 @@ mono_class_check_vtable_constraints (MonoClass *klass, GList *in_setup) } return TRUE; } - + /* * mono_class_setup_vtable: * @@ -959,10 +959,10 @@ apply_override (MonoClass *klass, MonoClass *override_class, MonoMethod **vtable dslot += mono_class_interface_offset (klass, decl->klass); - //check if the override comes from an interface and the overrided method is from a class, if this is the case it shouldn't be changed + //check if the override comes from an interface and the overrided method is from a class, if this is the case it shouldn't be changed if (vtable [dslot] && vtable [dslot]->klass && MONO_CLASS_IS_INTERFACE_INTERNAL (override->klass) && !MONO_CLASS_IS_INTERFACE_INTERNAL (vtable [dslot]->klass)) return TRUE; - + vtable [dslot] = override; if (!MONO_CLASS_IS_INTERFACE_INTERNAL (override->klass)) { /* @@ -1110,7 +1110,7 @@ print_unimplemented_interface_method_info (MonoClass *klass, MonoClass *ic, Mono int index, mcount; char *method_signature; char *type_name; - + for (index = 0; index < onum; ++index) { mono_trace_warning (MONO_TRACE_TYPE, " at slot %d: %s (%d) overrides %s (%d)", im_slot, overrides [index*2+1]->name, overrides [index*2+1]->slot, overrides [index*2]->name, overrides [index*2]->slot); @@ -1266,15 +1266,15 @@ print_vtable_layout_result (MonoClass *klass, MonoMethod **vtable, int cur_slot) for (i = 0; i < klass->interface_count; i++) { MonoClass *ic = klass->interfaces [i]; - printf (" slot offset: %03d, method count: %03d, iid: %03d %s\n", + printf (" slot offset: %03d, method count: %03d, iid: %03d %s\n", mono_class_interface_offset (klass, ic), mono_class_setup_count_virtual_methods (ic), ic->interface_id, mono_type_full_name (m_class_get_byval_arg (ic))); } for (MonoClass *k = klass->parent; k ; k = k->parent) { for (i = 0; i < k->interface_count; i++) { - MonoClass *ic = k->interfaces [i]; - printf (" parent slot offset: %03d, method count: %03d, iid: %03d %s\n", + MonoClass *ic = k->interfaces [i]; + printf (" parent slot offset: %03d, method count: %03d, iid: %03d %s\n", mono_class_interface_offset (klass, ic), mono_class_setup_count_virtual_methods (ic), ic->interface_id, mono_type_full_name (m_class_get_byval_arg (ic))); } @@ -1285,10 +1285,10 @@ print_vtable_layout_result (MonoClass *klass, MonoMethod **vtable, int cur_slot) /* * LOCKING: this is supposed to be called with the loader lock held. */ -static int +static int setup_class_vtsize (MonoClass *klass, GList *in_setup, int *cur_slot, int *stelemref_slot, MonoError *error) { - GPtrArray *ifaces = NULL; + GPtrArray *ifaces = NULL; int i, max_vtsize = 0; ifaces = mono_class_get_implemented_interfaces (klass, error); if (!is_ok (error)) { @@ -1305,7 +1305,7 @@ setup_class_vtsize (MonoClass *klass, GList *in_setup, int *cur_slot, int *stele g_ptr_array_free (ifaces, TRUE); ifaces = NULL; } - + if (klass->parent) { mono_class_init_internal (klass->parent); mono_class_setup_vtable_full (klass->parent, in_setup); @@ -1381,14 +1381,14 @@ mono_class_setup_vtable_ginst (MonoClass *klass, GList *in_setup) #ifdef FEATURE_COVARIANT_RETURNS /* * vtable_slot_has_preserve_base_overrides_attribute: - * + * * Needs to walk up the class hierarchy looking for the methods in this slot to * see if any are tagged with PreserveBaseOverrideAtrribute. */ static gboolean vtable_slot_has_preserve_base_overrides_attribute (MonoClass *klass, int slot, MonoClass **out_klass) { - /* + /* * FIXME: it's slow to do this loop every time. A faster way would be * to hang a boolean in the image of the parent class if it or any of * its ancestors have the attribute. @@ -1695,7 +1695,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o max_vtsize = setup_class_vtsize (klass, in_setup, &cur_slot, &stelemref_slot, error); if (max_vtsize == -1) return; - + cur_slot = mono_class_setup_interface_offsets_internal (klass, cur_slot, TRUE); if (cur_slot == -1) /*setup_interface_offsets fails the type.*/ return; @@ -1768,7 +1768,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o TRACE_INTERFACE_VTABLE (print_vtable_full (klass, vtable, cur_slot, first_non_interface_slot, "AFTER OVERRIDING INTERFACE METHODS", FALSE)); /* - * Create a list of virtual methods to avoid calling + * Create a list of virtual methods to avoid calling * mono_class_get_virtual_methods () which is slow because of the metadata * optimization. */ @@ -1823,14 +1823,14 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o } else { interface_is_explicitly_implemented_by_class = TRUE; } - + // Loop on all interface methods... int mcount = mono_class_get_method_count (ic); for (im_index = 0; im_index < mcount; im_index++) { MonoMethod *im = ic->methods [im_index]; int im_slot = ic_offset + im->slot; MonoMethod *override_im = (override_map != NULL) ? (MonoMethod *)g_hash_table_lookup (override_map, im) : NULL; - + if (!m_method_is_virtual (im)) continue; @@ -1867,14 +1867,14 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o if (mono_class_has_failure (klass)) /*Might be set by check_interface_method_override*/ goto fail; } - + // If the slot is still empty, look in all the inherited virtual methods... if ((vtable [im_slot] == NULL) && klass->parent != NULL) { MonoClass *parent = klass->parent; // Reverse order, so that last added methods are preferred for (cm_index = parent->vtable_size - 1; cm_index >= 0; cm_index--) { MonoMethod *cm = parent->vtable [cm_index]; - + TRACE_INTERFACE_VTABLE ((cm != NULL) && printf (" For slot %d ('%s'.'%s':'%s'), trying (ancestor) method '%s'.'%s':'%s'... ", im_slot, ic->name_space, ic->name, im->name, cm->klass->name_space, cm->klass->name, cm->name)); if ((cm != NULL) && check_interface_method_override (klass, im, cm, MONO_ITF_OVERRIDE_SLOT_EMPTY)) { TRACE_INTERFACE_VTABLE (printf ("[everything ok]: ASSIGNING\n")); @@ -1902,7 +1902,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o } } } - + // If the class is not abstract, check that all its interface slots are full. // The check is done here and not directly at the end of the loop above because // it can happen (for injected generic array interfaces) that the same slot is @@ -1913,15 +1913,15 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o for (i = 0; i < klass->interface_offsets_count; i++) { int ic_offset; int im_index; - + ic = klass->interfaces_packed [i]; ic_offset = mono_class_interface_offset (klass, ic); - + int mcount = mono_class_get_method_count (ic); for (im_index = 0; im_index < mcount; im_index++) { MonoMethod *im = ic->methods [im_index]; int im_slot = ic_offset + im->slot; - + if (!m_method_is_virtual (im)) continue; if (mono_method_get_is_reabstracted (im)) @@ -1960,7 +1960,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o if (!cmsig || !m1sig) /* FIXME proper error message, use signature_checked? */ goto fail; - if (!strcmp(cm->name, m1->name) && + if (!strcmp(cm->name, m1->name) && mono_metadata_signature_equal (cmsig, m1sig)) { slot = mono_method_get_vtable_slot (m1); @@ -1996,8 +1996,8 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o } if (mono_class_has_failure (k)) goto fail; - - if (slot >= 0) + + if (slot >= 0) break; } if (slot >= 0) @@ -2033,7 +2033,7 @@ mono_class_setup_vtable_general (MonoClass *klass, MonoMethod **overrides, int o #endif if (!override_map) override_map = g_hash_table_new (mono_aligned_addr_hash, NULL); - TRACE_INTERFACE_VTABLE (printf ("adding explicit override from %s [%p] to %s [%p]\n", + TRACE_INTERFACE_VTABLE (printf ("adding explicit override from %s [%p] to %s [%p]\n", mono_method_full_name (decl, 1), decl, mono_method_full_name (impl, 1), impl)); g_hash_table_insert (override_map, decl, impl); diff --git a/src/mono/mono/metadata/class.h b/src/mono/mono/metadata/class.h index 8966e029b7c6c2..a9fada0d31a3c0 100644 --- a/src/mono/mono/metadata/class.h +++ b/src/mono/mono/metadata/class.h @@ -127,7 +127,7 @@ MONO_API MONO_RT_EXTERNAL_ONLY MonoClass * mono_class_from_mono_type (MonoType *type); MONO_API MONO_RT_EXTERNAL_ONLY mono_bool -mono_class_is_subclass_of (MonoClass *klass, MonoClass *klassc, +mono_class_is_subclass_of (MonoClass *klass, MonoClass *klassc, mono_bool check_interfaces); MONO_API MONO_RT_EXTERNAL_ONLY mono_bool @@ -140,7 +140,7 @@ mono_ldtoken (MonoImage *image, uint32_t token, MonoClass **retcla MONO_API char * mono_type_get_name_full (MonoType *type, MonoTypeNameFormat format); -MONO_API char* +MONO_API char* mono_type_get_name (MonoType *type); MONO_API MonoType* diff --git a/src/mono/mono/metadata/cominterop.c b/src/mono/mono/metadata/cominterop.c index 7084b5feb81fb7..ff2de267ddfd6d 100644 --- a/src/mono/mono/metadata/cominterop.c +++ b/src/mono/mono/metadata/cominterop.c @@ -1,7 +1,7 @@ /** * \file * COM Interop Support - * + * * * (C) 2002 Ximian, Inc. http://www.ximian.com * @@ -267,7 +267,7 @@ mono_class_try_get_com_object_class (void) * cominterop_method_signature: * @method: a method * - * Returns: the corresponding unmanaged method signature for a managed COM + * Returns: the corresponding unmanaged method signature for a managed COM * method. */ static MonoMethodSignature* @@ -380,7 +380,7 @@ cominterop_get_com_slot_begin (MonoClass* klass) { ERROR_DECL (error); MonoCustomAttrInfo *cinfo = NULL; - MonoInterfaceTypeAttribute* itf_attr = NULL; + MonoInterfaceTypeAttribute* itf_attr = NULL; cinfo = mono_custom_attrs_from_class_checked (klass, error); mono_error_assert_ok (error); @@ -760,7 +760,7 @@ mono_cominterop_emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, case MONO_MARSHAL_CONV_OBJECT_IDISPATCH: { guint32 pos_null = 0, pos_ccw = 0, pos_end = 0; - MonoClass *klass = NULL; + MonoClass *klass = NULL; klass = mono_class_from_mono_type_internal (type); @@ -845,13 +845,13 @@ mono_cominterop_emit_object_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, mono_mb_emit_byte (mb, CEE_CONV_U); mono_mb_emit_byte (mb, CEE_STIND_I); - mono_mb_emit_ldloc (mb, 0); + mono_mb_emit_ldloc (mb, 0); mono_mb_emit_byte (mb, CEE_LDIND_REF); // if null just break, dst was already inited to 0 pos_null = mono_mb_emit_short_branch (mb, CEE_BRFALSE_S); - mono_mb_emit_ldloc (mb, 0); + mono_mb_emit_ldloc (mb, 0); mono_mb_emit_byte (mb, CEE_LDIND_REF); mono_mb_emit_icall (mb, cominterop_object_is_rcw); pos_rcw = mono_mb_emit_short_branch (mb, CEE_BRFALSE_S); @@ -860,7 +860,7 @@ mono_cominterop_emit_object_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, mono_mb_emit_ldloc (mb, 1); // load src - mono_mb_emit_ldloc (mb, 0); + mono_mb_emit_ldloc (mb, 0); mono_mb_emit_byte (mb, CEE_LDIND_REF); mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoTransparentProxy, rp)); mono_mb_emit_byte (mb, CEE_LDIND_REF); @@ -894,15 +894,15 @@ mono_cominterop_emit_object_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, } mono_mb_emit_byte (mb, CEE_STIND_I); pos_end = mono_mb_emit_short_branch (mb, CEE_BR_S); - + // if not rcw mono_mb_patch_short_branch (mb, pos_rcw); /* load dst to store later */ mono_mb_emit_ldloc (mb, 1); /* load src */ - mono_mb_emit_ldloc (mb, 0); + mono_mb_emit_ldloc (mb, 0); mono_mb_emit_byte (mb, CEE_LDIND_REF); - + if (conv == MONO_MARSHAL_CONV_OBJECT_INTERFACE) mono_mb_emit_ptr (mb, mono_type_get_class_internal (type)); else if (conv == MONO_MARSHAL_CONV_OBJECT_IUNKNOWN) @@ -991,7 +991,7 @@ cominterop_get_native_wrapper_adjusted (MonoMethod *method) if (method->iflags & METHOD_IMPL_ATTRIBUTE_PRESERVE_SIG) { // move return spec to last param - if (!MONO_TYPE_IS_VOID (sig->ret) && mspecs[0] == NULL) { + if (!MONO_TYPE_IS_VOID (sig->ret) && mspecs[0] == NULL) { // default object to VARIANT if (sig->ret->type == MONO_TYPE_OBJECT) { mspecs[0] = g_new0 (MonoMarshalSpec, 1); @@ -1014,7 +1014,7 @@ cominterop_get_native_wrapper_adjusted (MonoMethod *method) mono_marshal_emit_native_wrapper (m_class_get_image (method->klass), mb_native, sig_native, piinfo, mspecs, piinfo->addr, EMIT_NATIVE_WRAPPER_CHECK_EXCEPTIONS | EMIT_NATIVE_WRAPPER_RUNTIME_MARSHALLING_ENABLED); - res = mono_mb_create_method (mb_native, sig_native, sig_native->param_count + 16); + res = mono_mb_create_method (mb_native, sig_native, sig_native->param_count + 16); mono_mb_free (mb_native); @@ -1048,7 +1048,7 @@ mono_cominterop_get_native_wrapper (MonoMethod *method) if (!m_class_get_vtable (method->klass)) mono_class_setup_vtable (method->klass); - + if (!m_class_get_methods (method->klass)) mono_class_setup_methods (method->klass); g_assert (!mono_class_has_failure (method->klass)); /*FIXME do proper error handling*/ @@ -1119,7 +1119,7 @@ mono_cominterop_get_native_wrapper (MonoMethod *method) // push managed return value as byref last argument if (!MONO_TYPE_IS_VOID (sig->ret) && !preserve_sig) mono_mb_emit_ldloc_addr (mb, retval); - + adjusted_method = cominterop_get_native_wrapper_adjusted (method); mono_mb_emit_managed_call (mb, adjusted_method, NULL); @@ -1142,8 +1142,8 @@ mono_cominterop_get_native_wrapper (MonoMethod *method) mono_mb_emit_byte (mb, CEE_RET); } - - + + } /* Does this case ever get hit? */ else { @@ -1175,7 +1175,7 @@ mono_cominterop_get_invoke (MonoMethod *method) MonoMethod *res; int i; GHashTable* cache; - + cache = mono_marshal_get_cache (&mono_method_get_wrapper_cache (method)->cominterop_invoke_cache, mono_aligned_addr_hash, NULL); g_assert (method); @@ -1243,14 +1243,14 @@ mono_cominterop_get_invoke (MonoMethod *method) return res; } -/* Maps a managed object to its unmanaged representation - * i.e. it's COM Callable Wrapper (CCW). +/* Maps a managed object to its unmanaged representation + * i.e. it's COM Callable Wrapper (CCW). * Key: MonoObject* * Value: MonoCCW* */ static GHashTable* ccw_hash = NULL; -/* Maps a CCW interface to it's containing CCW. +/* Maps a CCW interface to it's containing CCW. * Note that a CCW support many interfaces. * Key: MonoCCW* * Value: MonoCCWInterface* @@ -1277,10 +1277,10 @@ mono_get_addref (void) } int -mono_cominterop_emit_marshal_com_interface (EmitMarshalContext *m, int argnum, +mono_cominterop_emit_marshal_com_interface (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, - int conv_arg, MonoType **conv_arg_type, + MonoMarshalSpec *spec, + int conv_arg, MonoType **conv_arg_type, MarshalAction action) { MonoMethodBuilder *mb = m->mb; @@ -1334,13 +1334,13 @@ mono_cominterop_emit_marshal_com_interface (EmitMarshalContext *m, int argnum, conv_arg = mono_mb_add_local (mb, int_type); mono_mb_emit_ptr (mb, NULL); - mono_mb_emit_stloc (mb, conv_arg); + mono_mb_emit_stloc (mb, conv_arg); /* we dont need any conversions for out parameters */ if (m_type_is_byref (t) && t->attrs & PARAM_ATTRIBUTE_OUT) break; - mono_mb_emit_ldarg (mb, argnum); + mono_mb_emit_ldarg (mb, argnum); if (m_type_is_byref (t)) mono_mb_emit_byte (mb, CEE_LDIND_REF); /* if null just break, conv arg was already inited to 0 */ @@ -1472,7 +1472,7 @@ mono_cominterop_emit_marshal_com_interface (EmitMarshalContext *m, int argnum, /* case if null */ mono_mb_patch_short_branch (mb, pos_null); break; - } + } case MARSHAL_ACTION_MANAGED_CONV_IN: { int ccw_obj; @@ -1534,11 +1534,11 @@ mono_cominterop_emit_marshal_com_interface (EmitMarshalContext *m, int argnum, mono_mb_emit_byte (mb, CEE_LDC_I4_0); mono_mb_emit_byte (mb, CEE_STIND_I); - mono_mb_emit_ldloc (mb, conv_arg); + mono_mb_emit_ldloc (mb, conv_arg); pos_null = mono_mb_emit_short_branch (mb, CEE_BRFALSE_S); /* to store later */ - mono_mb_emit_ldarg (mb, argnum); + mono_mb_emit_ldarg (mb, argnum); mono_mb_emit_ldloc (mb, conv_arg); if (klass && klass != mono_defaults.object_class) { mono_mb_emit_ptr (mb, t); @@ -1595,7 +1595,7 @@ mono_cominterop_emit_marshal_com_interface (EmitMarshalContext *m, int argnum, g_assert_not_reached (); mono_mb_emit_stloc (mb, 3); mono_mb_emit_ldloc (mb, 3); - + mono_mb_emit_managed_call (mb, mono_get_addref (), NULL); mono_mb_emit_byte (mb, CEE_POP); @@ -1794,7 +1794,7 @@ ves_icall_System_ComObject_CreateRCW (MonoReflectionTypeHandle ref_type, MonoErr return mono_object_new_alloc_by_vtable (vtable, error); } -static gboolean +static gboolean cominterop_rcw_interface_finalizer (gpointer key, gpointer value, gpointer user_data) { mono_IUnknown_Release ((MonoIUnknown*)value); @@ -1928,7 +1928,7 @@ cominterop_setup_marshal_context (EmitMarshalContext *m, MonoMethod *method) /* FIXME: which to use? */ csig = mono_metadata_signature_dup_full (method_klass_image, sig); /* csig = mono_metadata_signature_dup (sig); */ - + /* STDCALL on windows, CDECL everywhere else to work with XPCOM and MainWin COM */ #ifdef HOST_WIN32 csig->call_convention = MONO_CALL_STDCALL; @@ -2554,10 +2554,10 @@ cominterop_get_managed_wrapper_adjusted (MonoMethod *method) main_clause->flags = MONO_EXCEPTION_CLAUSE_NONE; main_clause->try_len = mono_mb_get_pos (mb) - main_clause->try_offset; main_clause->data.catch_class = mono_defaults.object_class; - + /* handler code */ main_clause->handler_offset = mono_mb_get_label (mb); - + if (!preserve_sig || (sig->ret && !m_type_is_byref (sig->ret) && (sig->ret->type == MONO_TYPE_U4 || sig->ret->type == MONO_TYPE_I4))) { mono_mb_emit_managed_call (mb, get_hr_for_exception, NULL); mono_mb_emit_stloc (mb, hr); @@ -2584,7 +2584,7 @@ cominterop_get_managed_wrapper_adjusted (MonoMethod *method) #endif /* DISABLE_JIT */ mono_cominterop_lock (); - res = mono_mb_create_method (mb, sig_native, sig_native->param_count + 16); + res = mono_mb_create_method (mb, sig_native, sig_native->param_count + 16); mono_cominterop_unlock (); mono_mb_free (mb); @@ -2605,10 +2605,10 @@ cominterop_class_guid_equal (const guint8* guid, MonoClass* klass) return FALSE; } -static int STDCALL +static int STDCALL cominterop_ccw_addref_impl (MonoCCWInterface* ccwe); -static int STDCALL +static int STDCALL cominterop_ccw_addref (MonoCCWInterface* ccwe) { int result; @@ -2621,7 +2621,7 @@ cominterop_ccw_addref (MonoCCWInterface* ccwe) return result; } -static int STDCALL +static int STDCALL cominterop_ccw_addref_impl (MonoCCWInterface* ccwe) { MONO_REQ_GC_UNSAFE_MODE; @@ -2639,10 +2639,10 @@ cominterop_ccw_addref_impl (MonoCCWInterface* ccwe) return ref_count; } -static int STDCALL +static int STDCALL cominterop_ccw_release_impl (MonoCCWInterface* ccwe); -static int STDCALL +static int STDCALL cominterop_ccw_release (MonoCCWInterface* ccwe) { int result; @@ -2655,7 +2655,7 @@ cominterop_ccw_release (MonoCCWInterface* ccwe) return result; } -static int STDCALL +static int STDCALL cominterop_ccw_release_impl (MonoCCWInterface* ccwe) { MONO_REQ_GC_UNSAFE_MODE; @@ -2691,10 +2691,10 @@ cominterop_ccw_getfreethreadedmarshaler (MonoCCW* ccw, MonoObjectHandle object, } #endif -static int STDCALL +static int STDCALL cominterop_ccw_queryinterface_impl (MonoCCWInterface* ccwe, const guint8* riid, gpointer* ppv); -static int STDCALL +static int STDCALL cominterop_ccw_queryinterface (MonoCCWInterface* ccwe, const guint8* riid, gpointer* ppv) { int result; @@ -2707,7 +2707,7 @@ cominterop_ccw_queryinterface (MonoCCWInterface* ccwe, const guint8* riid, gpoin return result; } -static int STDCALL +static int STDCALL cominterop_ccw_queryinterface_impl (MonoCCWInterface* ccwe, const guint8* riid, gpointer* ppv) { MONO_REQ_GC_UNSAFE_MODE; @@ -2718,7 +2718,7 @@ cominterop_ccw_queryinterface_impl (MonoCCWInterface* ccwe, const guint8* riid, MonoCCW* ccw = ccwe->ccw; MonoClass* klass_iter = NULL; MonoObjectHandle object = mono_gchandle_get_target_handle (ccw->gc_handle); - + g_assert (!MONO_HANDLE_IS_NULL (object)); MonoClass* const klass = mono_handle_class (object); @@ -2741,7 +2741,7 @@ cominterop_ccw_queryinterface_impl (MonoCCWInterface* ccwe, const guint8* riid, if (cominterop_class_guid_equal (riid, mono_class_get_idispatch_class ())) { if (!cominterop_can_support_dispatch (klass)) return MONO_E_NOINTERFACE; - + *ppv = cominterop_get_ccw_checked (object, mono_class_get_idispatch_class (), error); mono_error_assert_ok (error); /* remember to addref on QI */ @@ -2792,7 +2792,7 @@ cominterop_ccw_queryinterface_impl (MonoCCWInterface* ccwe, const guint8* riid, return MONO_E_NOINTERFACE; } -static int STDCALL +static int STDCALL cominterop_ccw_get_type_info_count (MonoCCWInterface* ccwe, guint32 *pctinfo) { if(!pctinfo) @@ -2803,19 +2803,19 @@ cominterop_ccw_get_type_info_count (MonoCCWInterface* ccwe, guint32 *pctinfo) return MONO_S_OK; } -static int STDCALL +static int STDCALL cominterop_ccw_get_type_info (MonoCCWInterface* ccwe, guint32 iTInfo, guint32 lcid, gpointer *ppTInfo) { return MONO_E_NOTIMPL; } -static int STDCALL +static int STDCALL cominterop_ccw_get_ids_of_names_impl (MonoCCWInterface* ccwe, gpointer riid, gunichar2** rgszNames, guint32 cNames, guint32 lcid, gint32 *rgDispId); -static int STDCALL +static int STDCALL cominterop_ccw_get_ids_of_names (MonoCCWInterface* ccwe, gpointer riid, gunichar2** rgszNames, guint32 cNames, guint32 lcid, gint32 *rgDispId) @@ -2830,7 +2830,7 @@ cominterop_ccw_get_ids_of_names (MonoCCWInterface* ccwe, gpointer riid, return result; } -static int STDCALL +static int STDCALL cominterop_ccw_get_ids_of_names_impl (MonoCCWInterface* ccwe, gpointer riid, gunichar2** rgszNames, guint32 cNames, guint32 lcid, gint32 *rgDispId) @@ -2891,7 +2891,7 @@ cominterop_ccw_get_ids_of_names_impl (MonoCCWInterface* ccwe, gpointer riid, return ret; } -static int STDCALL +static int STDCALL cominterop_ccw_invoke (MonoCCWInterface* ccwe, guint32 dispIdMember, gpointer riid, guint32 lcid, guint16 wFlags, gpointer pDispParams, @@ -3165,7 +3165,7 @@ mono_string_from_bstr_icall_impl (mono_bstr_const bstr, MonoError *error) return mono_string_from_bstr_checked (bstr, error); } -MONO_API void +MONO_API void mono_free_bstr (/*mono_bstr_const*/gpointer bstr) { if (!bstr) @@ -3397,7 +3397,7 @@ mono_cominterop_emit_marshal_safearray (EmitMarshalContext *m, int argnum, MonoT result.SetValueImpl(elem, index); } ++index; - } + } while (mono_marshal_safearray_next(safearray, indices)); } // label2 mono_marshal_safearray_end(safearray, indices); @@ -3707,7 +3707,7 @@ mono_marshal_safearray_begin (gpointer safearray, MonoArray **result, gpointer * gboolean bounded = FALSE; #ifndef HOST_WIN32 - // If not on windows, check that the MS provider is used as it is + // If not on windows, check that the MS provider is used as it is // required for SAFEARRAY support. // If SAFEARRAYs are not supported, returning FALSE from this // function will prevent the other mono_marshal_safearray_xxx functions @@ -3832,7 +3832,7 @@ mono_marshal_safearray_get_value (gpointer safearray, gpointer indices) #endif /* HOST_WIN32 */ /* This is an icall */ -static +static gboolean mono_marshal_safearray_next (gpointer safearray, gpointer indices) { ERROR_DECL (error); @@ -3950,7 +3950,7 @@ static gboolean mono_marshal_safearray_create (MonoArray *input, gpointer *newsafearray, gpointer *indices, gpointer empty) { #ifndef HOST_WIN32 - // If not on windows, check that the MS provider is used as it is + // If not on windows, check that the MS provider is used as it is // required for SAFEARRAY support. // If SAFEARRAYs are not supported, returning FALSE from this // function will prevent the other mono_marshal_safearray_xxx functions @@ -4023,7 +4023,7 @@ mono_marshal_safearray_set_value (gpointer safearray, gpointer indices, gpointer } } -static +static void mono_marshal_safearray_free_indices (gpointer indices) { g_free (indices); diff --git a/src/mono/mono/metadata/cominterop.h b/src/mono/mono/metadata/cominterop.h index ea6118b7e362de..2bd129ca7d7cde 100644 --- a/src/mono/mono/metadata/cominterop.h +++ b/src/mono/mono/metadata/cominterop.h @@ -1,7 +1,7 @@ /** * \file * COM Interop Support - * + * * * (C) 2002 Ximian, Inc. http://www.ximian.com * @@ -39,16 +39,16 @@ MonoMethod * mono_cominterop_get_invoke (MonoMethod *method); int -mono_cominterop_emit_marshal_com_interface (EmitMarshalContext *m, int argnum, +mono_cominterop_emit_marshal_com_interface (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, - int conv_arg, MonoType **conv_arg_type, + MonoMarshalSpec *spec, + int conv_arg, MonoType **conv_arg_type, MarshalAction action); int mono_cominterop_emit_marshal_safearray (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, + MonoMarshalSpec *spec, int conv_arg, MonoType **conv_arg_type, MarshalAction action); @@ -58,7 +58,7 @@ mono_string_from_bstr (/*mono_bstr*/gpointer bstr); MonoStringHandle mono_string_from_bstr_checked (mono_bstr_const bstr, MonoError *error); -MONO_API void +MONO_API void mono_free_bstr (/*mono_bstr_const*/gpointer bstr); MonoClass* diff --git a/src/mono/mono/metadata/coree.c b/src/mono/mono/metadata/coree.c index 0d2be4aab223fb..be6ce1434544c6 100644 --- a/src/mono/mono/metadata/coree.c +++ b/src/mono/mono/metadata/coree.c @@ -432,7 +432,7 @@ HMODULE WINAPI MonoLoadImage(LPCWSTR FileName) if (FileHandle == INVALID_HANDLE_VALUE) return NULL; - FileSize = GetFileSize(FileHandle, NULL); + FileSize = GetFileSize(FileHandle, NULL); if (FileSize == INVALID_FILE_SIZE) goto CloseFile; diff --git a/src/mono/mono/metadata/debug-helpers.c b/src/mono/mono/metadata/debug-helpers.c index b2743a89b03267..c3c706b754c6dc 100644 --- a/src/mono/mono/metadata/debug-helpers.c +++ b/src/mono/mono/metadata/debug-helpers.c @@ -88,7 +88,7 @@ append_class_name (GString *res, MonoClass *klass, gboolean include_namespace) static MonoClass* find_system_class (const char *name) { - if (!strcmp (name, "void")) + if (!strcmp (name, "void")) return mono_defaults.void_class; else if (!strcmp (name, "char")) return mono_defaults.char_class; else if (!strcmp (name, "bool")) return mono_defaults.boolean_class; @@ -335,7 +335,7 @@ mono_context_get_desc (MonoGenericContext *context) res = g_strdup (str->str); g_string_free (str, TRUE); return res; -} +} /** * mono_method_desc_new: @@ -360,7 +360,7 @@ mono_method_desc_new (const char *name, gboolean include_namespace) char *class_name, *class_nspace, *method_name, *use_args, *end; int use_namespace; int generic_delim_stack; - + class_nspace = g_strdup (name); use_args = strchr (class_nspace, '('); if (use_args) { @@ -429,7 +429,7 @@ MonoMethodDesc* mono_method_desc_from_method (MonoMethod *method) { MonoMethodDesc *result; - + result = g_new0 (MonoMethodDesc, 1); result->include_namespace = TRUE; result->name = g_strdup (method->name); @@ -583,7 +583,7 @@ mono_method_desc_search_in_class (MonoMethodDesc *desc, MonoClass *klass) { MonoMethod* m; gpointer iter = NULL; - + while ((m = mono_class_get_methods (klass, &iter))) if (mono_method_desc_match (desc, m)) return m; @@ -663,7 +663,7 @@ dis_one (GString *str, MonoDisHelper *dh, MonoMethod *method, const unsigned cha } if (dh->label_format) g_string_append_printf (str, dh->label_format, label); - + i = mono_opcode_value (&ip, end); ip++; opcode = &mono_opcodes [i]; @@ -833,7 +833,7 @@ mono_disasm_code_one (MonoDisHelper *dh, MonoMethod *method, const guchar *ip, c ip = dis_one (res, dh, method, ip, ip + 2); if (endp) *endp = ip; - + result = res->str; g_string_free (res, FALSE); return result; @@ -853,7 +853,7 @@ mono_disasm_code (MonoDisHelper *dh, MonoMethod *method, const guchar *ip, const while (ip < end) { ip = dis_one (res, dh, method, ip, end); } - + result = res->str; g_string_free (res, FALSE); return result; diff --git a/src/mono/mono/metadata/debug-mono-ppdb.h b/src/mono/mono/metadata/debug-mono-ppdb.h index d26c16446a49a7..1a011a10307789 100644 --- a/src/mono/mono/metadata/debug-mono-ppdb.h +++ b/src/mono/mono/metadata/debug-mono-ppdb.h @@ -50,7 +50,7 @@ mono_ppdb_lookup_location_enc (MonoPPDBFile *ppdb_file, int idx, uint32_t offset void mono_ppdb_get_seq_points (MonoDebugMethodInfo *minfo, char **source_file, GPtrArray **source_file_list, int **source_files, MonoSymSeqPoint **seq_points, int *n_seq_points); -gboolean +gboolean mono_ppdb_get_seq_points_enc (MonoDebugMethodInfo *minfo, MonoPPDBFile *ppdb_file, int idx, char **source_file, GPtrArray **source_file_list, int **source_files, MonoSymSeqPoint **seq_points, int *n_seq_points); MonoDebugLocalsInfo* @@ -68,7 +68,7 @@ mono_ppdb_get_image (MonoPPDBFile *ppdb); char * mono_ppdb_get_sourcelink (MonoDebugHandle *handle); -gboolean +gboolean mono_ppdb_is_embedded (MonoPPDBFile *ppdb); MONO_COMPONENT_API MonoPPDBFile* diff --git a/src/mono/mono/metadata/debug-mono-symfile.c b/src/mono/mono/metadata/debug-mono-symfile.c index d8eed685da2b57..72925b73a68fe0 100644 --- a/src/mono/mono/metadata/debug-mono-symfile.c +++ b/src/mono/mono/metadata/debug-mono-symfile.c @@ -176,7 +176,7 @@ mono_debug_open_mono_symbols (MonoDebugHandle *handle, const uint8_t *raw_conten mono_file_map_close (f); } } - + if (load_symfile (handle, symfile, in_the_debugger)) { mono_debugger_unlock (); return symfile; @@ -233,7 +233,7 @@ read_leb128 (const uint8_t *ptr, const uint8_t **rptr) do { b = *ptr++; - + ret = ret | ((b & 0x7f) << shift); shift += 7; } while ((b & 0x80) == 0x80); @@ -290,7 +290,7 @@ check_line (StatementMachine *stm, int offset, MonoDebugSourceLocation **locatio } if (stm->last_line == 0) { - /* + /* * The IL offset is less than the first IL offset which has a corresponding * source line. */ @@ -658,7 +658,7 @@ mono_debug_symfile_get_seq_points (MonoDebugMethodInfo *minfo, char **source_fil if (source_files) (*source_files) [i] = (*source_file_list)->len - 1; } - } + } if (n_seq_points) { g_assert (seq_points); diff --git a/src/mono/mono/metadata/domain-internals.h b/src/mono/mono/metadata/domain-internals.h index 398898c6e609a0..65a44da3a28b44 100644 --- a/src/mono/mono/metadata/domain-internals.h +++ b/src/mono/mono/metadata/domain-internals.h @@ -29,7 +29,7 @@ G_BEGIN_DECLS * unloaded, and assemblies loaded by the appdomain are not unloaded either. This * allows us to use typed gc in non-default appdomains too, leading to increased * performance. - */ + */ extern gboolean mono_dont_free_domains; struct _MonoAppContext { @@ -136,7 +136,7 @@ mono_runtime_register_runtimeconfig_json_properties (MonovmRuntimeConfigArgument void mono_runtime_install_appctx_properties (void); -MONO_COMPONENT_API void +MONO_COMPONENT_API void mono_domain_set_fast (MonoDomain *domain); G_END_DECLS diff --git a/src/mono/mono/metadata/dynamic-image.c b/src/mono/mono/metadata/dynamic-image.c index 0eef1743355763..706d4ed209a9f1 100644 --- a/src/mono/mono/metadata/dynamic-image.c +++ b/src/mono/mono/metadata/dynamic-image.c @@ -1,8 +1,8 @@ /** * \file * Images created at runtime. - * - * + * + * * Author: * Paolo Molaro (lupus@ximian.com) * @@ -213,11 +213,11 @@ mono_dynamic_image_get_registered_token (MonoDynamicImage *dynimage, guint32 tok #endif /** - * + * * mono_dynamic_image_is_valid_token: - * + * * Returns TRUE if token is valid in the given image. - * + * */ gboolean mono_dynamic_image_is_valid_token (MonoDynamicImage *image, guint32 token) @@ -234,7 +234,7 @@ mono_dynamic_image_is_valid_token (MonoDynamicImage *image, guint32 token) * mono_reflection_lookup_dynamic_token: * * Finish the Builder object pointed to by TOKEN and return the corresponding - * runtime structure. If HANDLE_CLASS is not NULL, it is set to the class required by + * runtime structure. If HANDLE_CLASS is not NULL, it is set to the class required by * mono_ldtoken. If valid_token is TRUE, assert if it is not found in the token->object * mapping table. * @@ -250,7 +250,7 @@ mono_reflection_lookup_dynamic_token (MonoImage *image, guint32 token, gboolean MonoClass *klass; error_init (error); - + lookup_dyn_token (assembly, token, &obj); if (MONO_HANDLE_IS_NULL (obj)) { if (valid_token) @@ -343,7 +343,7 @@ mono_dynamic_image_create (MonoDynamicAssembly *assembly, char *assembly_name, c image = g_new0 (MonoDynamicImage, 1); MONO_PROFILER_RAISE (image_loading, (&image->image)); - + /*g_print ("created image %p\n", image);*/ /* keep in sync with image.c */ image->image.name = assembly_name; @@ -392,7 +392,7 @@ mono_dynamic_image_create (MonoDynamicAssembly *assembly, char *assembly_name, c image->image.assembly = (MonoAssembly*)assembly; image->pe_kind = 0x1; /* ILOnly */ image->machine = 0x14c; /* I386 */ - + MONO_PROFILER_RAISE (image_loaded, (&image->image)); dynamic_images_lock (); diff --git a/src/mono/mono/metadata/dynamic-stream.c b/src/mono/mono/metadata/dynamic-stream.c index e33bec79d3fa11..940532bdd96c8e 100644 --- a/src/mono/mono/metadata/dynamic-stream.c +++ b/src/mono/mono/metadata/dynamic-stream.c @@ -34,14 +34,14 @@ make_room_in_stream (MonoDynamicStream *stream, int size) if (size <= stream->alloc_size) return; - + while (stream->alloc_size <= size) { if (stream->alloc_size < 4096) stream->alloc_size = 4096; else stream->alloc_size *= 2; } - + stream->data = (char *)g_realloc (stream->data, stream->alloc_size); } @@ -59,7 +59,7 @@ mono_dynstream_insert_string (MonoDynamicStream *sh, const char *str) len = strlen (str) + 1; idx = sh->index; - + make_room_in_stream (sh, idx + len); /* @@ -93,12 +93,12 @@ mono_dynstream_add_data (MonoDynamicStream *stream, gconstpointer data, guint32 MONO_REQ_GC_NEUTRAL_MODE; guint32 idx; - + make_room_in_stream (stream, stream->index + len); memcpy (stream->data + stream->index, data, len); idx = stream->index; stream->index += len; - /* + /* * align index? Not without adding an additional param that controls it since * we may store a blob value in pieces. */ @@ -111,7 +111,7 @@ mono_dynstream_add_zero (MonoDynamicStream *stream, guint32 len) MONO_REQ_GC_NEUTRAL_MODE; guint32 idx; - + make_room_in_stream (stream, stream->index + len); memset (stream->data + stream->index, 0, len); idx = stream->index; diff --git a/src/mono/mono/metadata/exception.c b/src/mono/mono/metadata/exception.c index f1aaba68de069f..340ab7d4664522 100644 --- a/src/mono/mono/metadata/exception.c +++ b/src/mono/mono/metadata/exception.c @@ -101,7 +101,7 @@ mono_exception_from_name (MonoImage *image, const char *name_space, * \returns the initialized exception instance. */ MonoException * -mono_exception_from_name_domain (MonoDomain *domain, MonoImage *image, +mono_exception_from_name_domain (MonoDomain *domain, MonoImage *image, const char* name_space, const char *name) { HANDLE_FUNCTION_ENTER (); @@ -148,14 +148,14 @@ create_exception_two_strings (MonoClass *klass, MonoStringHandle a1, MonoStringH int const count = 1 + !MONO_HANDLE_IS_NULL (a2); gpointer iter; MonoMethod *m; - + MonoObjectHandle o = mono_object_new_handle (klass, error); mono_error_assert_ok (error); iter = NULL; while ((m = mono_class_get_methods (klass, &iter))) { MonoMethodSignature *sig; - + if (strcmp (".ctor", mono_method_get_name (m))) continue; sig = mono_method_signature_internal (m); @@ -862,7 +862,7 @@ MonoException * mono_get_exception_bad_image_format (const char *msg) { return mono_exception_from_name_msg (mono_get_corlib (), "System", "BadImageFormatException", msg); -} +} /** * mono_get_exception_bad_image_format2: @@ -896,7 +896,7 @@ mono_get_exception_bad_image_format2 (const char *msg, MonoString *fname_raw) MonoException * mono_get_exception_stack_overflow (void) { - return mono_exception_from_name (mono_get_corlib (), "System", "StackOverflowException"); + return mono_exception_from_name (mono_get_corlib (), "System", "StackOverflowException"); } /** @@ -1222,7 +1222,7 @@ mono_invoke_unhandled_exception_hook (MonoObject *exc) MonoObject *other = NULL; MonoString *str = mono_object_try_to_string (exc, &other, inner_error); char *msg = NULL; - + if (str && is_ok (inner_error)) { msg = mono_string_to_utf8_checked_internal (str, inner_error); if (!is_ok (inner_error)) { diff --git a/src/mono/mono/metadata/exception.h b/src/mono/mono/metadata/exception.h index 155c23c7e77476..0876657ac2e60e 100644 --- a/src/mono/mono/metadata/exception.h +++ b/src/mono/mono/metadata/exception.h @@ -12,8 +12,8 @@ MONO_BEGIN_DECLS MONO_API MonoException * -mono_exception_from_name (MonoImage *image, - const char* name_space, +mono_exception_from_name (MonoImage *image, + const char* name_space, const char *name); MONO_API MonoException * @@ -34,8 +34,8 @@ mono_exception_from_token_two_strings (MonoImage *image, uint32_t token, MonoString *a1, MonoString *a2); MONO_API MonoException * -mono_exception_from_name_domain (MonoDomain *domain, MonoImage *image, - const char* name_space, +mono_exception_from_name_domain (MonoDomain *domain, MonoImage *image, + const char* name_space, const char *name); MONO_API MonoException * diff --git a/src/mono/mono/metadata/external-only.c b/src/mono/mono/metadata/external-only.c index 19999e384c7763..2b65cf280fb4f7 100644 --- a/src/mono/mono/metadata/external-only.c +++ b/src/mono/mono/metadata/external-only.c @@ -275,7 +275,7 @@ mono_g_hash_table_new_type (GHashFunc hash_func, GEqualFunc key_equal_func, Mono /** * mono_config_for_assembly: */ -void +void mono_config_for_assembly (MonoImage *assembly) { } @@ -618,8 +618,8 @@ mono_context_init (MonoDomain *domain) * * Used to set the system configuration for an appdomain * - * Without using this, embedded builds will get 'System.Configuration.ConfigurationErrorsException: - * Error Initializing the configuration system. ---> System.ArgumentException: + * Without using this, embedded builds will get 'System.Configuration.ConfigurationErrorsException: + * Error Initializing the configuration system. ---> System.ArgumentException: * The 'ExeConfigFilename' argument cannot be null.' for some managed calls. */ void diff --git a/src/mono/mono/metadata/gc-internals.h b/src/mono/mono/metadata/gc-internals.h index 60e2d79d0ff3c3..466c3be715dc05 100644 --- a/src/mono/mono/metadata/gc-internals.h +++ b/src/mono/mono/metadata/gc-internals.h @@ -182,7 +182,7 @@ void mono_gc_clear_domain (MonoDomain * domain); void mono_gc_suspend_finalizers (void); -/* +/* * Register a root which can only be written using a write barrier. * Writes to the root must be done using a write barrier (MONO_ROOT_SETREF). * If the root uses an user defined mark routine, the writes are not required to be @@ -235,30 +235,30 @@ typedef void (*MonoRangeCopyFunction)(gpointer, gconstpointer, int size); MonoRangeCopyFunction mono_gc_get_range_copy_func (void); -/* +/* * Functions supplied by the runtime and called by the GC. Currently only used * by SGEN. */ typedef struct { - /* - * Function called during thread startup/attach to allocate thread-local data + /* + * Function called during thread startup/attach to allocate thread-local data * needed by the other functions. */ gpointer (*thread_attach_func) (void); - /* + /* * Function called during thread deatch to free the data allocated by * thread_attach_func. */ void (*thread_detach_func) (gpointer user_data); - /* + /* * Function called from every thread when suspending for GC. It can save - * data needed for marking from thread stacks. user_data is the data returned + * data needed for marking from thread stacks. user_data is the data returned * by attach_func. This might called with GC locks held and the word stopped, * so it shouldn't do any synchronization etc. */ void (*thread_suspend_func) (gpointer user_data, void *sigcontext, MonoContext *ctx); - /* - * Function called to mark from thread stacks. user_data is the data returned + /* + * Function called to mark from thread stacks. user_data is the data returned * by attach_func. This is called twice, with the word stopped: * - in the first pass, it should mark areas of the stack using * conservative marking by calling mono_gc_conservatively_scan_area (). diff --git a/src/mono/mono/metadata/gc.c b/src/mono/mono/metadata/gc.c index ad8f0c2b9e337c..5144e40eeec431 100644 --- a/src/mono/mono/metadata/gc.c +++ b/src/mono/mono/metadata/gc.c @@ -175,7 +175,7 @@ coop_cond_timedwait_alertable (MonoCoopCond *cond, MonoCoopMutex *mutex, guint32 return res; } -/* +/* * actually, we might want to queue the finalize requests in a separate thread, * but we need to be careful about the execution domain of the thread... */ @@ -253,7 +253,7 @@ mono_gc_run_finalize (void *obj, void *data) * These can't be finalized during unloading/shutdown, since that would * free the native code which can still be referenced by other * finalizers. - * FIXME: This is not perfect, objects dying at the same time as + * FIXME: This is not perfect, objects dying at the same time as * dynamic methods can still reference them even when !shutdown. */ return; @@ -293,7 +293,7 @@ mono_gc_run_finalize (void *obj, void *data) return; } - /* + /* * To avoid the locking plus the other overhead of mono_runtime_invoke_checked (), * create and precompile a wrapper which calls the finalize method using * a CALLVIRT. @@ -356,7 +356,7 @@ mono_gc_run_finalize (void *obj, void *data) * (because of the GetHashCode hack), but we need to pass the real address to register_finalizer. * This also means that in the callback we need to adjust the pointer to get back the real * MonoObject*. - * We also need to be consistent in the use of the GC_debug* variants of malloc and register_finalizer, + * We also need to be consistent in the use of the GC_debug* variants of malloc and register_finalizer, * since that, too, can cause the underlying pointer to be offset. */ static void @@ -386,7 +386,7 @@ object_register_finalizer (MonoObject *obj, void (*callback)(void *, void*)) * * Records that object \p obj has a finalizer, this will call the * Finalize method when the garbage collector disposes the object. - * + * */ void mono_object_register_finalizer_handle (MonoObjectHandle obj) @@ -420,7 +420,7 @@ mono_object_register_finalizer (MonoObject *obj) * \returns TRUE if succeeded, FALSE if there was a timeout */ gboolean -mono_domain_finalize (MonoDomain *domain, guint32 timeout) +mono_domain_finalize (MonoDomain *domain, guint32 timeout) { DomainFinalizationReq *req; MonoInternalThread *thread = mono_thread_internal_current (); @@ -432,11 +432,11 @@ mono_domain_finalize (MonoDomain *domain, guint32 timeout) /* We are called from inside a finalizer, not much we can do here */ return FALSE; - /* + /* * No need to create another thread 'cause the finalizer thread * is still working and will take care of running the finalizers - */ - + */ + if (gc_disabled) return TRUE; @@ -453,7 +453,7 @@ mono_domain_finalize (MonoDomain *domain, guint32 timeout) if (domain == mono_get_root_domain ()) finalizing_root_domain = TRUE; - + mono_finalizer_lock (); domains_to_finalize = g_slist_append (domains_to_finalize, req); @@ -789,7 +789,7 @@ finalize_domain_objects (void) while (g_hash_table_size (finalizable_objects_hash) > 0) { int i; GPtrArray *objs; - /* + /* * Since the domain is unloading, nobody is allowed to put * new entries into the hash table. But finalize_object might * remove entries from the hash table, so we make a copy. @@ -813,7 +813,7 @@ finalize_domain_objects (void) /* cleanup the reference queue */ reference_queue_clear_for_domain (domain); - + /* printf ("DONE.\n"); */ mono_coop_sem_post (&req->done); @@ -1002,7 +1002,7 @@ mono_gc_is_finalizer_internal_thread (MonoInternalThread *thread) * In Mono objects are finalized asynchronously on a separate thread. * This routine tests whether the \p thread argument represents the * finalization thread. - * + * * \returns TRUE if \p thread is the finalization thread. */ gboolean diff --git a/src/mono/mono/metadata/handle.c b/src/mono/mono/metadata/handle.c index d6af32f73b291c..8474c385007b20 100644 --- a/src/mono/mono/metadata/handle.c +++ b/src/mono/mono/metadata/handle.c @@ -49,7 +49,7 @@ Combine: MonoDefaults, GENERATE_GET_CLASS_WITH_CACHE, TYPED_HANDLE_DECL and frie /* * NOTE: Async suspend - * + * * If we are running with cooperative GC, all the handle stack * manipulation will complete before a GC thread scans the handle * stack. If we are using async suspend, however, a thread may be @@ -362,7 +362,7 @@ mono_stack_mark_record_size (MonoThreadInfo *info, HandleStackMark *stackmark, c /* * Pop the stack until @stackmark and make @value the top value. * - * @return the new handle for what @value points to + * @return the new handle for what @value points to */ MonoRawHandle mono_stack_mark_pop_value (MonoThreadInfo *info, HandleStackMark *stackmark, MonoRawHandle value) diff --git a/src/mono/mono/metadata/handle.h b/src/mono/mono/metadata/handle.h index 5628d3b1792767..46f69c5124bbff 100644 --- a/src/mono/mono/metadata/handle.h +++ b/src/mono/mono/metadata/handle.h @@ -32,7 +32,7 @@ The handle stack is designed so it's efficient to pop a large amount of entries The stack is made out of a series of fixed size segments. To do bulk operations you use a stack mark. - + */ /* diff --git a/src/mono/mono/metadata/image.c b/src/mono/mono/metadata/image.c index ee77f79966982e..4b2efe2b37659c 100644 --- a/src/mono/mono/metadata/image.c +++ b/src/mono/mono/metadata/image.c @@ -2,7 +2,7 @@ * \file * Routines for manipulating an image stored in an * extended PE/COFF file. - * + * * Authors: * Miguel de Icaza (miguel@ximian.com) * Paolo Molaro (lupus@ximian.com) @@ -127,7 +127,7 @@ void mono_install_image_unload_hook (MonoImageUnloadFunc func, gpointer user_data) { ImageUnloadHook *hook; - + g_return_if_fail (func != NULL); hook = g_new0 (ImageUnloadHook, 1); @@ -206,10 +206,10 @@ mono_cli_rva_image_map (MonoImage *image, guint32 addr) * \param addr relative virtual address (RVA) * * This is a low-level routine used by the runtime to map relative - * virtual address (RVA) into their location in memory. + * virtual address (RVA) into their location in memory. * * \returns the address in memory for the given RVA, or NULL if the - * RVA is not valid for this image. + * RVA is not valid for this image. */ char * mono_image_rva_map (MonoImage *image, guint32 addr) @@ -288,14 +288,14 @@ mono_image_ensure_section_idx (MonoImage *image, int section) { MonoCLIImageInfo *iinfo = image->image_info; MonoSectionTable *sect; - + g_return_val_if_fail (section < iinfo->cli_section_count, FALSE); if (iinfo->cli_sections [section] != NULL) return TRUE; sect = &iinfo->cli_section_tables [section]; - + if (sect->st_raw_data_ptr + sect->st_raw_data_size > image->raw_data_len) return FALSE; #ifdef HOST_WIN32 @@ -323,11 +323,11 @@ mono_image_ensure_section (MonoImage *image, const char *section) { MonoCLIImageInfo *ii = image->image_info; int i; - + for (i = 0; i < ii->cli_section_count; i++){ if (strncmp (ii->cli_section_tables [i].st_name, section, 8) != 0) continue; - + return mono_image_ensure_section_idx (image, i); } return FALSE; @@ -342,7 +342,7 @@ load_section_tables (MonoImage *image, MonoCLIImageInfo *iinfo, guint32 offset) iinfo->cli_section_count = top; iinfo->cli_section_tables = g_new0 (MonoSectionTable, top); iinfo->cli_sections = g_new0 (void *, top); - + for (i = 0; i < top; i++){ MonoSectionTable *t = &iinfo->cli_section_tables [i]; @@ -372,7 +372,7 @@ gboolean mono_image_load_cli_header (MonoImage *image, MonoCLIImageInfo *iinfo) { guint32 offset; - + offset = mono_cli_rva_image_map (image, iinfo->cli_header.datadir.pe_cli_header.rva); if (offset == INVALID_ADDRESS) return FALSE; @@ -428,7 +428,7 @@ mono_image_load_cli_header (MonoImage *image, MonoCLIImageInfo *iinfo) /* g_warning ("Some fields in the CLI header which should have been zero are not zero"); */ } - + return TRUE; } @@ -455,7 +455,7 @@ load_metadata_ptrs (MonoImage *image, MonoCLIImageInfo *iinfo) int i; guint32 pad; char *ptr; - + offset = mono_cli_rva_image_map (image, iinfo->cli_cli_header.ch_metadata.rva); if (offset == INVALID_ADDRESS) return FALSE; @@ -490,7 +490,7 @@ load_metadata_ptrs (MonoImage *image, MonoCLIImageInfo *iinfo) /* skip over flags */ ptr += 2; - + streams = read16 (ptr); ptr += 2; @@ -591,7 +591,7 @@ load_tables (MonoImage *image) guint64 valid_mask; int valid = 0, table; int heap_sizes; - + heap_sizes = heap_tables [6]; image->idx_string_wide = ((heap_sizes & 0x01) == 1); image->idx_guid_wide = ((heap_sizes & 0x02) == 2); @@ -603,10 +603,10 @@ load_tables (MonoImage *image) g_assert (image->idx_guid_wide); g_assert (image->idx_blob_wide); } - + valid_mask = read64 (heap_tables + 8); rows = (const guint32 *) (heap_tables + 24); - + for (table = 0; table < 64; table++){ if ((valid_mask & ((guint64) 1 << table)) == 0){ if (table > MONO_TABLE_LAST) @@ -677,7 +677,7 @@ mono_image_check_for_module_cctor (MonoImage *image) guint32 last_method; if (table_info_get_rows (t) > 1) last_method = mono_metadata_decode_row_col (t, 1, MONO_TYPEDEF_METHOD_LIST) - 1; - else + else last_method = table_info_get_rows (mt); for (; first_method < last_method; first_method++) { nameidx = mono_metadata_decode_row_col (mt, first_method, MONO_METHOD_NAME); @@ -777,7 +777,7 @@ mono_image_init (MonoImage *image) #define SWAPPDE(x) #endif -static int +static int do_load_header_internal (const char *raw_data, guint32 raw_data_len, MonoDotNetHeader *header, int offset, gboolean image_is_module_handle) { MonoDotNetHeader64 header64; @@ -910,12 +910,12 @@ do_load_header_internal (const char *raw_data, guint32 raw_data_len, MonoDotNetH static int do_load_header (MonoImage *image, MonoDotNetHeader *header, int offset) { - offset = do_load_header_internal (image->raw_data, image->raw_data_len, header, offset, + offset = do_load_header_internal (image->raw_data, image->raw_data_len, header, offset, #ifdef HOST_WIN32 m_image_is_module_handle (image)); #else FALSE); -#endif +#endif #ifdef HOST_WIN32 if (m_image_is_module_handle (image)) @@ -924,7 +924,7 @@ do_load_header (MonoImage *image, MonoDotNetHeader *header, int offset) return offset; } -mono_bool +mono_bool mono_has_pdb_checksum (char *raw_data, uint32_t raw_data_len) { MonoDotNetHeader cli_header; @@ -934,11 +934,11 @@ mono_has_pdb_checksum (char *raw_data, uint32_t raw_data_len) int offset = 0; memcpy (&msdos, raw_data + offset, sizeof (msdos)); - + if (!(msdos.msdos_sig [0] == 'M' && msdos.msdos_sig [1] == 'Z')) { return FALSE; } - + msdos.pe_offset = GUINT32_FROM_LE (msdos.pe_offset); offset = msdos.pe_offset; @@ -959,7 +959,7 @@ mono_has_pdb_checksum (char *raw_data, uint32_t raw_data_len) if (ret + sizeof (MonoSectionTable) > raw_data_len) { return FALSE; } - + memcpy (&t, raw_data + ret, sizeof (MonoSectionTable)); ret += sizeof (MonoSectionTable); @@ -1014,10 +1014,10 @@ pe_image_load_pe_data (MonoImage *image) goto invalid_image; memcpy (&msdos, image->raw_data + offset, sizeof (msdos)); - + if (!(msdos.msdos_sig [0] == 'M' && msdos.msdos_sig [1] == 'Z')) goto invalid_image; - + msdos.pe_offset = GUINT32_FROM_LE (msdos.pe_offset); offset = msdos.pe_offset; @@ -1052,7 +1052,7 @@ pe_image_load_pe_data (MonoImage *image) /* * FIXME: byte swap all addresses here for header. */ - + if (!load_section_tables (image, iinfo, offset)) goto invalid_image; @@ -1104,7 +1104,7 @@ mono_image_load_names (MonoImage *image) { /* modules don't have an assembly table row */ if (table_info_get_rows (&image->tables [MONO_TABLE_ASSEMBLY])) { - image->assembly_name = mono_metadata_string_heap (image, + image->assembly_name = mono_metadata_string_heap (image, mono_metadata_decode_row_col (&image->tables [MONO_TABLE_ASSEMBLY], 0, MONO_ASSEMBLY_NAME)); } @@ -1314,7 +1314,7 @@ mono_image_storage_dtor (gpointer self) MonoImageStorage *storage = (MonoImageStorage *)self; mono_image_storage_unpublish (storage); - + #ifdef HOST_WIN32 if (storage->is_module_handle && !storage->has_entry_point) { mono_images_lock (); @@ -1369,7 +1369,7 @@ mono_image_storage_open (const char *fname) g_free (key); return published_storage; } - + MonoFileMap *filed; if ((filed = mono_file_map_open (fname)) == NULL){ g_free (key); @@ -1390,7 +1390,7 @@ mono_image_storage_open (const char *fname) mono_file_map_close (filed); storage->key = key; - + MonoImageStorage *other_storage = NULL; if (!mono_image_storage_trypublish (storage, &other_storage)) { mono_image_storage_close (storage); @@ -1789,7 +1789,7 @@ mono_image_open_a_lot_parameterized (MonoLoadedImages *li, MonoAssemblyLoadConte char *absfname; g_return_val_if_fail (fname != NULL, NULL); - + #ifdef HOST_WIN32 // Win32 path: If we are running with mixed-mode assemblies enabled (ie have loaded mscoree.dll), // then assemblies need to be loaded with LoadLibrary: @@ -1901,8 +1901,8 @@ mono_image_open_a_lot (MonoAssemblyLoadContext *alc, const char *fname, MonoImag * mono_image_open: * \param fname filename that points to the module we want to open * \param status An error condition is returned in this field - * \returns An open image of type \c MonoImage or NULL on error. - * The caller holds a temporary reference to the returned image which should be cleared + * \returns An open image of type \c MonoImage or NULL on error. + * The caller holds a temporary reference to the returned image which should be cleared * when no longer needed by calling \c mono_image_close. * if NULL, then check the value of \p status for details on the error */ @@ -1926,7 +1926,7 @@ MonoImage * mono_pe_file_open (const char *fname, MonoImageOpenStatus *status) { g_return_val_if_fail (fname != NULL, NULL); - + return do_mono_image_open (mono_alc_get_default (), fname, status, FALSE, TRUE, FALSE); } @@ -1935,13 +1935,13 @@ mono_pe_file_open (const char *fname, MonoImageOpenStatus *status) * \param fname filename that points to the module we want to open * \param status An error condition is returned in this field * \returns an image without loading neither pe or cli data. - * Use mono_image_load_pe_data and mono_image_load_cli_data to load them. + * Use mono_image_load_pe_data and mono_image_load_cli_data to load them. */ MonoImage * mono_image_open_raw (MonoAssemblyLoadContext *alc, const char *fname, MonoImageOpenStatus *status) { g_return_val_if_fail (fname != NULL, NULL); - + return do_mono_image_open (alc, fname, status, FALSE, FALSE, FALSE); } @@ -1980,7 +1980,7 @@ mono_image_fixup_vtable (MonoImage *image) vtfixup = (MonoVTableFixup*) mono_image_rva_map (image, de->rva); if (!vtfixup) return; - + count = de->size / sizeof (MonoVTableFixup); while (count--) { if (!vtfixup->rva || !vtfixup->count) @@ -2039,7 +2039,7 @@ void mono_image_addref (MonoImage *image) { mono_atomic_inc_i32 (&image->ref_count); -} +} void mono_dynamic_stream_reset (MonoDynamicStream* stream) @@ -2068,7 +2068,7 @@ mono_wrapper_caches_free (MonoWrapperCaches *cache) free_hash (cache->delegate_end_invoke_cache); free_hash (cache->delegate_bound_static_invoke_cache); free_hash (cache->runtime_invoke_signature_cache); - + free_hash (cache->delegate_abstract_invoke_cache); free_hash (cache->runtime_invoke_method_cache); @@ -2139,7 +2139,7 @@ mono_image_close_except_pools (MonoImage *image) mono_metadata_update_cleanup_on_close (image); /* - * The caches inside a MonoImage might refer to metadata which is stored in referenced + * The caches inside a MonoImage might refer to metadata which is stored in referenced * assemblies, so we can't release these references in mono_assembly_close () since the * MonoImage might outlive its associated MonoAssembly. */ @@ -2340,7 +2340,7 @@ mono_image_close (MonoImage *image) mono_image_close_finish (image); } -/** +/** * mono_image_strerror: * \param status an code indicating the result from a recent operation * \returns a string describing the error @@ -2415,7 +2415,7 @@ mono_image_walk_resource_tree (MonoCLIImageInfo *info, guint32 res_id, for(i=0; ires_named_entries) + GUINT16_FROM_LE (resource_dir->res_id_entries); res_entries=(MonoPEResourceDirEntry *)(resource_dir+1); - + for(i=0; ich_resources.rva || offset + 4 > ch->ch_resources.size) return NULL; - + data = mono_image_rva_map (image, ch->ch_resources.rva); if (!data) return NULL; @@ -2698,10 +2698,10 @@ mono_image_strong_name_position (MonoImage *image, guint32 *size) * \param size a \c guint32 pointer, or NULL. * * This is used to obtain the public key in the \p image. - * + * * If the image has a public key, and \p size is not NULL, the value * pointed to by size will have the size of the public key. - * + * * \returns NULL if the image does not have a public key, or a pointer * to the public key. */ @@ -2797,7 +2797,7 @@ mono_table_info_get_rows (const MonoTableInfo *table) * Use this routine to get the assembly that owns this image. * \returns the assembly that holds this image. */ -MonoAssembly* +MonoAssembly* mono_image_get_assembly (MonoImage *image) { return image->assembly; @@ -2911,7 +2911,7 @@ GList* mono_g_list_prepend_image (MonoImage *image, GList *list, gpointer data) { GList *new_list; - + new_list = (GList *)mono_image_alloc (image, sizeof (GList)); new_list->data = data; new_list->prev = list ? list->prev : NULL; @@ -2956,7 +2956,7 @@ mono_image_unlock (MonoImage *image) * * LOCKING: Takes the image lock */ -gpointer +gpointer mono_image_property_lookup (MonoImage *image, gpointer subject, guint32 property) { gpointer res; diff --git a/src/mono/mono/metadata/image.h b/src/mono/mono/metadata/image.h index 3049bcc973f327..4b43eefaf05e93 100644 --- a/src/mono/mono/metadata/image.h +++ b/src/mono/mono/metadata/image.h @@ -2,7 +2,7 @@ * \file */ -#ifndef _MONONET_METADATA_IMAGE_H_ +#ifndef _MONONET_METADATA_IMAGE_H_ #define _MONONET_METADATA_IMAGE_H_ #include @@ -88,7 +88,7 @@ MONO_API void* mono_image_lookup_resource (MonoImage *image, uint32_t res_i MONO_API const char* mono_image_get_public_key (MonoImage *image, uint32_t *size); MONO_API const char* mono_image_get_strong_name (MonoImage *image, uint32_t *size); MONO_API uint32_t mono_image_strong_name_position (MonoImage *image, uint32_t *size); -MONO_API void mono_image_add_to_name_cache (MonoImage *image, +MONO_API void mono_image_add_to_name_cache (MonoImage *image, const char *nspace, const char *name, uint32_t idx); MONO_API mono_bool mono_image_has_authenticode_entry (MonoImage *image); diff --git a/src/mono/mono/metadata/jit-info.c b/src/mono/mono/metadata/jit-info.c index 4dd455987afc34..a36af20affb799 100644 --- a/src/mono/mono/metadata/jit-info.c +++ b/src/mono/mono/metadata/jit-info.c @@ -335,7 +335,7 @@ mono_jit_info_table_find_internal (gpointer addr, gboolean try_aot, gboolean all if (ji && ji->is_trampoline && !allow_trampolines) return NULL; - + return ji; } diff --git a/src/mono/mono/metadata/jit-info.h b/src/mono/mono/metadata/jit-info.h index c380a23216c65b..bdf6572de173c1 100644 --- a/src/mono/mono/metadata/jit-info.h +++ b/src/mono/mono/metadata/jit-info.h @@ -222,7 +222,7 @@ struct _MonoJitInfo { gpointer gc_info; /* Currently only used by SGen */ gpointer seq_points; - + MonoJitExceptionInfo clauses [MONO_ZERO_LEN_ARRAY]; /* There is an optional MonoGenericJitInfo after the clauses */ /* There is an optional MonoTryBlockHoleTableJitInfo after MonoGenericJitInfo clauses*/ @@ -278,7 +278,7 @@ mono_jit_info_get_thunk_info (MonoJitInfo *ji); MonoUnwindJitInfo* mono_jit_info_get_unwind_info (MonoJitInfo *ji); -/* +/* * Installs a new function which is used to return a MonoJitInfo for a method inside * an AOT module. */ diff --git a/src/mono/mono/metadata/loaded-images.c b/src/mono/mono/metadata/loaded-images.c index 821e8f391f08de..9108a297d21f37 100644 --- a/src/mono/mono/metadata/loaded-images.c +++ b/src/mono/mono/metadata/loaded-images.c @@ -117,7 +117,7 @@ mono_loaded_images_remove_image (MonoImage *image) mono_images_unlock (); return proceed; - + } MonoLoadedImages* diff --git a/src/mono/mono/metadata/loader.c b/src/mono/mono/metadata/loader.c index e0ce3f575ae06d..df93bf6864844d 100644 --- a/src/mono/mono/metadata/loader.c +++ b/src/mono/mono/metadata/loader.c @@ -53,7 +53,7 @@ #include /* - * This lock protects the hash tables inside MonoImage used by the metadata + * This lock protects the hash tables inside MonoImage used by the metadata * loading functions in class.c and loader.c. * * See domain-internals.h for locking policy in combination with the @@ -65,7 +65,7 @@ static gboolean loader_lock_inited; static gboolean loader_lock_track_ownership; /* - * This TLS variable holds how many times the current thread has acquired the loader + * This TLS variable holds how many times the current thread has acquired the loader * lock. */ static MonoNativeTlsKey loader_lock_nest_id; @@ -156,7 +156,7 @@ mono_loader_unlock (void) * * Set whenever the runtime should track ownership of the loader lock. If set to TRUE, * the mono_loader_lock_is_owned_by_self () can be called to query whenever the current - * thread owns the loader lock. + * thread owns the loader lock. */ void mono_loader_lock_track_ownership (gboolean track) @@ -203,9 +203,9 @@ mono_loader_unlock_if_inited (void) * * Return a cached copy of the memberref signature identified by SIG_IDX. * We use a gpointer since the cache stores both MonoTypes and MonoMethodSignatures. - * A cache is needed since the type/signature parsing routines allocate everything - * from a mempool, so without a cache, multiple requests for the same signature would - * lead to unbounded memory growth. For normal methods/fields this is not a problem + * A cache is needed since the type/signature parsing routines allocate everything + * from a mempool, so without a cache, multiple requests for the same signature would + * lead to unbounded memory growth. For normal methods/fields this is not a problem * since the resulting methods/fields are cached, but inflated methods/fields cannot * be cached. * LOCKING: Acquires the loader lock. @@ -412,7 +412,7 @@ mono_metadata_signature_vararg_match (MonoMethodSignature *sig1, MonoMethodSigna sig1->sentinelpos != sig2->sentinelpos) return FALSE; - for (i = 0; i < sig1->sentinelpos; i++) { + for (i = 0; i < sig1->sentinelpos; i++) { MonoType *p1 = sig1->params[i]; MonoType *p2 = sig2->params[i]; @@ -465,7 +465,7 @@ find_method_in_class (MonoClass *klass, const char *name, const char *qname, con if (method) { other_sig = mono_method_signature_checked (method, error); if (!is_ok (error)) //bail out if we hit a loader error - return NULL; + return NULL; if (other_sig && (sig->call_convention != MONO_CALL_VARARG) && mono_metadata_signature_equal (sig, other_sig)) return method; } @@ -500,7 +500,7 @@ find_method_in_class (MonoClass *klass, const char *name, const char *qname, con (name && !strcmp (m->name, name)))) continue; msig = mono_method_signature_checked (m, error); - if (!is_ok (error)) //bail out if we hit a loader error + if (!is_ok (error)) //bail out if we hit a loader error return NULL; if (!msig) @@ -570,7 +570,7 @@ find_method (MonoClass *in_class, MonoClass *ic, const char* name, MonoMethodSig MonoClass *in_ic = in_class_interfaces_packed [i]; MonoClass *from_ic = from_class_interfaces_packed [i]; char *ic_qname, *ic_fqname, *ic_class_name; - + ic_class_name = mono_type_get_name_full (m_class_get_byval_arg (in_ic), MONO_TYPE_NAME_FORMAT_IL); ic_qname = g_strconcat (ic_class_name, ".", name, (const char*)NULL); const char *in_ic_name_space = m_class_get_name_space (in_ic); @@ -598,7 +598,7 @@ find_method (MonoClass *in_class, MonoClass *ic, const char* name, MonoMethodSig //we did not find the method if (!result && is_ok (error)) mono_error_set_method_missing (error, initial_class, name, sig, NULL); - + out: g_free (class_name); g_free (fqname); @@ -677,7 +677,7 @@ inflate_generic_header (MonoMethodHeader *header, MonoGenericContext *context, M { size_t locals_size = sizeof (gpointer) * header->num_locals; size_t clauses_size = header->num_clauses * sizeof (MonoExceptionClause); - size_t header_size = MONO_SIZEOF_METHOD_HEADER + locals_size + clauses_size; + size_t header_size = MONO_SIZEOF_METHOD_HEADER + locals_size + clauses_size; MonoMethodHeader *res = (MonoMethodHeader *)g_malloc0 (header_size); res->num_locals = header->num_locals; res->clauses = (MonoExceptionClause *) &res->locals [res->num_locals] ; @@ -1097,8 +1097,8 @@ mono_get_method_from_token (MonoImage *image, guint32 token, MonoClass *klass, container = mono_class_try_get_generic_container (klass); - /* - * load_generic_params does a binary search so only call it if the method + /* + * load_generic_params does a binary search so only call it if the method * is generic. */ if (*sig & 0x10) { @@ -1293,7 +1293,7 @@ get_method_constrained (MonoImage *image, MonoMethod *method, MonoClass *constra mono_error_set_for_class_failure (error, constrained_class); return NULL; } - + /* Get the slot of the method in the interface. Then get the * interface base in constrained_class */ int itf_slot = mono_method_get_vtable_index (method); @@ -1366,20 +1366,20 @@ mono_free_method (MonoMethod *method) return; MONO_PROFILER_RAISE (method_free, (method)); - + /* FIXME: This hack will go away when the profiler will support freeing methods */ if (G_UNLIKELY (mono_profiler_installed ())) return; - + if (method->signature) { - /* + /* * FIXME: This causes crashes because the types inside signatures and * locals are shared. */ /* mono_metadata_free_method_signature (method->signature); */ /* g_free (method->signature); */ } - + if (method_is_dynamic (method)) { MonoMethodWrapper *mw = (MonoMethodWrapper*)method; int i; @@ -1438,7 +1438,7 @@ mono_method_get_param_names (MonoMethod *method, const char **names) MonoImage *klass_image = m_class_get_image (klass); if (image_is_dynamic (klass_image)) { - MonoReflectionMethodAux *method_aux = + MonoReflectionMethodAux *method_aux = (MonoReflectionMethodAux *)g_hash_table_lookup ( ((MonoDynamicImage*)m_class_get_image (method->klass))->method_aux_hash, method); if (method_aux && method_aux->param_names) { @@ -1535,7 +1535,7 @@ mono_method_get_marshal_info (MonoMethod *method, MonoMarshalSpec **mspecs) mspecs [i] = NULL; if (image_is_dynamic (m_class_get_image (method->klass))) { - MonoReflectionMethodAux *method_aux = + MonoReflectionMethodAux *method_aux = (MonoReflectionMethodAux *)g_hash_table_lookup ( ((MonoDynamicImage*)m_class_get_image (method->klass))->method_aux_hash, method); if (method_aux && method_aux->param_marshall) { @@ -1601,7 +1601,7 @@ mono_method_has_marshal_info (MonoMethod *method) guint32 idx; if (image_is_dynamic (m_class_get_image (method->klass))) { - MonoReflectionMethodAux *method_aux = + MonoReflectionMethodAux *method_aux = (MonoReflectionMethodAux *)g_hash_table_lookup ( ((MonoDynamicImage*)m_class_get_image (method->klass))->method_aux_hash, method); MonoMarshalSpec **dyn_specs = method_aux->param_marshall; @@ -1785,7 +1785,7 @@ mono_method_signature_checked_slow (MonoMethod *m, MonoError *error) MonoMethodSignature *signature = NULL, *sig2; guint32 sig_offset; - /* We need memory barriers below because of the double-checked locking pattern */ + /* We need memory barriers below because of the double-checked locking pattern */ error_init (error); @@ -2041,7 +2041,7 @@ mono_method_get_header_internal (MonoMethod *method, MonoError *error) return mw->header; } - /* + /* * We don't need locks here: the new header is allocated from malloc memory * and is not stored anywhere in the runtime, the user needs to free it. */ diff --git a/src/mono/mono/metadata/loader.h b/src/mono/mono/metadata/loader.h index 42c89288fcc6ea..c1468257867a7f 100644 --- a/src/mono/mono/metadata/loader.h +++ b/src/mono/mono/metadata/loader.h @@ -25,7 +25,7 @@ MONO_API MONO_RT_EXTERNAL_ONLY MonoMethod * mono_get_method_constrained (MonoImage *image, uint32_t token, MonoClass *constrained_class, MonoGenericContext *context, MonoMethod **cil_method); -MONO_API void +MONO_API void mono_free_method (MonoMethod *method); MONO_API MONO_RT_EXTERNAL_ONLY MonoMethodSignature* diff --git a/src/mono/mono/metadata/lock-tracer.c b/src/mono/mono/metadata/lock-tracer.c index 302c29f2c9aa8a..13283f13de5d0f 100644 --- a/src/mono/mono/metadata/lock-tracer.c +++ b/src/mono/mono/metadata/lock-tracer.c @@ -4,7 +4,7 @@ * * Authors: * Rodrigo Kumpera (rkumpera@novell.com) - * + * */ #include @@ -29,7 +29,7 @@ /* * This is a very simple lock trace implementation. It can be used to verify that the runtime is * correctly following all locking rules. - * + * * To log more kind of locks just do the following: * - add an entry into the RuntimeLocks enum * - change mono_os_mutex_lock(mutex) to mono_locks_os_acquire (mutex, LockName) @@ -44,7 +44,7 @@ * - Enable tracing of more runtime locks * - Add lock check assertions (must_not_hold_any_lock_but, must_hold_lock, etc) * This should be used to verify methods that expect that a given lock is held at entrypoint, for example. - * + * * To use the trace, define LOCK_TRACER in lock-trace.h and when running mono define MONO_ENABLE_LOCK_TRACER. * This will produce a locks.ZZZ where ZZZ is the pid of the mono process. * Use the decoder to verify the result. diff --git a/src/mono/mono/metadata/marshal-ilgen.c b/src/mono/mono/metadata/marshal-ilgen.c index 2290c438125c9d..8061e75fc778ea 100644 --- a/src/mono/mono/metadata/marshal-ilgen.c +++ b/src/mono/mono/metadata/marshal-ilgen.c @@ -348,7 +348,7 @@ emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv /* create a new array */ mono_mb_emit_ldloc (mb, 1); mono_mb_emit_icon (mb, mspec->data.array_data.num_elem); - mono_mb_emit_op (mb, CEE_NEWARR, eklass); + mono_mb_emit_op (mb, CEE_NEWARR, eklass); mono_mb_emit_byte (mb, CEE_STIND_REF); if (m_class_is_blittable (eklass)) { @@ -360,7 +360,7 @@ emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv mono_mb_emit_ldloc (mb, 0); mono_mb_emit_icon (mb, mspec->data.array_data.num_elem * esize); mono_mb_emit_byte (mb, CEE_PREFIX1); - mono_mb_emit_byte (mb, CEE_CPBLK); + mono_mb_emit_byte (mb, CEE_CPBLK); } else { int array_var, src_var, dst_var, index_var; @@ -375,7 +375,7 @@ emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv mono_mb_emit_ldloc (mb, 1); mono_mb_emit_byte (mb, CEE_LDIND_REF); mono_mb_emit_stloc (mb, array_var); - + /* save the old src pointer */ mono_mb_emit_ldloc (mb, 0); mono_mb_emit_stloc (mb, src_var); @@ -412,7 +412,7 @@ emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv mono_mb_emit_branch_label (mb, CEE_BR, label2); mono_mb_patch_branch (mb, label3); - + /* restore the old src pointer */ mono_mb_emit_ldloc (mb, src_var); mono_mb_emit_stloc (mb, 0); @@ -428,7 +428,7 @@ emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv /* create a new array */ mono_mb_emit_ldloc (mb, 1); mono_mb_emit_icon (mb, mspec->data.array_data.num_elem); - mono_mb_emit_op (mb, CEE_NEWARR, eclass); + mono_mb_emit_op (mb, CEE_NEWARR, eclass); mono_mb_emit_byte (mb, CEE_STIND_REF); mono_mb_emit_ldloc (mb, 1); @@ -438,7 +438,7 @@ emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv mono_mb_emit_icall (mb, mono_byvalarray_to_byte_array); break; } - case MONO_MARSHAL_CONV_STR_BYVALSTR: + case MONO_MARSHAL_CONV_STR_BYVALSTR: if (mspec && mspec->native == MONO_NATIVE_BYVALTSTR && mspec->data.array_data.num_elem) { mono_mb_emit_ldloc (mb, 1); mono_mb_emit_ldloc (mb, 0); @@ -449,7 +449,7 @@ emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv mono_mb_emit_ldloc (mb, 0); mono_mb_emit_icall (mb, ves_icall_string_new_wrapper); } - mono_mb_emit_byte (mb, CEE_STIND_REF); + mono_mb_emit_byte (mb, CEE_STIND_REF); break; case MONO_MARSHAL_CONV_STR_BYVALWSTR: if (mspec && mspec->native == MONO_NATIVE_BYVALTSTR && mspec->data.array_data.num_elem) { @@ -462,8 +462,8 @@ emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv mono_mb_emit_ldloc (mb, 0); mono_mb_emit_icall (mb, ves_icall_mono_string_from_utf16); } - mono_mb_emit_byte (mb, CEE_STIND_REF); - break; + mono_mb_emit_byte (mb, CEE_STIND_REF); + break; case MONO_MARSHAL_CONV_STR_ANSIBSTR: case MONO_MARSHAL_CONV_STR_TBSTR: @@ -487,13 +487,13 @@ emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv MonoType *int_type = mono_get_int_type (); src_var = mono_mb_add_local (mb, int_type); dst_var = mono_mb_add_local (mb, int_type); - + /* *dst = new object */ mono_mb_emit_ldloc (mb, 1); mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); - mono_mb_emit_op (mb, CEE_MONO_NEWOBJ, klass); + mono_mb_emit_op (mb, CEE_MONO_NEWOBJ, klass); mono_mb_emit_byte (mb, CEE_STIND_REF); - + /* save the old src pointer */ mono_mb_emit_ldloc (mb, 0); mono_mb_emit_stloc (mb, src_var); @@ -506,10 +506,10 @@ emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv mono_mb_emit_byte (mb, CEE_LDIND_I); mono_mb_emit_icon (mb, MONO_ABI_SIZEOF (MonoObject)); mono_mb_emit_byte (mb, CEE_ADD); - mono_mb_emit_stloc (mb, 1); + mono_mb_emit_stloc (mb, 1); emit_struct_conv (mb, klass, TRUE); - + /* restore the old src pointer */ mono_mb_emit_ldloc (mb, src_var); mono_mb_emit_stloc (mb, 0); @@ -550,7 +550,7 @@ emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv * to change the SafeHandle value. If the value is changed, * we should issue a diagnostic exception (NotSupportedException) * that informs the user that changes to handles in unmanaged code - * is not supported. + * is not supported. * * Since we currently have no access to the original * SafeHandle that was used during the marshalling, @@ -559,15 +559,15 @@ emit_ptr_to_object_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv */ break; } - + case MONO_MARSHAL_CONV_HANDLEREF: { /* - * Passing HandleRefs in a struct that is ref()ed does not + * Passing HandleRefs in a struct that is ref()ed does not * copy the values back to the HandleRef */ break; } - + case MONO_MARSHAL_CONV_ARRAY_SAVEARRAY: default: { char *msg = g_strdup_printf ("marshaling conversion %d not implemented", conv); @@ -837,12 +837,12 @@ emit_object_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv mono_mb_emit_icall_id (mb, conv_to_icall (conv, &stind_op)); mono_mb_emit_byte (mb, stind_op); break; - case MONO_MARSHAL_CONV_STR_BYVALSTR: + case MONO_MARSHAL_CONV_STR_BYVALSTR: case MONO_MARSHAL_CONV_STR_BYVALWSTR: { g_assert (mspec); mono_mb_emit_ldloc (mb, 1); /* dst */ - mono_mb_emit_ldloc (mb, 0); + mono_mb_emit_ldloc (mb, 0); mono_mb_emit_byte (mb, CEE_LDIND_REF); /* src String */ mono_mb_emit_icon (mb, mspec->data.array_data.num_elem); mono_mb_emit_icall_id (mb, conv_to_icall (conv, NULL)); @@ -872,12 +872,12 @@ emit_object_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv if (m_class_is_blittable (eklass)) { mono_mb_emit_ldloc (mb, 1); - mono_mb_emit_ldloc (mb, 0); - mono_mb_emit_byte (mb, CEE_LDIND_REF); + mono_mb_emit_ldloc (mb, 0); + mono_mb_emit_byte (mb, CEE_LDIND_REF); mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoArray, vector)); mono_mb_emit_icon (mb, mspec->data.array_data.num_elem * esize); mono_mb_emit_byte (mb, CEE_PREFIX1); - mono_mb_emit_byte (mb, CEE_CPBLK); + mono_mb_emit_byte (mb, CEE_CPBLK); } else { int array_var, src_var, dst_var, index_var; guint32 label2, label3; @@ -889,7 +889,7 @@ emit_object_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv dst_var = mono_mb_add_local (mb, int_type); /* set array_var */ - mono_mb_emit_ldloc (mb, 0); + mono_mb_emit_ldloc (mb, 0); mono_mb_emit_byte (mb, CEE_LDIND_REF); mono_mb_emit_stloc (mb, array_var); @@ -929,7 +929,7 @@ emit_object_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv mono_mb_emit_branch_label (mb, CEE_BR, label2); mono_mb_patch_branch (mb, label3); - + /* restore the old src pointer */ mono_mb_emit_ldloc (mb, src_var); mono_mb_emit_stloc (mb, 0); @@ -947,7 +947,7 @@ emit_object_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv pos = mono_mb_emit_short_branch (mb, CEE_BRFALSE_S); mono_mb_emit_ldloc (mb, 1); - mono_mb_emit_ldloc (mb, 0); + mono_mb_emit_ldloc (mb, 0); mono_mb_emit_byte (mb, CEE_LDIND_REF); mono_mb_emit_icon (mb, mspec->data.array_data.num_elem); mono_mb_emit_icall (mb, mono_array_to_byte_byvalarray); @@ -960,11 +960,11 @@ emit_object_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv MonoType *int_type = mono_get_int_type (); src_var = mono_mb_add_local (mb, int_type); dst_var = mono_mb_add_local (mb, int_type); - + mono_mb_emit_ldloc (mb, 0); mono_mb_emit_byte (mb, CEE_LDIND_I); pos = mono_mb_emit_branch (mb, CEE_BRFALSE); - + /* save the old src pointer */ mono_mb_emit_ldloc (mb, 0); mono_mb_emit_stloc (mb, src_var); @@ -974,13 +974,13 @@ emit_object_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv /* src = pointer to object data */ mono_mb_emit_ldloc (mb, 0); - mono_mb_emit_byte (mb, CEE_LDIND_I); + mono_mb_emit_byte (mb, CEE_LDIND_I); mono_mb_emit_icon (mb, MONO_ABI_SIZEOF (MonoObject)); mono_mb_emit_byte (mb, CEE_ADD); - mono_mb_emit_stloc (mb, 0); + mono_mb_emit_stloc (mb, 0); emit_struct_conv (mb, mono_class_from_mono_type_internal (type), FALSE); - + /* restore the old src pointer */ mono_mb_emit_ldloc (mb, src_var); mono_mb_emit_stloc (mb, 0); @@ -1002,13 +1002,13 @@ emit_object_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv case MONO_MARSHAL_CONV_SAFEHANDLE: { int pos; - + mono_mb_emit_ldloc (mb, 0); mono_mb_emit_byte (mb, CEE_LDIND_I); pos = mono_mb_emit_branch (mb, CEE_BRTRUE); mono_mb_emit_exception (mb, "ArgumentNullException", NULL); mono_mb_patch_branch (mb, pos); - + /* Pull the handle field from SafeHandle */ mono_mb_emit_ldloc (mb, 1); mono_mb_emit_ldloc (mb, 0); @@ -1028,7 +1028,7 @@ emit_object_to_ptr_conv (MonoMethodBuilder *mb, MonoType *type, MonoMarshalConv mono_mb_emit_byte (mb, CEE_STIND_I); break; } - + default: { g_error ("marshalling conversion %d not implemented", conv); } @@ -1143,11 +1143,11 @@ emit_struct_conv_full (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_obje } if (klass != mono_class_try_get_safehandle_class ()){ - /* - * FIXME: Should really check for usize==0 and msize>0, but we apply + /* + * FIXME: Should really check for usize==0 and msize>0, but we apply * the layout to the managed structure as well. */ - + if (mono_class_is_explicit_layout (klass) && (usize == 0)) { if (MONO_TYPE_IS_REFERENCE (info->fields [i].field->type) || ((!last_field && MONO_TYPE_IS_REFERENCE (info->fields [i + 1].field->type)))) @@ -1156,7 +1156,7 @@ emit_struct_conv_full (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_obje mono_type_full_name (m_class_get_byval_arg (klass))); } } - + switch (conv) { case MONO_MARSHAL_CONV_NONE: { int t; @@ -1223,7 +1223,7 @@ emit_struct_conv_full (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_obje MonoType *int_type = mono_get_int_type (); src_var = mono_mb_add_local (mb, int_type); dst_var = mono_mb_add_local (mb, int_type); - + /* save the old src pointer */ mono_mb_emit_ldloc (mb, 0); mono_mb_emit_stloc (mb, src_var); @@ -1269,7 +1269,7 @@ emit_struct_conv_full (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_obje break; } - default: + default: g_warning ("marshaling type %02x not implemented", ftype->type); g_assert_not_reached (); } @@ -1289,7 +1289,7 @@ emit_struct_conv_full (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_obje mono_mb_emit_ldloc (mb, 1); mono_mb_emit_stloc (mb, dst_var); - if (to_object) + if (to_object) emit_ptr_to_object_conv (mb, ftype, conv, info->fields [i].mspec); else emit_object_to_ptr_conv (mb, ftype, conv, info->fields [i].mspec); @@ -1309,7 +1309,7 @@ emit_struct_conv_full (MonoMethodBuilder *mb, MonoClass *klass, gboolean to_obje } else { mono_mb_emit_add_to_local (mb, 0, msize); mono_mb_emit_add_to_local (mb, 1, usize); - } + } } } @@ -1360,7 +1360,7 @@ emit_thread_interrupt_checkpoint_call (MonoMethodBuilder *mb, MonoJitICallId che mono_mb_patch_branch (mb, pos_noex); mono_mb_emit_byte (mb, CEE_POP); - + mono_mb_patch_branch (mb, pos_noabort); } @@ -1370,7 +1370,7 @@ emit_thread_interrupt_checkpoint (MonoMethodBuilder *mb) // FIXME Put a boolean in MonoMethodBuilder instead. if (strstr (mb->name, "mono_thread_interruption_checkpoint")) return; - + emit_thread_interrupt_checkpoint_call (mb, MONO_JIT_ICALL_mono_thread_interruption_checkpoint); } @@ -1452,10 +1452,10 @@ mono_mb_emit_restore_result (MonoMethodBuilder *mb, MonoType *return_type) case MONO_TYPE_PTR: case MONO_TYPE_FNPTR: case MONO_TYPE_STRING: - case MONO_TYPE_CLASS: - case MONO_TYPE_OBJECT: - case MONO_TYPE_ARRAY: - case MONO_TYPE_SZARRAY: + case MONO_TYPE_CLASS: + case MONO_TYPE_OBJECT: + case MONO_TYPE_ARRAY: + case MONO_TYPE_SZARRAY: /* nothing to do */ break; case MONO_TYPE_U1: @@ -1580,7 +1580,7 @@ emit_invoke_call (MonoMethodBuilder *mb, MonoMethod *method, mono_mb_emit_byte (mb, mono_type_to_ldind (sig->params [i])); break; case MONO_TYPE_STRING: - case MONO_TYPE_CLASS: + case MONO_TYPE_CLASS: case MONO_TYPE_ARRAY: case MONO_TYPE_PTR: case MONO_TYPE_FNPTR: @@ -1618,7 +1618,7 @@ emit_invoke_call (MonoMethodBuilder *mb, MonoMethod *method, g_assert_not_reached (); } } - + if (virtual_) { mono_mb_emit_op (mb, CEE_CALLVIRT, method); } else if (need_direct_wrapper) { @@ -1676,7 +1676,7 @@ emit_invoke_call (MonoMethodBuilder *mb, MonoMethod *method, mono_mb_emit_op (mb, CEE_BOX, mono_class_from_mono_type_internal (sig->ret)); break; case MONO_TYPE_STRING: - case MONO_TYPE_CLASS: + case MONO_TYPE_CLASS: case MONO_TYPE_ARRAY: case MONO_TYPE_SZARRAY: case MONO_TYPE_OBJECT: @@ -1697,12 +1697,12 @@ emit_invoke_call (MonoMethodBuilder *mb, MonoMethod *method, for (i = 0; i < sig->param_count; i++) { MonoType *t = sig->params [i]; - /* + /* * Box the result and put it back into the array, the caller will have * to obtain it from there. */ if (m_type_is_byref (t) && t->type == MONO_TYPE_GENERICINST && mono_class_is_nullable (mono_class_from_mono_type_internal (t))) { - mono_mb_emit_ldarg (mb, 1); + mono_mb_emit_ldarg (mb, 1); mono_mb_emit_icon (mb, TARGET_SIZEOF_VOID_P * i); mono_mb_emit_byte (mb, CEE_ADD); @@ -1771,7 +1771,7 @@ emit_runtime_invoke_body_ilgen (MonoMethodBuilder *mb, const char **param_names, clause->handler_offset = mono_mb_get_label (mb); /* handler code */ - mono_mb_emit_stloc (mb, loc_exc); + mono_mb_emit_stloc (mb, loc_exc); mono_mb_emit_byte (mb, CEE_LDARG_2); mono_mb_emit_ldloc (mb, loc_exc); mono_mb_emit_byte (mb, CEE_STIND_REF); @@ -1812,7 +1812,7 @@ emit_runtime_invoke_dynamic_ilgen (MonoMethodBuilder *mb) /* cond set *exc to null */ mono_mb_emit_byte (mb, CEE_LDARG_1); mono_mb_emit_byte (mb, CEE_BRFALSE_S); - mono_mb_emit_byte (mb, 3); + mono_mb_emit_byte (mb, 3); mono_mb_emit_byte (mb, CEE_LDARG_1); mono_mb_emit_byte (mb, CEE_LDNULL); mono_mb_emit_byte (mb, CEE_STIND_REF); @@ -1832,7 +1832,7 @@ emit_runtime_invoke_dynamic_ilgen (MonoMethodBuilder *mb) /* filter code */ clause->data.filter_offset = mono_mb_get_label (mb); - + mono_mb_emit_byte (mb, CEE_POP); mono_mb_emit_byte (mb, CEE_LDARG_1); mono_mb_emit_byte (mb, CEE_LDC_I4_0); @@ -1846,7 +1846,7 @@ emit_runtime_invoke_dynamic_ilgen (MonoMethodBuilder *mb) /* handler code */ /* store exception */ mono_mb_emit_stloc (mb, 1); - + mono_mb_emit_byte (mb, CEE_LDARG_1); mono_mb_emit_ldloc (mb, 1); mono_mb_emit_byte (mb, CEE_STIND_REF); @@ -2129,7 +2129,7 @@ emit_native_wrapper_ilgen (MonoImage *image, MonoMethodBuilder *mb, MonoMethodSi for (i = 0; i < sig->param_count; i++) { mono_emit_marshal (&m, i + param_shift, sig->params [i], mspecs [i + 1], tmp_locals [i], NULL, MARSHAL_ACTION_PUSH); - } + } /* call the native method */ if (func_param) { @@ -2237,7 +2237,7 @@ emit_native_wrapper_ilgen (MonoImage *image, MonoMethodBuilder *mb, MonoMethodSi break; case MONO_TYPE_TYPEDBYREF: default: - g_warning ("return type 0x%02x unknown", sig->ret->type); + g_warning ("return type 0x%02x unknown", sig->ret->type); g_assert_not_reached (); } } @@ -2245,8 +2245,8 @@ emit_native_wrapper_ilgen (MonoImage *image, MonoMethodBuilder *mb, MonoMethodSi mono_mb_emit_stloc (mb, 3); } - /* - * Need to call this after converting the result since MONO_VTADDR needs + /* + * Need to call this after converting the result since MONO_VTADDR needs * to be adjacent to the call instruction. */ if (check_exceptions) @@ -2354,7 +2354,7 @@ emit_castclass_ilgen (MonoMethodBuilder *mb) const int class_arg_position = TYPECHECK_CLASS_ARG_POS; const int cache_arg_position = TYPECHECK_CACHE_ARG_POS; - generate_check_cache (obj_arg_position, class_arg_position, cache_arg_position, + generate_check_cache (obj_arg_position, class_arg_position, cache_arg_position, &return_null_pos, &negative_cache_hit_pos, &positive_cache_hit_pos, mb); invalid_cast_pos = mono_mb_emit_branch (mb, CEE_BRFALSE); @@ -2382,7 +2382,7 @@ emit_isinst_ilgen (MonoMethodBuilder *mb) const int class_arg_position = TYPECHECK_CLASS_ARG_POS; const int cache_arg_position = TYPECHECK_CACHE_ARG_POS; - generate_check_cache (obj_arg_position, class_arg_position, cache_arg_position, + generate_check_cache (obj_arg_position, class_arg_position, cache_arg_position, &return_null_pos, &negative_cache_hit_pos, &positive_cache_hit_pos, mb); // Return the object gotten via the slow path. mono_mb_emit_byte (mb, CEE_RET); @@ -2433,8 +2433,8 @@ load_value_class (MonoMethodBuilder *mb, int vklass) static int emit_marshal_array_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, - int conv_arg, MonoType **conv_arg_type, + MonoMarshalSpec *spec, + int conv_arg, MonoType **conv_arg_type, MarshalAction action) { MonoMethodBuilder *mb = m->mb; @@ -2525,7 +2525,7 @@ emit_marshal_array_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_stloc (mb, dest_ptr); /* Emit marshalling loop */ - index_var = mono_mb_add_local (mb, int_type); + index_var = mono_mb_add_local (mb, int_type); mono_mb_emit_byte (mb, CEE_LDC_I4_0); mono_mb_emit_stloc (mb, index_var); label2 = mono_mb_get_label (mb); @@ -2561,7 +2561,7 @@ emit_marshal_array_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_add_to_local (mb, index_var, 1); mono_mb_emit_add_to_local (mb, dest_ptr, esize); - + mono_mb_emit_branch_label (mb, CEE_BR, label2); mono_mb_patch_branch (mb, label3); @@ -2637,7 +2637,7 @@ emit_marshal_array_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_stloc (mb, src_ptr); /* Emit marshalling loop */ - index_var = mono_mb_add_local (mb, int_type); + index_var = mono_mb_add_local (mb, int_type); mono_mb_emit_byte (mb, CEE_LDC_I4_0); mono_mb_emit_stloc (mb, index_var); label2 = mono_mb_get_label (mb); @@ -2721,7 +2721,7 @@ emit_marshal_array_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_patch_branch (mb, label3); } #endif - + if (m_class_is_blittable (eklass)) { /* free memory allocated (if any) by MONO_MARSHAL_CONV_ARRAY_LPARRAY */ @@ -2754,7 +2754,7 @@ emit_marshal_array_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, int index_var, src_ptr, esize, param_num, num_elem; MonoMarshalConv conv; gboolean is_string = FALSE; - + conv_arg = mono_mb_add_local (mb, object_type); *conv_arg_type = int_type; @@ -2868,8 +2868,8 @@ emit_marshal_array_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_stloc (mb, src_ptr); /* Create managed array */ - /* - * The LPArray marshalling spec says that sometimes param_num starts + /* + * The LPArray marshalling spec says that sometimes param_num starts * from 1, sometimes it starts from 0. But MS seems to allways start * from 0. */ @@ -2946,7 +2946,7 @@ emit_marshal_array_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_patch_branch (mb, label1); mono_mb_patch_branch (mb, label3); #endif - + break; } case MARSHAL_ACTION_MANAGED_CONV_OUT: { @@ -2958,7 +2958,7 @@ emit_marshal_array_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, if (!spec) /* Already handled in CONV_IN */ break; - + /* These are already checked in CONV_IN */ g_assert (!m_type_is_byref (t)); g_assert (spec->native == MONO_NATIVE_LPARRAY); @@ -3022,7 +3022,7 @@ emit_marshal_array_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_icon (mb, esize); mono_mb_emit_byte (mb, CEE_MUL); mono_mb_emit_byte (mb, CEE_PREFIX1); - mono_mb_emit_byte (mb, CEE_CPBLK); + mono_mb_emit_byte (mb, CEE_CPBLK); mono_mb_patch_branch (mb, label1); break; } @@ -3078,7 +3078,7 @@ emit_marshal_array_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, int index_var, src, dest, esize; MonoMarshalConv conv = MONO_MARSHAL_CONV_INVALID; gboolean is_string = FALSE; - + g_assert (!m_type_is_byref (t)); mono_marshal_load_type_info (eklass); @@ -3100,7 +3100,7 @@ emit_marshal_array_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, src = mono_mb_add_local (mb, object_type); dest = mono_mb_add_local (mb, int_type); - + mono_mb_emit_stloc (mb, src); mono_mb_emit_ldloc (mb, src); mono_mb_emit_stloc (mb, 3); @@ -3175,8 +3175,8 @@ emit_marshal_array_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, } static int -emit_marshal_ptr_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, int conv_arg, +emit_marshal_ptr_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, + MonoMarshalSpec *spec, int conv_arg, MonoType **conv_arg_type, MarshalAction action) { MonoMethodBuilder *mb = m->mb; @@ -3208,8 +3208,8 @@ emit_marshal_ptr_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, } static int -emit_marshal_scalar_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, int conv_arg, +emit_marshal_scalar_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, + MonoMarshalSpec *spec, int conv_arg, MonoType **conv_arg_type, MarshalAction action) { MonoMethodBuilder *mb = m->mb; @@ -3232,8 +3232,8 @@ emit_marshal_scalar_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, static int emit_marshal_boolean_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, - int conv_arg, MonoType **conv_arg_type, + MonoMarshalSpec *spec, + int conv_arg, MonoType **conv_arg_type, MarshalAction action) { MonoMethodBuilder *mb = m->mb; @@ -3252,7 +3252,7 @@ emit_marshal_boolean_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, else *conv_arg_type = local_type; conv_arg = mono_mb_add_local (mb, local_type); - + mono_mb_emit_ldarg (mb, argnum); if (m_type_is_byref (t)) mono_mb_emit_byte (mb, CEE_LDIND_I1); @@ -3272,7 +3272,7 @@ emit_marshal_boolean_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_ldarg (mb, argnum); mono_mb_emit_ldloc (mb, conv_arg); - + label_false = mono_mb_emit_branch (mb, CEE_BRFALSE); mono_mb_emit_byte (mb, CEE_LDC_I4_1); @@ -3314,7 +3314,7 @@ emit_marshal_boolean_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_ldarg (mb, argnum); - + /* Check null */ if (m_type_is_byref (t)) { label_null = mono_mb_emit_branch (mb, CEE_BRFALSE); @@ -3328,7 +3328,7 @@ emit_marshal_boolean_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_stloc (mb, conv_arg); mono_mb_patch_branch (mb, label_false); - if (m_type_is_byref (t)) + if (m_type_is_byref (t)) mono_mb_patch_branch (mb, label_null); break; } @@ -3354,7 +3354,7 @@ emit_marshal_boolean_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, break; } } - + /* Check null */ mono_mb_emit_ldarg (mb, argnum); label_null = mono_mb_emit_branch (mb, CEE_BRFALSE); @@ -3382,8 +3382,8 @@ emit_marshal_boolean_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, } static int -emit_marshal_char_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, int conv_arg, +emit_marshal_char_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, + MonoMarshalSpec *spec, int conv_arg, MonoType **conv_arg_type, MarshalAction action) { MonoMethodBuilder *mb = m->mb; @@ -3823,50 +3823,50 @@ emit_stelemref_ilgen (MonoMethodBuilder *mb) guint32 copy_pos; int aklass, vklass; int array_slot_addr; - + MonoType *int_type = mono_get_int_type (); MonoType *object_type_byref = mono_class_get_byref_type (mono_defaults.object_class); aklass = mono_mb_add_local (mb, int_type); vklass = mono_mb_add_local (mb, int_type); array_slot_addr = mono_mb_add_local (mb, object_type_byref); - + /* the method: if (!value) goto store; - + aklass = array->vtable->m_class_get_element_class (klass); vklass = value->vtable->klass; - + if (vklass->idepth < aklass->idepth) goto long; - + if (vklass->supertypes [aklass->idepth - 1] != aklass) goto long; - + store: *array_slot_addr = value; return; - + long: if (mono_object_isinst (value, aklass)) goto store; - + throw new ArrayTypeMismatchException (); */ - + /* ldelema (implicit bound check) */ mono_mb_emit_ldarg (mb, 0); mono_mb_emit_ldarg (mb, 1); mono_mb_emit_op (mb, CEE_LDELEMA, mono_defaults.object_class); mono_mb_emit_stloc (mb, array_slot_addr); - + /* if (!value) goto do_store */ mono_mb_emit_ldarg (mb, 2); b1 = mono_mb_emit_branch (mb, CEE_BRFALSE); - + /* aklass = array->vtable->klass->element_class */ mono_mb_emit_ldarg (mb, 0); mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoObject, vtable)); @@ -3876,7 +3876,7 @@ emit_stelemref_ilgen (MonoMethodBuilder *mb) mono_mb_emit_ldflda (mb, m_class_offsetof_element_class ()); mono_mb_emit_byte (mb, CEE_LDIND_I); mono_mb_emit_stloc (mb, aklass); - + /* vklass = value->vtable->klass */ mono_mb_emit_ldarg (mb, 2); mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoObject, vtable)); @@ -3884,23 +3884,23 @@ emit_stelemref_ilgen (MonoMethodBuilder *mb) mono_mb_emit_ldflda (mb, MONO_STRUCT_OFFSET (MonoVTable, klass)); mono_mb_emit_byte (mb, CEE_LDIND_I); mono_mb_emit_stloc (mb, vklass); - + /* if (vklass->idepth < aklass->idepth) goto failue */ mono_mb_emit_ldloc (mb, vklass); mono_mb_emit_ldflda (mb, m_class_offsetof_idepth ()); mono_mb_emit_byte (mb, CEE_LDIND_U2); - + mono_mb_emit_ldloc (mb, aklass); mono_mb_emit_ldflda (mb, m_class_offsetof_idepth ()); mono_mb_emit_byte (mb, CEE_LDIND_U2); - + b2 = mono_mb_emit_branch (mb, CEE_BLT_UN); - + /* if (vklass->supertypes [aklass->idepth - 1] != aklass) goto failure */ mono_mb_emit_ldloc (mb, vklass); mono_mb_emit_ldflda (mb, m_class_offsetof_supertypes ()); mono_mb_emit_byte (mb, CEE_LDIND_I); - + mono_mb_emit_ldloc (mb, aklass); mono_mb_emit_ldflda (mb, m_class_offsetof_idepth ()); mono_mb_emit_byte (mb, CEE_LDIND_U2); @@ -3910,32 +3910,32 @@ emit_stelemref_ilgen (MonoMethodBuilder *mb) mono_mb_emit_byte (mb, CEE_MUL); mono_mb_emit_byte (mb, CEE_ADD); mono_mb_emit_byte (mb, CEE_LDIND_I); - + mono_mb_emit_ldloc (mb, aklass); - + b3 = mono_mb_emit_branch (mb, CEE_BNE_UN); - + copy_pos = mono_mb_get_label (mb); /* do_store */ mono_mb_patch_branch (mb, b1); mono_mb_emit_ldloc (mb, array_slot_addr); mono_mb_emit_ldarg (mb, 2); mono_mb_emit_byte (mb, CEE_STIND_REF); - + mono_mb_emit_byte (mb, CEE_RET); - + /* the hard way */ mono_mb_patch_branch (mb, b2); mono_mb_patch_branch (mb, b3); - + mono_mb_emit_ldarg (mb, 2); mono_mb_emit_ldloc (mb, aklass); mono_mb_emit_icall (mb, mono_object_isinst_icall); - + b4 = mono_mb_emit_branch (mb, CEE_BRTRUE); mono_mb_patch_addr (mb, b4, copy_pos - (b4 + 4)); mono_mb_emit_exception (mb, "ArrayTypeMismatchException", NULL); - + mono_mb_emit_byte (mb, CEE_RET); } @@ -4165,7 +4165,7 @@ emit_delegate_invoke_internal_ilgen (MonoMethodBuilder *mb, MonoMethodSignature mono_mb_emit_op (mb, CEE_MONO_CALLI_EXTRA_ARG, sig); mono_mb_emit_byte (mb, CEE_RET); } - + /* else [target == null] call this->method_ptr static */ mono_mb_patch_branch (mb, pos0); } @@ -4372,7 +4372,7 @@ emit_unbox_wrapper_ilgen (MonoMethodBuilder *mb, MonoMethod *method) { MonoMethodSignature *sig = mono_method_signature_internal (method); - mono_mb_emit_ldarg (mb, 0); + mono_mb_emit_ldarg (mb, 0); mono_mb_emit_icon (mb, MONO_ABI_SIZEOF (MonoObject)); mono_mb_emit_byte (mb, CEE_ADD); for (int i = 0; i < sig->param_count; ++i) @@ -4552,8 +4552,8 @@ emit_marshal_custom_get_instance (MonoMethodBuilder *mb, MonoClass *klass, MonoM static int emit_marshal_custom_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, - int conv_arg, MonoType **conv_arg_type, + MonoMarshalSpec *spec, + int conv_arg, MonoType **conv_arg_type, MarshalAction action) { ERROR_DECL (error); @@ -4656,7 +4656,7 @@ emit_marshal_custom_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, pos2 = mono_mb_emit_branch (mb, CEE_BRFALSE); emit_marshal_custom_get_instance (mb, mklass, spec); - + mono_mb_emit_ldarg (mb, argnum); if (m_type_is_byref (t)) mono_mb_emit_byte (mb, CEE_LDIND_REF); @@ -4718,7 +4718,7 @@ emit_marshal_custom_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, case MARSHAL_ACTION_CONV_RESULT: loc1 = mono_mb_add_local (mb, int_type); - + mono_mb_emit_stloc (mb, 3); mono_mb_emit_ldloc (mb, 3); @@ -4757,11 +4757,11 @@ emit_marshal_custom_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, pos2 = mono_mb_emit_branch (mb, CEE_BRFALSE); emit_marshal_custom_get_instance (mb, mklass, spec); - + mono_mb_emit_ldarg (mb, argnum); if (m_type_is_byref (t)) mono_mb_emit_byte (mb, CEE_LDIND_I); - + mono_mb_emit_op (mb, CEE_CALLVIRT, marshal_native_to_managed); mono_mb_emit_stloc (mb, conv_arg); @@ -4772,9 +4772,9 @@ emit_marshal_custom_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, g_assert (!m_type_is_byref (t)); loc1 = mono_mb_add_local (mb, object_type); - + mono_mb_emit_stloc (mb, 3); - + mono_mb_emit_ldloc (mb, 3); mono_mb_emit_stloc (mb, loc1); @@ -4813,7 +4813,7 @@ emit_marshal_custom_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, /* Call CleanUpManagedData */ emit_marshal_custom_get_instance (mb, mklass, spec); - + mono_mb_emit_ldloc (mb, conv_arg); mono_mb_emit_op (mb, CEE_CALLVIRT, cleanup_managed); @@ -4828,8 +4828,8 @@ emit_marshal_custom_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, static int emit_marshal_asany_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, - int conv_arg, MonoType **conv_arg_type, + MonoMarshalSpec *spec, + int conv_arg, MonoType **conv_arg_type, MarshalAction action) { MonoMethodBuilder *mb = m->mb; @@ -4874,8 +4874,8 @@ emit_marshal_asany_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, static int emit_marshal_vtype_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, - int conv_arg, MonoType **conv_arg_type, + MonoMarshalSpec *spec, + int conv_arg, MonoType **conv_arg_type, MarshalAction action) { MonoMethodBuilder *mb = m->mb; @@ -4924,15 +4924,15 @@ emit_marshal_vtype_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, break; conv_arg = mono_mb_add_local (mb, int_type); - + /* store the address of the source into local variable 0 */ if (m_type_is_byref (t)) mono_mb_emit_ldarg (mb, argnum); else mono_mb_emit_ldarg_addr (mb, argnum); - + mono_mb_emit_stloc (mb, 0); - + /* allocate space for the native struct and * store the address into local variable 1 (dest) */ mono_mb_emit_icon (mb, mono_class_native_size (klass, NULL)); @@ -4984,7 +4984,7 @@ emit_marshal_vtype_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, if (mono_class_is_explicit_layout (klass) || m_class_is_blittable (klass) || m_class_is_enumtype (klass)) { mono_mb_emit_ldarg (mb, argnum); break; - } + } mono_mb_emit_ldloc (mb, conv_arg); if (!m_type_is_byref (t)) { mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); @@ -5037,7 +5037,7 @@ emit_marshal_vtype_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, } emit_struct_free (mb, klass, conv_arg); - + if (m_type_is_byref (t)) mono_mb_patch_branch (mb, pos); break; @@ -5056,7 +5056,7 @@ emit_marshal_vtype_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, /* set dst_ptr */ mono_mb_emit_ldloc_addr (mb, 3); mono_mb_emit_stloc (mb, 1); - + /* emit valuetype conversion code */ emit_struct_conv (mb, klass, TRUE); break; @@ -5072,7 +5072,7 @@ emit_marshal_vtype_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, if (t->attrs & PARAM_ATTRIBUTE_OUT) break; - if (m_type_is_byref (t)) + if (m_type_is_byref (t)) mono_mb_emit_ldarg (mb, argnum); else mono_mb_emit_ldarg_addr (mb, argnum); @@ -5081,7 +5081,7 @@ emit_marshal_vtype_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, if (m_type_is_byref (t)) { mono_mb_emit_ldloc (mb, 0); pos = mono_mb_emit_branch (mb, CEE_BRFALSE); - } + } mono_mb_emit_ldloc_addr (mb, conv_arg); mono_mb_emit_stloc (mb, 1); @@ -5123,11 +5123,11 @@ emit_marshal_vtype_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, m->retobj_var = 0; break; } - + /* load pointer to returned value type */ g_assert (m->vtaddr_var); mono_mb_emit_ldloc (mb, m->vtaddr_var); - + /* store the address of the source into local variable 0 */ mono_mb_emit_stloc (mb, 0); /* allocate space for the native struct and @@ -5163,8 +5163,8 @@ emit_string_free_icall (MonoMethodBuilder *mb, MonoMarshalConv conv) static int emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, - int conv_arg, MonoType **conv_arg_type, + MonoMarshalSpec *spec, + int conv_arg, MonoType **conv_arg_type, MarshalAction action) { MonoMethodBuilder *mb = m->mb; @@ -5184,7 +5184,7 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, break; mono_mb_emit_ldarg (mb, argnum); - mono_mb_emit_byte (mb, CEE_LDIND_I); + mono_mb_emit_byte (mb, CEE_LDIND_I); } else { mono_mb_emit_ldarg (mb, argnum); } @@ -5221,7 +5221,7 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, MONO_STATIC_POINTER_INIT_END (MonoMethod, m) - /* + /* * Have to allocate a new string with the same length as the original, and * copy the contents of the buffer pointed to by CONV_ARG into it. */ @@ -5229,7 +5229,7 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_ldarg (mb, argnum); mono_mb_emit_ldloc (mb, conv_arg); mono_mb_emit_ldarg (mb, argnum); - mono_mb_emit_byte (mb, CEE_LDIND_I); + mono_mb_emit_byte (mb, CEE_LDIND_I); mono_mb_emit_managed_call (mb, m, NULL); mono_mb_emit_icall (mb, mono_string_new_len_wrapper); mono_mb_emit_byte (mb, CEE_STIND_REF); @@ -5257,7 +5257,7 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, case MARSHAL_ACTION_CONV_RESULT: mono_mb_emit_stloc (mb, 0); - + conv = mono_marshal_get_ptr_to_string_conv (m->piinfo, spec, &need_free); if (conv == MONO_MARSHAL_CONV_INVALID) { char *msg = g_strdup_printf ("string marshalling conversion %d not implemented", encoding); @@ -5327,8 +5327,8 @@ emit_marshal_string_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, static int -emit_marshal_safehandle_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, int conv_arg, +emit_marshal_safehandle_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, + MonoMarshalSpec *spec, int conv_arg, MonoType **conv_arg_type, MarshalAction action) { MonoMethodBuilder *mb = m->mb; @@ -5348,7 +5348,7 @@ emit_marshal_safehandle_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_ldarg (mb, argnum); pos = mono_mb_emit_branch (mb, CEE_BRTRUE); mono_mb_emit_exception (mb, "ArgumentNullException", NULL); - + mono_mb_patch_branch (mb, pos); /* Create local to hold the ref parameter to DangerousAddRef */ @@ -5399,7 +5399,7 @@ emit_marshal_safehandle_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, case MARSHAL_ACTION_PUSH: if (m_type_is_byref (t)) mono_mb_emit_ldloc_addr (mb, conv_arg); - else + else mono_mb_emit_ldloc (mb, conv_arg); break; @@ -5425,7 +5425,7 @@ emit_marshal_safehandle_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, if (is_out (t)) { ERROR_DECL (local_error); MonoMethod *ctor; - + /* * If the SafeHandle was marshalled on input we can skip the marshalling on * output if the handle value is identical. @@ -5439,7 +5439,7 @@ emit_marshal_safehandle_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, /* * Create an empty SafeHandle (of correct derived type). - * + * * FIXME: If an out-of-memory situation or exception happens here we will * leak the handle. We should move the allocation of the SafeHandle to the * input marshalling code to prevent that. @@ -5476,12 +5476,12 @@ emit_marshal_safehandle_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, } break; } - + case MARSHAL_ACTION_CONV_RESULT: { ERROR_DECL (error); MonoMethod *ctor = NULL; int intptr_handle_slot; - + if (mono_class_is_abstract (t->data.klass)) { mono_mb_emit_byte (mb, CEE_POP); mono_mb_emit_exception_marshal_directive (mb, g_strdup ("Returned SafeHandles should not be abstract")); @@ -5510,11 +5510,11 @@ emit_marshal_safehandle_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_byte (mb, CEE_STIND_I); break; } - + case MARSHAL_ACTION_MANAGED_CONV_IN: fprintf (stderr, "mono/marshal: SafeHandles missing MANAGED_CONV_IN\n"); break; - + case MARSHAL_ACTION_MANAGED_CONV_OUT: fprintf (stderr, "mono/marshal: SafeHandles missing MANAGED_CONV_OUT\n"); break; @@ -5530,8 +5530,8 @@ emit_marshal_safehandle_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, static int -emit_marshal_handleref_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, int conv_arg, +emit_marshal_handleref_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, + MonoMarshalSpec *spec, int conv_arg, MonoType **conv_arg_type, MarshalAction action) { MonoMethodBuilder *mb = m->mb; @@ -5546,7 +5546,7 @@ emit_marshal_handleref_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, char *msg = g_strdup ("HandleRefs can not be returned from unmanaged code (or passed by ref)"); mono_mb_emit_exception_marshal_directive (mb, msg); break; - } + } mono_mb_emit_ldarg_addr (mb, argnum); mono_mb_emit_icon (mb, MONO_STRUCT_OFFSET (MonoHandleRef, handle)); mono_mb_emit_byte (mb, CEE_ADD); @@ -5563,17 +5563,17 @@ emit_marshal_handleref_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, /* no resource release required */ break; } - + case MARSHAL_ACTION_CONV_RESULT: { char *msg = g_strdup ("HandleRefs can not be returned from unmanaged code (or passed by ref)"); mono_mb_emit_exception_marshal_directive (mb, msg); break; } - + case MARSHAL_ACTION_MANAGED_CONV_IN: fprintf (stderr, "mono/marshal: SafeHandles missing MANAGED_CONV_IN\n"); break; - + case MARSHAL_ACTION_MANAGED_CONV_OUT: fprintf (stderr, "mono/marshal: SafeHandles missing MANAGED_CONV_OUT\n"); break; @@ -5590,8 +5590,8 @@ emit_marshal_handleref_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, static int emit_marshal_object_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, - int conv_arg, MonoType **conv_arg_type, + MonoMarshalSpec *spec, + int conv_arg, MonoType **conv_arg_type, MarshalAction action) { MonoMethodBuilder *mb = m->mb; @@ -5629,7 +5629,7 @@ emit_marshal_object_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, MonoMarshalNative encoding = mono_marshal_get_string_encoding (m->piinfo, spec); MonoMarshalConv conv = mono_marshal_get_stringbuilder_to_ptr_conv (m->piinfo, spec); -#if 0 +#if 0 if (m_type_is_byref (t)) { if (!(t->attrs & PARAM_ATTRIBUTE_OUT)) { char *msg = g_strdup_printf ("Byref marshalling of stringbuilders is not implemented."); @@ -5676,7 +5676,7 @@ emit_marshal_object_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, if (t->attrs & PARAM_ATTRIBUTE_OUT) break; - mono_mb_emit_ldarg (mb, argnum); + mono_mb_emit_ldarg (mb, argnum); mono_mb_emit_byte (mb, CEE_LDIND_I); } else { @@ -5684,7 +5684,7 @@ emit_marshal_object_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); mono_mb_emit_byte (mb, CEE_MONO_OBJADDR); } - + /* store the address of the source into local variable 0 */ mono_mb_emit_stloc (mb, 0); mono_mb_emit_ldloc (mb, 0); @@ -5803,7 +5803,7 @@ emit_marshal_object_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_icon (mb, MONO_ABI_SIZEOF (MonoObject)); mono_mb_emit_byte (mb, CEE_ADD); mono_mb_emit_stloc (mb, 1); - + /* src = tmp_locals [i] */ mono_mb_emit_ldloc (mb, conv_arg); mono_mb_emit_stloc (mb, 0); @@ -5815,7 +5815,7 @@ emit_marshal_object_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, emit_struct_free (mb, klass, conv_arg); if (m->orig_conv_args [argnum]) { - /* + /* * If the native function changed the pointer, then free * the original structure plus the new pointer. */ @@ -5865,35 +5865,35 @@ emit_marshal_object_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, } else { /* set src */ mono_mb_emit_stloc (mb, 0); - + /* Make a copy since emit_conv modifies local 0 */ loc = mono_mb_add_local (mb, int_type); mono_mb_emit_ldloc (mb, 0); mono_mb_emit_stloc (mb, loc); - + mono_mb_emit_byte (mb, CEE_LDNULL); mono_mb_emit_stloc (mb, 3); - + mono_mb_emit_ldloc (mb, 0); pos = mono_mb_emit_branch (mb, CEE_BRFALSE); - + /* allocate result object */ - + mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); - mono_mb_emit_op (mb, CEE_MONO_NEWOBJ, klass); + mono_mb_emit_op (mb, CEE_MONO_NEWOBJ, klass); mono_mb_emit_stloc (mb, 3); - + /* set dst */ - + mono_mb_emit_ldloc (mb, 3); mono_mb_emit_ldflda (mb, MONO_ABI_SIZEOF (MonoObject)); mono_mb_emit_stloc (mb, 1); - + /* emit conversion code */ emit_struct_conv (mb, klass, TRUE); - + emit_struct_free (mb, klass, loc); - + /* Free the pointer allocated by unmanaged code */ mono_mb_emit_ldloc (mb, loc); mono_mb_emit_icall (mb, mono_marshal_free); @@ -5957,7 +5957,7 @@ emit_marshal_object_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_patch_branch (mb, pos2); mono_mb_emit_ldarg (mb, argnum); mono_mb_emit_byte (mb, CEE_LDIND_I); - } + } mono_mb_emit_stloc (mb, 0); @@ -5969,11 +5969,11 @@ emit_marshal_object_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, /* Create and set dst */ mono_mb_emit_byte (mb, MONO_CUSTOM_PREFIX); - mono_mb_emit_op (mb, CEE_MONO_NEWOBJ, klass); + mono_mb_emit_op (mb, CEE_MONO_NEWOBJ, klass); mono_mb_emit_stloc (mb, conv_arg); mono_mb_emit_ldloc (mb, conv_arg); mono_mb_emit_ldflda (mb, MONO_ABI_SIZEOF (MonoObject)); - mono_mb_emit_stloc (mb, 1); + mono_mb_emit_stloc (mb, 1); /* emit valuetype conversion code */ emit_struct_conv (mb, klass, TRUE); @@ -6002,8 +6002,8 @@ emit_marshal_object_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_byte (mb, CEE_STIND_I); pos2 = mono_mb_emit_branch (mb, CEE_BR); - mono_mb_patch_branch (mb, pos); - + mono_mb_patch_branch (mb, pos); + /* Set src */ mono_mb_emit_ldloc (mb, conv_arg); mono_mb_emit_ldflda (mb, MONO_ABI_SIZEOF (MonoObject)); @@ -6014,12 +6014,12 @@ emit_marshal_object_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, mono_mb_emit_byte (mb, CEE_CONV_I); mono_mb_emit_icall (mb, ves_icall_marshal_alloc); mono_mb_emit_stloc (mb, 1); - + /* Update argument pointer */ mono_mb_emit_ldarg (mb, argnum); mono_mb_emit_ldloc (mb, 1); mono_mb_emit_byte (mb, CEE_STIND_I); - + /* emit valuetype conversion code */ emit_struct_conv (mb, klass, FALSE); @@ -6039,10 +6039,10 @@ emit_marshal_object_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, /* Set dest */ mono_mb_emit_ldarg (mb, argnum); mono_mb_emit_stloc (mb, 1); - + /* emit valuetype conversion code */ emit_struct_conv (mb, klass, FALSE); - } + } break; case MARSHAL_ACTION_MANAGED_CONV_RESULT: @@ -6094,8 +6094,8 @@ emit_marshal_object_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, static int emit_marshal_variant_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, - int conv_arg, MonoType **conv_arg_type, + MonoMarshalSpec *spec, + int conv_arg, MonoType **conv_arg_type, MarshalAction action) { #ifndef DISABLE_COM @@ -6107,7 +6107,7 @@ emit_marshal_variant_ilgen (EmitMarshalContext *m, int argnum, MonoType *t, switch (action) { case MARSHAL_ACTION_CONV_IN: { conv_arg = mono_mb_add_local (mb, variant_type); - + if (m_type_is_byref (t)) *conv_arg_type = variant_type_byref; else @@ -6330,7 +6330,7 @@ emit_managed_wrapper_ilgen (MonoMethodBuilder *mb, MonoMethodSignature *invoke_s if (mspecs [0] && mspecs [0]->native == MONO_NATIVE_CUSTOM) { mono_emit_marshal (m, 0, sig->ret, mspecs [0], 0, NULL, MARSHAL_ACTION_MANAGED_CONV_RESULT); - } else if (!m_type_is_byref (sig->ret)) { + } else if (!m_type_is_byref (sig->ret)) { switch (sig->ret->type) { case MONO_TYPE_VOID: break; @@ -6362,7 +6362,7 @@ emit_managed_wrapper_ilgen (MonoMethodBuilder *mb, MonoMethodSignature *invoke_s mono_emit_marshal (m, 0, sig->ret, mspecs [0], 0, NULL, MARSHAL_ACTION_MANAGED_CONV_RESULT); break; default: - g_warning ("return type 0x%02x unknown", sig->ret->type); + g_warning ("return type 0x%02x unknown", sig->ret->type); g_assert_not_reached (); } } else { @@ -6481,7 +6481,7 @@ emit_ptr_to_struct_ilgen (MonoMethodBuilder *mb, MonoClass *klass) mono_mb_add_local (mb, int_type); /* allocate local 1 (pointer) dst_ptr */ mono_mb_add_local (mb, m_class_get_this_arg (klass)); - + /* initialize src_ptr to point to the start of object data */ mono_mb_emit_byte (mb, CEE_LDARG_0); mono_mb_emit_stloc (mb, 0); @@ -6776,7 +6776,7 @@ emit_marshal_directive_exception_ilgen (EmitMarshalContext *m, int argnum, const char* fullmsg = NULL; if (argnum == 0) fullmsg = g_strdup_printf("Error marshalling return value: %s", msg); - else + else fullmsg = g_strdup_printf("Error marshalling parameter #%d: %s", argnum, msg); mono_mb_emit_exception_marshal_directive (m->mb, fullmsg); diff --git a/src/mono/mono/metadata/marshal.c b/src/mono/mono/metadata/marshal.c index 4f57d238e16a8d..491fdcc2b9fc06 100644 --- a/src/mono/mono/metadata/marshal.c +++ b/src/mono/mono/metadata/marshal.c @@ -3088,7 +3088,7 @@ mono_emit_disabled_marshal (EmitMarshalContext *m, int argnum, MonoType *t, if (m_type_is_byref(t)) { if (emit_exception) - get_marshal_cb ()->emit_marshal_directive_exception (m, argnum, "Cannot marshal managed references when the runtime marshalling system is disabled."); + get_marshal_cb ()->emit_marshal_directive_exception (m, argnum, "Cannot marshal managed references when the runtime marshalling system is disabled."); else get_marshal_cb ()->emit_marshal_scalar (m, argnum, t, spec, conv_arg, conv_arg_type, action); return conv_arg; @@ -3140,7 +3140,7 @@ mono_emit_disabled_marshal (EmitMarshalContext *m, int argnum, MonoType *t, } if (emit_exception) - get_marshal_cb ()->emit_marshal_directive_exception (m, argnum, "Cannot marshal managed types when the runtime marshalling system is disabled."); + get_marshal_cb ()->emit_marshal_directive_exception (m, argnum, "Cannot marshal managed types when the runtime marshalling system is disabled."); else get_marshal_cb ()->emit_marshal_scalar (m, argnum, t, spec, conv_arg, conv_arg_type, action); return conv_arg; diff --git a/src/mono/mono/metadata/marshal.h b/src/mono/mono/metadata/marshal.h index 1779131e450938..3d35ee3abf75d0 100644 --- a/src/mono/mono/metadata/marshal.h +++ b/src/mono/mono/metadata/marshal.h @@ -1,7 +1,7 @@ /** * \file * Routines for marshaling complex types in P/Invoke methods. - * + * * Author: * Paolo Molaro (lupus@ximian.com) * @@ -78,7 +78,7 @@ typedef enum { /* * The result from the unmanaged call is at the top of the stack when * this action is invoked. The result should be stored in the - * third local variable slot. + * third local variable slot. */ MARSHAL_ACTION_CONV_RESULT, @@ -378,7 +378,7 @@ gint32 mono_marshal_type_size (MonoType *type, MonoMarshalSpec *mspec, guint32 *align, gboolean as_field, gboolean unicode); -int +int mono_type_native_stack_size (MonoType *type, guint32 *alignment); mono_bstr @@ -542,18 +542,18 @@ mono_marshal_unlock_internal (void); /* marshaling internal calls */ -void * +void * mono_marshal_alloc (gsize size, MonoError *error); ICALL_EXPORT -void +void mono_marshal_free (gpointer ptr); ICALL_EXPORT void mono_marshal_free_array (gpointer *ptr, int size); -gboolean +gboolean mono_marshal_free_ccw (MonoObject* obj); MONO_API void * @@ -564,12 +564,12 @@ void mono_marshal_set_last_error_windows (int error); ICALL_EXPORT -void +void mono_struct_delete_old (MonoClass *klass, char *ptr); int -mono_emit_marshal (EmitMarshalContext *m, int argnum, MonoType *t, - MonoMarshalSpec *spec, int conv_arg, +mono_emit_marshal (EmitMarshalContext *m, int argnum, MonoType *t, + MonoMarshalSpec *spec, int conv_arg, MonoType **conv_arg_type, MarshalAction action); ICALL_EXPORT diff --git a/src/mono/mono/metadata/mempool-internals.h b/src/mono/mono/metadata/mempool-internals.h index c16e83438e4435..fb09d2ecda04ba 100644 --- a/src/mono/mono/metadata/mempool-internals.h +++ b/src/mono/mono/metadata/mempool-internals.h @@ -14,7 +14,7 @@ static inline GList* g_list_prepend_mempool (MonoMemPool *mp, GList *list, gpointer data) { GList *new_list; - + new_list = (GList *) mono_mempool_alloc (mp, sizeof (GList)); new_list->data = data; new_list->prev = list ? list->prev : NULL; @@ -32,7 +32,7 @@ static inline GSList* g_slist_prepend_mempool (MonoMemPool *mp, GSList *list, gpointer data) { GSList *new_list; - + new_list = (GSList *) mono_mempool_alloc (mp, sizeof (GSList)); new_list->data = data; new_list->next = list; diff --git a/src/mono/mono/metadata/mempool.c b/src/mono/mono/metadata/mempool.c index ab9fc28bccc356..6a2698a5385f97 100644 --- a/src/mono/mono/metadata/mempool.c +++ b/src/mono/mono/metadata/mempool.c @@ -113,7 +113,7 @@ mono_mempool_new_size (int initial_size) pool->next = NULL; pool->pos = (guint8*)pool + SIZEOF_MEM_POOL; // Start after header - pool->end = (guint8*)pool + initial_size; // End at end of allocated space + pool->end = (guint8*)pool + initial_size; // End at end of allocated space pool->d.allocated = pool->size = initial_size; UnlockedAdd64 (&total_bytes_allocated, initial_size); return pool; diff --git a/src/mono/mono/metadata/metadata-internals.h b/src/mono/mono/metadata/metadata-internals.h index ba8f957aaf2d02..ed4627d4bab073 100644 --- a/src/mono/mono/metadata/metadata-internals.h +++ b/src/mono/mono/metadata/metadata-internals.h @@ -32,7 +32,7 @@ struct _MonoType { } data; unsigned int attrs : 16; /* param attributes or field flags */ MonoTypeEnum type : 8; - unsigned int has_cmods : 1; + unsigned int has_cmods : 1; unsigned int byref__ : 1; /* don't access directly, use m_type_is_byref */ unsigned int pinned : 1; /* valid when included in a local var signature */ }; @@ -130,14 +130,14 @@ mono_type_get_custom_modifier (const MonoType *ty, uint8_t idx, gboolean *requir // memory unsafety on the stack and/or heap, when we try to traverse // this array. // -// Use mono_sizeof_monotype +// Use mono_sizeof_monotype // to get the size of the memory to copy. #define MONO_SIZEOF_TYPE sizeof (MonoType) -size_t +size_t mono_sizeof_type_with_mods (uint8_t num_mods, gboolean aggregate); -size_t +size_t mono_sizeof_type (const MonoType *ty); size_t @@ -192,8 +192,8 @@ typedef struct _MonoAssemblyContext { } MonoAssemblyContext; struct _MonoAssembly { - /* - * The number of appdomains which have this assembly loaded plus the number of + /* + * The number of appdomains which have this assembly loaded plus the number of * assemblies referencing this assembly through an entry in their image->references * arrays. The latter is needed because entries in the image->references array * might point to assemblies which are only loaded in some appdomains, and without @@ -238,7 +238,7 @@ struct _MonoTableInfo { * A 32 bit value can encode the resulting size * * The top eight bits encode the number of columns in the table. - * we only need 4, but 8 is aligned no shift required. + * we only need 4, but 8 is aligned no shift required. */ guint32 size_bitfield; }; @@ -350,14 +350,14 @@ struct _MonoImage { MonoMemPool *mempool; /*protected by the image lock*/ char *raw_metadata; - + MonoStreamHeader heap_strings; MonoStreamHeader heap_us; MonoStreamHeader heap_blob; MonoStreamHeader heap_guid; MonoStreamHeader heap_tables; MonoStreamHeader heap_pdb; - + const char *tables_base; /* For PPDB files */ @@ -447,7 +447,7 @@ struct _MonoImage { GHashTable *native_func_wrapper_cache; /* - * indexed by MonoMethod pointers + * indexed by MonoMethod pointers */ GHashTable *wrapper_param_names; GHashTable *array_accessor_cache; @@ -899,7 +899,7 @@ mono_metadata_parse_mh_full (MonoImage *image, const char *ptr, MonoError *error); -MonoMethodSignature *mono_metadata_parse_signature_checked (MonoImage *image, +MonoMethodSignature *mono_metadata_parse_signature_checked (MonoImage *image, uint32_t token, MonoError *error); @@ -948,7 +948,7 @@ void mono_dynamic_stream_reset (MonoDynamicStream* stream); void mono_assembly_load_friends (MonoAssembly* ass); gboolean mono_assembly_has_skip_verification (MonoAssembly* ass); -MONO_API gint32 +MONO_API gint32 mono_assembly_addref (MonoAssembly *assembly); gint32 mono_assembly_decref (MonoAssembly *assembly); @@ -1010,7 +1010,7 @@ mono_metadata_signature_equal_no_ret (MonoMethodSignature *sig1, MonoMethodSigna MONO_API void mono_metadata_field_info_with_mempool ( - MonoImage *meta, + MonoImage *meta, guint32 table_index, guint32 *offset, guint32 *rva, @@ -1059,7 +1059,7 @@ mono_type_create_from_typespec_checked (MonoImage *image, guint32 type_spec, Mon MonoMethodSignature* mono_method_get_signature_checked (MonoMethod *method, MonoImage *image, guint32 token, MonoGenericContext *context, MonoError *error); - + MONO_COMPONENT_API MonoMethod * mono_get_method_checked (MonoImage *image, guint32 token, MonoClass *klass, MonoGenericContext *context, MonoError *error); diff --git a/src/mono/mono/metadata/metadata-update.c b/src/mono/mono/metadata/metadata-update.c index e24823ead81f3b..ac31818c5e4992 100644 --- a/src/mono/mono/metadata/metadata-update.c +++ b/src/mono/mono/metadata/metadata-update.c @@ -155,7 +155,7 @@ mono_metadata_update_metadata_linear_search (MonoImage *base_image, MonoTableInf return mono_component_hot_reload()->metadata_linear_search (base_image, base_table, key, comparer); } -/* +/* * Returns the (1-based) table row index of the fielddef of the given field * (which must have m_field_is_from_update set). */ diff --git a/src/mono/mono/metadata/metadata.c b/src/mono/mono/metadata/metadata.c index 8aa7a921ab48c4..f249e816b76f57 100644 --- a/src/mono/mono/metadata/metadata.c +++ b/src/mono/mono/metadata/metadata.c @@ -4994,7 +4994,7 @@ mono_metadata_nested_in_typedef (MonoImage *meta, guint32 index) if (!found && !mono_metadata_update_metadata_linear_search (meta, tdef, &loc, table_locator)) return 0; } - + /* loc_result is 0..1, needs to be mapped to table index (that is +1) */ return mono_metadata_decode_row_col (tdef, loc.result, MONO_NESTED_CLASS_ENCLOSING) | MONO_TOKEN_TYPE_DEF; } diff --git a/src/mono/mono/metadata/method-builder-ilgen.c b/src/mono/mono/metadata/method-builder-ilgen.c index 68ddbaae60e800..5f48ac8b038aaf 100644 --- a/src/mono/mono/metadata/method-builder-ilgen.c +++ b/src/mono/mono/metadata/method-builder-ilgen.c @@ -616,10 +616,10 @@ mono_mb_emit_exception_for_error (MonoMethodBuilder *mb, MonoError *error) void mono_mb_emit_add_to_local (MonoMethodBuilder *mb, guint16 local, gint32 incr) { - mono_mb_emit_ldloc (mb, local); + mono_mb_emit_ldloc (mb, local); mono_mb_emit_icon (mb, incr); mono_mb_emit_byte (mb, CEE_ADD); - mono_mb_emit_stloc (mb, local); + mono_mb_emit_stloc (mb, local); } void diff --git a/src/mono/mono/metadata/method-builder.c b/src/mono/mono/metadata/method-builder.c index b907d82add622b..3f6452ec89a6b5 100644 --- a/src/mono/mono/metadata/method-builder.c +++ b/src/mono/mono/metadata/method-builder.c @@ -1,7 +1,7 @@ /** * \file * Functions for creating IL methods at runtime. - * + * * Author: * Paolo Molaro (lupus@ximian.com) * @@ -47,11 +47,11 @@ static MonoDisHelper marshal_dh = { "\n", "IL_%04x: ", "IL_%04x", - indenter, + indenter, NULL, NULL }; -#endif +#endif static MonoMethodBuilderCallbacks mb_cb; static gboolean cb_inited = FALSE; diff --git a/src/mono/mono/metadata/method-builder.h b/src/mono/mono/metadata/method-builder.h index fd3903c866445f..673dcec32b8582 100644 --- a/src/mono/mono/metadata/method-builder.h +++ b/src/mono/mono/metadata/method-builder.h @@ -1,7 +1,7 @@ /** * \file * Functions for creating IL methods at runtime. - * + * * Author: * Paolo Molaro (lupus@ximian.com) * diff --git a/src/mono/mono/metadata/monitor.c b/src/mono/mono/metadata/monitor.c index da5662677b8664..042f73b866c86d 100644 --- a/src/mono/mono/metadata/monitor.c +++ b/src/mono/mono/metadata/monitor.c @@ -315,7 +315,7 @@ mono_locks_dump (gboolean include_untaken) } /* LOCKING: this is called with monitor_mutex held */ -static void +static void mon_finalize (MonoThreadsSync *mon) { LOCK_DEBUG (g_message ("%s: Finalizing sync %p", __func__, mon)); @@ -411,7 +411,7 @@ mon_new (gsize id) new_->status = mon_status_init_entry_count (new_->status); new_->nest = 1; new_->data = NULL; - + #ifndef DISABLE_PERFCOUNTERS mono_atomic_inc_i32 (&mono_perfcounters->gc_sync_blocks); #endif @@ -566,7 +566,7 @@ mono_object_hash_internal (MonoObject* obj) /* Done by somebody else */ return hash; } - + mono_monitor_inflate (obj); lw.sync = obj->synchronisation; } else if (lock_word_is_flat (lw)) { @@ -666,7 +666,7 @@ mono_monitor_exit_inflated (MonoObject *obj) old_status = tmp_status; } LOCK_DEBUG (g_message ("%s: (%d) Object %p is now unlocked", __func__, mono_thread_info_get_small_id (), obj)); - + /* object is now unlocked, leave nest==1 so we don't * need to set it when the lock is reacquired */ @@ -758,7 +758,7 @@ static gint64 thread_contentions; /* for Monitor.LockContentionCount, otherwise /* If allow_interruption==TRUE, the method will be interrupted if abort or suspend * is requested. In this case it returns -1. - */ + */ static gint32 mono_monitor_try_enter_inflated (MonoObject *obj, guint32 ms, gboolean allow_interruption, guint32 id) { @@ -874,7 +874,7 @@ mono_monitor_try_enter_inflated (MonoObject *obj, guint32 ms, gboolean allow_int then = mono_msec_ticks (); } waitms = ms; - + #ifndef DISABLE_PERFCOUNTERS mono_atomic_inc_i32 (&mono_perfcounters->thread_queue_len); mono_atomic_inc_i32 (&mono_perfcounters->thread_queue_max); @@ -905,8 +905,8 @@ mono_monitor_try_enter_inflated (MonoObject *obj, guint32 ms, gboolean allow_int if (timedout || (interrupted && allow_interruption)) { /* we're done */ } else { - /* - * We have to obey a stop/suspend request even if + /* + * We have to obey a stop/suspend request even if * allow_interruption is FALSE to avoid hangs at shutdown. * FIXME Handle abort protected blocks */ @@ -1051,7 +1051,7 @@ void mono_monitor_exit_internal (MonoObject *obj) { LockWord lw; - + LOCK_DEBUG (g_message ("%s: (%d) Unlocking %p", __func__, mono_thread_info_get_small_id (), obj)); if (G_UNLIKELY (!obj)) { @@ -1242,7 +1242,7 @@ ves_icall_System_Threading_Monitor_Monitor_test_owner (MonoObjectHandle obj_hand } else if (lock_word_is_inflated (lw)) { return mon_status_get_owner (lock_word_get_inflated_lock (lw)->status) == mono_thread_info_get_small_id (); } - + return FALSE; } @@ -1279,7 +1279,7 @@ mono_monitor_pulse (MonoObject *obj, const char *func, gboolean all) MonoThreadsSync *mon; LOCK_DEBUG (g_message ("%s: (%d) Pulsing %p", func, id, obj)); - + lw.sync = obj->synchronisation; if (!mono_monitor_ensure_owned (lw, id)) @@ -1365,7 +1365,7 @@ mono_monitor_wait (MonoObjectHandle obj_handle, guint32 ms, MonoBoolean allow_in mono_thread_set_state (thread, ThreadState_WaitSleepJoin); mon->wait_list = g_slist_append (mon->wait_list, event); - + /* Save the nest count, and release the lock */ nest = mon->nest; mon->nest = 1; @@ -1414,7 +1414,7 @@ mono_monitor_wait (MonoObjectHandle obj_handle, guint32 ms, MonoBoolean allow_in * be signalled more than once, thereby starving another * thread. */ - + if (ret == MONO_W32HANDLE_WAIT_RET_SUCCESS_0) { LOCK_DEBUG (g_message ("%s: (%d) Success", __func__, id)); success = TRUE; @@ -1426,7 +1426,7 @@ mono_monitor_wait (MonoObjectHandle obj_handle, guint32 ms, MonoBoolean allow_in mon->wait_list = g_slist_remove (mon->wait_list, event); } mono_w32event_close (event); - + return success; } diff --git a/src/mono/mono/metadata/mono-basic-block.c b/src/mono/mono/metadata/mono-basic-block.c index 6dd0a679fe541c..4fef3f8b9a442f 100644 --- a/src/mono/mono/metadata/mono-basic-block.c +++ b/src/mono/mono/metadata/mono-basic-block.c @@ -410,7 +410,7 @@ bb_formation_il_pass (const unsigned char *start, const unsigned char *end, Mono offset = cli_addr + 5 + (gint32)read32 (ip + 1); ip += 5; } - + branch = bb_split (bb, current, root, offset, TRUE, method, error); if (!branch) return; @@ -442,7 +442,7 @@ bb_formation_il_pass (const unsigned char *start, const unsigned char *end, Mono return; bb_link (current, next); - tmp = next; + tmp = next; for (j = 0; j < n; ++j) { if (ip >= end) { @@ -545,7 +545,7 @@ mono_basic_block_split (MonoMethod *method, MonoError *error, MonoMethodHeader * bb_formation_il_pass (start, end, bb, &root, method, error); if (!is_ok (error)) goto fail; - + bb_formation_eh_pass (header, bb, &root, method, error); if (!is_ok (error)) goto fail; @@ -567,14 +567,14 @@ mono_basic_block_split (MonoMethod *method, MonoError *error, MonoMethodHeader * * mono_opcode_value_and_size: * * Returns the size of the opcode starting at *@ip, or -1 on error. - * Value is the opcode number. + * Value is the opcode number. */ int mono_opcode_value_and_size (const unsigned char **ip, const unsigned char *end, MonoOpcodeEnum *value) { const unsigned char *start = *ip, *p; int i = *value = mono_opcode_value (ip, end); - int size = 0; + int size = 0; if (i < 0 || i >= MONO_CEE_LAST) return -1; p = *ip; diff --git a/src/mono/mono/metadata/mono-conc-hash.c b/src/mono/mono/metadata/mono-conc-hash.c index f0bdcc4002482c..c79e7210ce20ae 100644 --- a/src/mono/mono/metadata/mono-conc-hash.c +++ b/src/mono/mono/metadata/mono-conc-hash.c @@ -169,7 +169,7 @@ rehash_table (MonoConcGHashTable *hash_table, int multiplier) hash_table->overflow_count = (int)(new_table->table_size * LOAD_FACTOR); hash_table->element_count -= hash_table->tombstone_count; hash_table->tombstone_count = 0; - conc_table_lf_free (old_table); + conc_table_lf_free (old_table); } @@ -305,7 +305,7 @@ mono_conc_g_hash_table_foreach (MonoConcGHashTable *hash_table, GHFunc func, gpo if (table->keys [i] && !key_is_tombstone (hash_table, table->keys [i])) { func (table->keys [i], table->values [i], user_data); } - } + } } void @@ -359,7 +359,7 @@ mono_conc_g_hash_table_insert (MonoConcGHashTable *hash_table, gpointer key, gpo if (is_tombstone) --hash_table->tombstone_count; else - ++hash_table->element_count; + ++hash_table->element_count; return NULL; } @@ -382,7 +382,7 @@ mono_conc_g_hash_table_insert (MonoConcGHashTable *hash_table, gpointer key, gpo if (is_tombstone) --hash_table->tombstone_count; else - ++hash_table->element_count; + ++hash_table->element_count; return NULL; } diff --git a/src/mono/mono/metadata/mono-config-internals.h b/src/mono/mono/metadata/mono-config-internals.h index ce26f5dd52ca67..dabccc0e8a4f0f 100644 --- a/src/mono/mono/metadata/mono-config-internals.h +++ b/src/mono/mono/metadata/mono-config-internals.h @@ -7,7 +7,7 @@ #include "mono/metadata/mono-config.h" -void +void mono_config_for_assembly_internal (MonoImage *assembly); #endif /* __MONO_METADATA_CONFIG_INTERNALS_H__ */ diff --git a/src/mono/mono/metadata/mono-config.c b/src/mono/mono/metadata/mono-config.c index 89c5be8ff5e7fc..f38b8f5303dd5b 100644 --- a/src/mono/mono/metadata/mono-config.c +++ b/src/mono/mono/metadata/mono-config.c @@ -63,7 +63,7 @@ #define CONFIG_WORDSIZE "32" #elif defined(__ppc64__) || defined(__powerpc64__) || defined(_ARCH_64) || defined(TARGET_POWERPC) #define CONFIG_WORDSIZE "64" -#ifdef __mono_ppc_ilp32__ +#ifdef __mono_ppc_ilp32__ # define CONFIG_CPU "ppc64ilp32" #else # define CONFIG_CPU "ppc64" diff --git a/src/mono/mono/metadata/mono-debug.c b/src/mono/mono/metadata/mono-debug.c index 03626981f441d0..78b1e07a421836 100644 --- a/src/mono/mono/metadata/mono-debug.c +++ b/src/mono/mono/metadata/mono-debug.c @@ -847,7 +847,7 @@ mono_debug_method_lookup_location (MonoDebugMethodInfo *minfo, int il_offset) if (ret) return ret; } - } + } MonoDebugSourceLocation *location; @@ -871,7 +871,7 @@ mono_debug_lookup_locals (MonoMethod *method) { MonoDebugMethodInfo *minfo; MonoDebugLocalsInfo *res; - + MonoImage* img = m_class_get_image (method->klass); if (img->has_updates) { int idx = mono_metadata_token_index (method->token); @@ -1144,7 +1144,7 @@ mono_debug_get_seq_points (MonoDebugMethodInfo *minfo, char **source_file, GPtrA if (mono_ppdb_get_seq_points_enc (minfo, mdie->ppdb_file, mdie->idx, source_file, source_file_list, source_files, seq_points, n_seq_points)) return; } - } + } if (minfo->handle->ppdb) mono_ppdb_get_seq_points (minfo, source_file, source_file_list, source_files, seq_points, n_seq_points); else diff --git a/src/mono/mono/metadata/mono-endian.c b/src/mono/mono/metadata/mono-endian.c index d7822c72ff6306..170498377f6052 100644 --- a/src/mono/mono/metadata/mono-endian.c +++ b/src/mono/mono/metadata/mono-endian.c @@ -29,7 +29,7 @@ typedef union { guint64 i; } mono_rint64; -guint16 +guint16 mono_read16 (const unsigned char *x) { mono_rint16 r; @@ -43,7 +43,7 @@ mono_read16 (const unsigned char *x) return r.i; } -guint32 +guint32 mono_read32 (const unsigned char *x) { mono_rint32 r; @@ -61,7 +61,7 @@ mono_read32 (const unsigned char *x) return r.i; } -guint64 +guint64 mono_read64 (const unsigned char *x) { mono_rint64 r; diff --git a/src/mono/mono/metadata/mono-hash-internals.h b/src/mono/mono/metadata/mono-hash-internals.h index 84b8894f9e00e7..bf2f4ea9fd7be6 100644 --- a/src/mono/mono/metadata/mono-hash-internals.h +++ b/src/mono/mono/metadata/mono-hash-internals.h @@ -12,7 +12,7 @@ MONO_COMPONENT_API MonoGHashTable * mono_g_hash_table_new_type_internal (GHashFunc hash_func, GEqualFunc key_equal_func, MonoGHashGCType type, MonoGCRootSource source, void *key, const char *msg); -MONO_COMPONENT_API void +MONO_COMPONENT_API void mono_g_hash_table_insert_internal (MonoGHashTable *h, gpointer k, gpointer v); #endif /* __MONO_G_HASH_INTERNALS_H__ */ diff --git a/src/mono/mono/metadata/mono-private-unstable.h b/src/mono/mono/metadata/mono-private-unstable.h index 4618c8fe08bc92..203ef008ad486a 100644 --- a/src/mono/mono/metadata/mono-private-unstable.h +++ b/src/mono/mono/metadata/mono-private-unstable.h @@ -1,6 +1,6 @@ /** * \file - * + * * Private unstable APIs. * * WARNING: The declarations and behavior of functions in this header are NOT STABLE and can be modified or removed at diff --git a/src/mono/mono/metadata/native-library.c b/src/mono/mono/metadata/native-library.c index e32515ae8dcd14..a1fc8b47b702dd 100644 --- a/src/mono/mono/metadata/native-library.c +++ b/src/mono/mono/metadata/native-library.c @@ -92,7 +92,7 @@ mono_dllmap_lookup_list (MonoDllMap *dll_map, const char *dll, const char* func, if (!dll_map) goto exit; - /* + /* * we use the first entry we find that matches, since entries from * the config file are prepended to the list and we document that the * later entries win. @@ -254,7 +254,7 @@ mono_global_dllmap_cleanup (void) * This function is used to programatically add \c DllImport remapping in either * a specific assembly, or as a global remapping. This is done by remapping * references in a \c DllImport attribute from the \p dll library name into the \p tdll - * name. If the \p dll name contains the prefix i:, the comparison of the + * name. If the \p dll name contains the prefix i:, the comparison of the * library name is done without case sensitivity. * * If you pass \p func, this is the name of the \c EntryPoint in a \c DllImport if specified @@ -526,7 +526,7 @@ netcore_probe_for_module (MonoImage *image, const char *file_name, int flags) module = netcore_probe_for_module_variations (pinvoke_search_directories[i], file_name, lflags); // Check the assembly directory if the search flag is set and the image exists - if ((flags & DLLIMPORTSEARCHPATH_ASSEMBLY_DIRECTORY) != 0 && image != NULL && + if ((flags & DLLIMPORTSEARCHPATH_ASSEMBLY_DIRECTORY) != 0 && image != NULL && module == NULL && (image->filename != NULL)) { char *mdirname = g_path_get_dirname (image->filename); if (mdirname) @@ -1145,7 +1145,7 @@ pinvoke_probe_for_symbol (MonoDl *module, MonoMethodPInvoke *piinfo, const char #if HOST_WIN32 && HOST_X86 /* Try the stdcall mangled name */ - /* + /* * gcc under windows creates mangled names without the underscore, but MS.NET * doesn't support it, so we doesn't support it either. */ @@ -1385,7 +1385,7 @@ mono_loader_save_bundled_library (int fd, uint64_t offset, uint64_t size, const char *file, *buffer, *err, *internal_path; if (!bundle_save_library_initialized) bundle_save_library_initialize (); - + file = g_build_filename (bundled_dylibrary_directory, destfname, (const char*)NULL); buffer = g_str_from_file_region (fd, offset, size); g_file_set_contents (file, buffer, size, NULL); @@ -1400,7 +1400,7 @@ mono_loader_save_bundled_library (int fd, uint64_t offset, uint64_t size, const mono_loader_register_module (internal_path, lib); g_free (internal_path); bundle_library_paths = g_slist_append (bundle_library_paths, file); - + g_free (buffer); } diff --git a/src/mono/mono/metadata/null-gc-handles.c b/src/mono/mono/metadata/null-gc-handles.c index 6ba1c0fe7f99dc..8d946fe890b1c5 100644 --- a/src/mono/mono/metadata/null-gc-handles.c +++ b/src/mono/mono/metadata/null-gc-handles.c @@ -36,7 +36,7 @@ typedef struct { #define EMPTY_HANDLE_DATA(type) {NULL, NULL, 0, (type), 0, NULL} -/* weak and weak-track arrays will be allocated in malloc memory +/* weak and weak-track arrays will be allocated in malloc memory */ static HandleData gc_handles [] = { EMPTY_HANDLE_DATA (HANDLE_WEAK), @@ -236,12 +236,12 @@ alloc_handle (HandleData *handles, MonoObject *obj, gboolean track) * This returns a handle that wraps the object, this is used to keep a * reference to a managed object from the unmanaged world and preventing the * object from being disposed. - * + * * If \p pinned is false the address of the object can not be obtained, if it is * true the address of the object can be obtained. This will also pin the * object so it will not be possible by a moving garbage collector to move the - * object. - * + * object. + * * \returns a handle that can be used to access the object from * unmanaged code. */ @@ -261,14 +261,14 @@ mono_gchandle_new_internal (MonoObject *obj, gboolean pinned) * Unlike the \c mono_gchandle_new_internal the object can be reclaimed by the * garbage collector. In this case the value of the GCHandle will be * set to zero. - * + * * If \p track_resurrection is TRUE the object will be tracked through * finalization and if the object is resurrected during the execution * of the finalizer, then the returned weakref will continue to hold * a reference to the object. If \p track_resurrection is FALSE, then * the weak reference's target will become NULL as soon as the object * is passed on to the finalizer. - * + * * \returns a handle that can be used to access the object from * unmanaged code. */ @@ -388,7 +388,7 @@ mono_gchandle_is_in_domain (guint32 gchandle, MonoDomain *domain) * * Frees the \p gchandle handle. If there are no outstanding * references, the garbage collector can reclaim the memory of the - * object wrapped. + * object wrapped. */ void mono_gchandle_free_internal (guint32 gchandle) diff --git a/src/mono/mono/metadata/null-gc.c b/src/mono/mono/metadata/null-gc.c index 343756d2c67da4..039e3c2ad70567 100644 --- a/src/mono/mono/metadata/null-gc.c +++ b/src/mono/mono/metadata/null-gc.c @@ -635,7 +635,7 @@ mono_gc_ephemeron_array_add (MonoObject *obj) return TRUE; } -guint64 mono_gc_get_total_allocated_bytes (MonoBoolean precise) +guint64 mono_gc_get_total_allocated_bytes (MonoBoolean precise) { return 0; } diff --git a/src/mono/mono/metadata/object-internals.h b/src/mono/mono/metadata/object-internals.h index c1c4d939df2a1c..2be830e375b151 100644 --- a/src/mono/mono/metadata/object-internals.h +++ b/src/mono/mono/metadata/object-internals.h @@ -93,7 +93,7 @@ mono_array_new_specific_handle (MonoVTable *vtable, uintptr_t n, MonoError *erro MonoArray* mono_array_new_specific_checked (MonoVTable *vtable, uintptr_t n, MonoError *error); -/* +/* * Macros which cache. * These should be used instead of the original versions. */ @@ -170,7 +170,7 @@ struct _MonoArray { /* bounds is NULL for szarrays */ MonoArrayBounds *bounds; /* total number of elements of the array */ - mono_array_size_t max_length; + mono_array_size_t max_length; /* we use mono_64bitaligned_t to ensure proper alignment on platforms that need it */ mono_64bitaligned_t vector [MONO_ZERO_LEN_ARRAY]; }; @@ -469,7 +469,7 @@ typedef struct _MonoQCallAssemblyHandle MonoQCallAssemblyHandle; typedef struct { MonoObject object; - MonoReflectionType *class_to_proxy; + MonoReflectionType *class_to_proxy; MonoObject *context; MonoObject *unwrapped_server; gint32 target_domain_id; @@ -523,7 +523,7 @@ TYPED_HANDLE_DECL (MonoComInteropProxy); typedef struct { MonoObject object; - MonoRealProxy *rp; + MonoRealProxy *rp; MonoRemoteClass *remote_class; MonoBoolean custom_type_info; } MonoTransparentProxy; @@ -534,9 +534,9 @@ TYPED_HANDLE_DECL (MonoTransparentProxy); typedef struct { MonoObject obj; MonoReflectionMethod *method; - MonoArray *args; - MonoArray *names; - MonoArray *arg_types; + MonoArray *args; + MonoArray *names; + MonoArray *arg_types; MonoObject *ctx; MonoObject *rval; MonoObject *exc; @@ -664,7 +664,7 @@ TYPED_HANDLE_DECL (MonoDelegate); typedef void (*InterpJitInfoFunc) (MonoJitInfo *ji, gpointer user_data); -/* +/* * Callbacks supplied by the runtime and called by the modules in metadata/ * This interface is easier to extend than adding a new function type + * a new 'install' function for every callback. @@ -780,9 +780,9 @@ mono_domain_get_tls_offset (void); /* * Handling System.Type objects: * - * Fields defined as System.Type in managed code should be defined as MonoObject* - * in unmanaged structures, and the monotype_cast () function should be used for - * casting them to MonoReflectionType* to avoid crashes/security issues when + * Fields defined as System.Type in managed code should be defined as MonoObject* + * in unmanaged structures, and the monotype_cast () function should be used for + * casting them to MonoReflectionType* to avoid crashes/security issues when * encountering instances of user defined subclasses of System.Type. */ @@ -830,8 +830,8 @@ struct _MonoDelegate { gpointer delegate_trampoline; /* Extra argument passed to the target method in llvmonly mode */ gpointer extra_arg; - /* - * If non-NULL, this points to a memory location which stores the address of + /* + * If non-NULL, this points to a memory location which stores the address of * the compiled code of the method, or NULL if it is not yet compiled. */ guint8 **method_code; @@ -1138,7 +1138,7 @@ typedef struct { MonoArray *modopt; } MonoReflectionFieldBuilder; -/* Safely access System.Reflection.Emit.FieldBuilder from native code */ +/* Safely access System.Reflection.Emit.FieldBuilder from native code */ TYPED_HANDLE_DECL (MonoReflectionFieldBuilder); typedef struct { @@ -1344,7 +1344,7 @@ typedef struct { MonoArray *refs; GSList *referenced_by; MonoReflectionType *owner; -} MonoReflectionDynamicMethod; +} MonoReflectionDynamicMethod; /* Safely access System.Reflection.Emit.DynamicMethod from native code */ TYPED_HANDLE_DECL (MonoReflectionDynamicMethod); @@ -1678,7 +1678,7 @@ mono_object_new_specific_checked (MonoVTable *vtable, MonoError *error); ICALL_EXPORT MonoObject * ves_icall_object_new (MonoClass *klass); - + ICALL_EXPORT MonoObject * ves_icall_object_new_specific (MonoVTable *vtable); @@ -1886,7 +1886,7 @@ MonoObject* mono_runtime_invoke_span_checked (MonoMethod *method, void *obj, MonoSpanOfObjects *params, MonoError *error); -void* +void* mono_compile_method_checked (MonoMethod *method, MonoError *error); MonoObject* diff --git a/src/mono/mono/metadata/object.h b/src/mono/mono/metadata/object.h index fa9d84121bc1ba..2186fa802c448f 100644 --- a/src/mono/mono/metadata/object.h +++ b/src/mono/mono/metadata/object.h @@ -48,7 +48,7 @@ typedef void (*MonoMainThreadFunc) (void* user_data); } while (0) #define mono_array_addr(array,type,index) ((type*)mono_array_addr_with_size ((array), sizeof (type), (index))) -#define mono_array_get(array,type,index) ( *(type*)mono_array_addr ((array), type, (index)) ) +#define mono_array_get(array,type,index) ( *(type*)mono_array_addr ((array), type, (index)) ) #define mono_array_set(array,type,index,value) \ do { \ type *__p = (type *) mono_array_addr ((array), type, (index)); \ @@ -291,7 +291,7 @@ mono_runtime_exec_managed_code (MonoDomain *domain, void* main_args); MONO_API MONO_RT_EXTERNAL_ONLY int -mono_runtime_run_main (MonoMethod *method, int argc, char* argv[], +mono_runtime_run_main (MonoMethod *method, int argc, char* argv[], MonoObject **exc); MONO_API MONO_RT_EXTERNAL_ONLY int @@ -348,11 +348,11 @@ mono_property_get_value (MonoProperty *prop, void *obj, void **params, MonoObjec /* GC handles support * * A handle can be created to refer to a managed object and either prevent it - * from being garbage collected or moved or to be able to know if it has been + * from being garbage collected or moved or to be able to know if it has been * collected or not (weak references). * mono_gchandle_new () is used to prevent an object from being garbage collected * until mono_gchandle_free() is called. Use a TRUE value for the pinned argument to - * prevent the object from being moved (this should be avoided as much as possible + * prevent the object from being moved (this should be avoided as much as possible * and this should be used only for shorts periods of time or performance will suffer). * To create a weakref use mono_gchandle_new_weakref (): track_resurrection should * usually be false (see the GC docs for more details). diff --git a/src/mono/mono/metadata/property-bag.c b/src/mono/mono/metadata/property-bag.c index 9dc0634ec00870..42c083f0381150 100644 --- a/src/mono/mono/metadata/property-bag.c +++ b/src/mono/mono/metadata/property-bag.c @@ -21,7 +21,7 @@ void* mono_property_bag_get (MonoPropertyBag *bag, int tag) { MonoPropertyBagItem *item; - + for (item = bag->head; item && item->tag <= tag; item = item->next) { if (item->tag == tag) return item; diff --git a/src/mono/mono/metadata/reflection.c b/src/mono/mono/metadata/reflection.c index 9c39731d698b21..47683f1e68ab9b 100644 --- a/src/mono/mono/metadata/reflection.c +++ b/src/mono/mono/metadata/reflection.c @@ -1,7 +1,7 @@ /** * \file * System.Type icalls and related reflection queries. - * + * * Author: * Paolo Molaro (lupus@ximian.com) * @@ -238,7 +238,7 @@ mono_assembly_get_object_handle (MonoAssembly *assembly, MonoError *error) /** * mono_module_get_object: */ -MonoReflectionModule* +MonoReflectionModule* mono_module_get_object (MonoDomain *domain, MonoImage *image) { MonoReflectionModuleHandle result; @@ -255,7 +255,7 @@ static MonoReflectionModuleHandle module_object_construct (MonoClass *unused_klass, MonoImage *image, gpointer user_data, MonoError *error) { char* basename; - + error_init (error); MonoReflectionModuleHandle res = MONO_HANDLE_CAST (MonoReflectionModule, mono_object_new_handle (mono_class_get_mono_module_class (), error)); goto_if_nok (error, fail); @@ -328,7 +328,7 @@ mono_module_file_get_object_handle (MonoImage *image, int table_index, MonoError const char *name; guint32 i, name_idx; const char *val; - + error_init (error); MonoReflectionModuleHandle res = MONO_HANDLE_CAST (MonoReflectionModule, mono_object_new_handle (mono_class_get_mono_module_class (), error)); @@ -448,7 +448,7 @@ mono_type_get_object_checked (MonoType *type, MonoError *error) /*we must avoid using @type as it might have come * from a mono_metadata_type_dup and the caller * expects that is can be freed. - * Using the right type from + * Using the right type from */ type = m_type_is_byref (m_class_get_byval_arg (klass)) == m_type_is_byref (type) ? m_class_get_byval_arg (klass) : m_class_get_this_arg (klass); @@ -469,9 +469,9 @@ mono_type_get_object_checked (MonoType *type, MonoError *error) /* * If the vtable of the given class was already created, we can use * the MonoType from there and avoid all locking and hash table lookups. - * + * * We cannot do this for TypeBuilders as mono_reflection_create_runtime_class expects - * that the resulting object is different. + * that the resulting object is different. */ if (type == m_class_get_byval_arg (klass) && !image_is_dynamic (m_class_get_image (klass))) { MonoVTable *vtable = mono_class_try_get_vtable (klass); @@ -594,7 +594,7 @@ method_object_construct (MonoClass *refclass, MonoMethod *method, gpointer user_ error_init (error); g_assert (refclass != NULL); /* - * We use the same C representation for methods and constructors, but the type + * We use the same C representation for methods and constructors, but the type * name in C# is different. */ MonoClass *klass; @@ -1053,7 +1053,7 @@ param_objects_construct (MonoClass *refclass, MonoMethodSignature **addr_of_sig, int i; error_init (error); - + MonoReflectionMethodHandle member = mono_method_get_object_handle (method, refclass, error); goto_if_nok (error, leave); names = g_new (char *, sig->param_count); @@ -1107,7 +1107,7 @@ param_objects_construct (MonoClass *refclass, MonoMethodSignature **addr_of_sig, if (!is_ok (error)) return NULL_HANDLE_ARRAY; - + return res; } @@ -1444,7 +1444,7 @@ get_default_param_value_blobs (MonoMethod *method, char **blobs, guint32 *types) if (!crow) { continue; } - + mono_metadata_decode_row (constt, crow - 1, const_cols, MONO_CONSTANT_SIZE); blobs [paramseq - 1] = (char *)mono_metadata_blob_heap (image, const_cols [MONO_CONSTANT_VALUE]); types [paramseq - 1] = const_cols [MONO_CONSTANT_TYPE]; @@ -1479,7 +1479,7 @@ mono_get_object_from_blob (MonoType *type, const char *blob, MonoStringHandleOut if (m_class_is_enumtype (klass)) basetype = mono_class_enum_basetype_internal (klass); } - + if (mono_get_constant_value_from_blob (basetype->type, blob, retval, string_handle, error)) MONO_HANDLE_ASSIGN_RAW (object_handle, object); else @@ -1685,7 +1685,7 @@ _mono_reflection_parse_type (char *name, char **endptr, gboolean is_recursed, // *w++ = *p++; p++; } - + if (!info->name) { if (last_point) { info->name_space = start; @@ -1936,7 +1936,7 @@ mono_reflection_parse_type (char *name, MonoTypeNameParse *info) * \param name the string to parse * \param info the parsed name components * \param error set on error - * + * * Parse the given \p name and write the results to \p info, setting \p error * on error. The string \p name is modified in place and \p info points into * its memory and into allocated memory. @@ -1969,7 +1969,7 @@ _mono_reflection_get_type_from_info (MonoAssemblyLoadContext *alc, MonoTypeNameP if (info->assembly.name) { MonoAssembly *assembly = mono_assembly_loaded_internal (alc, &info->assembly); if (!assembly && image && image->assembly && mono_assembly_check_name_match (&info->assembly, &image->assembly->aname)) - /* + /* * This could happen in the AOT compiler case when the search hook is not * installed. */ @@ -2015,7 +2015,7 @@ mono_reflection_get_type_internal (MonoAssemblyLoadContext *alc, MonoImage *root int modval; gboolean bounded = FALSE; MonoType* type = NULL; - + error_init (error); if (!image) image = mono_defaults.corlib; @@ -2151,7 +2151,7 @@ mono_reflection_get_type_internal (MonoAssemblyLoadContext *alc, MonoImage *root * \param type_resolve whenever type resolve was already tried * * Build a MonoType from the type description in \p info. - * + * */ MonoType* mono_reflection_get_type (MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase, gboolean *type_resolve) @@ -2253,7 +2253,7 @@ mono_reflection_get_type_internal_dynamic (MonoAssemblyLoadContext *alc, MonoIma leave: HANDLE_FUNCTION_RETURN_VAL (type); } - + MonoType* mono_reflection_get_type_with_rootimage (MonoAssemblyLoadContext *alc, MonoImage *rootimage, MonoImage* image, MonoTypeNameParse *info, gboolean ignorecase, gboolean search_mscorlib, gboolean *type_resolve, MonoError *error) { @@ -2279,11 +2279,11 @@ mono_reflection_get_type_with_rootimage (MonoAssemblyLoadContext *alc, MonoImage goto return_null; if (type_resolve) { - if (*type_resolve) + if (*type_resolve) goto return_null; *type_resolve = TRUE; } - + /* Reconstruct the type name */ fullName = g_string_new (""); if (info->name_space && (info->name_space [0] != '\0')) @@ -2354,7 +2354,7 @@ mono_reflection_free_type_info (MonoTypeNameParse *info) * Retrieves a \c MonoType from its \p name. If the name is not fully qualified, * it defaults to get the type from \p image or, if \p image is NULL or loading * from it fails, uses corlib. - * + * */ MonoType* mono_reflection_type_from_name (char *name, MonoImage *image) @@ -2392,7 +2392,7 @@ mono_reflection_type_from_name_checked (char *name, MonoAssemblyLoadContext *alc error_init (error); /* Make a copy since parse_type modifies its argument */ tmp = g_strdup (name); - + /*g_print ("requested type %s\n", str);*/ ERROR_DECL (parse_error); if (!mono_reflection_parse_type_checked (tmp, &info, parse_error)) { @@ -2421,7 +2421,7 @@ mono_reflection_get_token (MonoObject *obj_raw) ERROR_DECL (error); result = mono_reflection_get_token_checked (obj, error); mono_error_assert_ok (error); - + MONO_EXIT_GC_UNSAFE; HANDLE_FUNCTION_RETURN_VAL (result); } @@ -2570,7 +2570,7 @@ mono_reflection_bind_generic_parameters (MonoReflectionTypeHandle reftype, int t MonoClass *geninst; error_init (error); - + mono_loader_lock (); MonoClass *klass = mono_handle_class (reftype); @@ -2803,7 +2803,7 @@ mono_declsec_flags_from_method (MonoMethod *method) * mono_declsec_flags_from_class: * \param klass The class for which we want the declarative security flags. * Get the security actions (in the form of flags) associated with the specified class. - * We cache the flags inside the \c MonoClass structure as this will get + * We cache the flags inside the \c MonoClass structure as this will get * called very often (at least for each method). * \returns the declarative security flags for the class. */ @@ -2900,7 +2900,7 @@ fill_actions_from_index (MonoImage *image, guint32 token, MonoDeclSecurityAction } static MonoBoolean -mono_declsec_get_class_demands_params (MonoClass *klass, MonoDeclSecurityActions* demands, +mono_declsec_get_class_demands_params (MonoClass *klass, MonoDeclSecurityActions* demands, guint32 id_std, guint32 id_noncas, guint32 id_choice) { guint32 idx = mono_metadata_token_index (m_class_get_type_token (klass)); @@ -2910,7 +2910,7 @@ mono_declsec_get_class_demands_params (MonoClass *klass, MonoDeclSecurityActions } static MonoBoolean -mono_declsec_get_method_demands_params (MonoMethod *method, MonoDeclSecurityActions* demands, +mono_declsec_get_method_demands_params (MonoMethod *method, MonoDeclSecurityActions* demands, guint32 id_std, guint32 id_noncas, guint32 id_choice) { guint32 idx = mono_method_get_index (method); @@ -2928,7 +2928,7 @@ mono_declsec_get_method_demands_params (MonoMethod *method, MonoDeclSecurityActi MonoBoolean mono_declsec_get_demands (MonoMethod *method, MonoDeclSecurityActions* demands) { - guint32 mask = MONO_DECLSEC_FLAG_DEMAND | MONO_DECLSEC_FLAG_NONCAS_DEMAND | + guint32 mask = MONO_DECLSEC_FLAG_DEMAND | MONO_DECLSEC_FLAG_NONCAS_DEMAND | MONO_DECLSEC_FLAG_DEMAND_CHOICE; MonoBoolean result = FALSE; guint32 flags; @@ -2949,7 +2949,7 @@ mono_declsec_get_demands (MonoMethod *method, MonoDeclSecurityActions* demands) mono_class_init_internal (method->klass); memset (demands, 0, sizeof (MonoDeclSecurityActions)); - result = mono_declsec_get_method_demands_params (method, demands, + result = mono_declsec_get_method_demands_params (method, demands, SECURITY_ACTION_DEMAND, SECURITY_ACTION_NONCASDEMAND, SECURITY_ACTION_DEMANDCHOICE); } @@ -2960,7 +2960,7 @@ mono_declsec_get_demands (MonoMethod *method, MonoDeclSecurityActions* demands) mono_class_init_internal (method->klass); memset (demands, 0, sizeof (MonoDeclSecurityActions)); } - result |= mono_declsec_get_class_demands_params (method->klass, demands, + result |= mono_declsec_get_class_demands_params (method->klass, demands, SECURITY_ACTION_DEMAND, SECURITY_ACTION_NONCASDEMAND, SECURITY_ACTION_DEMANDCHOICE); } @@ -3000,7 +3000,7 @@ mono_declsec_get_linkdemands (MonoMethod *method, MonoDeclSecurityActions* klass if (method->flags & METHOD_ATTRIBUTE_HAS_SECURITY) { mono_class_init_internal (method->klass); - result = mono_declsec_get_method_demands_params (method, cmethod, + result = mono_declsec_get_method_demands_params (method, cmethod, SECURITY_ACTION_LINKDEMAND, SECURITY_ACTION_NONCASLINKDEMAND, SECURITY_ACTION_LINKDEMANDCHOICE); } @@ -3009,7 +3009,7 @@ mono_declsec_get_linkdemands (MonoMethod *method, MonoDeclSecurityActions* klass if (flags & (MONO_DECLSEC_FLAG_LINKDEMAND | MONO_DECLSEC_FLAG_NONCAS_LINKDEMAND | MONO_DECLSEC_FLAG_LINKDEMAND_CHOICE)) { mono_class_init_internal (method->klass); - result |= mono_declsec_get_class_demands_params (method->klass, klass, + result |= mono_declsec_get_class_demands_params (method->klass, klass, SECURITY_ACTION_LINKDEMAND, SECURITY_ACTION_NONCASLINKDEMAND, SECURITY_ACTION_LINKDEMANDCHOICE); } @@ -3040,7 +3040,7 @@ mono_declsec_get_inheritdemands_class (MonoClass *klass, MonoDeclSecurityActions mono_class_init_internal (klass); memset (demands, 0, sizeof (MonoDeclSecurityActions)); - result |= mono_declsec_get_class_demands_params (klass, demands, + result |= mono_declsec_get_class_demands_params (klass, demands, SECURITY_ACTION_INHERITDEMAND, SECURITY_ACTION_NONCASINHERITANCE, SECURITY_ACTION_INHERITDEMANDCHOICE); } @@ -3070,7 +3070,7 @@ mono_declsec_get_inheritdemands_method (MonoMethod *method, MonoDeclSecurityActi mono_class_init_internal (method->klass); memset (demands, 0, sizeof (MonoDeclSecurityActions)); - return mono_declsec_get_method_demands_params (method, demands, + return mono_declsec_get_method_demands_params (method, demands, SECURITY_ACTION_INHERITDEMAND, SECURITY_ACTION_NONCASINHERITANCE, SECURITY_ACTION_INHERITDEMANDCHOICE); } return FALSE; @@ -3164,7 +3164,7 @@ mono_reflection_call_is_assignable_to (MonoClass *klass, MonoClass *oklass, Mono g_assert (method); } - /* + /* * The result of mono_type_get_object_checked () might be a System.MonoType but we * need a TypeBuilder so use mono_class_get_ref_info (klass). */ diff --git a/src/mono/mono/metadata/reflection.h b/src/mono/mono/metadata/reflection.h index 83bcfccd657bf0..bab5586a8d7f57 100644 --- a/src/mono/mono/metadata/reflection.h +++ b/src/mono/mono/metadata/reflection.h @@ -27,7 +27,7 @@ typedef struct { #define MONO_SIZEOF_CUSTOM_ATTR_INFO (offsetof (MonoCustomAttrInfo, attrs)) -/* +/* * Information which isn't in the MonoMethod structure is stored here for * dynamic methods. */ diff --git a/src/mono/mono/metadata/row-indexes.h b/src/mono/mono/metadata/row-indexes.h index b0f5dc072d681d..64534db11373e2 100644 --- a/src/mono/mono/metadata/row-indexes.h +++ b/src/mono/mono/metadata/row-indexes.h @@ -306,7 +306,7 @@ enum { MONO_GENERICPARAM_FLAGS, MONO_GENERICPARAM_OWNER, MONO_GENERICPARAM_NAME, - + MONO_GENERICPARAM_SIZE }; diff --git a/src/mono/mono/metadata/runtime.c b/src/mono/mono/metadata/runtime.c index a71933874505e7..81e74c4be8d666 100644 --- a/src/mono/mono/metadata/runtime.c +++ b/src/mono/mono/metadata/runtime.c @@ -66,7 +66,7 @@ mono_runtime_fire_process_exit_event (void) MONO_STATIC_POINTER_INIT_END (MonoMethod, procexit_method) g_assert (procexit_method); - + mono_runtime_try_invoke (procexit_method, NULL, NULL, &exc, error); #endif } diff --git a/src/mono/mono/metadata/seq-points-data.c b/src/mono/mono/metadata/seq-points-data.c index 308435993793c5..fa80737f1e2b34 100644 --- a/src/mono/mono/metadata/seq-points-data.c +++ b/src/mono/mono/metadata/seq-points-data.c @@ -405,7 +405,7 @@ mono_seq_point_data_read (SeqPointData *data, char *path) fclose (f); return FALSE; } - + fseek(f, 0, SEEK_SET); buffer_orig = buffer = (guint8 *)g_malloc (fsize + 1); diff --git a/src/mono/mono/metadata/seq-points-data.h b/src/mono/mono/metadata/seq-points-data.h index 4b9c1d0d479f8b..575e0f815fdc9d 100644 --- a/src/mono/mono/metadata/seq-points-data.h +++ b/src/mono/mono/metadata/seq-points-data.h @@ -3,7 +3,7 @@ * Copyright 2015 Xamarin Inc * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ - + #ifndef __MONO_SEQ_POINTS_DATA_H__ #define __MONO_SEQ_POINTS_DATA_H__ @@ -21,7 +21,7 @@ #define SEQ_POINT_AOT_EXT ".msym" /* Native offset used to mark seq points in dead code */ -#define SEQ_POINT_NATIVE_OFFSET_DEAD_CODE -1 +#define SEQ_POINT_NATIVE_OFFSET_DEAD_CODE -1 typedef struct { int il_offset, native_offset, flags; diff --git a/src/mono/mono/metadata/sgen-bridge.h b/src/mono/mono/metadata/sgen-bridge.h index 3f11c11bcb09f3..0b91359064d97e 100644 --- a/src/mono/mono/metadata/sgen-bridge.h +++ b/src/mono/mono/metadata/sgen-bridge.h @@ -1,7 +1,7 @@ /** * \file * Copyright 2011 Novell, Inc. - * + * * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ @@ -57,7 +57,7 @@ MONO_BEGIN_DECLS enum { SGEN_BRIDGE_VERSION = 5 }; - + typedef enum { /* Instances of this class should be scanned when computing the transitive dependency among bridges. E.g. List*/ GC_BRIDGE_TRANSPARENT_CLASS, diff --git a/src/mono/mono/metadata/sgen-client-mono.h b/src/mono/mono/metadata/sgen-client-mono.h index f69e05904f6df4..bb54b33d0a248e 100644 --- a/src/mono/mono/metadata/sgen-client-mono.h +++ b/src/mono/mono/metadata/sgen-client-mono.h @@ -697,7 +697,7 @@ sgen_client_binary_protocol_ephemeron_ref (gpointer list, gpointer key, gpointer /* Enter must be visible before anything is done in the critical region. */ #define ENTER_CRITICAL_REGION do { mono_atomic_store_acquire (&IN_CRITICAL_REGION, 1); } while (0) -/* Exit must make sure all critical regions stores are visible before it signal the end of the region. +/* Exit must make sure all critical regions stores are visible before it signal the end of the region. * We don't need to emit a full barrier since we */ #define EXIT_CRITICAL_REGION do { mono_atomic_store_release (&IN_CRITICAL_REGION, 0); } while (0) diff --git a/src/mono/mono/metadata/sgen-mono-ilgen.c b/src/mono/mono/metadata/sgen-mono-ilgen.c index aa5e034dbc6f9d..734e2a4f9f5da6 100644 --- a/src/mono/mono/metadata/sgen-mono-ilgen.c +++ b/src/mono/mono/metadata/sgen-mono-ilgen.c @@ -295,7 +295,7 @@ emit_managed_allocator_ilgen (MonoMethodBuilder *mb, gboolean slowpath, gboolean * * offsetof (MonoString, chars) + ((len + 1) * 2) <= INT32_MAX - (SGEN_ALLOC_ALIGN - 1) * len <= (SIZE_MAX - (SGEN_ALLOC_ALIGN - 1) - offsetof (MonoString, chars)) / 2 - 1 - * + * * On 64-bit platforms SIZE_MAX is so big that the 32-bit string length can * never reach the maximum size. */ @@ -372,7 +372,7 @@ emit_managed_allocator_ilgen (MonoMethodBuilder *mb, gboolean slowpath, gboolean mono_mb_emit_no_nullcheck (mb); mono_mb_emit_byte (mb, CEE_LDIND_I); mono_mb_emit_stloc (mb, p_var); - + /* new_next = (char*)p + size; */ new_next_var = mono_mb_add_local (mb, int_type); mono_mb_emit_ldloc (mb, p_var); diff --git a/src/mono/mono/metadata/sgen-old-bridge.c b/src/mono/mono/metadata/sgen-old-bridge.c index b9ef527dd42fec..c3650a769343d0 100644 --- a/src/mono/mono/metadata/sgen-old-bridge.c +++ b/src/mono/mono/metadata/sgen-old-bridge.c @@ -313,15 +313,15 @@ dyn_array_int_merge (DynIntArray *dst, DynIntArray *src) for (i = j = 0; i < dyn_array_int_size (dst) || j < dyn_array_int_size (src); ) { if (i < dyn_array_int_size (dst) && j < dyn_array_int_size (src)) { - int a = dyn_array_int_get (dst, i); - int b = dyn_array_int_get (src, j); + int a = dyn_array_int_get (dst, i); + int b = dyn_array_int_get (src, j); if (a < b) { dyn_array_int_add (&merge_array, a); ++i; } else if (a == b) { dyn_array_int_add (&merge_array, a); ++i; - ++j; + ++j; } else { dyn_array_int_add (&merge_array, b); ++j; diff --git a/src/mono/mono/metadata/sgen-tarjan-bridge.c b/src/mono/mono/metadata/sgen-tarjan-bridge.c index c5a7f876502d0e..f956277b0efb26 100644 --- a/src/mono/mono/metadata/sgen-tarjan-bridge.c +++ b/src/mono/mono/metadata/sgen-tarjan-bridge.c @@ -978,7 +978,7 @@ step_timer (gint64 *timer) { gint64 curtime, diff; - SGEN_TV_GETTIME (curtime); + SGEN_TV_GETTIME (curtime); diff = SGEN_TV_ELAPSED (*timer, curtime); *timer = curtime; return diff; diff --git a/src/mono/mono/metadata/sgen-toggleref.h b/src/mono/mono/metadata/sgen-toggleref.h index a2d5ce2aa7902a..77b622bed79a81 100644 --- a/src/mono/mono/metadata/sgen-toggleref.h +++ b/src/mono/mono/metadata/sgen-toggleref.h @@ -6,7 +6,7 @@ * * Author: * Rodrigo Kumpera (kumpera@gmail.com) - * + * * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ diff --git a/src/mono/mono/metadata/sre-encode.c b/src/mono/mono/metadata/sre-encode.c index 450b6f37d72d39..4bcbbf7683c4be 100644 --- a/src/mono/mono/metadata/sre-encode.c +++ b/src/mono/mono/metadata/sre-encode.c @@ -2,8 +2,8 @@ * \file * Routines for encoding SRE builders into a * MonoDynamicImage and generating tokens. - * - * + * + * * Author: * Paolo Molaro (lupus@ximian.com) * @@ -161,7 +161,7 @@ encode_type (MonoDynamicImage *assembly, MonoType *type, SigBuffer *buf) g_assert_not_reached (); return; } - + if (m_type_is_byref (type)) sigbuffer_add_value (buf, MONO_TYPE_BYREF); @@ -343,13 +343,13 @@ mono_dynimage_encode_constant (MonoDynamicImage *assembly, MonoObject *val, Mono break; case MONO_TYPE_VALUETYPE: { MonoClass *klass = val->vtable->klass; - + if (m_class_is_enumtype (klass)) { *ret_type = mono_class_enum_basetype_internal (klass)->type; goto handle_enum; } else if (mono_is_corlib_image (m_class_get_image (klass)) && strcmp (m_class_get_name_space (klass), "System") == 0 && strcmp (m_class_get_name (klass), "DateTime") == 0) { len = 8; - } else + } else g_error ("we can't encode valuetypes, we should have never reached this line"); break; } @@ -438,7 +438,7 @@ mono_dynimage_encode_typedef_or_ref_full (MonoDynamicImage *assembly, MonoType * /* * If it's in the same module and not a generic type parameter: */ - if ((m_class_get_image (klass) == &assembly->image) && (type->type != MONO_TYPE_VAR) && + if ((m_class_get_image (klass) == &assembly->image) && (type->type != MONO_TYPE_VAR) && (type->type != MONO_TYPE_MVAR)) { token = MONO_TYPEDEFORREF_TYPEDEF | (MONO_HANDLE_GETVAL (tb, table_idx) << MONO_TYPEDEFORREF_BITS); /* This function is called multiple times from sre and sre-save, so same object is okay */ diff --git a/src/mono/mono/metadata/sre-internals.h b/src/mono/mono/metadata/sre-internals.h index b602748833cf63..356e0c43fb7643 100644 --- a/src/mono/mono/metadata/sre-internals.h +++ b/src/mono/mono/metadata/sre-internals.h @@ -100,7 +100,7 @@ mono_reflection_methodbuilder_from_method_builder (ReflectionMethodBuilder *rmb, gboolean mono_reflection_methodbuilder_from_ctor_builder (ReflectionMethodBuilder *rmb, MonoReflectionCtorBuilder *mb, MonoError *error); - + guint32 mono_reflection_resolution_scope_from_image (MonoDynamicImage *assembly, MonoImage *image); diff --git a/src/mono/mono/metadata/sre.c b/src/mono/mono/metadata/sre.c index 912c4a9e94578c..5a9e16eb81b8f1 100644 --- a/src/mono/mono/metadata/sre.c +++ b/src/mono/mono/metadata/sre.c @@ -2,8 +2,8 @@ * \file * Routines for creating an image at runtime * and related System.Reflection.Emit icalls - * - * + * + * * Author: * Paolo Molaro (lupus@ximian.com) * @@ -139,7 +139,7 @@ type_get_qualified_name (MonoType *type, MonoAssembly *ass) MonoAssembly *ta; klass = mono_class_from_mono_type_internal (type); - if (!klass) + if (!klass) return mono_type_get_name_full (type, MONO_TYPE_NAME_FORMAT_REFLECTION); ta = klass->image->assembly; if (assembly_is_dynamic (ta) || (ta == ass)) { @@ -381,7 +381,7 @@ method_encode_clauses (MonoImage *image, MonoDynamicImage *assembly, MonoReflect #ifndef DISABLE_REFLECTION_EMIT /* - * LOCKING: Acquires the loader lock. + * LOCKING: Acquires the loader lock. */ static void mono_save_custom_attrs (MonoImage *image, void *obj, MonoArray *cattrs) @@ -440,7 +440,7 @@ mono_reflection_resolution_scope_from_image (MonoDynamicImage *assembly, MonoIma return token; } - + if (assembly_is_dynamic (image->assembly)) /* FIXME: */ memset (cols, 0, sizeof (cols)); @@ -624,7 +624,7 @@ reflection_methodbuilder_from_dynamic_method (ReflectionMethodBuilder *rmb, Mono rmb->mhandle = mb->mhandle; rmb->nrefs = 0; rmb->refs = NULL; -} +} #else /* DISABLE_REFLECTION_EMIT */ gboolean mono_reflection_methodbuilder_from_method_builder (ReflectionMethodBuilder *rmb, MonoReflectionMethodBuilder *mb, MonoError *error) { @@ -678,14 +678,14 @@ mono_image_get_methodref_token (MonoDynamicImage *assembly, MonoMethod *method, guint32 token; MonoMethodSignature *sig; - + create_typespec = create_typespec && method->is_generic && method->klass->image != &assembly->image; if (create_typespec) { token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->handleref, GUINT_TO_POINTER (GPOINTER_TO_UINT (method) + 1))); if (token) return token; - } + } token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->handleref, method)); if (token && !create_typespec) @@ -723,7 +723,7 @@ mono_image_get_varargs_method_token (MonoDynamicImage *assembly, guint32 origina { MonoDynamicTable *table; guint32 token; - + table = &assembly->tables [MONO_TABLE_MEMBERREF]; token = MONO_TOKEN_MEMBER_REF | table->next_idx; table->next_idx ++; @@ -801,7 +801,7 @@ mono_image_get_methodspec_token (MonoDynamicImage *assembly, MonoMethod *method) { MonoMethodInflated *imethod; guint32 token; - + token = GPOINTER_TO_UINT (g_hash_table_lookup (assembly->handleref, method)); if (token) return token; @@ -825,7 +825,7 @@ mono_image_get_inflated_method_token (MonoDynamicImage *assembly, MonoMethod *m) return mono_image_get_memberref_token (assembly, m_class_get_byval_arg (m->klass)); } -static guint32 +static guint32 mono_image_get_sighelper_token (MonoDynamicImage *assembly, MonoReflectionSigHelperHandle helper, MonoError *error) { guint32 idx; @@ -911,7 +911,7 @@ mono_image_get_array_token (MonoDynamicImage *assembly, MonoReflectionArrayMetho am = NULL; for (GList *tmp = assembly->array_methods; tmp; tmp = tmp->next) { am = (ArrayMethod *)tmp->data; - if (strcmp (name, am->name) == 0 && + if (strcmp (name, am->name) == 0 && mono_metadata_type_equal (am->parent, mtype) && mono_metadata_signature_equal (am->sig, sig)) { g_free (name); @@ -1040,15 +1040,15 @@ mono_image_create_method_token (MonoDynamicImage *assembly, MonoObjectHandle obj * mono_image_create_token: * @assembly: a dynamic assembly * @obj: - * @register_token: Whenever to register the token in the assembly->tokens hash. + * @register_token: Whenever to register the token in the assembly->tokens hash. * * Get a token to insert in the IL code stream for the given MemberInfo. - * The metadata emission routines need to pass FALSE as REGISTER_TOKEN, since by that time, - * the table_idx-es were recomputed, so registering the token would overwrite an existing + * The metadata emission routines need to pass FALSE as REGISTER_TOKEN, since by that time, + * the table_idx-es were recomputed, so registering the token would overwrite an existing * entry. */ guint32 -mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj, +mono_image_create_token (MonoDynamicImage *assembly, MonoObjectHandle obj, gboolean create_open_instance, gboolean register_token, MonoError *error) { @@ -1215,14 +1215,14 @@ mono_reflection_dynimage_basic_init (MonoReflectionAssemblyBuilder *assemblyb, M MonoDynamicAssembly *assembly; MonoDynamicImage *image; MonoAssemblyLoadContext *alc = mono_alc_get_default (); - + if (assemblyb->dynamic_assembly) return; assembly = assemblyb->dynamic_assembly = g_new0 (MonoDynamicAssembly, 1); MONO_PROFILER_RAISE (assembly_loading, (&assembly->assembly)); - + assembly->assembly.ref_count = 1; assembly->assembly.dynamic = TRUE; assemblyb->assembly.assembly = (MonoAssembly*)assembly; @@ -1271,9 +1271,9 @@ mono_reflection_dynimage_basic_init (MonoReflectionAssemblyBuilder *assemblyb, M mono_alc_add_assembly (alc, (MonoAssembly*)assembly); register_assembly (&assemblyb->assembly, &assembly->assembly); - + MONO_PROFILER_RAISE (assembly_loaded, (&assembly->assembly)); - + mono_assembly_invoke_load_hook_internal (alc, (MonoAssembly*)assembly); } @@ -1287,7 +1287,7 @@ image_module_basic_init (MonoReflectionModuleBuilderHandle moduleb, MonoError *e if (!image) { /* * FIXME: we already created an image in mono_reflection_dynimage_basic_init (), but - * we don't know which module it belongs to, since that is only + * we don't know which module it belongs to, since that is only * determined at assembly save time. */ /*image = (MonoDynamicImage*)ab->dynamic_assembly->assembly.image; */ @@ -1993,7 +1993,7 @@ encode_cattr_value (MonoAssembly *assembly, char *buffer, char *p, char **retbuf { const char *argval = (const char*)void_argval; MonoTypeEnum simple_type; - + error_init (error); if ((p-buffer) + 10 >= *buflen) { char *newbuf; @@ -2163,7 +2163,7 @@ MONO_DISABLE_WARNING(4309) // truncation of constant MONO_RESTORE_WARNING break; } - + klass = mono_object_class (arg); if (mono_object_isinst_checked (arg, mono_defaults.systemtype_class, error)) { @@ -2537,7 +2537,7 @@ reflection_setup_internal_class_internal (MonoReflectionTypeBuilderHandle ref_tb guint32 table_idx; table_idx = MONO_HANDLE_GETVAL (ref_tb, table_idx); /* - * The size calculation here warrants some explaining. + * The size calculation here warrants some explaining. * reflection_setup_internal_class is called too early, well before we know whether the type will be a GTD or DEF, * meaning we need to alloc enough space to morth a def into a gtd. */ @@ -2554,7 +2554,7 @@ reflection_setup_internal_class_internal (MonoReflectionTypeBuilderHandle ref_tb goto_if_nok (error, leave); klass->type_token = MONO_TOKEN_TYPE_DEF | table_idx; mono_class_set_flags (klass, MONO_HANDLE_GETVAL (ref_tb, attrs)); - + MONO_PROFILER_RAISE (class_loading, (klass)); klass->element_class = klass; @@ -2649,7 +2649,7 @@ reflection_setup_internal_class_internal (MonoReflectionTypeBuilderHandle ref_tb /*g_print ("setup %s as %s (%p)\n", klass->name, ((MonoObject*)tb)->vtable->klass->name, tb);*/ MONO_PROFILER_RAISE (class_loaded, (klass)); - + leave: mono_loader_unlock (); HANDLE_FUNCTION_RETURN_VAL (is_ok (error)); @@ -2790,7 +2790,7 @@ mono_reflection_marshal_as_attribute_from_marshal_spec (MonoClass *klass, MonoMarshalSpec *spec, MonoError *error) { error_init (error); - + MonoAssemblyLoadContext *alc = mono_alc_get_ambient (); MonoReflectionMarshalAsAttributeHandle minfo = MONO_HANDLE_CAST (MonoReflectionMarshalAsAttribute, mono_object_new_handle (mono_class_get_marshal_as_attribute_class (), error)); goto_if_nok (error, fail); @@ -2909,7 +2909,7 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass, mono_error_assert_ok (error); method_aux->dll = string_to_utf8_image_raw (image, rmb->dll, error); mono_error_assert_ok (error); - + ((MonoMethodPInvoke*)m)->piflags = (rmb->native_cc << 8) | (rmb->charset ? (rmb->charset - 1) * 2 : 0) | rmb->extra_flags; if (image_is_dynamic (klass->image)) @@ -2938,7 +2938,7 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass, code = mono_array_addr_internal (rmb->code, guint8, 0); code_size = mono_array_length_internal (rmb->code); /* we probably need to run a verifier on the code... */ - max_stack = 8; + max_stack = 8; } else { code = NULL; @@ -2956,7 +2956,7 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass, header->num_locals = num_locals; for (i = 0; i < num_locals; ++i) { - MonoReflectionLocalBuilder *lb = + MonoReflectionLocalBuilder *lb = mono_array_get_internal (rmb->ilgen->locals, MonoReflectionLocalBuilder*, i); header->locals [i] = image_g_new0 (image, MonoType, 1); @@ -3095,14 +3095,14 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass, } /* Parameter marshalling */ - if (rmb->pinfo) + if (rmb->pinfo) for (i = 0; i < mono_array_length_internal (rmb->pinfo); ++i) { MonoReflectionParamBuilder *pb; if ((pb = mono_array_get_internal (rmb->pinfo, MonoReflectionParamBuilder*, i))) { if (pb->marshal_info) { if (specs == NULL) specs = image_g_new0 (image, MonoMarshalSpec*, sig->param_count + 1); - specs [pb->position] = + specs [pb->position] = mono_marshal_spec_from_builder (image, klass->image->assembly, pb->marshal_info, error); goto_if_nok (error, fail); } @@ -3126,7 +3126,7 @@ reflection_methodbuilder_to_mono_method (MonoClass *klass, fail: m = NULL; goto leave; -} +} static MonoMethod* ctorbuilder_to_mono_method (MonoClass *klass, MonoReflectionCtorBuilder* mb, MonoError *error) @@ -3374,7 +3374,7 @@ ensure_runtime_vtable (MonoClass *klass, MonoError *error) return FALSE; klass->methods [j++] = meth; } - + if (tb->interfaces) { klass->interface_count = mono_array_length_internal (tb->interfaces); klass->interfaces = (MonoClass **)mono_image_alloc (klass->image, sizeof (MonoClass*) * klass->interface_count); @@ -3402,7 +3402,7 @@ ensure_runtime_vtable (MonoClass *klass, MonoError *error) if (!(im->flags & METHOD_ATTRIBUTE_STATIC)) im->slot = slot_num++; } - + klass->interfaces_packed = NULL; /*make setup_interface_offsets happy*/ mono_class_setup_interface_offsets (klass); mono_class_setup_interface_id (klass); @@ -3410,12 +3410,12 @@ ensure_runtime_vtable (MonoClass *klass, MonoError *error) /* * The generic vtable is needed even if image->run is not set since some - * runtime code like ves_icall_Type_GetMethodsByName depends on + * runtime code like ves_icall_Type_GetMethodsByName depends on * method->slot being defined. */ - /* - * tb->methods could not be freed since it is used for determining + /* + * tb->methods could not be freed since it is used for determining * overrides during dynamic vtable construction. */ @@ -3470,7 +3470,7 @@ mono_reflection_get_dynamic_overrides (MonoClass *klass, MonoMethod ***overrides onum = 0; if (tb->methods) { for (i = 0; i < tb->num_methods; ++i) { - MonoReflectionMethodBuilder *mb = + MonoReflectionMethodBuilder *mb = mono_array_get_internal (tb->methods, MonoReflectionMethodBuilder*, i); if (mb->override_methods) onum += mono_array_length_internal (mb->override_methods); @@ -3482,7 +3482,7 @@ mono_reflection_get_dynamic_overrides (MonoClass *klass, MonoMethod ***overrides onum = 0; for (i = 0; i < tb->num_methods; ++i) { - MonoReflectionMethodBuilder *mb = + MonoReflectionMethodBuilder *mb = mono_array_get_internal (tb->methods, MonoReflectionMethodBuilder*, i); if (mb->override_methods) { for (j = 0; j < mono_array_length_internal (mb->override_methods); ++j) { @@ -3622,7 +3622,7 @@ typebuilder_setup_fields (MonoClass *klass, MonoError *error) packing_size = tb->packing_size; instance_size += tb->class_size; } - + klass->fields = image_g_new0 (image, MonoClassField, fcount); def_values = image_g_new0 (image, MonoFieldDefaultValue, fcount); mono_class_set_field_def_values (klass, def_values); @@ -3738,7 +3738,7 @@ typebuilder_setup_events (MonoClass *klass, MonoError *error) int j; events [i].other = image_g_new0 (image, MonoMethod*, mono_array_length_internal (eb->other_methods) + 1); for (j = 0; j < mono_array_length_internal (eb->other_methods); ++j) { - MonoReflectionMethodBuilder *mb = + MonoReflectionMethodBuilder *mb = mono_array_get_internal (eb->other_methods, MonoReflectionMethodBuilder*, j); events [i].other [j] = mb->mhandle; @@ -3910,9 +3910,9 @@ ves_icall_TypeBuilder_create_runtime_class (MonoReflectionTypeBuilderHandle ref_ } } - /* + /* * If we are a generic TypeBuilder, there might be instantiations in the type cache - * which have type System.Reflection.MonoGenericClass, but after the type is created, + * which have type System.Reflection.MonoGenericClass, but after the type is created, * we want to return normal System.MonoType objects, so clear these out from the cache. * * Together with this we must ensure the contents of all instances to match the created type. @@ -3957,7 +3957,7 @@ typedef struct { /* * The runtime automatically clean up those after finalization. -*/ +*/ static MonoReferenceQueue *dynamic_method_queue; static void @@ -4013,7 +4013,7 @@ reflection_create_dynamic_method (MonoReflectionDynamicMethodHandle ref_mb, Mono /* * Resolve references. */ - /* + /* * Every second entry in the refs array is reserved for storing handle_class, * which is needed by the ldtoken implementation in the JIT. */ @@ -4030,7 +4030,7 @@ reflection_create_dynamic_method (MonoReflectionDynamicMethodHandle ref_mb, Mono /* * The referenced DynamicMethod should already be created by the managed * code, except in the case of circular references. In that case, we store - * method in the refs array, and fix it up later when the referenced + * method in the refs array, and fix it up later when the referenced * DynamicMethod is created. */ if (method->mhandle) { @@ -4060,7 +4060,7 @@ reflection_create_dynamic_method (MonoReflectionDynamicMethodHandle ref_mb, Mono rmb.refs [i] = ref; rmb.refs [i + 1] = handle_class; - } + } if (mb->owner) { MonoType *owner_type = mono_reflection_type_get_handle ((MonoReflectionType*)mb->owner, error); @@ -4090,7 +4090,7 @@ reflection_create_dynamic_method (MonoReflectionDynamicMethodHandle ref_mb, Mono MonoReflectionDynamicMethod *method = (MonoReflectionDynamicMethod*)l->data; MonoMethodWrapper *wrapper = (MonoMethodWrapper*)method->mhandle; gpointer *data; - + g_assert (method->mhandle); data = (gpointer*)wrapper->method_data; diff --git a/src/mono/mono/metadata/tabledefs.h b/src/mono/mono/metadata/tabledefs.h index 6cfc4c8ffe7567..52521435fc3b55 100644 --- a/src/mono/mono/metadata/tabledefs.h +++ b/src/mono/mono/metadata/tabledefs.h @@ -10,12 +10,12 @@ * * From the ECMA documentation */ - + #ifndef _MONO_METADATA_TABLEDEFS_H_ #define _MONO_METADATA_TABLEDEFS_H_ /* - * 22.1.1 Values for AssemblyHashAlgorithm + * 22.1.1 Values for AssemblyHashAlgorithm */ enum { @@ -42,7 +42,7 @@ enum { FILE_CONTAINS_NO_METADATA = 1 }; -/* keep in synch with System.Security.Permissions.SecurityAction enum +/* keep in synch with System.Security.Permissions.SecurityAction enum (except for the special non-CAS cases) */ enum { SECURITY_ACTION_DEMAND = 2, diff --git a/src/mono/mono/metadata/tokentype.h b/src/mono/mono/metadata/tokentype.h index a1c58944d74043..c7ae1178aff74c 100644 --- a/src/mono/mono/metadata/tokentype.h +++ b/src/mono/mono/metadata/tokentype.h @@ -9,13 +9,13 @@ * These tokens match the table ID except for the last * three (string, name and base type which are special) */ - + typedef enum { MONO_TOKEN_MODULE = 0x00000000, MONO_TOKEN_TYPE_REF = 0x01000000, MONO_TOKEN_TYPE_DEF = 0x02000000, MONO_TOKEN_FIELD_DEF = 0x04000000, - MONO_TOKEN_METHOD_DEF = 0x06000000, + MONO_TOKEN_METHOD_DEF = 0x06000000, MONO_TOKEN_PARAM_DEF = 0x08000000, MONO_TOKEN_INTERFACE_IMPL = 0x09000000, MONO_TOKEN_MEMBER_REF = 0x0a000000, diff --git a/src/mono/mono/metadata/verify.h b/src/mono/mono/metadata/verify.h index 9ec9f2e07d2ace..6efb0fd3373b1a 100644 --- a/src/mono/mono/metadata/verify.h +++ b/src/mono/mono/metadata/verify.h @@ -23,7 +23,7 @@ typedef enum { MONO_VERIFY_NOT_VERIFIABLE = 8, /*OR it with other flags*/ - + /* Abort the verification if the code is not verifiable. * The standard behavior is to abort if the code is not valid. * */ diff --git a/src/mono/mono/metadata/w32file-unix.c b/src/mono/mono/metadata/w32file-unix.c index 50da28bf8468b9..ee1e2fe89d557a 100644 --- a/src/mono/mono/metadata/w32file-unix.c +++ b/src/mono/mono/metadata/w32file-unix.c @@ -298,7 +298,7 @@ static void _wapi_set_last_path_error_from_errno (const gchar *dir, } else { dirname = g_strdup (dir); } - + if (_wapi_access (dirname, F_OK) == 0) { mono_w32error_set_last (ERROR_FILE_NOT_FOUND); } else { @@ -316,18 +316,18 @@ file_write (FileHandle *filehandle, gpointer buffer, guint32 numbytes, guint32 * { gint ret; MonoThreadInfo *info = mono_thread_info_current (); - + if(byteswritten!=NULL) { *byteswritten=0; } - + if(!(filehandle->fileaccess & GENERIC_WRITE) && !(filehandle->fileaccess & GENERIC_ALL)) { mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_FILE, "%s: fd %d doesn't have GENERIC_WRITE access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess); mono_w32error_set_last (ERROR_ACCESS_DENIED); return(FALSE); } - + do { MONO_ENTER_GC_SAFE; ret = write (((MonoFDHandle*) filehandle)->fd, buffer, numbytes); @@ -340,7 +340,7 @@ file_write (FileHandle *filehandle, gpointer buffer, guint32 numbytes, guint32 * ret = 0; } else { _wapi_set_last_error_from_errno (); - + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_FILE, "%s: write of fd %d error: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(errno)); return(FALSE); @@ -357,18 +357,18 @@ console_write (FileHandle *filehandle, gpointer buffer, guint32 numbytes, guint3 { gint ret; MonoThreadInfo *info = mono_thread_info_current (); - + if(byteswritten!=NULL) { *byteswritten=0; } - + if(!(filehandle->fileaccess & (GENERIC_WRITE | GENERIC_ALL))) { mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_FILE, "%s: fd %d doesn't have GENERIC_WRITE access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess); mono_w32error_set_last (ERROR_ACCESS_DENIED); return(FALSE); } - + do { MONO_ENTER_GC_SAFE; ret = write(((MonoFDHandle*) filehandle)->fd, buffer, numbytes); @@ -381,7 +381,7 @@ console_write (FileHandle *filehandle, gpointer buffer, guint32 numbytes, guint3 ret = 0; } else { _wapi_set_last_error_from_errno (); - + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_FILE, "%s: write of fd %d error: %s", __func__, ((MonoFDHandle*) filehandle)->fd, g_strerror(errno)); return(FALSE); @@ -390,7 +390,7 @@ console_write (FileHandle *filehandle, gpointer buffer, guint32 numbytes, guint3 if(byteswritten!=NULL) { *byteswritten=ret; } - + return(TRUE); } @@ -399,18 +399,18 @@ pipe_write (FileHandle *filehandle, gpointer buffer, guint32 numbytes, guint32 * { gint ret; MonoThreadInfo *info = mono_thread_info_current (); - + if(byteswritten!=NULL) { *byteswritten=0; } - + if(!(filehandle->fileaccess & (GENERIC_WRITE | GENERIC_ALL))) { mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_FILE, "%s: fd %d doesn't have GENERIC_WRITE access: %u", __func__, ((MonoFDHandle*) filehandle)->fd, filehandle->fileaccess); mono_w32error_set_last (ERROR_ACCESS_DENIED); return(FALSE); } - + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_FILE, "%s: writing up to %" G_GUINT32_FORMAT " bytes to pipe %d", __func__, numbytes, ((MonoFDHandle*) filehandle)->fd); do { @@ -425,7 +425,7 @@ pipe_write (FileHandle *filehandle, gpointer buffer, guint32 numbytes, guint32 * ret = 0; } else { _wapi_set_last_error_from_errno (); - + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_FILE, "%s: write of fd %d error: %s", __func__,((MonoFDHandle*) filehandle)->fd, g_strerror(errno)); return(FALSE); @@ -434,14 +434,14 @@ pipe_write (FileHandle *filehandle, gpointer buffer, guint32 numbytes, guint32 * if(byteswritten!=NULL) { *byteswritten=ret; } - + return(TRUE); } static gint convert_flags(guint32 fileaccess, guint32 createmode) { gint flags=0; - + switch(fileaccess) { case GENERIC_READ: flags=O_RDONLY; @@ -478,7 +478,7 @@ static gint convert_flags(guint32 fileaccess, guint32 createmode) createmode); break; } - + return(flags); } @@ -490,7 +490,7 @@ static gboolean share_allows_open (struct stat *statbuf, guint32 sharemode, guint32 file_existing_share, file_existing_access; file_already_shared = file_share_get (statbuf->st_dev, statbuf->st_ino, sharemode, fileaccess, &file_existing_share, &file_existing_access, share_info); - + if (file_already_shared) { /* The reference to this share info was incremented * when we looked it up, so be careful to put it back @@ -502,7 +502,7 @@ static gboolean share_allows_open (struct stat *statbuf, guint32 sharemode, file_share_release (*share_info); *share_info = NULL; - + return(FALSE); } @@ -515,7 +515,7 @@ static gboolean share_allows_open (struct stat *statbuf, guint32 sharemode, file_share_release (*share_info); *share_info = NULL; - + return(FALSE); } } else { @@ -560,12 +560,12 @@ mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode if (attrs & FILE_ATTRIBUTE_TEMPORARY) perms = 0600; - + if (attrs & FILE_ATTRIBUTE_ENCRYPTED){ mono_w32error_set_last (ERROR_ENCRYPTION_FAILED); return INVALID_HANDLE_VALUE; } - + if (name == NULL) { mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_FILE, "%s: name is NULL", __func__); @@ -581,12 +581,12 @@ mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode mono_w32error_set_last (ERROR_INVALID_NAME); return(INVALID_HANDLE_VALUE); } - + mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_FILE, "%s: Opening %s with share 0x%" PRIx32 " and access 0x%" PRIx32, __func__, filename, sharemode, fileaccess); - + fd = _wapi_open (filename, flags, perms); - + /* If we were trying to open a directory with write permissions * (e.g. O_WRONLY or O_RDWR), this call will fail with * EISDIR. However, this is a bit bogus because calls to @@ -600,7 +600,7 @@ mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode /* Try again but don't try to make it writable */ fd = _wapi_open (filename, flags & ~(O_RDWR|O_WRONLY), perms); } - + if (fd == -1) { mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER_FILE, "%s: Error opening file %s: %s", __func__, filename, g_strerror(errno)); _wapi_set_last_path_error_from_errno (NULL, filename); @@ -647,7 +647,7 @@ mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode MONO_ENTER_GC_SAFE; close (((MonoFDHandle*) filehandle)->fd); MONO_EXIT_GC_SAFE; - + mono_fdhandle_unref ((MonoFDHandle*) filehandle); return (INVALID_HANDLE_VALUE); } @@ -659,7 +659,7 @@ mono_w32file_create(const gunichar2 *name, guint32 fileaccess, guint32 sharemode MONO_ENTER_GC_SAFE; close (((MonoFDHandle*) filehandle)->fd); MONO_EXIT_GC_SAFE; - + mono_fdhandle_unref ((MonoFDHandle*) filehandle); return(INVALID_HANDLE_VALUE); } diff --git a/src/mono/mono/metadata/w32handle.h b/src/mono/mono/metadata/w32handle.h index 6ec82b812e0772..3ab448759ec0d3 100644 --- a/src/mono/mono/metadata/w32handle.h +++ b/src/mono/mono/metadata/w32handle.h @@ -47,7 +47,7 @@ typedef enum { MONO_W32HANDLE_WAIT_RET_NOT_OWNED_BY_CALLER = -5 } MonoW32HandleWaitRet; -typedef struct +typedef struct { void (*close)(gpointer data); diff --git a/src/mono/mono/mini/abcremoval.c b/src/mono/mono/mini/abcremoval.c index ec87d201c06ee4..6568a7003c5409 100644 --- a/src/mono/mono/mini/abcremoval.c +++ b/src/mono/mono/mini/abcremoval.c @@ -148,7 +148,7 @@ print_evaluation_context_status (MonoRelationsEvaluationStatus status) { printf ("EVALUATION_NOT_STARTED"); } else { gboolean print_or = FALSE; - + printf ("("); if (status & MONO_RELATIONS_EVALUATION_IN_PROGRESS) { if (print_or) printf ("|"); @@ -257,7 +257,7 @@ get_relation_from_ins (MonoVariableRelationsEvaluationArea *area, MonoInst *ins, { MonoIntegerValueKind value_kind; MonoSummarizedValue *value = &result->related_value; - + if (ins->type == STACK_I8) { value_kind = MONO_INTEGER_VALUE_SIZE_8; } else if (ins->type == STACK_I4) { @@ -401,7 +401,7 @@ get_relation_from_ins (MonoVariableRelationsEvaluationArea *area, MonoInst *ins, * 462 i8const * 472 call */ - + break; } return value_kind; @@ -462,10 +462,10 @@ get_relations_from_previous_bb (MonoVariableRelationsEvaluationArea *area, MonoB relations->relation1.variable = -1; INITIALIZE_VALUE_RELATION (&(relations->relation2.relation)); relations->relation2.relation.relation_is_static_definition = FALSE; - relations->relation2.relation.next = NULL; + relations->relation2.relation.next = NULL; relations->relation2.insertion_point = NULL; relations->relation2.variable = -1; - + if (bb->in_count == 1) { /* Should write the code to "sum" conditions... */ in_bb = bb->in_bb [0]; @@ -527,7 +527,7 @@ static void apply_change_to_evaluation_area (MonoVariableRelationsEvaluationArea *area, MonoAdditionalVariableRelation *change) { MonoSummarizedValueRelation *base_relation; - + if (change->relation.relation != MONO_ANY_RELATION) { base_relation = &(area->relations [change->variable]); while ((base_relation->next != NULL) && (base_relation->next->relation_is_static_definition)) { @@ -698,24 +698,24 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are { MonoRelationsEvaluationContext * const context = &(area->contexts [variable]); MonoRelationsEvaluationStatus * const status = &(area->statuses [variable]); - + // First of all, we check the evaluation status // (what must be done is *very* different in each case) switch (*status) { case MONO_RELATIONS_EVALUATION_NOT_STARTED: { MonoSummarizedValueRelation *relation = &(area->relations [variable]); - + if (TRACE_ABC_REMOVAL) { printf ("Evaluating variable %d (target variable %d); ", variable, target_variable); print_summarized_value_relation (relation); printf ("\n"); } - + // We properly inizialize the context *status = MONO_RELATIONS_EVALUATION_IN_PROGRESS; context->father = father_context; MONO_MAKE_RELATIONS_EVALUATION_RANGES_WEAK (context->ranges); - + // If we have found the target variable, we can set the range // related to it in the context to "equal" (which is [0,0]) if (variable == target_variable) { @@ -725,18 +725,18 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are context->ranges.variable.lower = 0; context->ranges.variable.upper = 0; } - + // Examine all relations for this variable (scan the list) // The contribute of each relation will be intersected (logical and) while (relation != NULL) { context->current_relation = relation; - + if (TRACE_ABC_REMOVAL) { printf ("Processing (%d): ", variable); print_summarized_value_relation (relation); printf ("\n"); } - + // We decie what to do according the the type of the related value switch (relation->related_value.type) { case MONO_ANY_SUMMARIZED_VALUE: @@ -749,13 +749,13 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are case MONO_VARIABLE_SUMMARIZED_VALUE: // Generally, evaluate related variable and intersect ranges. // However, some check is necessary... - + // If the relation is "ANY", nothing to do (no added information) if (relation->relation != MONO_ANY_RELATION) { int related_variable = relation->related_value.value.variable.variable; MonoRelationsEvaluationContext *related_context = &(area->contexts [related_variable]); MonoRelationsEvaluationStatus related_status = area->statuses [related_variable]; - + // The second condition in the "or" avoids messing with "back edges" in the graph traversal // (they are simply ignored instead of triggering the handling of recursion) if ( (related_status == MONO_RELATIONS_EVALUATION_NOT_STARTED) || ! @@ -763,14 +763,14 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are (related_context->current_relation->related_value.value.variable.variable == variable))) { // Evaluate the related variable evaluate_relation_with_target_variable (area, related_variable, target_variable, context); - + // Check if we are part of a recursive loop if (*status & MONO_RELATIONS_EVALUATION_IS_RECURSIVE) { if (TRACE_ABC_REMOVAL) { printf ("Recursivity detected for variable %d (target variable %d), status ", variable, target_variable); print_evaluation_context_status (*status); } - + // If we are, check if the evaluation of the related variable is complete if (related_status == MONO_RELATIONS_EVALUATION_COMPLETED) { // If it is complete, we are part of a recursive definition. @@ -811,13 +811,13 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are int phi; gboolean is_ascending = FALSE; gboolean is_descending = FALSE; - + MONO_MAKE_RELATIONS_EVALUATION_RANGES_IMPOSSIBLE (phi_ranges); phi_ranges.zero.nullness = relation->related_value.value.phi.number_of_alternatives > 0 ? MONO_VALUE_NOT_NULL : MONO_VALUE_MAYBE_NULL; for (phi = 0; phi < relation->related_value.value.phi.number_of_alternatives; phi++) { int phi_alternative = relation->related_value.value.phi.phi_alternatives [phi]; evaluate_relation_with_target_variable (area, phi_alternative, target_variable, context); - + // This means we are part of a recursive loop if (*status & MONO_RELATIONS_EVALUATION_IS_RECURSIVE) { if (TRACE_ABC_REMOVAL) { @@ -836,7 +836,7 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are is_descending = TRUE; } phi_ranges.zero.nullness = MONO_VALUE_MAYBE_NULL; - + // Clear "recursivity" bits in the status (recursion has been handled) *status = MONO_RELATIONS_EVALUATION_IN_PROGRESS; } else { @@ -844,7 +844,7 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are union_nullness (&phi_ranges.zero, area->contexts [phi_alternative].ranges.zero.nullness); } } - + // Apply the effects of all recursive loops if (is_ascending) { phi_ranges.zero.upper = INT_MAX; @@ -854,7 +854,7 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are phi_ranges.zero.lower = INT_MIN; phi_ranges.variable.lower = INT_MIN; } - + // Intersect final result MONO_RELATIONS_EVALUATION_RANGES_INTERSECTION (context->ranges, phi_ranges); intersect_nullness (&context->ranges.zero, phi_ranges.zero.nullness, MONO_EQ_RELATION); @@ -863,11 +863,11 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are default: g_assert_not_reached(); } - + // Pass to next relation relation = relation->next; } - + // Check if any recursivity bits are still in the status, and in any case clear them if (*status & MONO_RELATIONS_EVALUATION_IS_RECURSIVE) { if (TRACE_ABC_REMOVAL) { @@ -897,21 +897,21 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are gboolean evaluation_can_be_recursive = TRUE; gboolean evaluation_is_definition = TRUE; int path_value = 0; - + if (TRACE_ABC_REMOVAL) { printf ("Evaluation of variable %d (target variable %d) already in progress\n", variable, target_variable); print_evaluation_context (context, *status); print_summarized_value_relation (context->current_relation); printf ("\n"); } - + // We must check if the loop can be a recursive definition (we scan the whole loop) while (current_context != last_context) { if (current_context == NULL) { printf ("Broken recursive ring in ABC removal\n"); g_assert_not_reached (); } - + if (current_context->current_relation->relation_is_static_definition) { if (current_context->current_relation->related_value.type == MONO_VARIABLE_SUMMARIZED_VALUE) { /* No need to check path_value for over/under-flow, since delta should be safe */ @@ -923,10 +923,10 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are evaluation_is_definition = FALSE; evaluation_can_be_recursive = FALSE; } - + current_context = current_context->father; } - + // If this is a recursive definition, we properly flag the status in all the involved contexts if (evaluation_is_definition) { MonoRelationsEvaluationStatus recursive_status; @@ -941,13 +941,13 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are } else { recursive_status = MONO_RELATIONS_EVALUATION_IS_RECURSIVELY_INDEFINITE; } - + if (TRACE_ABC_REMOVAL) { printf ("Recursivity accepted ("); print_evaluation_context_status (recursive_status); printf (")\n"); } - + current_context = father_context; while (current_context != last_context) { int index = current_context - area->contexts; @@ -974,7 +974,7 @@ evaluate_relation_with_target_variable (MonoVariableRelationsEvaluationArea *are } break; } - + } /* @@ -1032,9 +1032,9 @@ remove_abc_from_inst (MonoInst *ins, MonoVariableRelationsEvaluationArea *area) int index_variable = ins->sreg2; MonoRelationsEvaluationContext *array_context = &(area->contexts [array_variable]); MonoRelationsEvaluationContext *index_context = &(area->contexts [index_variable]); - + clean_contexts (area, area->cfg->next_vreg); - + evaluate_relation_with_target_variable (area, index_variable, array_variable, NULL); evaluate_relation_with_target_variable (area, array_variable, array_variable, NULL); @@ -1066,7 +1066,7 @@ eval_non_null (MonoVariableRelationsEvaluationArea *area, int reg) clean_contexts (area, area->cfg->next_vreg); evaluate_relation_with_target_variable (area, reg, reg, NULL); - + return context->ranges.zero.nullness == MONO_VALUE_NOT_NULL; } @@ -1107,7 +1107,7 @@ process_block (MonoCompile *cfg, MonoBasicBlock *bb, MonoVariableRelationsEvalua MonoAdditionalVariableRelationsForBB additional_relations; GSList *dominated_bb, *l; GSList *check_relations = NULL; - + if (TRACE_ABC_REMOVAL) { printf ("\nABCREM BLOCK/2 %d [dfn %d]...\n", bb->block_num, bb->dfn); } @@ -1141,7 +1141,7 @@ process_block (MonoCompile *cfg, MonoBasicBlock *bb, MonoVariableRelationsEvalua if (ins->opcode == OP_BOUNDS_CHECK) { /* Handle OP_LDELEMA2D, too */ array_var = ins->sreg1; index_var = ins->sreg2; - + remove_abc_from_inst (ins, area); /* We can derive additional relations from the bounds check */ @@ -1229,15 +1229,15 @@ process_block (MonoCompile *cfg, MonoBasicBlock *bb, MonoVariableRelationsEvalua } */ } - } - + } + for (dominated_bb = bb->dominated; dominated_bb != NULL; dominated_bb = dominated_bb->next) { process_block (cfg, (MonoBasicBlock*) (dominated_bb->data), area); } for (l = check_relations; l; l = l->next) remove_change_from_evaluation_area ((MonoAdditionalVariableRelation *)l->data); - + remove_change_from_evaluation_area (&(additional_relations.relation1)); remove_change_from_evaluation_area (&(additional_relations.relation2)); } @@ -1295,7 +1295,7 @@ type_to_value_kind (MonoType *type) * - Allocate memory for the evaluation contexts in the evaluation area * - Recursively process all the BBs in the dominator tree (it is enough * to invoke the processing on the entry BB) - * + * * cfg: the method code */ void @@ -1304,7 +1304,7 @@ mono_perform_abc_removal (MonoCompile *cfg) MonoVariableRelationsEvaluationArea area; MonoBasicBlock *bb; int i; - + verbose_level = cfg->verbose_level; area.cfg = cfg; @@ -1338,7 +1338,7 @@ mono_perform_abc_removal (MonoCompile *cfg) for (ins = bb->code; ins; ins = ins->next) { const char *spec = INS_INFO (ins->opcode); gint32 idx, *reg; - + if (spec [MONO_INST_DEST] == ' ' || MONO_IS_STORE_MEMBASE (ins)) continue; @@ -1371,7 +1371,7 @@ mono_perform_abc_removal (MonoCompile *cfg) MONO_MAKE_RELATIONS_EVALUATION_RANGE_WEAK (range); apply_value_kind_to_range (&range, area.variable_value_kind [ins->dreg]); apply_value_kind_to_range (&range, effective_value_kind); - + if (range.upper < INT_MAX) { type_relation = (MonoSummarizedValueRelation *) mono_mempool_alloc (cfg->mempool, sizeof (MonoSummarizedValueRelation)); type_relation->relation = MONO_LE_RELATION; @@ -1414,17 +1414,17 @@ mono_perform_abc_removal (MonoCompile *cfg) if (area.relations [i].related_value.value.variable.nullness & MONO_VALUE_IS_VARIABLE) { symmetric_nullness = area.relations [i].related_value.value.variable.nullness; } - + area.relations [related_index].relation = MONO_EQ_RELATION; area.relations [related_index].relation_is_static_definition = TRUE; area.relations [related_index].related_value.type = MONO_VARIABLE_SUMMARIZED_VALUE; area.relations [related_index].related_value.value.variable.variable = i; area.relations [related_index].related_value.value.variable.delta = - area.relations [i].related_value.value.variable.delta; area.relations [related_index].related_value.value.variable.nullness = symmetric_nullness; - + area.relations [related_index].next = area.relations [related_variable].next; area.relations [related_variable].next = &(area.relations [related_index]); - + if (TRACE_ABC_REMOVAL) { printf ("Added symmetric summarized value for variable variable %d (to %d): ", i, related_variable); print_summarized_value (&(area.relations [related_index].related_value)); diff --git a/src/mono/mono/mini/abcremoval.h b/src/mono/mono/mini/abcremoval.h index 8bc91ad4d7053e..585a9072fbca3c 100644 --- a/src/mono/mono/mini/abcremoval.h +++ b/src/mono/mono/mini/abcremoval.h @@ -159,7 +159,7 @@ typedef struct MonoSummarizedValueRelation { * The bits are handled separately because the same evaluation context could * belong to more than one loop, so that each loop would set its bits. * After the backtracking, the bits are examined and a decision is taken. - * + * */ typedef enum { MONO_RELATIONS_EVALUATION_NOT_STARTED = 0, @@ -333,7 +333,7 @@ typedef struct MonoVariableRelationsEvaluationArea { * coming to dominate the running time of abcremoval. By * storing the statuses together, we can memset the entire * region. - */ + */ MonoRelationsEvaluationStatus *statuses; MonoRelationsEvaluationContext *contexts; diff --git a/src/mono/mono/mini/alias-analysis.c b/src/mono/mono/mini/alias-analysis.c index 522e62d8509154..206c16274331d2 100644 --- a/src/mono/mono/mini/alias-analysis.c +++ b/src/mono/mono/mini/alias-analysis.c @@ -53,8 +53,8 @@ lower_load (MonoCompile *cfg, MonoInst *load, MonoInst *ldaddr) } if (replaced_op != load->opcode) { - if (cfg->verbose_level > 2) - printf ("Incompatible load type: expected %s but got %s\n", + if (cfg->verbose_level > 2) + printf ("Incompatible load type: expected %s but got %s\n", mono_inst_name (replaced_op), mono_inst_name (load->opcode)); return FALSE; @@ -84,8 +84,8 @@ lower_store (MonoCompile *cfg, MonoInst *store, MonoInst *ldaddr) if (replaced_op != store->opcode) { - if (cfg->verbose_level > 2) - printf ("Incompatible store_reg type: expected %s but got %s\n", + if (cfg->verbose_level > 2) + printf ("Incompatible store_reg type: expected %s but got %s\n", mono_inst_name (replaced_op), mono_inst_name (store->opcode)); return FALSE; @@ -131,7 +131,7 @@ lower_store_imm (MonoCompile *cfg, MonoInst *store, MonoInst *ldaddr) #if TARGET_SIZEOF_VOID_P == 8 case OP_STORE_MEMBASE_IMM: -#endif +#endif case OP_STOREI8_MEMBASE_IMM: if (!is_long_stack_size (var->type)) { if (cfg->verbose_level > 2) printf ("Incompatible variable of size != 8\n"); diff --git a/src/mono/mono/mini/aot-runtime.c b/src/mono/mono/mini/aot-runtime.c index c4b0b821a25dcc..cddb53c8649b48 100644 --- a/src/mono/mono/mini/aot-runtime.c +++ b/src/mono/mono/mini/aot-runtime.c @@ -184,12 +184,12 @@ static GHashTable *aot_modules; #define mono_aot_unlock() mono_os_mutex_unlock (&aot_mutex) static mono_mutex_t aot_mutex; -/* +/* * Maps assembly names to the mono_aot_module__info symbols in the * AOT modules registered by mono_aot_register_module (). */ static GHashTable *static_aot_modules; -/* +/* * Same as above, but tracks module that must be loaded before others are * This allows us to have a "container" module which contains resources for * other modules. Since it doesn't provide methods for a managed assembly, @@ -346,7 +346,7 @@ decode_value (guint8 *ptr, guint8 **rptr) { guint8 b = *ptr; gint32 len; - + if ((b & 0x80) == 0){ len = b; ++ptr; @@ -385,7 +385,7 @@ mono_aot_get_offset (guint32 *table, int index) guint8 *data_start, *p; guint32 *index32 = NULL; guint16 *index16 = NULL; - + /* noffsets = table [0]; */ group_size = table [1]; ngroups = table [2]; @@ -571,7 +571,7 @@ decode_klass_ref (MonoAotModule *module, guint8 *buf, guint8 **endbuf, MonoError if (is_not_anonymous) { gboolean is_method = decode_value (p, &p); - + if (is_method) { MonoMethod *method_def; g_assert (type == MONO_TYPE_MVAR); @@ -899,7 +899,7 @@ sig_matches_target (MonoAotModule *module, MonoMethod *target, guint8 *buf, guin MonoMethodSignature *sig; gboolean res; guint8 *p = buf; - + sig = decode_signature_with_target (module, mono_method_signature_internal (target), p, &p); res = sig && mono_metadata_signature_equal (mono_method_signature_internal (target), sig); g_free (sig); @@ -997,7 +997,7 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod ref->method = mono_marshal_get_stelemref (); } else if (subtype == WRAPPER_SUBTYPE_VIRTUAL_STELEMREF) { int kind; - + kind = decode_value (p, &p); ref->method = mono_marshal_get_virtual_stelemref_wrapper ((MonoStelemrefKind)kind); @@ -1311,8 +1311,8 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod MonoGenericContext ctx; guint32 token_index; - /* - * These methods do not have a token which resolves them, so we + /* + * These methods do not have a token which resolves them, so we * resolve them immediately. */ klass = decode_klass_ref (module, p, &p, error); @@ -1339,11 +1339,11 @@ decode_method_ref_with_target (MonoAotModule *module, MethodRef *ref, MonoMethod if (FALSE && mono_class_is_ginst (klass)) { ctx.class_inst = mono_class_get_generic_class (klass)->context.class_inst; ctx.method_inst = NULL; - + ref->method = mono_class_inflate_generic_method_full_checked (ref->method, klass, &ctx, error); if (!ref->method) return FALSE; - } + } memset (&ctx, 0, sizeof (ctx)); @@ -1449,7 +1449,7 @@ find_symbol (MonoDl *module, gpointer *globals, const char *name, gpointer *valu int global_index; guint16 *table, *entry; guint16 table_size; - guint32 hash; + guint32 hash; char *symbol = (char*)name; #ifdef TARGET_MACH @@ -1906,7 +1906,7 @@ load_aot_module (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer return; if (assembly->image->aot_module) - /* + /* * Already loaded. This can happen because the assembly loading code might invoke * the assembly load hooks multiple times for the same assembly. */ @@ -2112,7 +2112,7 @@ load_aot_module (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer aname->culture = g_strdup (table); table += strlen (table) + 1; memcpy (aname->public_key_token, table, strlen (table) + 1); - table += strlen (table) + 1; + table += strlen (table) + 1; table = (char *)ALIGN_PTR_TO (table, 8); aname->flags = *(guint32*)table; @@ -2310,7 +2310,7 @@ load_aot_module (MonoAssemblyLoadContext *alc, MonoAssembly *assembly, gpointer * mono_aot_register_module: * * This should be called by embedding code to register normal AOT modules statically linked - * into the executable. + * into the executable. * * \param aot_info the value of the 'mono_aot_module__info' global symbol from the AOT module. */ @@ -2451,7 +2451,7 @@ decode_cached_class_info (MonoAotModule *module, MonoCachedClassInfo *info, guin *endbuf = buf; return TRUE; -} +} gpointer mono_aot_get_method_from_vt_slot (MonoVTable *vtable, int slot, MonoError *error) @@ -2524,7 +2524,7 @@ mono_aot_get_cached_class_info (MonoClass *klass, MonoCachedClassInfo *res) * using a cache stored in the AOT file. * Stores the resulting class in *KLASS if found, stores NULL otherwise. * - * Returns: TRUE if the klass was found/not found in the cache, FALSE if no aot file was + * Returns: TRUE if the klass was found/not found in the cache, FALSE if no aot file was * found. */ gboolean @@ -2624,7 +2624,7 @@ mono_aot_get_class_from_name (MonoImage *image, const char *name_space, const ch } amodule_unlock (amodule); - + return TRUE; } @@ -2842,7 +2842,7 @@ decode_llvm_mono_eh_frame (MonoAotModule *amodule, MonoJitInfo *jinfo, /* Clear thumb flag */ code_start = (guint8*)(((gsize)code_start) & ~1); - fde = amodule->mono_eh_frame + table [(pos * 2) + 1]; + fde = amodule->mono_eh_frame + table [(pos * 2) + 1]; /* This won't overflow because there is +1 entry in the table */ fde_len = table [(pos * 2) + 2 + 1] - table [(pos * 2) + 1]; @@ -3272,7 +3272,7 @@ decode_exception_debug_info (MonoAotModule *amodule, int map_size = decode_value (p, &p); /* The GC map requires 4 bytes of alignment */ while ((guint64)(gsize)p % 4) - p ++; + p ++; jinfo->gc_info = p; p += map_size; } @@ -3282,7 +3282,7 @@ decode_exception_debug_info (MonoAotModule *amodule, if (!ji_to_amodule) ji_to_amodule = g_hash_table_new (NULL, NULL); g_hash_table_insert (ji_to_amodule, jinfo, amodule); - mono_aot_unlock (); + mono_aot_unlock (); } return jinfo; @@ -3644,7 +3644,7 @@ mono_aot_find_jit_info (MonoImage *image, gpointer addr) if ((guint8*)addr >= (guint8*)jinfo->code_start + jinfo->code_size) /* addr is in the padding between methods, see the adjustment of code_size in decode_exception_debug_info () */ return NULL; - + return jinfo; } @@ -3757,7 +3757,7 @@ decode_patch (MonoAotModule *aot_module, MonoMemPool *mp, MonoJumpInfo *ji, guin case MONO_PATCH_INFO_R4: case MONO_PATCH_INFO_R4_GOT: { guint32 val; - + ji->data.target = mono_mem_manager_alloc0 (mem_manager, sizeof (float)); val = decode_value (p, &p); *(float*)ji->data.target = *(float*)&val; @@ -3849,7 +3849,7 @@ decode_patch (MonoAotModule *aot_module, MonoMemPool *mp, MonoJumpInfo *ji, guin entry->data = (MonoJumpInfo *)mono_mempool_alloc0 (mp, sizeof (MonoJumpInfo)); entry->data->type = (MonoJumpInfoType)((val >> 9) & 0xff); mono_error_cleanup (error); /* FIXME don't swallow the error */ - + res = decode_patch (aot_module, mp, entry->data, p, &p); if (!res) goto cleanup; @@ -3877,7 +3877,7 @@ decode_patch (MonoAotModule *aot_module, MonoMemPool *mp, MonoJumpInfo *ji, guin case MONO_PATCH_INFO_GSHAREDVT_METHOD: { MonoGSharedVtMethodInfo *info = (MonoGSharedVtMethodInfo *)mono_mempool_alloc0 (mp, sizeof (MonoGSharedVtMethodInfo)); int i; - + info->method = decode_resolve_method_ref (aot_module, p, &p, error); mono_error_assert_ok (error); /* FIXME don't swallow the error */ @@ -4035,7 +4035,7 @@ register_jump_target_got_slot (MonoMethod *method, gpointer *got_slot) MonoMethod *shared_method = mini_method_to_shared (method); method = shared_method ? shared_method : method; - jit_mm = jit_mm_for_method (method); + jit_mm = jit_mm_for_method (method); jit_mm_lock (jit_mm); if (!jit_mm->jump_target_got_slot_hash) jit_mm->jump_target_got_slot_hash = g_hash_table_new (NULL, NULL); @@ -4243,7 +4243,7 @@ load_method (MonoAotModule *amodule, MonoImage *image, MonoMethod *method, guint } /** find_aot_method_in_amodule - * + * * \param code_amodule The AOT module containing the code pointer * \param method The method to find the code index for * \param hash_full The hash for the method @@ -4257,7 +4257,7 @@ find_aot_method_in_amodule (MonoAotModule *code_amodule, MonoMethod *method, gui guint32 index; static guint32 n_extra_decodes; - // The AOT module containing the MonoMethod + // The AOT module containing the MonoMethod // The reference to the metadata amodule will differ among multiple dedup methods // which mangle to the same name but live in different assemblies. This leads to // the caching breaking. The solution seems to be to cache using the "metadata" amodule. @@ -4414,7 +4414,7 @@ find_aot_method (MonoMethod *method, MonoAotModule **out_amodule) int i; guint32 hash = mono_aot_method_hash (method); - /* Try the place we expect to have moved the method only + /* Try the place we expect to have moved the method only * We don't probe, as that causes hard-to-debug issues when we fail * to find the method */ if (container_amodule && mono_aot_can_dedup (method)) { @@ -4429,7 +4429,7 @@ find_aot_method (MonoMethod *method, MonoAotModule **out_amodule) if (index != 0xffffff) return index; - /* + /* * Try all other modules. * This is needed because generic instances klass->image points to the image * containing the generic definition, but the native code is generated to the @@ -4453,7 +4453,7 @@ find_aot_method (MonoMethod *method, MonoAotModule **out_amodule) break; } } - + g_ptr_array_free (modules, TRUE); return index; @@ -4687,7 +4687,7 @@ mono_aot_get_method (MonoMethod *method, MonoError *error) if (method->is_inflated && !method->wrapper_type && mono_method_is_generic_sharable_full (method, TRUE, FALSE, FALSE) && !dedupable) { MonoMethod *orig_method = method; - /* + /* * For generic methods, we store the fully shared instance in place of the * original method. */ @@ -4754,7 +4754,7 @@ mono_aot_get_method (MonoMethod *method, MonoError *error) if (!m) g_error ("AOT runtime could not load method due to %s", mono_error_get_message (error)); /* FIXME don't swallow the error */ - /* + /* * Get the code for the instantiation which should be emitted into * the mscorlib aot image by the AOT compiler. */ @@ -4914,7 +4914,7 @@ mono_aot_is_got_entry (guint8 *code, guint8 *addr) mono_aot_lock (); g_hash_table_foreach (aot_modules, check_is_got_entry, &user_data); mono_aot_unlock (); - + return user_data.res; } @@ -4947,11 +4947,11 @@ find_aot_module (guint8 *code) user_data.addr = code; user_data.module = NULL; - + mono_aot_lock (); g_hash_table_foreach (aot_modules, find_aot_module_cb, &user_data); mono_aot_unlock (); - + return user_data.module; } @@ -5022,7 +5022,7 @@ mono_aot_plt_resolve (gpointer aot_module, host_mgreg_t *regs, guint8 *code, Mon using_gsharedvt = TRUE; #endif - /* + /* * Avoid calling resolve_patch_target in the full-aot case if possible, since * it would create a trampoline, and we don't need that. * We could do this only if the method does not need the special handling @@ -5163,7 +5163,7 @@ mono_aot_get_plt_entry (host_mgreg_t *regs, guint8 *code) while (target != NULL) { if ((target >= (guint8*)(amodule->plt)) && (target < (guint8*)(amodule->plt_end))) return target; - + // Add 4 since mono_arch_get_call_target assumes we're passing // the instruction after the actual branch instruction. target = mono_arch_get_call_target (target + 4); @@ -5223,7 +5223,7 @@ mono_create_ftnptr_malloc (guint8 *code) /* * load_function_full: * - * Load the function named NAME from the aot image. + * Load the function named NAME from the aot image. */ static gpointer load_function_full (MonoAotModule *amodule, const char *name, MonoTrampInfo **out_tinfo) @@ -5696,7 +5696,7 @@ get_numerous_trampoline (MonoAotTrampoline tramp_type, int n_got_slots, MonoAotM #define MONOTOUCH_TRAMPOLINES_ERROR "" #endif if (amodule->trampoline_index [tramp_type] == amodule->info.num_trampolines [tramp_type]) { - g_error ("Ran out of trampolines of type %d in '%s' (limit %d)%s\n", + g_error ("Ran out of trampolines of type %d in '%s' (limit %d)%s\n", tramp_type, image ? image->name : MONO_ASSEMBLY_CORLIB_NAME, amodule->info.num_trampolines [tramp_type], MONOTOUCH_TRAMPOLINES_ERROR); } index = amodule->trampoline_index [tramp_type] ++; @@ -5789,7 +5789,7 @@ mono_aot_get_static_rgctx_trampoline (gpointer ctx, gpointer addr) code = (guint8 *)get_numerous_trampoline (MONO_AOT_TRAMP_STATIC_RGCTX, 2, &amodule, &got_offset, NULL); amodule->got [got_offset] = ctx; - amodule->got [got_offset + 1] = addr; + amodule->got [got_offset + 1] = addr; } /* The caller expects an ftnptr */ @@ -6041,7 +6041,7 @@ mono_aot_get_imt_trampoline (MonoVTable *vtable, MonoIMTCheckItem **imt_entries, buf = (void **)m_class_alloc0 (vtable->klass, (real_count + 1) * 2 * sizeof (gpointer)); index = 0; for (i = 0; i < count; ++i) { - MonoIMTCheckItem *item = imt_entries [i]; + MonoIMTCheckItem *item = imt_entries [i]; if (!item->is_equals) continue; @@ -6060,7 +6060,7 @@ mono_aot_get_imt_trampoline (MonoVTable *vtable, MonoIMTCheckItem **imt_entries, } buf [(index * 2)] = NULL; buf [(index * 2) + 1] = fail_tramp; - + if (USE_PAGE_TRAMPOLINES) { code = get_new_imt_trampoline_from_page (buf); } else { @@ -6085,7 +6085,7 @@ mono_aot_get_gsharedvt_arg_trampoline (gpointer arg, gpointer addr) code = (guint8 *)get_numerous_trampoline (MONO_AOT_TRAMP_GSHAREDVT_ARG, 2, &amodule, &got_offset, NULL); amodule->got [got_offset] = arg; - amodule->got [got_offset + 1] = addr; + amodule->got [got_offset + 1] = addr; } /* The caller expects an ftnptr */ @@ -6130,7 +6130,7 @@ mono_aot_set_make_unreadable (gboolean unreadable) if (make_unreadable && !inited) { mono_counters_register ("AOT: pagefaults", MONO_COUNTER_JIT | MONO_COUNTER_INT, &n_pagefaults); - } + } } typedef struct { @@ -6179,7 +6179,7 @@ mono_aot_is_pagefault (void *ptr) if (!make_unreadable) return FALSE; - /* + /* * Not signal safe, but SIGSEGV's are synchronous, and * this is only turned on by a MONO_DEBUG option. */ @@ -6368,7 +6368,7 @@ mono_aot_get_imt_trampoline (MonoVTable *vtable, MonoIMTCheckItem **imt_entries, { g_assert_not_reached (); return NULL; -} +} gpointer mono_aot_get_gsharedvt_arg_trampoline (gpointer arg, gpointer addr) diff --git a/src/mono/mono/mini/arch-stubs.c b/src/mono/mono/mini/arch-stubs.c index 853f92d5a52c0d..bd09fb0066ae8e 100644 --- a/src/mono/mono/mini/arch-stubs.c +++ b/src/mono/mono/mini/arch-stubs.c @@ -134,7 +134,7 @@ mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) return NULL; } -gpointer +gpointer mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot) { g_assert_not_reached (); diff --git a/src/mono/mono/mini/branch-opts.c b/src/mono/mono/mini/branch-opts.c index df8954784aefe2..bdf889f57953e9 100644 --- a/src/mono/mono/mini/branch-opts.c +++ b/src/mono/mono/mini/branch-opts.c @@ -19,7 +19,7 @@ /* * Returns true if @bb is a basic block which falls through the next block. - * TODO verify if it helps to check if the bb last ins is a branch to its successor. + * TODO verify if it helps to check if the bb last ins is a branch to its successor. */ static gboolean mono_bb_is_fall_through (MonoCompile *cfg, MonoBasicBlock *bb) @@ -30,7 +30,7 @@ mono_bb_is_fall_through (MonoCompile *cfg, MonoBasicBlock *bb) /* * Used by the arch code to replace the exception handling - * with a direct branch. This is safe to do if the + * with a direct branch. This is safe to do if the * exception object isn't used, no rethrow statement and * no filter statement (verify). * @@ -57,9 +57,9 @@ mono_branch_optimize_exception_target (MonoCompile *cfg, MonoBasicBlock *bb, con if (clause->flags == MONO_EXCEPTION_CLAUSE_NONE && clause->data.catch_class && mono_class_is_assignable_from_internal (clause->data.catch_class, exclass)) { MonoBasicBlock *tbb; - /* get the basic block for the handler and + /* get the basic block for the handler and * check if the exception object is used. - * Flag is set during method_to_ir due to + * Flag is set during method_to_ir due to * pop-op is optmized away in codegen (burg). */ tbb = cfg->cil_offset_to_bb [clause->handler_offset]; @@ -69,7 +69,7 @@ mono_branch_optimize_exception_target (MonoCompile *cfg, MonoBasicBlock *bb, con /* Check if this catch clause is ok to optimize by * looking for the BB_EXCEPTION_UNSAFE in every BB that - * belongs to the same region. + * belongs to the same region. * * UNSAFE flag is set during method_to_ir (OP_RETHROW) */ @@ -93,11 +93,11 @@ mono_branch_optimize_exception_target (MonoCompile *cfg, MonoBasicBlock *bb, con jump->inst_i1 = (MonoInst *)mono_mempool_alloc0 (cfg->mempool, sizeof (MonoInst)); jump->inst_true_bb = targetbb; - if (cfg->verbose_level > 2) + if (cfg->verbose_level > 2) g_print ("found exception to optimize - returning branch to BB%d (%s) (instead of throw) for method %s:%s\n", targetbb->block_num, m_class_get_name (clause->data.catch_class), m_class_get_name (cfg->method->klass), cfg->method->name); return jump; - } + } return NULL; } else { @@ -168,7 +168,7 @@ br_to_br_un (int opcode) * mono_replace_ins: * * Replace INS with its decomposition which is stored in a series of bblocks starting - * at FIRST_BB and ending at LAST_BB. On enter, PREV points to the predecessor of INS. + * at FIRST_BB and ending at LAST_BB. On enter, PREV points to the predecessor of INS. * On return, it will be set to the last ins of the decomposition. */ void @@ -183,7 +183,7 @@ mono_replace_ins (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, MonoInst } if (first_bb == last_bb) { - /* + /* * Only one replacement bb, merge the code into * the current bb. */ @@ -295,7 +295,7 @@ mono_if_conversion (MonoCompile *cfg) // FIXME: Make this work with extended bblocks - /* + /* * This pass requires somewhat optimized IR code so it should be run after * local cprop/deadce. Also, it should be run before dominator computation, since * it changes control flow. @@ -349,7 +349,7 @@ mono_if_conversion (MonoCompile *cfg) true_bb = branch->inst_true_bb; false_bb = branch->inst_false_bb; - /* + /* * Check that bb1 and bb2 are 'simple' and both assign to the same * variable. */ @@ -364,7 +364,7 @@ mono_if_conversion (MonoCompile *cfg) for (tmp = ins1->next; tmp; tmp = tmp->next) if (!((tmp->opcode == OP_NOP) || (tmp->opcode == OP_IL_SEQ_POINT) || (tmp->opcode == OP_BR))) simple = FALSE; - + for (tmp = ins2->next; tmp; tmp = tmp->next) if (!((tmp->opcode == OP_NOP) || (tmp->opcode == OP_IL_SEQ_POINT) || (tmp->opcode == OP_BR))) simple = FALSE; @@ -549,7 +549,7 @@ mono_if_conversion (MonoCompile *cfg) continue; if (!(cfg->opt & MONO_OPT_DEADCE)) - /* + /* * It is possible that dreg is never set before, so we can't use * it as an sreg of the cmov instruction (#582322). */ @@ -618,10 +618,10 @@ mono_if_conversion (MonoCompile *cfg) (bb->region == bb->out_bb [0]->region)) { mono_merge_basic_blocks (cfg, bb, bb->out_bb [0]); - /* - * bbn might have fallen through to the next bb without a branch, + /* + * bbn might have fallen through to the next bb without a branch, * have to add one now (#474718). - * FIXME: Maybe need to do this more generally in + * FIXME: Maybe need to do this more generally in * merge_basic_blocks () ? */ if (!(bb->last_ins && MONO_IS_BRANCH_OP (bb->last_ins)) && bb->out_count) { @@ -717,7 +717,7 @@ mono_if_conversion (MonoCompile *cfg) mono_unlink_bblock (cfg, bb, branch1->inst_true_bb); mono_unlink_bblock (cfg, bb, branch1->inst_false_bb); branch1->inst_target_bb = next_bb; - mono_link_bblock (cfg, bb, next_bb); + mono_link_bblock (cfg, bb, next_bb); /* Rewrite the second branch */ branch2->opcode = br_to_br_un (branch2->opcode); @@ -774,7 +774,7 @@ mono_if_conversion (MonoCompile *cfg) } void -mono_nullify_basic_block (MonoBasicBlock *bb) +mono_nullify_basic_block (MonoBasicBlock *bb) { bb->in_count = 0; bb->out_count = 0; @@ -785,7 +785,7 @@ mono_nullify_basic_block (MonoBasicBlock *bb) bb->cil_code = NULL; } -static void +static void replace_out_block (MonoBasicBlock *bb, MonoBasicBlock *orig, MonoBasicBlock *repl) { int i; @@ -805,7 +805,7 @@ replace_out_block (MonoBasicBlock *bb, MonoBasicBlock *orig, MonoBasicBlock *re } } -static void +static void replace_in_block (MonoBasicBlock *bb, MonoBasicBlock *orig, MonoBasicBlock *repl) { int i; @@ -829,7 +829,7 @@ static void replace_out_block_in_code (MonoBasicBlock *bb, MonoBasicBlock *orig, MonoBasicBlock *repl) { MonoInst *ins; - + for (ins = bb->code; ins != NULL; ins = ins->next) { switch (ins->opcode) { case OP_BR: @@ -885,7 +885,7 @@ remove_block_if_useless (MonoCompile *cfg, MonoBasicBlock *bb, MonoBasicBlock *p bb->not_useless = TRUE; return FALSE; } - + MONO_BB_FOR_EACH_INS (bb, inst) { switch (inst->opcode) { case OP_NOP: @@ -899,7 +899,7 @@ remove_block_if_useless (MonoCompile *cfg, MonoBasicBlock *bb, MonoBasicBlock *p return FALSE; } } - + if (target_bb == NULL) { if ((bb->out_count == 1) && (bb->out_bb [0] == bb->next_bb)) { target_bb = bb->next_bb; @@ -908,25 +908,25 @@ remove_block_if_useless (MonoCompile *cfg, MonoBasicBlock *bb, MonoBasicBlock *p return FALSE; } } - + /* Do not touch BBs following a switch (they are the "default" branch) */ if ((previous_bb->last_ins != NULL) && (previous_bb->last_ins->opcode == OP_SWITCH)) { return FALSE; } - + /* Do not touch BBs following the entry BB and jumping to something that is not */ /* thiry "next" bb (the entry BB cannot contain the branch) */ if ((previous_bb == cfg->bb_entry) && (bb->next_bb != target_bb)) { return FALSE; } - /* - * Do not touch BBs following a try block as the code in + /* + * Do not touch BBs following a try block as the code in * mini_method_compile needs them to compute the length of the try block. */ if (MONO_BBLOCK_IS_IN_REGION (previous_bb, MONO_REGION_TRY)) return FALSE; - + /* Check that there is a target BB, and that bb is not an empty loop (Bug 75061) */ if ((target_bb != NULL) && (target_bb != bb)) { int i; @@ -934,7 +934,7 @@ remove_block_if_useless (MonoCompile *cfg, MonoBasicBlock *bb, MonoBasicBlock *p if (cfg->verbose_level > 1) { printf ("remove_block_if_useless, removed BB%d\n", bb->block_num); } - + /* unlink_bblock () modifies the bb->in_bb array so can't use a for loop here */ while (bb->in_count) { MonoBasicBlock *in_bb = bb->in_bb [0]; @@ -942,7 +942,7 @@ remove_block_if_useless (MonoCompile *cfg, MonoBasicBlock *bb, MonoBasicBlock *p mono_link_bblock (cfg, in_bb, target_bb); replace_out_block_in_code (in_bb, bb, target_bb); } - + mono_unlink_bblock (cfg, bb, target_bb); if (previous_bb != cfg->bb_entry && mono_bb_is_fall_through (cfg, previous_bb)) { for (i = 0; i < previous_bb->out_count; i++) { @@ -956,10 +956,10 @@ remove_block_if_useless (MonoCompile *cfg, MonoBasicBlock *bb, MonoBasicBlock *p } } } - + previous_bb->next_bb = bb->next_bb; mono_nullify_basic_block (bb); - + return TRUE; } else { return FALSE; @@ -967,7 +967,7 @@ remove_block_if_useless (MonoCompile *cfg, MonoBasicBlock *bb, MonoBasicBlock *p } void -mono_merge_basic_blocks (MonoCompile *cfg, MonoBasicBlock *bb, MonoBasicBlock *bbn) +mono_merge_basic_blocks (MonoCompile *cfg, MonoBasicBlock *bb, MonoBasicBlock *bbn) { MonoInst *inst; MonoBasicBlock *prev_bb; @@ -1048,7 +1048,7 @@ mono_merge_basic_blocks (MonoCompile *cfg, MonoBasicBlock *bb, MonoBasicBlock *b } mono_nullify_basic_block (bbn); - /* + /* * If bbn fell through to its next bblock, have to add a branch, since bb * will not fall though to the same bblock (#513931). */ @@ -1087,7 +1087,7 @@ move_basic_block_to_end (MonoCompile *cfg, MonoBasicBlock *bb) MONO_ADD_INS (bb, ins); mono_link_bblock (cfg, bb, next); ins->inst_target_bb = next; - } + } } /* @@ -1096,7 +1096,7 @@ move_basic_block_to_end (MonoCompile *cfg, MonoBasicBlock *bb) * Remove BB from the control flow graph */ void -mono_remove_bblock (MonoCompile *cfg, MonoBasicBlock *bb) +mono_remove_bblock (MonoCompile *cfg, MonoBasicBlock *bb) { MonoBasicBlock *tmp_bb; @@ -1112,7 +1112,7 @@ mono_remove_critical_edges (MonoCompile *cfg) { MonoBasicBlock *bb; MonoBasicBlock *previous_bb; - + if (cfg->verbose_level > 3) { for (bb = cfg->bb_entry; bb; bb = bb->next_bb) { int i; @@ -1132,15 +1132,15 @@ mono_remove_critical_edges (MonoCompile *cfg) printf ("\n"); } } - + for (previous_bb = cfg->bb_entry, bb = previous_bb->next_bb; bb != NULL; previous_bb = previous_bb->next_bb, bb = bb->next_bb) { if (bb->in_count > 1) { int in_bb_index; for (in_bb_index = 0; in_bb_index < bb->in_count; in_bb_index++) { MonoBasicBlock *in_bb = bb->in_bb [in_bb_index]; - /* + /* * Have to remove non-critical edges whose source ends with a BR_REG - * ins too, since inserting a computation before the BR_REG could + * ins too, since inserting a computation before the BR_REG could * overwrite the sreg1 of the ins. */ if ((in_bb->out_count > 1) || (in_bb->out_count == 1 && in_bb->last_ins && in_bb->last_ins->opcode == OP_BR_REG)) { @@ -1148,7 +1148,7 @@ mono_remove_critical_edges (MonoCompile *cfg) new_bb->block_num = cfg->num_bblocks++; // new_bb->real_offset = bb->real_offset; new_bb->region = bb->region; - + /* Do not alter the CFG while altering the BB list */ if (mono_bb_is_fall_through (cfg, previous_bb)) { if (previous_bb != cfg->bb_entry) { @@ -1172,7 +1172,7 @@ mono_remove_critical_edges (MonoCompile *cfg) new_bb_after_entry->block_num = cfg->num_bblocks++; // new_bb_after_entry->real_offset = bb->real_offset; new_bb_after_entry->region = bb->region; - + MONO_INST_NEW (cfg, jump, OP_BR); MONO_ADD_INS (new_bb_after_entry, jump); jump->cil_code = bb->cil_code; @@ -1181,7 +1181,7 @@ mono_remove_critical_edges (MonoCompile *cfg) mono_unlink_bblock (cfg, previous_bb, bb); mono_link_bblock (cfg, new_bb_after_entry, bb); mono_link_bblock (cfg, previous_bb, new_bb_after_entry); - + previous_bb->next_bb = new_bb_after_entry; previous_bb = new_bb_after_entry; @@ -1190,12 +1190,12 @@ mono_remove_critical_edges (MonoCompile *cfg) } } } - + /* Insert new_bb in the BB list */ previous_bb->next_bb = new_bb; new_bb->next_bb = bb; previous_bb = new_bb; - + /* Setup in_bb and out_bb */ new_bb->in_bb = (MonoBasicBlock **)mono_mempool_alloc ((cfg)->mempool, sizeof (MonoBasicBlock*)); new_bb->in_bb [0] = in_bb; @@ -1203,12 +1203,12 @@ mono_remove_critical_edges (MonoCompile *cfg) new_bb->out_bb = (MonoBasicBlock **)mono_mempool_alloc ((cfg)->mempool, sizeof (MonoBasicBlock*)); new_bb->out_bb [0] = bb; new_bb->out_count = 1; - + /* Relink in_bb and bb to (from) new_bb */ replace_out_block (in_bb, bb, new_bb); replace_out_block_in_code (in_bb, bb, new_bb); replace_in_block (bb, in_bb, new_bb); - + if (cfg->verbose_level > 2) { printf ("remove_critical_edges, removed critical edge from BB%d to BB%d (added BB%d)\n", in_bb->block_num, bb->block_num, new_bb->block_num); } @@ -1216,7 +1216,7 @@ mono_remove_critical_edges (MonoCompile *cfg) } } } - + if (cfg->verbose_level > 3) { for (bb = cfg->bb_entry; bb; bb = bb->next_bb) { int i; @@ -1260,7 +1260,7 @@ mono_optimize_branches (MonoCompile *cfg) niterations = cfg->num_bblocks * 2; else niterations = 1000; - + do { MonoBasicBlock *previous_bb; changed = FALSE; @@ -1291,7 +1291,7 @@ mono_optimize_branches (MonoCompile *cfg) for (i = 0; i < bbn->out_count; i++) replace_in_block (bbn->out_bb [i], bbn, NULL); - mono_nullify_basic_block (bbn); + mono_nullify_basic_block (bbn); changed = TRUE; } @@ -1341,7 +1341,7 @@ mono_optimize_branches (MonoCompile *cfg) for (i = 0; i < bbn->out_count; i++) replace_in_block (bbn->out_bb [i], bbn, NULL); - mono_nullify_basic_block (bbn); + mono_nullify_basic_block (bbn); changed = TRUE; continue; } @@ -1355,7 +1355,7 @@ mono_optimize_branches (MonoCompile *cfg) if (bb->region == bbn->region && bbn_first_inst && bbn_first_inst->opcode == OP_BR && bbn_first_inst->inst_target_bb != bbn && bbn_first_inst->inst_target_bb->region == bb->region) { - + if (cfg->verbose_level > 2) g_print ("branch to branch triggered %d -> %d -> %d\n", bb->block_num, bbn->block_num, bbn_first_inst->inst_target_bb->block_num); @@ -1387,7 +1387,7 @@ mono_optimize_branches (MonoCompile *cfg) untaken_branch_target = bb->last_ins->inst_true_bb; } if (taken_branch_target) { - /* if mono_eval_cond_branch () is ever taken to handle + /* if mono_eval_cond_branch () is ever taken to handle * non-constant values to compare, issue a pop here. */ bb->last_ins->opcode = OP_BR; @@ -1401,12 +1401,12 @@ mono_optimize_branches (MonoCompile *cfg) bbn_first_inst = mono_bb_first_inst (bbn, filter); if (bb->region == bbn->region && bbn_first_inst && bbn_first_inst->opcode == OP_BR && bbn_first_inst->inst_target_bb->region == bb->region) { - if (cfg->verbose_level > 2) - g_print ("cbranch1 to branch triggered %d -> (%d) %d (0x%02x)\n", - bb->block_num, bbn->block_num, bbn_first_inst->inst_target_bb->block_num, + if (cfg->verbose_level > 2) + g_print ("cbranch1 to branch triggered %d -> (%d) %d (0x%02x)\n", + bb->block_num, bbn->block_num, bbn_first_inst->inst_target_bb->block_num, bbn_first_inst->opcode); - /* + /* * Unlink, then relink bblocks to avoid various * tricky situations when the two targets of the branch * are equal, or will become equal after the change. @@ -1428,8 +1428,8 @@ mono_optimize_branches (MonoCompile *cfg) if (bbn && bb->region == bbn->region && bbn_first_inst && bbn_first_inst->opcode == OP_BR && bbn_first_inst->inst_target_bb->region == bb->region) { if (cfg->verbose_level > 2) - g_print ("cbranch2 to branch triggered %d -> (%d) %d (0x%02x)\n", - bb->block_num, bbn->block_num, bbn_first_inst->inst_target_bb->block_num, + g_print ("cbranch2 to branch triggered %d -> (%d) %d (0x%02x)\n", + bb->block_num, bbn->block_num, bbn_first_inst->inst_target_bb->block_num, bbn_first_inst->opcode); mono_unlink_bblock (cfg, bb, bb->last_ins->inst_true_bb); @@ -1449,7 +1449,7 @@ mono_optimize_branches (MonoCompile *cfg) * If bb is an extended bb, it could contain an inside branch to bbn. * FIXME: Enable the optimization if that is not true. * If bblocks_linked () is true, then merging bb and bbn - * would require addition of an extra branch at the end of bbn + * would require addition of an extra branch at the end of bbn * slowing down loops. */ if (bbn && bb->region == bbn->region && bbn->in_count == 1 && cfg->enable_extended_bblocks && bbn != cfg->bb_exit && !bb->extended && !bbn->out_of_line && !mono_bblocks_linked (bbn, bb)) { @@ -1472,7 +1472,7 @@ mono_optimize_branches (MonoCompile *cfg) move_basic_block_to_end (cfg, bb->last_ins->inst_true_bb); if (cfg->verbose_level > 2) - g_print ("cbranch to throw block triggered %d.\n", + g_print ("cbranch to throw block triggered %d.\n", bb->block_num); } } diff --git a/src/mono/mono/mini/calls.c b/src/mono/mono/mini/calls.c index e4877f6d98c032..e6eed77d6884c3 100644 --- a/src/mono/mono/mini/calls.c +++ b/src/mono/mono/mini/calls.c @@ -105,7 +105,7 @@ ret_type_to_call_opcode (MonoCompile *cfg, MonoType *type, int calli, int virt) case MONO_TYPE_STRING: case MONO_TYPE_OBJECT: case MONO_TYPE_SZARRAY: - case MONO_TYPE_ARRAY: + case MONO_TYPE_ARRAY: return calli? OP_CALL_REG: virt? OP_CALL_MEMBASE: OP_CALL; case MONO_TYPE_I8: case MONO_TYPE_U8: @@ -139,7 +139,7 @@ ret_type_to_call_opcode (MonoCompile *cfg, MonoType *type, int calli, int virt) } MonoCallInst * -mini_emit_call_args (MonoCompile *cfg, MonoMethodSignature *sig, +mini_emit_call_args (MonoCompile *cfg, MonoMethodSignature *sig, MonoInst **args, gboolean calli, gboolean virtual_, gboolean tailcall, gboolean rgctx, gboolean unbox_trampoline, MonoMethod *target) { @@ -218,8 +218,8 @@ mini_emit_call_args (MonoCompile *cfg, MonoMethodSignature *sig, #ifdef MONO_ARCH_SOFT_FLOAT_FALLBACK if (COMPILE_SOFT_FLOAT (cfg)) { - /* - * If the call has a float argument, we would need to do an r8->r4 conversion using + /* + * If the call has a float argument, we would need to do an r8->r4 conversion using * an icall, but that cannot be done during the call sequence since it would clobber * the call registers + the stack. So we do it before emitting the call. */ @@ -260,7 +260,7 @@ mini_emit_call_args (MonoCompile *cfg, MonoMethodSignature *sig, cfg->param_area = MAX (cfg->param_area, call->stack_usage); cfg->flags |= MONO_CFG_HAS_CALLS; - + return call; } @@ -289,7 +289,7 @@ set_rgctx_arg (MonoCompile *cfg, MonoCallInst *call, int rgctx_reg, MonoInst *rg #ifdef ENABLE_LLVM call->rgctx_arg_reg = rgctx_reg; #endif -} +} /* Either METHOD or IMT_ARG needs to be set */ static void @@ -524,7 +524,7 @@ mini_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign FIXME: a dummy use is not the best way to do it as the local register allocator will put it on a caller save register and spill it around the call. - Ideally, we would either put it on a callee save register or only do the store part. + Ideally, we would either put it on a callee save register or only do the store part. */ EMIT_NEW_DUMMY_USE (cfg, dummy_use, args [0]); @@ -533,7 +533,7 @@ mini_emit_method_call_full (MonoCompile *cfg, MonoMethod *method, MonoMethodSign if ((!(method->flags & METHOD_ATTRIBUTE_VIRTUAL) || (MONO_METHOD_IS_FINAL (method)))) { - /* + /* * the method is not virtual, we just need to ensure this is not null * and then we can call the method directly. */ @@ -635,13 +635,13 @@ mono_emit_jit_icall_id (MonoCompile *cfg, MonoJitICallId jit_icall_id, MonoInst * Emit a call to the runtime function described by PATCH_TYPE and DATA. */ MonoInst* -mini_emit_abs_call (MonoCompile *cfg, MonoJumpInfoType patch_type, gconstpointer data, +mini_emit_abs_call (MonoCompile *cfg, MonoJumpInfoType patch_type, gconstpointer data, MonoMethodSignature *sig, MonoInst **args) { MonoJumpInfo *ji = mono_patch_info_new (cfg->mempool, 0, patch_type, data); MonoInst *ins; - /* + /* * We pass ji as the call address, the PATCH_INFO_ABS resolving code will * handle it. * FIXME: Is the abs_patches hashtable avoidable? diff --git a/src/mono/mono/mini/cfold.c b/src/mono/mono/mini/cfold.c index 89c4f7b9563acd..fea708e4ef6d7a 100644 --- a/src/mono/mono/mini/cfold.c +++ b/src/mono/mono/mini/cfold.c @@ -110,7 +110,7 @@ mono_constant_fold_ins (MonoCompile *cfg, MonoInst *ins, MonoInst *arg1, MonoIns FOLD_FBINOP (OP_FMUL, *); } dest->opcode = OP_R8CONST; - MONO_INST_NULLIFY_SREGS (dest); + MONO_INST_NULLIFY_SREGS (dest); } break; case OP_RADD: @@ -122,7 +122,7 @@ mono_constant_fold_ins (MonoCompile *cfg, MonoInst *ins, MonoInst *arg1, MonoIns FOLD_RBINOP (OP_RMUL, *); } dest->opcode = OP_R4CONST; - MONO_INST_NULLIFY_SREGS (dest); + MONO_INST_NULLIFY_SREGS (dest); } break; case OP_IMUL: @@ -144,7 +144,7 @@ mono_constant_fold_ins (MonoCompile *cfg, MonoInst *ins, MonoInst *arg1, MonoIns MONO_INST_NULLIFY_SREGS (dest); } } else if (arg1->opcode == OP_ICONST) { - /* + /* * This is commutative so swap the arguments, allowing the _imm variant * to be used later. */ @@ -380,8 +380,8 @@ mono_constant_fold_ins (MonoCompile *cfg, MonoInst *ins, MonoInst *arg1, MonoIns } if (overwrite) { - /* - * Can't nullify OP_COMPARE here since the decompose long branch + /* + * Can't nullify OP_COMPARE here since the decompose long branch * opcodes depend on it being executed. Also, the branch might not * be eliminated after all if loop opts is disabled, for example. */ @@ -443,17 +443,17 @@ mono_constant_fold_ins (MonoCompile *cfg, MonoInst *ins, MonoInst *arg1, MonoIns } /* - * TODO: + * TODO: * conv.* opcodes. * *ovf* opcodes? It's slow and hard to do in C. - * switch can be replaced by a simple jump + * switch can be replaced by a simple jump */ default: return NULL; } - + return dest; -} +} #endif /* DISABLE_JIT */ diff --git a/src/mono/mono/mini/debug-mini.c b/src/mono/mono/mini/debug-mini.c index 2fdb64d2c12b2e..a665dd012738de 100644 --- a/src/mono/mono/mini/debug-mini.c +++ b/src/mono/mono/mini/debug-mini.c @@ -76,7 +76,7 @@ mono_debug_open_method (MonoCompile *cfg) header = cfg->header; g_assert (header); - + info->jit = jit = g_new0 (MonoDebugMethodJitInfo, 1); info->line_numbers = g_array_new (FALSE, TRUE, sizeof (MonoDebugLineNumberEntry)); jit->num_locals = header->num_locals; @@ -118,7 +118,7 @@ write_variable (MonoInst *inst, MonoDebugVarInfo *var) * * Register symbol information for the method with valgrind */ -static void +static void mono_debug_add_vg_method (MonoMethod *method, MonoDebugMethodJitInfo *jit) { #ifdef VALGRIND_ADD_LINE_INFO @@ -143,7 +143,7 @@ mono_debug_add_vg_method (MonoMethod *method, MonoDebugMethodJitInfo *jit) addresses = g_new0 (guint32, header->code_size + 1); lines = g_new0 (guint32, header->code_size + 1); - /* + /* * Very simple code to convert the addr->offset mappings that mono has * into [addr-addr] ->line number mappings. */ @@ -183,7 +183,7 @@ mono_debug_add_vg_method (MonoMethod *method, MonoDebugMethodJitInfo *jit) else address = addresses [i]; } - + address = 0; line_number = 0; i = 0; @@ -193,7 +193,7 @@ mono_debug_add_vg_method (MonoMethod *method, MonoDebugMethodJitInfo *jit) else { if (line_number > 0) { //g_assert (addresses [i] - 1 >= address); - + if (addresses [i] - 1 >= address) { VALGRIND_ADD_LINE_INFO (jit->code_start + address, jit->code_start + addresses [i] - 1, filename, line_number); //printf ("[%d-%d] -> %d.\n", address, addresses [i] - 1, line_number); @@ -294,7 +294,7 @@ mono_debug_free_method (MonoCompile *cfg) if (info->line_numbers) g_array_free (info->line_numbers, TRUE); g_free (info); - cfg->debug_info = NULL; + cfg->debug_info = NULL; } } @@ -359,7 +359,7 @@ encode_value (gint32 value, guint8 *buf, guint8 **endbuf) //printf ("ENCODE: %d 0x%x.\n", value, value); - /* + /* * Same encoding as the one used in the metadata, extended to handle values * greater than 0x1fffffff. */ @@ -393,7 +393,7 @@ decode_value (guint8 *ptr, guint8 **rptr) { guint8 b = *ptr; gint32 len; - + if ((b & 0x80) == 0){ len = b; ++ptr; @@ -597,7 +597,7 @@ deserialize_debug_info (MonoMethod *method, guint8 *code_start, guint8 *buf, gui } void -mono_debug_add_aot_method (MonoMethod *method, guint8 *code_start, +mono_debug_add_aot_method (MonoMethod *method, guint8 *code_start, guint8 *debug_info, guint32 debug_info_len) { MonoDebugMethodJitInfo *jit; @@ -654,7 +654,7 @@ print_var_info (MonoDebugVarInfo *info, int idx, const char *name, const char *t * * Prints to stdout the information about the local variables in * a method (if \p only_arguments is false) or about the arguments. - * The information includes the storage info (where the variable + * The information includes the storage info (where the variable * lives, in a register or in memory). * The method is found by looking up what method has been emitted at * the instruction address \p ip. diff --git a/src/mono/mono/mini/debugger-agent-external.c b/src/mono/mono/mini/debugger-agent-external.c index 2fc584c5ad9497..67298c2363b7eb 100644 --- a/src/mono/mono/mini/debugger-agent-external.c +++ b/src/mono/mono/mini/debugger-agent-external.c @@ -49,7 +49,7 @@ mono_debugger_agent_parse_options (char *options) } DebuggerTransport * -mono_debugger_agent_get_transports (int *ntrans) +mono_debugger_agent_get_transports (int *ntrans) { *ntrans = ntransports; return transports; diff --git a/src/mono/mono/mini/decompose.c b/src/mono/mono/mini/decompose.c index efc8bfd6f06bcd..8e6db0073f5898 100644 --- a/src/mono/mono/mini/decompose.c +++ b/src/mono/mono/mini/decompose.c @@ -129,7 +129,7 @@ decompose_long_opcode (MonoCompile *cfg, MonoInst *ins, MonoInst **repl_ins) break; } #endif - + case OP_ICONV_TO_OVF_I8: case OP_ICONV_TO_OVF_I: ins->opcode = OP_SEXT_I4; @@ -310,7 +310,7 @@ mono_decompose_opcode (MonoCompile *cfg, MonoInst *ins) mono_arch_decompose_opts (cfg, ins); /* - * The code below assumes that we are called immediately after emitting + * The code below assumes that we are called immediately after emitting * ins. This means we can emit code using the normal code generation * macros. */ @@ -600,7 +600,7 @@ mono_decompose_long_opts (MonoCompile *cfg) */ /** - * Create a dummy bblock and emit code into it so we can use the normal + * Create a dummy bblock and emit code into it so we can use the normal * code generation macros. */ cfg->cbb = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock)); @@ -980,7 +980,7 @@ mono_decompose_long_opts (MonoCompile *cfg) break; case OP_LCEQ: { int d1, d2; - + /* Branchless version based on gcc code */ d1 = alloc_ireg (cfg); d2 = alloc_ireg (cfg); @@ -998,7 +998,7 @@ mono_decompose_long_opts (MonoCompile *cfg) case OP_LCGT: case OP_LCGT_UN: { MonoBasicBlock *set_to_0, *set_to_1; - + NEW_BBLOCK (cfg, set_to_0); NEW_BBLOCK (cfg, set_to_1); @@ -1013,7 +1013,7 @@ mono_decompose_long_opts (MonoCompile *cfg) MONO_EMIT_NEW_ICONST (cfg, next->dreg, 1); MONO_START_BB (cfg, set_to_0); NULLIFY_INS (next); - break; + break; } default: g_assert_not_reached (); @@ -1067,7 +1067,7 @@ mono_decompose_long_opts (MonoCompile *cfg) break; case OP_LCEQ: { int d1, d2; - + /* Branchless version based on gcc code */ d1 = alloc_ireg (cfg); d2 = alloc_ireg (cfg); @@ -1085,7 +1085,7 @@ mono_decompose_long_opts (MonoCompile *cfg) case OP_LCGT: case OP_LCGT_UN: { MonoBasicBlock *set_to_0, *set_to_1; - + NEW_BBLOCK (cfg, set_to_0); NEW_BBLOCK (cfg, set_to_1); @@ -1100,7 +1100,7 @@ mono_decompose_long_opts (MonoCompile *cfg) MONO_EMIT_NEW_ICONST (cfg, next->dreg, 1); MONO_START_BB (cfg, set_to_0); NULLIFY_INS (next); - break; + break; } default: g_assert_not_reached (); @@ -1161,23 +1161,23 @@ mono_decompose_vtype_opts (MonoCompile *cfg) * everywhere. * - it gets rid of the LDADDR opcodes generated when vtype operations are decomposed, * enabling optimizations to work on vtypes too. - * Unlike decompose_long_opts, this pass does not alter the CFG of the method so it + * Unlike decompose_long_opts, this pass does not alter the CFG of the method so it * can be executed anytime. It should be executed as late as possible so vtype * opcodes can be optimized by the other passes. * The pinvoke wrappers need to manipulate vtypes in their unmanaged representation. - * This is indicated by setting the 'backend.is_pinvoke' field of the MonoInst for the + * This is indicated by setting the 'backend.is_pinvoke' field of the MonoInst for the * var to 1. - * This is done on demand, ie. by the LDNATIVEOBJ opcode, and propagated by this pass + * This is done on demand, ie. by the LDNATIVEOBJ opcode, and propagated by this pass * when OP_VMOVE opcodes are decomposed. */ - /* + /* * Vregs have no associated type information, so we store the type of the vregs * in ins->klass. */ /** - * Create a dummy bblock and emit code into it so we can use the normal + * Create a dummy bblock and emit code into it so we can use the normal * code generation macros. */ cfg->cbb = (MonoBasicBlock *)mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock)); @@ -1238,11 +1238,11 @@ mono_decompose_vtype_opts (MonoCompile *cfg) EMIT_NEW_VARLOADA_VREG (cfg, dest, ins->dreg, m_class_get_byval_arg (ins->klass)); mini_emit_initobj (cfg, dest, NULL, ins->klass); - + if (cfg->compute_gc_maps) { MonoInst *tmp; - /* + /* * Tell the GC map code that the vtype is considered live after * the initialization. */ @@ -1491,12 +1491,12 @@ mono_decompose_array_access_opts (MonoCompile *cfg) MonoBasicBlock *bb, *first_bb; /* - * Unlike decompose_long_opts, this pass does not alter the CFG of the method so it + * Unlike decompose_long_opts, this pass does not alter the CFG of the method so it * can be executed anytime. It should be run before decompose_long */ /** - * Create a dummy bblock and emit code into it so we can use the normal + * Create a dummy bblock and emit code into it so we can use the normal * code generation macros. */ cfg->cbb = (MonoBasicBlock *)mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock)); @@ -1628,7 +1628,7 @@ mono_decompose_soft_float (MonoCompile *cfg) */ /** - * Create a dummy bblock and emit code into it so we can use the normal + * Create a dummy bblock and emit code into it so we can use the normal * code generation macros. */ cfg->cbb = mono_mempool_alloc0 ((cfg)->mempool, sizeof (MonoBasicBlock)); @@ -1717,7 +1717,7 @@ mono_decompose_soft_float (MonoCompile *cfg) conv = mono_emit_jit_icall (cfg, mono_fload_r4, iargs); conv->dreg = ins->dreg; break; - } + } case OP_FCALL: case OP_FCALL_REG: case OP_FCALL_MEMBASE: { @@ -1809,7 +1809,7 @@ mono_decompose_soft_float (MonoCompile *cfg) cmp->sreg1 = call->dreg; cmp->inst_imm = 0; MONO_ADD_INS (cfg->cbb, cmp); - + MONO_INST_NEW (cfg, br, OP_IBNE_UN); br->inst_many_bb = mono_mempool_alloc (cfg->mempool, sizeof (gpointer) * 2); br->inst_true_bb = ins->next->inst_true_bb; diff --git a/src/mono/mono/mini/dominators.c b/src/mono/mono/mini/dominators.c index 01093eb9d11e3e..3e8197c6a64dbe 100644 --- a/src/mono/mono/mini/dominators.c +++ b/src/mono/mono/mini/dominators.c @@ -28,7 +28,7 @@ /* * Compute dominators and immediate dominators using the algorithm in the - * paper "A Simple, Fast Dominance Algorithm" by Keith D. Cooper, + * paper "A Simple, Fast Dominance Algorithm" by Keith D. Cooper, * Timothy J. Harvey, and Ken Kennedy: * http://citeseer.ist.psu.edu/cooper01simple.html */ @@ -169,7 +169,7 @@ check_dominance_frontier (MonoBasicBlock *x, MonoBasicBlock *t) if (!(t->flags & BB_VISITED)) { int found = FALSE; check_dominance_frontier (x, t->out_bb [i]); - + for (j = 0; j < t->out_bb [i]->in_count; j++) { if (t->out_bb [i]->in_bb [j] == t) found = TRUE; @@ -183,7 +183,7 @@ check_dominance_frontier (MonoBasicBlock *x, MonoBasicBlock *t) g_assert_not_reached (); } } -} +} #endif @@ -203,7 +203,7 @@ compute_dominance_frontier (MonoCompile *cfg) bitsize = mono_bitset_alloc_size (cfg->num_bblocks, 0); mem = (char *)mono_mempool_alloc0 (cfg->mempool, bitsize * cfg->num_bblocks); - + for (i = 0; i < cfg->num_bblocks; ++i) { MonoBasicBlock *bb = cfg->bblocks [i]; bb->dfrontier = mono_bitset_mem_new (mem, cfg->num_bblocks, 0); @@ -230,7 +230,7 @@ compute_dominance_frontier (MonoCompile *cfg) #if 0 for (i = 0; i < cfg->num_bblocks; ++i) { MonoBasicBlock *bb = cfg->bblocks [i]; - + printf ("DFRONT %s BB%d: ", mono_method_full_name (cfg->method, TRUE), bb->block_num); mono_blockset_print (cfg, bb->dfrontier, NULL, -1); } @@ -240,14 +240,14 @@ compute_dominance_frontier (MonoCompile *cfg) /* this is a check for the dominator frontier */ for (i = 0; i < m->num_bblocks; ++i) { MonoBasicBlock *x = m->bblocks [i]; - + mono_bitset_foreach_bit ((x->dfrontier), j, (m->num_bblocks)) { MonoBasicBlock *w = m->bblocks [j]; int k; /* x must not strictly dominates w */ if (mono_bitset_test_fast (w->dominators, x->dfn) && w != x) g_assert_not_reached (); - + for (k = 0; k < m->num_bblocks; ++k) m->bblocks [k]->flags &= ~BB_VISITED; @@ -260,7 +260,7 @@ compute_dominance_frontier (MonoCompile *cfg) } static void -df_set (MonoCompile *m, MonoBitSet* dest, MonoBitSet *set) +df_set (MonoCompile *m, MonoBitSet* dest, MonoBitSet *set) { int i; @@ -285,11 +285,11 @@ mono_compile_iterated_dfrontier (MonoCompile *m, MonoBitSet *set) df_set (m, result, result); count2 = mono_bitset_count (result); } while (count2 > count1); - + return result; } -void +void mono_compile_dominator_info (MonoCompile *cfg, int dom_flags) { if ((dom_flags & MONO_COMP_DOM) && !(cfg->comp_done & MONO_COMP_DOM)) @@ -301,7 +301,7 @@ mono_compile_dominator_info (MonoCompile *cfg, int dom_flags) /* * code to detect loops and loop nesting level */ -void +void mono_compute_natural_loops (MonoCompile *cfg) { int i, j, k; @@ -340,8 +340,8 @@ mono_compute_natural_loops (MonoCompile *cfg) mono_bitset_set_fast (in_loop_blocks, b->dfn); } } - todo = g_slist_prepend (NULL, n); - + todo = g_slist_prepend (NULL, n); + while (todo) { MonoBasicBlock *cb = (MonoBasicBlock *)todo->data; todo = g_slist_delete_link (todo, todo); @@ -424,27 +424,27 @@ static void clear_idominators (MonoCompile *cfg) { guint i; - + for (i = 0; i < cfg->num_bblocks; ++i) { if (cfg->bblocks[i]->dominated) { cfg->bblocks[i]->dominated = NULL; } } - cfg->comp_done &= ~MONO_COMP_IDOM; + cfg->comp_done &= ~MONO_COMP_IDOM; } static void clear_loops (MonoCompile *cfg) { guint i; - + for (i = 0; i < cfg->num_bblocks; ++i) { cfg->bblocks[i]->nesting = 0; cfg->bblocks[i]->loop_blocks = NULL; } - cfg->comp_done &= ~MONO_COMP_LOOPS; + cfg->comp_done &= ~MONO_COMP_LOOPS; } void diff --git a/src/mono/mono/mini/exceptions-arm.c b/src/mono/mono/mini/exceptions-arm.c index 146cf26e1e3664..afa4a5f976c14e 100644 --- a/src/mono/mono/mini/exceptions-arm.c +++ b/src/mono/mono/mini/exceptions-arm.c @@ -61,7 +61,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) start = code = mono_global_codeman_reserve (128); - /* + /* * Move things to their proper place so we can restore all the registers with * one instruction. */ @@ -99,7 +99,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) * arch_get_call_filter: * * Returns a pointer to a method which calls an exception filter. We - * also use this function to call finally handlers (we pass NULL as + * also use this function to call finally handlers (we pass NULL as * @exc object in this case). */ gpointer @@ -214,13 +214,13 @@ mono_arm_resume_unwind (guint32 dummy1, host_mgreg_t pc, host_mgreg_t sp, host_m /** * get_throw_trampoline: * - * Returns a function pointer which can be used to raise - * exceptions. The returned function has the following + * Returns a function pointer which can be used to raise + * exceptions. The returned function has the following * signature: void (*func) (MonoException *exc); or * void (*func) (guint32 ex_token, guint8* ip); * */ -static gpointer +static gpointer get_throw_trampoline (int size, gboolean corlib, gboolean rethrow, gboolean llvm, gboolean resume_unwind, const char *tramp_name, MonoTrampInfo **info, gboolean aot, gboolean preserve_ips) { guint8 *start; @@ -335,16 +335,16 @@ get_throw_trampoline (int size, gboolean corlib, gboolean rethrow, gboolean llvm /** * arch_get_throw_exception: * - * Returns a function pointer which can be used to raise - * exceptions. The returned function has the following - * signature: void (*func) (MonoException *exc); + * Returns a function pointer which can be used to raise + * exceptions. The returned function has the following + * signature: void (*func) (MonoException *exc); * For example to raise an arithmetic exception you can use: * - * x86_push_imm (code, mono_get_exception_arithmetic ()); - * x86_call_code (code, arch_get_throw_exception ()); + * x86_push_imm (code, mono_get_exception_arithmetic ()); + * x86_call_code (code, arch_get_throw_exception ()); * */ -gpointer +gpointer mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot) { return get_throw_trampoline (132, FALSE, FALSE, FALSE, FALSE, "throw_exception", info, aot, FALSE); @@ -353,9 +353,9 @@ mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot) /** * mono_arch_get_rethrow_exception: * - * Returns a function pointer which can be used to rethrow - * exceptions. The returned function has the following - * signature: void (*func) (MonoException *exc); + * Returns a function pointer which can be used to rethrow + * exceptions. The returned function has the following + * signature: void (*func) (MonoException *exc); * */ gpointer @@ -364,7 +364,7 @@ mono_arch_get_rethrow_exception (MonoTrampInfo **info, gboolean aot) return get_throw_trampoline (132, FALSE, TRUE, FALSE, FALSE, "rethrow_exception", info, aot, FALSE); } -gpointer +gpointer mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) { return get_throw_trampoline (132, FALSE, TRUE, FALSE, FALSE, "rethrow_preserve_exception", info, aot, TRUE); @@ -372,19 +372,19 @@ mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) /** * mono_arch_get_throw_corlib_exception: - * \returns a function pointer which can be used to raise - * corlib exceptions. The returned function has the following - * signature: void (*func) (guint32 ex_token, guint32 offset); - * Here, \c offset is the offset which needs to be substracted from the caller IP - * to get the IP of the throw. Passing the offset has the advantage that it + * \returns a function pointer which can be used to raise + * corlib exceptions. The returned function has the following + * signature: void (*func) (guint32 ex_token, guint32 offset); + * Here, \c offset is the offset which needs to be substracted from the caller IP + * to get the IP of the throw. Passing the offset has the advantage that it * needs no relocations in the caller. * On ARM, the ip is passed instead of an offset. */ -gpointer +gpointer mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot) { return get_throw_trampoline (168, TRUE, FALSE, FALSE, FALSE, "throw_corlib_exception", info, aot, FALSE); -} +} GSList* mono_arm_get_exception_trampolines (gboolean aot) @@ -398,7 +398,7 @@ mono_arm_get_exception_trampolines (gboolean aot) get_throw_trampoline (168, TRUE, FALSE, FALSE, FALSE, "llvm_throw_corlib_exception_trampoline", &info, aot, FALSE); info->jit_icall_info = &mono_get_jit_icall_info ()->mono_llvm_throw_corlib_exception_trampoline; tramps = g_slist_prepend (tramps, info); - + get_throw_trampoline (168, TRUE, FALSE, TRUE, FALSE, "llvm_throw_corlib_exception_abs_trampoline", &info, aot, FALSE); info->jit_icall_info = &mono_get_jit_icall_info ()->mono_llvm_throw_corlib_exception_abs_trampoline; tramps = g_slist_prepend (tramps, info); @@ -426,7 +426,7 @@ mono_arch_exceptions_init (void) { gpointer tramp; GSList *tramps, *l; - + if (mono_aot_only) { // FIXME Macroize. @@ -451,7 +451,7 @@ mono_arch_exceptions_init (void) } } -/* +/* * mono_arch_unwind_frame: * * See exceptions-amd64.c for docs; @@ -525,7 +525,7 @@ mono_arch_unwind_frame (MonoJitTlsData *jit_tls, g_assert ((((guint64)(*lmf)->previous_lmf) & 2) == 0); frame->type = FRAME_TYPE_MANAGED_TO_NATIVE; - + if ((ji = mini_jit_info_table_find ((gpointer)(gsize)(*lmf)->ip))) { frame->ji = ji; } else { @@ -635,7 +635,7 @@ mono_arch_handle_exception (void *ctx, gpointer obj) result = mono_handle_exception (&mctx, obj); /* restore the context so that returning from the signal handler will invoke - * the catch clause + * the catch clause */ mono_monoctx_to_sigctx (&mctx, ctx); return result; diff --git a/src/mono/mono/mini/exceptions-arm64.c b/src/mono/mono/mini/exceptions-arm64.c index 30f0612f4fe88b..adf650de2d02ee 100644 --- a/src/mono/mono/mini/exceptions-arm64.c +++ b/src/mono/mono/mini/exceptions-arm64.c @@ -59,7 +59,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) /* ip0 = sp */ arm_ldrx (code, ARMREG_IP0, ctx_reg, MONO_STRUCT_OFFSET (MonoContext, regs) + (ARMREG_SP * 8)); /* Restore sp, ctx is no longer valid */ - arm_movspx (code, ARMREG_SP, ARMREG_IP0); + arm_movspx (code, ARMREG_SP, ARMREG_IP0); /* Branch to pc */ code = mono_arm_emit_brx (code, ARMREG_IP1); /* Not reached */ @@ -166,7 +166,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) return MINI_ADDR_TO_FTNPTR (start); } -static gpointer +static gpointer get_throw_trampoline (int size, gboolean corlib, gboolean rethrow, gboolean llvm, gboolean resume_unwind, const char *tramp_name, MonoTrampInfo **info, gboolean aot, gboolean preserve_ips) { guint8 *start, *code; @@ -206,7 +206,7 @@ get_throw_trampoline (int size, gboolean corlib, gboolean rethrow, gboolean llvm arm_ldrx (code, ARMREG_IP0, ARMREG_FP, 0); arm_strx (code, ARMREG_IP0, ARMREG_FP, gregs_offset + (ARMREG_FP * 8)); arm_addx_imm (code, ARMREG_IP0, ARMREG_FP, frame_size); - arm_strx (code, ARMREG_IP0, ARMREG_FP, gregs_offset + (ARMREG_SP * 8)); + arm_strx (code, ARMREG_IP0, ARMREG_FP, gregs_offset + (ARMREG_SP * 8)); /* Save fregs */ for (i = 0; i < num_fregs; ++i) arm_strfpx (code, ARMREG_D8 + i, ARMREG_FP, fregs_offset + (i * 8)); @@ -270,7 +270,7 @@ get_throw_trampoline (int size, gboolean corlib, gboolean rethrow, gboolean llvm return MINI_ADDR_TO_FTNPTR (start); } -gpointer +gpointer mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot) { return get_throw_trampoline (256, FALSE, FALSE, FALSE, FALSE, "throw_exception", info, aot, FALSE); @@ -288,7 +288,7 @@ mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) return get_throw_trampoline (256, FALSE, TRUE, FALSE, FALSE, "rethrow_preserve_exception", info, aot, TRUE); } -gpointer +gpointer mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot) { return get_throw_trampoline (256, TRUE, FALSE, FALSE, FALSE, "throw_corlib_exception", info, aot, FALSE); @@ -423,14 +423,14 @@ mono_arm_resume_unwind (gpointer arg, host_mgreg_t pc, host_mgreg_t *int_regs, g mono_resume_unwind (&ctx); } -/* +/* * mono_arch_unwind_frame: * * See exceptions-amd64.c for docs; */ gboolean -mono_arch_unwind_frame (MonoJitTlsData *jit_tls, - MonoJitInfo *ji, MonoContext *ctx, +mono_arch_unwind_frame (MonoJitTlsData *jit_tls, + MonoJitInfo *ji, MonoContext *ctx, MonoContext *new_ctx, MonoLMF **lmf, host_mgreg_t **save_locations, StackFrameInfo *frame) diff --git a/src/mono/mono/mini/exceptions-mips.c b/src/mono/mono/mini/exceptions-mips.c index eea3b637eee1d7..9e26eef50080fe 100644 --- a/src/mono/mono/mini/exceptions-mips.c +++ b/src/mono/mono/mini/exceptions-mips.c @@ -88,7 +88,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) * mono_arch_get_call_filter: * * Returns a pointer to a method which calls an exception filter. We - * also use this function to call finally handlers (we pass NULL as + * also use this function to call finally handlers (we pass NULL as * @exc object in this case). * * This function is invoked as @@ -222,13 +222,13 @@ throw_exception (MonoObject *exc, unsigned long eip, unsigned long esp, gboolean /** * arch_get_throw_exception_generic: * - * Returns a function pointer which can be used to raise - * exceptions. The returned function has the following + * Returns a function pointer which can be used to raise + * exceptions. The returned function has the following * signature: void (*func) (MonoException *exc); or * void (*func) (char *exc_name); * */ -static gpointer +static gpointer mono_arch_get_throw_exception_generic (guint8 *start, int size, int corlib, gboolean rethrow, gboolean preserve_ips) { guint8 *code; @@ -298,9 +298,9 @@ mono_arch_get_throw_exception_generic (guint8 *start, int size, int corlib, gboo /** * mono_arch_get_rethrow_exception: - * \returns a function pointer which can be used to rethrow - * exceptions. The returned function has the following - * signature: void (*func) (MonoException *exc); + * \returns a function pointer which can be used to rethrow + * exceptions. The returned function has the following + * signature: void (*func) (MonoException *exc); */ gpointer mono_arch_get_rethrow_exception (MonoTrampInfo **info, gboolean aot) @@ -323,8 +323,8 @@ mono_arch_get_rethrow_exception (MonoTrampInfo **info, gboolean aot) * mono_arch_get_rethrow_preserve_exception: * \returns a function pointer which can be used to rethrow * exceptions while avoiding modification of saved trace_ips. - * The returned function has the following - * signature: void (*func) (MonoException *exc); + * The returned function has the following + * signature: void (*func) (MonoException *exc); */ gpointer mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) @@ -346,13 +346,13 @@ mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) /** * arch_get_throw_exception: * - * Returns a function pointer which can be used to raise - * exceptions. The returned function has the following - * signature: void (*func) (MonoException *exc); + * Returns a function pointer which can be used to raise + * exceptions. The returned function has the following + * signature: void (*func) (MonoException *exc); * For example to raise an arithmetic exception you can use: * - * x86_push_imm (code, mono_get_exception_arithmetic ()); - * x86_call_code (code, arch_get_throw_exception ()); + * x86_push_imm (code, mono_get_exception_arithmetic ()); + * x86_call_code (code, arch_get_throw_exception ()); * */ gpointer @@ -372,13 +372,13 @@ mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot) return start; } -gpointer +gpointer mono_arch_get_throw_exception_by_name (void) { guint8 *start, *code; int size = 64; - /* Not used on MIPS */ + /* Not used on MIPS */ start = code = mono_global_codeman_reserve (size); mips_break (code, 0xfd); mono_arch_flush_icache (start, code - start); @@ -388,9 +388,9 @@ mono_arch_get_throw_exception_by_name (void) /** * mono_arch_get_throw_corlib_exception: - * \returns a function pointer which can be used to raise - * corlib exceptions. The returned function has the following - * signature: void (*func) (guint32 ex_token, guint32 offset); + * \returns a function pointer which can be used to raise + * corlib exceptions. The returned function has the following + * signature: void (*func) (guint32 ex_token, guint32 offset); * On MIPS, the offset argument is missing. */ gpointer @@ -419,9 +419,9 @@ mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot) * Returns TRUE on success, FALSE otherwise. */ gboolean -mono_arch_unwind_frame (MonoJitTlsData *jit_tls, - MonoJitInfo *ji, MonoContext *ctx, - MonoContext *new_ctx, MonoLMF **lmf, +mono_arch_unwind_frame (MonoJitTlsData *jit_tls, + MonoJitInfo *ji, MonoContext *ctx, + MonoContext *new_ctx, MonoLMF **lmf, host_mgreg_t **save_locations, StackFrameInfo *frame) { @@ -448,7 +448,7 @@ mono_arch_unwind_frame (MonoJitTlsData *jit_tls, for (i = 0; i < MONO_MAX_IREGS; ++i) regs [i] = new_ctx->sc_regs [i]; - gboolean success = mono_unwind_frame (unwind_info, unwind_info_len, ji->code_start, + gboolean success = mono_unwind_frame (unwind_info, unwind_info_len, ji->code_start, (guint8*)ji->code_start + ji->code_size, ip, NULL, regs, MONO_MAX_IREGS, save_locations, MONO_MAX_IREGS, &cfa); @@ -562,7 +562,7 @@ mono_arch_handle_exception (void *ctx, gpointer obj) result = mono_handle_exception (&mctx, obj); /* restore the context so that returning from the signal handler will invoke - * the catch clause + * the catch clause */ mono_monoctx_to_sigctx (&mctx, ctx); return result; diff --git a/src/mono/mono/mini/exceptions-ppc.c b/src/mono/mono/mini/exceptions-ppc.c index d1584191ff6afb..829da843d282a9 100644 --- a/src/mono/mono/mini/exceptions-ppc.c +++ b/src/mono/mono/mini/exceptions-ppc.c @@ -36,62 +36,62 @@ /* struct sigcontext { - int sc_onstack; // sigstack state to restore - int sc_mask; // signal mask to restore - int sc_ir; // pc - int sc_psw; // processor status word - int sc_sp; // stack pointer if sc_regs == NULL - void *sc_regs; // (kernel private) saved state + int sc_onstack; // sigstack state to restore + int sc_mask; // signal mask to restore + int sc_ir; // pc + int sc_psw; // processor status word + int sc_sp; // stack pointer if sc_regs == NULL + void *sc_regs; // (kernel private) saved state }; struct ucontext { int uc_onstack; - sigset_t uc_sigmask; // signal mask used by this context - stack_t uc_stack; // stack used by this context - struct ucontext *uc_link; // pointer to resuming context - size_t uc_mcsize; // size of the machine context passed in - mcontext_t uc_mcontext; // machine specific context + sigset_t uc_sigmask; // signal mask used by this context + stack_t uc_stack; // stack used by this context + struct ucontext *uc_link; // pointer to resuming context + size_t uc_mcsize; // size of the machine context passed in + mcontext_t uc_mcontext; // machine specific context }; typedef struct ppc_exception_state { - unsigned long dar; // Fault registers for coredump + unsigned long dar; // Fault registers for coredump unsigned long dsisr; - unsigned long exception;// number of powerpc exception taken - unsigned long pad0; // align to 16 bytes + unsigned long exception;// number of powerpc exception taken + unsigned long pad0; // align to 16 bytes - unsigned long pad1[4]; // space in PCB "just in case" + unsigned long pad1[4]; // space in PCB "just in case" } ppc_exception_state_t; typedef struct ppc_vector_state { unsigned long save_vr[32][4]; unsigned long save_vscr[4]; unsigned int save_pad5[4]; - unsigned int save_vrvalid; // VRs that have been saved + unsigned int save_vrvalid; // VRs that have been saved unsigned int save_pad6[7]; } ppc_vector_state_t; typedef struct ppc_float_state { double fpregs[32]; - unsigned int fpscr_pad; // fpscr is 64 bits, 32 bits of rubbish - unsigned int fpscr; // floating point status register + unsigned int fpscr_pad; // fpscr is 64 bits, 32 bits of rubbish + unsigned int fpscr; // floating point status register } ppc_float_state_t; typedef struct ppc_thread_state { - unsigned int srr0; // Instruction address register (PC) - unsigned int srr1; // Machine state register (supervisor) + unsigned int srr0; // Instruction address register (PC) + unsigned int srr1; // Machine state register (supervisor) unsigned int r0; unsigned int r1; unsigned int r2; - ... + ... unsigned int r31; - unsigned int cr; // Condition register - unsigned int xer; // User's integer exception register - unsigned int lr; // Link register - unsigned int ctr; // Count register - unsigned int mq; // MQ register (601 only) + unsigned int cr; // Condition register + unsigned int xer; // User's integer exception register + unsigned int lr; // Link register + unsigned int ctr; // Count register + unsigned int mq; // MQ register (601 only) - unsigned int vrsave; // Vector Save Register + unsigned int vrsave; // Vector Save Register } ppc_thread_state_t; struct mcontext { @@ -115,19 +115,19 @@ struct pt_regs { unsigned long gpr[32]; unsigned long nip; unsigned long msr; - unsigned long orig_gpr3; // Used for restarting system calls + unsigned long orig_gpr3; // Used for restarting system calls unsigned long ctr; unsigned long link; unsigned long xer; unsigned long ccr; - unsigned long mq; // 601 only (not used at present) - // Used on APUS to hold IPL value. - unsigned long trap; // Reason for being here + unsigned long mq; // 601 only (not used at present) + // Used on APUS to hold IPL value. + unsigned long trap; // Reason for being here // N.B. for critical exceptions on 4xx, the dar and dsisr - // fields are overloaded to hold srr0 and srr1. - unsigned long dar; // Fault registers - unsigned long dsisr; // on 4xx/Book-E used for ESR - unsigned long result; // Result of a system call + // fields are overloaded to hold srr0 and srr1. + unsigned long dar; // Fault registers + unsigned long dsisr; // on 4xx/Book-E used for ESR + unsigned long result; // Result of a system call }; struct mcontext { elf_gregset_t mc_gregs; @@ -141,22 +141,22 @@ struct ucontext { struct ucontext *uc_link; stack_t uc_stack; int uc_pad[7]; - struct mcontext *uc_regs; // points to uc_mcontext field + struct mcontext *uc_regs; // points to uc_mcontext field sigset_t uc_sigmask; - // glibc has 1024-bit signal masks, ours are 64-bit + // glibc has 1024-bit signal masks, ours are 64-bit int uc_maskext[30]; int uc_pad2[3]; struct mcontext uc_mcontext; }; -#define ELF_NGREG 48 // includes nip, msr, lr, etc. -#define ELF_NFPREG 33 // includes fpscr +#define ELF_NGREG 48 // includes nip, msr, lr, etc. +#define ELF_NFPREG 33 // includes fpscr -// General registers +// General registers typedef unsigned long elf_greg_t; typedef elf_greg_t elf_gregset_t[ELF_NGREG]; -// Floating point registers +// Floating point registers typedef double elf_fpreg_t; typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; @@ -256,7 +256,7 @@ emit_save_saved_regs (guint8 *code, int pos) * mono_arch_get_call_filter: * * Returns a pointer to a method which calls an exception filter. We - * also use this function to call finally handlers (we pass NULL as + * also use this function to call finally handlers (we pass NULL as * @exc object in this case). */ gpointer @@ -357,8 +357,8 @@ mono_ppc_throw_exception (MonoObject *exc, unsigned long eip, unsigned long esp, /** * arch_get_throw_exception_generic: * - * Returns a function pointer which can be used to raise - * exceptions. The returned function has the following + * Returns a function pointer which can be used to raise + * exceptions. The returned function has the following * signature: void (*func) (MonoException *exc); or * void (*func) (guint32 ex_token, gpointer ip) * @@ -461,8 +461,8 @@ mono_arch_get_throw_exception_generic (int size, MonoTrampInfo **info, int corli * mono_arch_get_rethrow_preserve_exception: * \returns a function pointer which can be used to rethrow * exceptions and completely preserve trace_ips. - * The returned function has the following - * signature: void (*func) (MonoException *exc); + * The returned function has the following + * signature: void (*func) (MonoException *exc); */ gpointer mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) @@ -476,9 +476,9 @@ mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) /** * mono_arch_get_rethrow_exception: - * \returns a function pointer which can be used to rethrow - * exceptions. The returned function has the following - * signature: void (*func) (MonoException *exc); + * \returns a function pointer which can be used to rethrow + * exceptions. The returned function has the following + * signature: void (*func) (MonoException *exc); */ gpointer mono_arch_get_rethrow_exception (MonoTrampInfo **info, gboolean aot) @@ -493,13 +493,13 @@ mono_arch_get_rethrow_exception (MonoTrampInfo **info, gboolean aot) /** * arch_get_throw_exception: * - * Returns a function pointer which can be used to raise - * exceptions. The returned function has the following - * signature: void (*func) (MonoException *exc); + * Returns a function pointer which can be used to raise + * exceptions. The returned function has the following + * signature: void (*func) (MonoException *exc); * For example to raise an arithmetic exception you can use: * - * x86_push_imm (code, mono_get_exception_arithmetic ()); - * x86_call_code (code, arch_get_throw_exception ()); + * x86_push_imm (code, mono_get_exception_arithmetic ()); + * x86_call_code (code, arch_get_throw_exception ()); * */ gpointer @@ -514,9 +514,9 @@ mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot) /** * mono_arch_get_throw_corlib_exception: - * \returns a function pointer which can be used to raise - * corlib exceptions. The returned function has the following - * signature: void (*func) (guint32 ex_token, guint32 offset); + * \returns a function pointer which can be used to raise + * corlib exceptions. The returned function has the following + * signature: void (*func) (guint32 ex_token, guint32 offset); * On PPC, we pass the ip instead of the offset */ gpointer @@ -535,8 +535,8 @@ mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot) * See exceptions-amd64.c for docs. */ gboolean -mono_arch_unwind_frame (MonoJitTlsData *jit_tls, - MonoJitInfo *ji, MonoContext *ctx, +mono_arch_unwind_frame (MonoJitTlsData *jit_tls, + MonoJitInfo *ji, MonoContext *ctx, MonoContext *new_ctx, MonoLMF **lmf, host_mgreg_t **save_locations, StackFrameInfo *frame) @@ -581,7 +581,7 @@ mono_arch_unwind_frame (MonoJitTlsData *jit_tls, for (i = MONO_PPC_FIRST_SAVED_GREG; i < MONO_MAX_IREGS; ++i) regs [i] = ctx->regs [i]; - gboolean success = mono_unwind_frame (unwind_info, unwind_info_len, (guint8*)ji->code_start, + gboolean success = mono_unwind_frame (unwind_info, unwind_info_len, (guint8*)ji->code_start, (guint8*)ji->code_start + ji->code_size, (guint8*)ip, NULL, regs, ppc_lr + 1, save_locations, MONO_MAX_IREGS, &cfa); @@ -599,7 +599,7 @@ mono_arch_unwind_frame (MonoJitTlsData *jit_tls, return TRUE; } else if (*lmf) { - + if ((ji = mini_jit_info_table_find ((gpointer)(*lmf)->eip))) { } else { if (!(*lmf)->method) @@ -796,7 +796,7 @@ mono_arch_handle_exception (void *ctx, gpointer obj) result = mono_handle_exception (&mctx, obj); /* restore the context so that returning from the signal handler will invoke - * the catch clause + * the catch clause */ mono_monoctx_to_sigctx (&mctx, ctx); return result; diff --git a/src/mono/mono/mini/exceptions-s390x.c b/src/mono/mono/mini/exceptions-s390x.c index c1e0e420c68737..c13ede7e922fdc 100644 --- a/src/mono/mono/mini/exceptions-s390x.c +++ b/src/mono/mono/mini/exceptions-s390x.c @@ -70,9 +70,9 @@ /* P r o t o t y p e s */ /*------------------------------------------------------------------*/ -static void throw_exception (MonoObject *, unsigned long, unsigned long, +static void throw_exception (MonoObject *, unsigned long, unsigned long, host_mgreg_t *, gdouble *, gint32 *, guint, gboolean, gboolean); -static gpointer mono_arch_get_throw_exception_generic (int, MonoTrampInfo **, +static gpointer mono_arch_get_throw_exception_generic (int, MonoTrampInfo **, int, gboolean, gboolean, gboolean); static void handle_signal_exception (gpointer); @@ -169,7 +169,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) /*------------------------------------------------------*/ /* Load all registers with values from the context */ /*------------------------------------------------------*/ - s390_lmg (code, s390_r3, s390_r12, s390_r13, + s390_lmg (code, s390_r3, s390_r12, s390_r13, G_STRUCT_OFFSET(MonoContext, uc_mcontext.gregs[3])); pos = G_STRUCT_OFFSET(MonoContext, uc_mcontext.fpregs.fprs[0]); for (i = 0; i < 16; ++i) { @@ -222,7 +222,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) s390_lmg (code, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET); s390_br (code, s390_r14); - g_assert ((code - start) < SZ_THROW); + g_assert ((code - start) < SZ_THROW); mono_arch_flush_icache(start, code - start); MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL)); @@ -246,7 +246,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) /*------------------------------------------------------------------*/ static void -throw_exception (MonoObject *exc, unsigned long ip, unsigned long sp, +throw_exception (MonoObject *exc, unsigned long ip, unsigned long sp, host_mgreg_t *int_regs, gdouble *fp_regs, gint32 *acc_regs, guint fpc, gboolean rethrow, gboolean preserve_ips) { @@ -271,7 +271,7 @@ throw_exception (MonoObject *exc, unsigned long ip, unsigned long sp, MONO_CONTEXT_SET_BP (&ctx, sp); MONO_CONTEXT_SET_IP (&ctx, ip); - + if (mono_object_isinst_checked (exc, mono_defaults.exception_class, error)) { MonoException *mono_ex = (MonoException*)exc; if (!rethrow && !mono_ex->caught_in_unmanaged) { @@ -303,8 +303,8 @@ throw_exception (MonoObject *exc, unsigned long ip, unsigned long sp, /* */ /*------------------------------------------------------------------*/ -static gpointer -mono_arch_get_throw_exception_generic (int size, MonoTrampInfo **info, int corlib, +static gpointer +mono_arch_get_throw_exception_generic (int size, MonoTrampInfo **info, int corlib, gboolean rethrow, gboolean aot, gboolean preserve_ips) { guint8 *code, *start; @@ -387,9 +387,9 @@ mono_arch_get_throw_exception_generic (int size, MonoTrampInfo **info, int corli MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_EXCEPTION_HANDLING, NULL)); if (info) - *info = mono_tramp_info_create (corlib ? "throw_corlib_exception" - : (rethrow ? "rethrow_exception" - : (preserve_ips ? "rethrow_preserve_exception" + *info = mono_tramp_info_create (corlib ? "throw_corlib_exception" + : (rethrow ? "rethrow_exception" + : (preserve_ips ? "rethrow_preserve_exception" : "throw_exception")), start, code - start, ji, unwind_ops); @@ -433,7 +433,7 @@ mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot) /* */ /*------------------------------------------------------------------*/ -gpointer +gpointer mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) { g_assert (!aot); @@ -456,7 +456,7 @@ mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) /* */ /*------------------------------------------------------------------*/ -gpointer +gpointer mono_arch_get_rethrow_exception (MonoTrampInfo **info, gboolean aot) { g_assert (!aot); @@ -487,7 +487,7 @@ mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot) *info = NULL; return (mono_arch_get_throw_exception_generic (SZ_THROW, info, TRUE, FALSE, aot, FALSE)); -} +} /*========================= End of Function ========================*/ @@ -500,8 +500,8 @@ mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot) /*------------------------------------------------------------------*/ gboolean -mono_arch_unwind_frame (MonoJitTlsData *jit_tls, - MonoJitInfo *ji, MonoContext *ctx, +mono_arch_unwind_frame (MonoJitTlsData *jit_tls, + MonoJitInfo *ji, MonoContext *ctx, MonoContext *new_ctx, MonoLMF **lmf, host_mgreg_t **save_locations, StackFrameInfo *frame) @@ -548,7 +548,7 @@ mono_arch_unwind_frame (MonoJitTlsData *jit_tls, MONO_CONTEXT_SET_IP(new_ctx, regs[14] - 2); MONO_CONTEXT_SET_BP(new_ctx, regs[15]); MONO_CONTEXT_SET_SP(new_ctx, regs[15]); - + return TRUE; } else if (*lmf) { @@ -556,7 +556,7 @@ mono_arch_unwind_frame (MonoJitTlsData *jit_tls, if (!ji) { if (!(*lmf)->method) return FALSE; - + frame->method = (*lmf)->method; } @@ -782,7 +782,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) /*========================= End of Function ========================*/ /** - * + * * @brief Setup CTX so execution resumes at FUNC * * @param[in] Context to be resumed @@ -829,19 +829,19 @@ mono_arch_is_int_overflow (void *uc, void *info) /*----------------------------------------------------------*/ switch (code[0]) { case 0x1d : /* Divide Register */ - regNo = code[1] & 0x0f; + regNo = code[1] & 0x0f; if (ctx->uc_mcontext.gregs[regNo] == 0) arithExc = FALSE; break; case 0x5d : /* Divide */ - regNo = (code[2] & 0xf0 >> 8); + regNo = (code[2] & 0xf0 >> 8); idxNo = (code[1] & 0x0f); offset = *((guint16 *) code+2) & 0x0fff; operand = (guint64*)(ctx->uc_mcontext.gregs[regNo] + offset); if (idxNo != 0) operand += ctx->uc_mcontext.gregs[idxNo]; if (*operand == 0) - arithExc = FALSE; + arithExc = FALSE; break; case 0xb9 : /* DL[GR] or DS[GR] */ if ((code[1] == 0x97) || (code[1] == 0x87) || @@ -854,15 +854,15 @@ mono_arch_is_int_overflow (void *uc, void *info) case 0xe3 : /* DL[G] | DS[G] */ if ((code[5] == 0x97) || (code[5] == 0x87) || (code[5] == 0x0d) || (code[5] == 0x1d)) { - regNo = (code[2] & 0xf0 >> 8); + regNo = (code[2] & 0xf0 >> 8); idxNo = (code[1] & 0x0f); - offset = (code[2] & 0x0f << 8) + + offset = (code[2] & 0x0f << 8) + code[3] + (code[4] << 12); operand = (guint64*)(ctx->uc_mcontext.gregs[regNo] + offset); if (idxNo != 0) operand += ctx->uc_mcontext.gregs[idxNo]; if (*operand == 0) - arithExc = FALSE; + arithExc = FALSE; } break; default: diff --git a/src/mono/mono/mini/exceptions-sparc.c b/src/mono/mono/mini/exceptions-sparc.c index bd41fdbe55ebb3..01dc27d1acf600 100644 --- a/src/mono/mono/mini/exceptions-sparc.c +++ b/src/mono/mono/mini/exceptions-sparc.c @@ -76,7 +76,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) * mono_arch_get_call_filter: * * Returns a pointer to a method which calls an exception filter. We - * also use this function to call finally handlers (we pass NULL as + * also use this function to call finally handlers (we pass NULL as * @exc object in this case). * * call_filter (MonoContext *ctx, gpointer ip) @@ -127,7 +127,7 @@ mono_arch_get_call_filter (MonoTrampInfo **info, gboolean aot) sparc_mov_reg_reg (code, sparc_fp, sparc_o7); - /* + /* * Modify the second frame so it is identical to the one used in the * method containing the filter. */ @@ -173,7 +173,7 @@ throw_exception (MonoObject *exc, gpointer sp, gpointer ip, gboolean rethrow, gb MonoContext ctx; static void (*restore_context) (MonoContext *); gpointer *window; - + if (!restore_context) restore_context = mono_get_restore_context (); @@ -198,7 +198,7 @@ throw_exception (MonoObject *exc, gpointer sp, gpointer ip, gboolean rethrow, gb g_assert_not_reached (); } -static gpointer +static gpointer get_throw_exception (gboolean rethrow, gboolean preserve_ips) { guint32 *start, *code; @@ -228,8 +228,8 @@ get_throw_exception (gboolean rethrow, gboolean preserve_ips) /** * mono_arch_get_throw_exception: * \returns a function pointer which can be used to raise exceptions. - * The returned function has the following - * signature: void (*func) (MonoException *exc); + * The returned function has the following + * signature: void (*func) (MonoException *exc); */ gpointer mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot) @@ -293,11 +293,11 @@ mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) /** * mono_arch_get_throw_corlib_exception: - * \returns a function pointer which can be used to raise - * corlib exceptions. The returned function has the following - * signature: void (*func) (guint32 ex_token, guint32 offset); - * Here, offset is the offset which needs to be substracted from the caller IP - * to get the IP of the throw. Passing the offset has the advantage that it + * \returns a function pointer which can be used to raise + * corlib exceptions. The returned function has the following + * signature: void (*func) (guint32 ex_token, guint32 offset); + * Here, offset is the offset which needs to be substracted from the caller IP + * to get the IP of the throw. Passing the offset has the advantage that it * needs no relocations in the caller. */ gpointer @@ -356,16 +356,16 @@ mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot) /* mono_arch_unwind_frame: * - * This function is used to gather information from @ctx. It return the + * This function is used to gather information from @ctx. It return the * MonoJitInfo of the corresponding function, unwinds one stack frame and - * stores the resulting context into @new_ctx. It also stores a string + * stores the resulting context into @new_ctx. It also stores a string * describing the stack location into @trace (if not NULL), and modifies - * the @lmf if necessary. @native_offset return the IP offset from the + * the @lmf if necessary. @native_offset return the IP offset from the * start of the function or -1 if that info is not available. */ gboolean -mono_arch_unwind_frame (MonoJitTlsData *jit_tls, - MonoJitInfo *ji, MonoContext *ctx, +mono_arch_unwind_frame (MonoJitTlsData *jit_tls, + MonoJitInfo *ji, MonoContext *ctx, MonoContext *new_ctx, MonoLMF **lmf, host_mgreg_t **save_locations, StackFrameInfo *frame) @@ -490,7 +490,7 @@ mono_arch_handle_exception (void *sigctx, gpointer obj) mctx.fp = window [sparc_fp - 16]; mono_handle_exception (&mctx, obj); - + /* We can't use restore_context to return from a signal handler */ ctx->uc_mcontext.gregs [REG_PC] = mctx.ip; ctx->uc_mcontext.gregs [REG_nPC] = mctx.ip + 4; diff --git a/src/mono/mono/mini/exceptions-wasm.c b/src/mono/mono/mini/exceptions-wasm.c index 05a1cbad2f3ebd..14545de35369b0 100644 --- a/src/mono/mono/mini/exceptions-wasm.c +++ b/src/mono/mono/mini/exceptions-wasm.c @@ -38,7 +38,7 @@ wasm_throw_corlib_exception (void) } gboolean -mono_arch_unwind_frame (MonoJitTlsData *jit_tls, +mono_arch_unwind_frame (MonoJitTlsData *jit_tls, MonoJitInfo *ji, MonoContext *ctx, MonoContext *new_ctx, MonoLMF **lmf, host_mgreg_t **save_locations, @@ -96,7 +96,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) *info = mono_tramp_info_create ("restore_context", (guint8*)wasm_restore_context, 1, NULL, NULL); return (gpointer)wasm_restore_context; } -gpointer +gpointer mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot) { if (info) diff --git a/src/mono/mono/mini/exceptions-x86.c b/src/mono/mono/mini/exceptions-x86.c index 1c451717415c6a..db6a76e5e06ed6 100644 --- a/src/mono/mono/mini/exceptions-x86.c +++ b/src/mono/mono/mini/exceptions-x86.c @@ -130,19 +130,19 @@ mono_win32_get_handle_stackoverflow (void) * * Stack walking part of this method is from mono_handle_exception * - * The idea is simple; + * The idea is simple; * - walk the stack to free some space (64k) * - set esp to new stack location * - call mono_arch_handle_exception with stack overflow exception * - set esp to SEH handlers stack * - done */ -static void +static void win32_handle_stack_overflow (EXCEPTION_POINTERS* ep, CONTEXT *sctx) { MonoJitInfo rji; MonoJitTlsData *jit_tls = mono_tls_get_jit_tls (); - MonoLMF *lmf = jit_tls->lmf; + MonoLMF *lmf = jit_tls->lmf; MonoContext initial_ctx; MonoContext ctx; guint32 free_stack = 0; @@ -295,7 +295,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) const int size = 128; start = code = mono_global_codeman_reserve (size); - + /* load ctx */ x86_mov_reg_membase (code, X86_EAX, X86_ESP, 4, 4); @@ -371,7 +371,7 @@ mono_arch_get_restore_context (MonoTrampInfo **info, gboolean aot) * mono_arch_get_call_filter: * * Returns a pointer to a method which calls an exception filter. We - * also use this function to call finally handlers (we pass NULL as + * also use this function to call finally handlers (we pass NULL as * @exc object in this case). */ gpointer @@ -495,7 +495,7 @@ mono_x86_throw_exception (host_mgreg_t *regs, MonoObject *exc, } void -mono_x86_throw_corlib_exception (host_mgreg_t *regs, guint32 ex_token_index, +mono_x86_throw_corlib_exception (host_mgreg_t *regs, guint32 ex_token_index, host_mgreg_t eip, gint32 pc_offset) { guint32 ex_token = MONO_TOKEN_TYPE_DEF | ex_token_index; @@ -512,7 +512,7 @@ mono_x86_throw_corlib_exception (host_mgreg_t *regs, guint32 ex_token_index, } static void -mono_x86_resume_unwind (host_mgreg_t *regs, MonoObject *exc, +mono_x86_resume_unwind (host_mgreg_t *regs, MonoObject *exc, host_mgreg_t eip, gboolean rethrow) { MonoContext ctx; @@ -535,7 +535,7 @@ mono_x86_resume_unwind (host_mgreg_t *regs, MonoObject *exc, * * Generate a call to mono_x86_throw_exception/ * mono_x86_throw_corlib_exception. - * If LLVM is true, generate code which assumes the caller is LLVM generated code, + * If LLVM is true, generate code which assumes the caller is LLVM generated code, * which doesn't push the arguments. */ static guint8* @@ -551,7 +551,7 @@ get_throw_trampoline (const char *name, gboolean rethrow, gboolean llvm, gboolea stack_size = 128; - /* + /* * On apple, the stack is misaligned by the pushing of the return address. */ if (!llvm && corlib) @@ -644,7 +644,7 @@ get_throw_trampoline (const char *name, gboolean rethrow, gboolean llvm, gboolea } else if (corlib) { x86_mov_reg_membase (code, X86_EAX, X86_ESP, stack_size + 8, 4); if (llvm_abs) { - /* + /* * The caller is LLVM code which passes the absolute address not a pc offset, * so compensate by passing 0 as 'ip' and passing the negated abs address as * the pc offset. @@ -691,28 +691,28 @@ get_throw_trampoline (const char *name, gboolean rethrow, gboolean llvm, gboolea /** * mono_arch_get_throw_exception: - * \returns a function pointer which can be used to raise - * exceptions. The returned function has the following - * signature: void (*func) (MonoException *exc); + * \returns a function pointer which can be used to raise + * exceptions. The returned function has the following + * signature: void (*func) (MonoException *exc); * For example to raise an arithmetic exception you can use: * - * x86_push_imm (code, mono_get_exception_arithmetic ()); - * x86_call_code (code, arch_get_throw_exception ()); + * x86_push_imm (code, mono_get_exception_arithmetic ()); + * x86_call_code (code, arch_get_throw_exception ()); * */ -gpointer +gpointer mono_arch_get_throw_exception (MonoTrampInfo **info, gboolean aot) { return get_throw_trampoline ("throw_exception", FALSE, FALSE, FALSE, FALSE, FALSE, info, aot, FALSE); } -gpointer +gpointer mono_arch_get_rethrow_exception (MonoTrampInfo **info, gboolean aot) { return get_throw_trampoline ("rethrow_exception", TRUE, FALSE, FALSE, FALSE, FALSE, info, aot, FALSE); } -gpointer +gpointer mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) { return get_throw_trampoline ("rethrow_preserve_exception", TRUE, FALSE, FALSE, FALSE, FALSE, info, aot, TRUE); @@ -720,14 +720,14 @@ mono_arch_get_rethrow_preserve_exception (MonoTrampInfo **info, gboolean aot) /** * mono_arch_get_throw_corlib_exception: - * \returns a function pointer which can be used to raise - * corlib exceptions. The returned function has the following - * signature: void (*func) (guint32 ex_token, guint32 offset); - * Here, offset is the offset which needs to be substracted from the caller IP - * to get the IP of the throw. Passing the offset has the advantage that it + * \returns a function pointer which can be used to raise + * corlib exceptions. The returned function has the following + * signature: void (*func) (guint32 ex_token, guint32 offset); + * Here, offset is the offset which needs to be substracted from the caller IP + * to get the IP of the throw. Passing the offset has the advantage that it * needs no relocations in the caller. */ -gpointer +gpointer mono_arch_get_throw_corlib_exception (MonoTrampInfo **info, gboolean aot) { return get_throw_trampoline ("throw_corlib_exception", FALSE, FALSE, TRUE, FALSE, FALSE, info, aot, FALSE); @@ -739,8 +739,8 @@ mono_arch_exceptions_init (void) guint8 *tramp; MonoTrampInfo *tinfo; -/* - * If we're running WoW64, we need to set the usermode exception policy +/* + * If we're running WoW64, we need to set the usermode exception policy * for SEHs to behave. This requires hotfix http://support.microsoft.com/kb/976038 * or (eventually) Windows 7 SP1. */ @@ -799,8 +799,8 @@ mono_arch_exceptions_init (void) * See exceptions-amd64.c for docs. */ gboolean -mono_arch_unwind_frame (MonoJitTlsData *jit_tls, - MonoJitInfo *ji, MonoContext *ctx, +mono_arch_unwind_frame (MonoJitTlsData *jit_tls, + MonoJitInfo *ji, MonoContext *ctx, MonoContext *new_ctx, MonoLMF **lmf, host_mgreg_t **save_locations, StackFrameInfo *frame) @@ -1074,7 +1074,7 @@ restore_soft_guard_pages (void) return NULL; } -/* +/* * this function modifies mctx so that when it is restored, it * won't execcute starting at mctx.eip, but in a function that * will restore the protection on the soft-guard pages and return back to diff --git a/src/mono/mono/mini/graph.c b/src/mono/mono/mini/graph.c index 4d6902d34a83a4..f078f9c0e95028 100644 --- a/src/mono/mono/mini/graph.c +++ b/src/mono/mono/mini/graph.c @@ -52,7 +52,7 @@ dtree_emit_one_loop_level (MonoCompile *cfg, FILE *fp, MonoBasicBlock *h) level = h->nesting; fprintf (fp, "subgraph cluster_%d {\n", h->block_num); fprintf (fp, "label=\"loop_%d\"\n", h->block_num); - } + } for (i = 1; i < cfg->num_bblocks; ++i) { bb = cfg->bblocks [i]; @@ -61,14 +61,14 @@ dtree_emit_one_loop_level (MonoCompile *cfg, FILE *fp, MonoBasicBlock *h) if (bb->nesting == level) { fprintf (fp, "BB%d -> BB%d;\n", bb->idom->block_num, bb->block_num); } - + if (bb->nesting == (level + 1) && bb->loop_blocks) { fprintf (fp, "BB%d -> BB%d;\n", bb->idom->block_num, bb->block_num); dtree_emit_one_loop_level (cfg, fp, bb); } } } - + if (h) { fprintf (fp, "}\n"); } @@ -84,7 +84,7 @@ cfg_emit_one_loop_level (MonoCompile *cfg, FILE *fp, MonoBasicBlock *h) level = h->nesting; fprintf (fp, "subgraph cluster_%d {\n", h->block_num); fprintf (fp, "label=\"loop_%d\"\n", h->block_num); - } + } for (bb = cfg->bb_entry->next_bb; bb; bb = bb->next_bb) { if (bb->region != -1) { @@ -107,18 +107,18 @@ cfg_emit_one_loop_level (MonoCompile *cfg, FILE *fp, MonoBasicBlock *h) if (!h || (g_list_find (h->loop_blocks, bb) && bb != h)) { if (bb->nesting == level) { - for (j = 0; j < bb->in_count; j++) + for (j = 0; j < bb->in_count; j++) fprintf (fp, "BB%d -> BB%d;\n", bb->in_bb [j]->block_num, bb->block_num); } - + if (bb->nesting == (level + 1) && bb->loop_blocks) { - for (j = 0; j < bb->in_count; j++) + for (j = 0; j < bb->in_count; j++) fprintf (fp, "BB%d -> BB%d;\n", bb->in_bb [j]->block_num, bb->block_num); cfg_emit_one_loop_level (cfg, fp, bb); } } } - + if (h) { fprintf (fp, "}\n"); } @@ -160,7 +160,7 @@ static void mono_draw_code_cfg (MonoCompile *cfg, FILE *fp) { MonoBasicBlock *bb; - + fprintf (fp, "digraph %s {\n", convert_name (cfg->method->name)); fprintf (fp, "node [fontsize=12.0]\nedge [len=1,color=red]\n"); fprintf (fp, "label=\"CFG for %s\";\n", mono_method_full_name (cfg->method, TRUE)); @@ -181,13 +181,13 @@ mono_draw_code_cfg (MonoCompile *cfg, FILE *fp) color = ""; fprintf (fp, "BB%d [%sshape=record,labeljust=l,label=\"{BB%d|", bb->block_num, color, bb->block_num); - + MONO_BB_FOR_EACH_INS (bb, inst) { //mono_print_label (fp, inst); - fprintf (fp, "\\n"); + fprintf (fp, "\\n"); } - fprintf (fp, "}\"];\n"); + fprintf (fp, "}\"];\n"); } cfg_emit_one_loop_level (cfg, fp, NULL); diff --git a/src/mono/mono/mini/helpers.c b/src/mono/mono/mini/helpers.c index 47525d02fec1a8..0d83439c775f81 100644 --- a/src/mono/mono/mini/helpers.c +++ b/src/mono/mono/mini/helpers.c @@ -88,20 +88,20 @@ mono_inst_name (int op) { } void -mono_blockset_print (MonoCompile *cfg, MonoBitSet *set, const char *name, guint idom) +mono_blockset_print (MonoCompile *cfg, MonoBitSet *set, const char *name, guint idom) { #ifndef DISABLE_LOGGING int i; if (name) g_print ("%s:", name); - + mono_bitset_foreach_bit (set, i, cfg->num_bblocks) { if (idom == i) g_print (" [BB%d]", cfg->bblocks [i]->block_num); else g_print (" BB%d", cfg->bblocks [i]->block_num); - + } g_print ("\n"); #endif @@ -129,11 +129,11 @@ mono_disassemble_code (MonoCompile *cfg, guint8 *code, int size, char *id) int unused G_GNUC_UNUSED; #ifdef HOST_WIN32 - as_file = g_strdup_printf ("%s/test.s", tmp); + as_file = g_strdup_printf ("%s/test.s", tmp); if (!(ofd = fopen (as_file, "w"))) g_assert_not_reached (); -#else +#else i = g_file_open_tmp (NULL, &as_file, NULL); ofd = fdopen (i, "w"); g_assert (ofd); @@ -247,14 +247,14 @@ mono_disassemble_code (MonoCompile *cfg, guint8 *code, int size, char *id) #ifdef HOST_WIN32 o_file = g_strdup_printf ("%s/test.o", tmp); -#else +#else i = g_file_open_tmp (NULL, &o_file, NULL); close (i); #endif #ifdef HAVE_SYSTEM char *cmd = g_strdup_printf (ARCH_PREFIX AS_CMD " %s -o %s", as_file, o_file); - unused = system (cmd); + unused = system (cmd); g_free (cmd); char *objdump_args = g_getenv ("MONO_OBJDUMP_ARGS"); if (!objdump_args) @@ -263,8 +263,8 @@ mono_disassemble_code (MonoCompile *cfg, guint8 *code, int size, char *id) fflush (stdout); #if (defined(__arm__) || defined(__aarch64__)) && !defined(TARGET_OSX) - /* - * The arm assembler inserts ELF directives instructing objdump to display + /* + * The arm assembler inserts ELF directives instructing objdump to display * everything as data. */ cmd = g_strdup_printf (ARCH_PREFIX "strip -s %s", o_file); diff --git a/src/mono/mono/mini/interp/interp-internals.h b/src/mono/mono/mini/interp/interp-internals.h index c239cab5ab7fc8..164a7080a7fc62 100644 --- a/src/mono/mono/mini/interp/interp-internals.h +++ b/src/mono/mono/mini/interp/interp-internals.h @@ -101,8 +101,8 @@ typedef enum { #define INTERP_IMETHOD_IS_TAGGED_UNBOX(im) ((mono_u)(im) & 1) #define INTERP_IMETHOD_UNTAG_UNBOX(im) ((InterpMethod*)((mono_u)(im) & ~1)) -/* - * Structure representing a method transformed for the interpreter +/* + * Structure representing a method transformed for the interpreter */ typedef struct InterpMethod InterpMethod; struct InterpMethod { diff --git a/src/mono/mono/mini/intrinsics.c b/src/mono/mono/mini/intrinsics.c index 4e30c67c85dd83..7dc808d2def83d 100644 --- a/src/mono/mono/mini/intrinsics.c +++ b/src/mono/mono/mini/intrinsics.c @@ -217,7 +217,7 @@ llvm_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign if (fsig->param_count == 2 && fsig->params [0]->type == MONO_TYPE_R8 && fsig->params [1]->type == MONO_TYPE_R8) { // Max and Min can only be optimized in fast math mode if (!strcmp (cmethod->name, "Max") && mono_use_fast_math) { - opcode = OP_FMAX; + opcode = OP_FMAX; } else if (!strcmp (cmethod->name, "Min") && mono_use_fast_math) { opcode = OP_FMIN; } else if (!strcmp (cmethod->name, "Pow")) { @@ -243,7 +243,7 @@ llvm_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign // (float, float) if (fsig->param_count == 2 && fsig->params [0]->type == MONO_TYPE_R4 && fsig->params [1]->type == MONO_TYPE_R4) { if (!strcmp (cmethod->name, "Max") && mono_use_fast_math) { - opcode = OP_RMAX; + opcode = OP_RMAX; } else if (!strcmp (cmethod->name, "Min") && mono_use_fast_math) { opcode = OP_RMIN; } else if (!strcmp (cmethod->name, "Pow")) { @@ -772,19 +772,19 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign } #else index_reg = args [1]->dreg; -#endif +#endif MONO_EMIT_BOUNDS_CHECK (cfg, args [0]->dreg, MonoString, length, index_reg); #if defined(TARGET_X86) || defined(TARGET_AMD64) EMIT_NEW_X86_LEA (cfg, ins, args [0]->dreg, index_reg, 1, MONO_STRUCT_OFFSET (MonoString, chars)); add_reg = ins->dreg; - EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOADU2_MEMBASE, dreg, + EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOADU2_MEMBASE, dreg, add_reg, 0); #else int mult_reg = alloc_preg (cfg); MONO_EMIT_NEW_BIALU_IMM (cfg, OP_SHL_IMM, mult_reg, index_reg, 1); MONO_EMIT_NEW_BIALU (cfg, OP_PADD, add_reg, mult_reg, args [0]->dreg); - EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOADU2_MEMBASE, dreg, + EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOADU2_MEMBASE, dreg, add_reg, MONO_STRUCT_OFFSET (MonoString, chars)); #endif mini_type_from_op (cfg, ins, NULL, NULL); @@ -799,7 +799,7 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign cfg->flags |= MONO_CFG_NEEDS_DECOMPOSE; return ins; - } else + } else return NULL; } else if (cmethod->klass == mono_defaults.object_class) { if (strcmp (cmethod->name, "GetType") == 0 && fsig->param_count + fsig->hasthis == 1) { @@ -816,7 +816,7 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign } else if (!cfg->backend->emulate_mul_div && strcmp (cmethod->name, "InternalGetHashCode") == 0 && fsig->param_count == 1 && !mono_gc_is_moving ()) { int dreg = alloc_ireg (cfg); int t1 = alloc_ireg (cfg); - + MONO_EMIT_NEW_BIALU_IMM (cfg, OP_SHR_IMM, t1, args [0]->dreg, 3); EMIT_NEW_BIALU_IMM (cfg, ins, OP_MUL_IMM, dreg, t1, 2654435761u); ins->type = STACK_I4; @@ -891,7 +891,7 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign EMIT_NEW_UNALU (cfg, ins, OP_MOVE, dreg, dreg); ins->type = STACK_I4; - + return ins; } #endif @@ -902,7 +902,7 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign if (strcmp (cmethod->name, "get_Rank") == 0 && fsig->param_count + fsig->hasthis == 1) { int dreg = alloc_ireg (cfg); int vtable_reg = alloc_preg (cfg); - MONO_EMIT_NEW_LOAD_MEMBASE_OP_FAULT (cfg, OP_LOAD_MEMBASE, vtable_reg, + MONO_EMIT_NEW_LOAD_MEMBASE_OP_FAULT (cfg, OP_LOAD_MEMBASE, vtable_reg, args [0]->dreg, MONO_STRUCT_OFFSET (MonoObject, vtable)); EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOADU1_MEMBASE, dreg, vtable_reg, MONO_STRUCT_OFFSET (MonoVTable, rank)); @@ -912,7 +912,7 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign } else if (strcmp (cmethod->name, "get_Length") == 0 && fsig->param_count + fsig->hasthis == 1) { int dreg = alloc_ireg (cfg); - EMIT_NEW_LOAD_MEMBASE_FAULT (cfg, ins, OP_LOADI4_MEMBASE, dreg, + EMIT_NEW_LOAD_MEMBASE_FAULT (cfg, ins, OP_LOADI4_MEMBASE, dreg, args [0]->dreg, MONO_STRUCT_OFFSET (MonoArray, max_length)); mini_type_from_op (cfg, ins, NULL, NULL); @@ -1722,8 +1722,8 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign return ins; } } else if (cmethod->klass == mono_class_try_get_math_class ()) { - /* - * There is general branchless code for Min/Max, but it does not work for + /* + * There is general branchless code for Min/Max, but it does not work for * all inputs: * http://everything2.com/?node_id=1051618 */ @@ -1738,7 +1738,7 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign int opcode = 0; const char *mname = cmethod->name; char c = mname [0]; - + if (c == 'A'){ if (strcmp (mname, "Abs") == 0 && fsig->params [0]->type == MONO_TYPE_R8) { opcode = OP_ABS; @@ -1758,7 +1758,7 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign } else if (strcmp (mname, "Atanh") == 0){ if (fabs (source) < 1) opcode = OP_ATANH; - } + } } else if (c == 'C'){ if (strcmp (mname, "Cos") == 0) { if (!isinf (source)) @@ -1797,7 +1797,7 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign ins->type = STACK_R8; ins->dreg = mono_alloc_dreg (cfg, (MonoStackType) ins->type); ins->inst_p0 = dest; - + switch (opcode){ case OP_ABS: result = fabs (source); @@ -2040,10 +2040,10 @@ mini_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSign } } - // Return false for IsSupported for all types in System.Runtime.Intrinsics.* + // Return false for IsSupported for all types in System.Runtime.Intrinsics.* // if it's not handled in mono_emit_simd_intrinsics - if (in_corlib && - !strncmp ("System.Runtime.Intrinsics", cmethod_klass_name_space, 25) && + if (in_corlib && + !strncmp ("System.Runtime.Intrinsics", cmethod_klass_name_space, 25) && !strcmp (cmethod->name, "get_IsSupported")) { EMIT_NEW_ICONST (cfg, ins, 0); ins->type = STACK_I4; @@ -2143,7 +2143,7 @@ static MonoInst* emit_array_unsafe_access (MonoCompile *cfg, MonoMethodSignature *fsig, MonoInst **args, int is_set) { MonoClass *eklass; - + if (is_set) eklass = mono_class_from_mono_type_internal (fsig->params [2]); else diff --git a/src/mono/mono/mini/ir-emit.h b/src/mono/mono/mini/ir-emit.h index 6177261f3507f4..a36efe38fbb43d 100644 --- a/src/mono/mono/mini/ir-emit.h +++ b/src/mono/mono/mini/ir-emit.h @@ -113,9 +113,9 @@ alloc_dreg (MonoCompile *cfg, MonoStackType stack_type) * Macros used to generate intermediate representation macros * * The macros use a `MonoConfig` object as its context, and among other - * things it is used to associate instructions with the memory pool with + * things it is used to associate instructions with the memory pool with * it. - * + * * The macros come in three variations with slightly different * features, the patter is: NEW_OP, EMIT_NEW_OP, MONO_EMIT_NEW_OP, * the differences are as follows: @@ -131,25 +131,25 @@ alloc_dreg (MonoCompile *cfg, MonoStackType stack_type) * * `MONO_EMIT_NEW_OP`: These variations of the instructions are used when * you are merely interested in emitting the instruction into the `MonoConfig` - * parameter. + * parameter. */ #undef MONO_INST_NEW -/* - * FIXME: zeroing out some fields is not needed with the new IR, but the old +/* + * FIXME: zeroing out some fields is not needed with the new IR, but the old * JIT code still uses the left and right fields, so it has to stay. */ /* * MONO_INST_NEW: create a new MonoInst instance that is allocated on the MonoConfig pool. * - * @cfg: the MonoConfig object that will be used as the context for the + * @cfg: the MonoConfig object that will be used as the context for the * instruction. * @dest: this is the place where the instance of the `MonoInst` is stored. * @op: the value that should be stored in the MonoInst.opcode field * * This initializes an empty MonoInst that has been nulled out, it is allocated * from the memory pool associated with the MonoConfig, but it is not linked anywhere. - * the cil_code is set to the cfg->ip address. + * the cil_code is set to the cfg->ip address. */ #define MONO_INST_NEW(cfg,dest,op) do { \ (dest) = (MonoInst *)mono_mempool_alloc ((cfg)->mempool, sizeof (MonoInst)); \ @@ -173,8 +173,8 @@ alloc_dreg (MonoCompile *cfg, MonoStackType stack_type) (dest)->dreg = alloc_dreg ((cfg), STACK_I4); \ } while (0) -/* - * Avoid using this with a non-NULL val if possible as it is not AOT +/* + * Avoid using this with a non-NULL val if possible as it is not AOT * compatible. Use one of the NEW_xxxCONST variants instead. */ #define NEW_PCONST(cfg,dest,val) do { \ @@ -217,7 +217,7 @@ alloc_dreg (MonoCompile *cfg, MonoStackType stack_type) MONO_INST_NEW ((cfg), (dest), (op)); \ (dest)->dreg = dr; \ (dest)->sreg1 = sr1; \ - } while (0) + } while (0) #define NEW_BIALU(cfg,dest,op,dr,sr1,sr2) do { \ MONO_INST_NEW ((cfg), (dest), (op)); \ diff --git a/src/mono/mono/mini/jit.h b/src/mono/mono/mini/jit.h index 7f7e46403efee9..c3413106b1ccd3 100644 --- a/src/mono/mono/mini/jit.h +++ b/src/mono/mono/mini/jit.h @@ -13,19 +13,19 @@ MONO_BEGIN_DECLS -MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain * +MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain * mono_jit_init (const char *file); -MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain * +MONO_API MONO_RT_EXTERNAL_ONLY MonoDomain * mono_jit_init_version (const char *root_domain_name, const char *runtime_version); -MONO_API MonoDomain * +MONO_API MonoDomain * mono_jit_init_version_for_test_only (const char *root_domain_name, const char *runtime_version); MONO_API int -mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly, +mono_jit_exec (MonoDomain *domain, MonoAssembly *assembly, int argc, char *argv[]); -MONO_API void +MONO_API void mono_jit_cleanup (MonoDomain *domain); MONO_API mono_bool diff --git a/src/mono/mono/mini/liveness.c b/src/mono/mono/mini/liveness.c index 81416eb3115caf..866f10be6889fb 100644 --- a/src/mono/mono/mini/liveness.c +++ b/src/mono/mono/mini/liveness.c @@ -25,7 +25,7 @@ #define BB_ID_SHIFT 18 -/* +/* * The liveness2 pass can't handle long vars on 32 bit platforms because the component * vars have the same 'idx'. */ @@ -100,7 +100,7 @@ static void optimize_initlocals (MonoCompile *cfg); /* mono_bitset_mp_new: - * + * * allocates a MonoBitSet inside a memory pool */ static MonoBitSet* @@ -156,7 +156,7 @@ visit_bb (MonoCompile *cfg, MonoBasicBlock *bb, MonoPtrSet *visited) /* DREG */ regtype = spec [MONO_INST_DEST]; g_assert (((ins->dreg == -1) && (regtype == ' ')) || ((ins->dreg != -1) && (regtype != ' '))); - + if ((ins->dreg != -1) && get_vreg_to_inst (cfg, ins->dreg)) { MonoInst *var = get_vreg_to_inst (cfg, ins->dreg); int idx = var->inst_c0; @@ -169,7 +169,7 @@ visit_bb (MonoCompile *cfg, MonoBasicBlock *bb, MonoPtrSet *visited) get_vreg_to_inst (cfg, MONO_LVREG_MS (var->dreg))->flags |= MONO_INST_VOLATILE; } } - + /* SREGS */ num_sregs = mono_inst_get_src_registers (ins, sregs); for (srcindex = 0; srcindex < num_sregs; ++srcindex) { @@ -193,7 +193,7 @@ visit_bb (MonoCompile *cfg, MonoBasicBlock *bb, MonoPtrSet *visited) mono_ptrset_add (visited, bb); - /* + /* * Need to visit all bblocks reachable from this one since they can be * reached during exception handling. */ @@ -211,7 +211,7 @@ mono_liveness_handle_exception_clauses (MonoCompile *cfg) int i, j; gboolean *outer_try; - /* + /* * Determine which clauses are outer try clauses, i.e. they are not contained in any * other non-try clause. */ @@ -283,7 +283,7 @@ analyze_liveness_bb (MonoCompile *cfg, MonoBasicBlock *bb) int sreg, inst_num; MonoMethodVar *vars = cfg->vars; guint32 abs_pos = (bb->dfn << BB_ID_SHIFT); - + /* Start inst_num from > 0, so last_use.abs_pos is only 0 for dead variables */ for (inst_num = 2, ins = bb->code; ins; ins = ins->next, inst_num += 2) { const char *spec = INS_INFO (ins->opcode); @@ -308,11 +308,11 @@ analyze_liveness_bb (MonoCompile *cfg, MonoBasicBlock *bb) if (cfg->verbose_level > 1) printf ("\tGEN: R%d(%d)\n", var->dreg, idx); #endif - update_live_range (&vars [idx], abs_pos + inst_num); + update_live_range (&vars [idx], abs_pos + inst_num); if (!mono_bitset_test_fast (bb->kill_set, idx)) mono_bitset_set_fast (bb->gen_set, idx); vi->spill_costs += SPILL_COST_INCREMENT; - } + } /* SREGs must come first, so MOVE r <- r is handled correctly */ num_sregs = mono_inst_get_src_registers (ins, sregs); @@ -327,7 +327,7 @@ analyze_liveness_bb (MonoCompile *cfg, MonoBasicBlock *bb) if (cfg->verbose_level > 1) printf ("\tGEN: R%d(%d)\n", sreg, idx); #endif - update_live_range (&vars [idx], abs_pos + inst_num); + update_live_range (&vars [idx], abs_pos + inst_num); if (!mono_bitset_test_fast (bb->kill_set, idx)) mono_bitset_set_fast (bb->gen_set, idx); vi->spill_costs += SPILL_COST_INCREMENT; @@ -341,7 +341,7 @@ analyze_liveness_bb (MonoCompile *cfg, MonoBasicBlock *bb) MonoMethodVar *vi = MONO_VARINFO (cfg, idx); if (MONO_IS_STORE_MEMBASE (ins)) { - update_live_range (&vars [idx], abs_pos + inst_num); + update_live_range (&vars [idx], abs_pos + inst_num); if (!mono_bitset_test_fast (bb->kill_set, idx)) mono_bitset_set_fast (bb->gen_set, idx); vi->spill_costs += SPILL_COST_INCREMENT; @@ -350,7 +350,7 @@ analyze_liveness_bb (MonoCompile *cfg, MonoBasicBlock *bb) if (cfg->verbose_level > 1) printf ("\tKILL: R%d(%d)\n", ins->dreg, idx); #endif - update_live_range (&vars [idx], abs_pos + inst_num + 1); + update_live_range (&vars [idx], abs_pos + inst_num + 1); mono_bitset_set_fast (bb->kill_set, idx); vi->spill_costs += SPILL_COST_INCREMENT; } @@ -358,7 +358,7 @@ analyze_liveness_bb (MonoCompile *cfg, MonoBasicBlock *bb) } } -/* generic liveness analysis code. CFG specific parts are +/* generic liveness analysis code. CFG specific parts are * in update_gen_kill_set() */ void @@ -380,7 +380,7 @@ mono_analyze_liveness (MonoCompile *cfg) g_assert (!(cfg->comp_done & MONO_COMP_LIVENESS)); cfg->comp_done |= MONO_COMP_LIVENESS; - + if (max_vars == 0) return; @@ -401,9 +401,9 @@ mono_analyze_liveness (MonoCompile *cfg) #ifdef DEBUG_LIVENESS if (cfg->verbose_level > 1) { printf ("BLOCK BB%d (", bb->block_num); - for (j = 0; j < bb->out_count; j++) + for (j = 0; j < bb->out_count; j++) printf ("BB%d, ", bb->out_bb [j]->block_num); - + printf ("):\n"); } #endif @@ -454,10 +454,10 @@ mono_analyze_liveness (MonoCompile *cfg) #ifdef DEBUG_LIVENESS if (cfg->verbose_level > 1) { printf ("P: BB%d(%d): IN: ", bb->block_num, bb->dfn); - for (j = 0; j < bb->in_count; ++j) + for (j = 0; j < bb->in_count; ++j) printf ("BB%d ", bb->in_bb [j]->block_num); printf ("OUT:"); - for (j = 0; j < bb->out_count; ++j) + for (j = 0; j < bb->out_count; ++j) printf ("BB%d ", bb->out_bb [j]->block_num); printf ("\n"); } @@ -477,7 +477,7 @@ mono_analyze_liveness (MonoCompile *cfg) changed = FALSE; mono_bitset_copyto_fast (bb->live_out_set, old_live_out_set); } - + for (j = 0; j < bb->out_count; j++) { out_bb = bb->out_bb [j]; @@ -495,7 +495,7 @@ mono_analyze_liveness (MonoCompile *cfg) mono_bitset_union_fast (bb->live_out_set, out_bb->live_in_set); } } - + if (changed || !mono_bitset_equal (old_live_out_set, bb->live_out_set)) { if (!bb->live_in_set) bb->live_in_set = mono_bitset_mp_new_noinit (cfg->mempool, bitsize, max_vars); @@ -505,8 +505,8 @@ mono_analyze_liveness (MonoCompile *cfg) for (j = 0; j < bb->in_count; j++) { MonoBasicBlock *in_bb = bb->in_bb [j]; - /* - * Some basic blocks do not seem to be in the + /* + * Some basic blocks do not seem to be in the * cfg->bblocks array... */ if (in_bb->gen_set && !in_worklist [in_bb->dfn]) { @@ -525,9 +525,9 @@ mono_analyze_liveness (MonoCompile *cfg) } if (G_UNLIKELY (cfg->verbose_level > 1)) { - printf ("\tLIVE IN BB%d: ", bb->block_num); - mono_bitset_print (bb->live_in_set); - } + printf ("\tLIVE IN BB%d: ", bb->block_num); + mono_bitset_print (bb->live_in_set); + } } #ifdef DEBUG_LIVENESS @@ -594,7 +594,7 @@ mono_analyze_liveness (MonoCompile *cfg) MonoMethodVar *vi = MONO_VARINFO (cfg, i); if (cfg->varinfo [vi->idx]->opcode == OP_ARG) { if (vi->range.last_use.abs_pos == 0 && !(cfg->varinfo [vi->idx]->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT))) { - /* + /* * Can't eliminate the this variable in gshared code, since * it is needed during exception handling to identify the * method. @@ -613,11 +613,11 @@ mono_analyze_liveness (MonoCompile *cfg) if (cfg->verbose_level > 1) { for (i = cfg->num_bblocks - 1; i >= 0; i--) { MonoBasicBlock *bb = cfg->bblocks [i]; - - printf ("LIVE IN BB%d: ", bb->block_num); - mono_bitset_print (bb->live_in_set); - printf ("LIVE OUT BB%d: ", bb->block_num); - mono_bitset_print (bb->live_out_set); + + printf ("LIVE IN BB%d: ", bb->block_num); + mono_bitset_print (bb->live_in_set); + printf ("LIVE OUT BB%d: ", bb->block_num); + mono_bitset_print (bb->live_out_set); } for (i = 0; i < max_vars; i ++) { @@ -681,7 +681,7 @@ optimize_initlocals (MonoCompile *cfg) if ((ins->opcode == OP_ICONST) || (ins->opcode == OP_I8CONST) || (ins->opcode == OP_R8CONST) || (ins->opcode == OP_R4CONST)) { NULLIFY_INS (ins); MONO_VARINFO (cfg, var->inst_c0)->spill_costs -= 1; - /* + /* * We should shorten the liveness interval of these vars as well, but * don't have enough info to do that. */ @@ -801,7 +801,7 @@ mono_linterval_get_intersect_pos (MonoLiveInterval *i1, MonoLiveInterval *i2) return -1; } - + /** * mono_linterval_split * @@ -973,7 +973,7 @@ mono_analyze_liveness2 (MonoCompile *cfg) LIVENESS_DEBUG (printf ("LIVENESS BLOCK BB%d:\n", bb->block_num)); memset (last_use, 0, max_vars * sizeof (gint32)); - + /* For variables in bb->live_out, set last_use to block_to */ max = ((max_vars + (BITS_PER_CHUNK -1)) / BITS_PER_CHUNK); @@ -982,7 +982,7 @@ mono_analyze_liveness2 (MonoCompile *cfg) int k; bits_out = mono_bitset_get_fast (bb->live_out_set, j); - k = (j * BITS_PER_CHUNK); + k = (j * BITS_PER_CHUNK); while (bits_out) { if (bits_out & 1) { LIVENESS_DEBUG (printf ("Var R%d live at exit, set last_use to %x\n", cfg->varinfo [k]->dreg, block_to)); @@ -1030,7 +1030,7 @@ mono_analyze_liveness2 (MonoCompile *cfg) #if 0 for (idx = 0; idx < max_vars; ++idx) { MonoMethodVar *vi = MONO_VARINFO (cfg, idx); - + LIVENESS_DEBUG (printf ("LIVENESS R%d: ", cfg->varinfo [idx]->dreg)); LIVENESS_DEBUG (mono_linterval_print (vi->interval)); LIVENESS_DEBUG (printf ("\n")); @@ -1149,7 +1149,7 @@ mono_analyze_liveness_gc (MonoCompile *cfg) continue; memset (last_use, 0, max_vars * sizeof (gint32)); - + /* For variables in bb->live_out, set last_use to block_to */ max = ((max_vars + (BITS_PER_CHUNK -1)) / BITS_PER_CHUNK); @@ -1162,7 +1162,7 @@ mono_analyze_liveness_gc (MonoCompile *cfg) continue; bits_out = mono_bitset_get_fast (bb->live_out_set, j); - k = (j * BITS_PER_CHUNK); + k = (j * BITS_PER_CHUNK); while (bits_out) { if ((bits_out & 1) && cfg->varinfo [k]->flags & MONO_INST_GC_TRACK) { int vreg = get_vreg_from_var (cfg, cfg->varinfo [k]); diff --git a/src/mono/mono/mini/llvm-runtime.h b/src/mono/mono/mini/llvm-runtime.h index 22d4d136e49c8b..bc1eaca1a2c7c3 100644 --- a/src/mono/mono/mini/llvm-runtime.h +++ b/src/mono/mono/mini/llvm-runtime.h @@ -26,6 +26,6 @@ mono_llvm_cpp_catch_exception (MonoLLVMInvokeCallback cb, gpointer arg, gboolean G_END_DECLS #endif /* __MONO_LLVM_RUNTIME_H__ */ - + diff --git a/src/mono/mono/mini/llvmonly-runtime.c b/src/mono/mono/mini/llvmonly-runtime.c index 8da3e60cce81bc..2aeb93b16a69f4 100644 --- a/src/mono/mono/mini/llvmonly-runtime.c +++ b/src/mono/mono/mini/llvmonly-runtime.c @@ -111,7 +111,7 @@ mini_llvmonly_get_delegate_arg (MonoMethod *method, gpointer method_ptr) * This is used for: * - generic sharing (ARG is the rgctx) * - gsharedvt signature wrappers (ARG is a function descriptor) - * + * */ MonoFtnDesc* mini_llvmonly_create_ftndesc (MonoMethod *m, gpointer addr, gpointer arg) @@ -160,7 +160,7 @@ mini_llvmonly_add_method_wrappers (MonoMethod *m, gpointer compiled_method, gboo addr = compiled_method; if (add_unbox_tramp) { - /* + /* * The unbox trampolines call the method directly, so need to add * an rgctx tramp before them. */ diff --git a/src/mono/mono/mini/local-propagation.c b/src/mono/mono/mini/local-propagation.c index 19801edd1f2814..8eb4db79b5581c 100644 --- a/src/mono/mono/mini/local-propagation.c +++ b/src/mono/mono/mini/local-propagation.c @@ -383,7 +383,7 @@ mono_strength_reduction_ins (MonoCompile *cfg, MonoInst *ins, const char **spec) ins->opcode = OP_ICONST; MONO_INST_NULLIFY_SREGS (ins); ins->inst_c0 = 0; - } else if ((ins->inst_imm > 0) && (ins->inst_imm < (1LL << 32)) && + } else if ((ins->inst_imm > 0) && (ins->inst_imm < (1LL << 32)) && (power != -1) && (!cfg->backend->optimized_div)) { gboolean is_long = ins->opcode == OP_LREM_IMM; int compensator_reg = alloc_ireg (cfg); @@ -600,21 +600,21 @@ mono_local_cprop (MonoCompile *cfg) def = defs [sreg]; /* Copy propagation */ - /* - * The first check makes sure the source of the copy did not change since + /* + * The first check makes sure the source of the copy did not change since * the copy was made. * The second check avoids volatile variables. - * The third check avoids copy propagating local vregs through a call, - * since the lvreg will be spilled + * The third check avoids copy propagating local vregs through a call, + * since the lvreg will be spilled * The fourth check avoids copy propagating a vreg in cases where * it would be eliminated anyway by reverse copy propagation later, - * because propagating it would create another use for it, thus making + * because propagating it would create another use for it, thus making * it impossible to use reverse copy propagation. */ /* Enabling this for floats trips up the fp stack */ - /* - * Enabling this for floats on amd64 seems to cause a failure in - * basic-math.cs, most likely because it gets rid of some r8->r4 + /* + * Enabling this for floats on amd64 seems to cause a failure in + * basic-math.cs, most likely because it gets rid of some r8->r4 * conversions. */ if (MONO_IS_MOVE (def) && @@ -707,7 +707,7 @@ mono_local_cprop (MonoCompile *cfg) } else if (((def->opcode == OP_ADD_IMM) || (def->opcode == OP_LADD_IMM)) && (MONO_IS_LOAD_MEMBASE (ins) || MONO_ARCH_IS_OP_MEMBASE (ins->opcode))) { /* ADD_IMM is created by spill_global_vars */ - /* + /* * We have to guarantee that def->sreg1 haven't changed since def->dreg * was defined. cfg->frame_reg is assumed to remain constant. */ @@ -806,7 +806,7 @@ mono_local_cprop (MonoCompile *cfg) def_index [ins->dreg] = ins_index; } } - + if (MONO_IS_CALL (ins)) last_call_index = ins_index; @@ -825,7 +825,7 @@ reg_is_softreg_no_fpstack (int reg, const char spec) #endif || (spec == 'v'); } - + static gboolean reg_is_softreg (int reg, const char spec) { @@ -864,7 +864,7 @@ mono_is_simd_accessor (MonoInst *ins) /** * mono_local_deadce: * - * Get rid of the dead assignments to local vregs like the ones created by the + * Get rid of the dead assignments to local vregs like the ones created by the * copyprop pass. */ void @@ -933,7 +933,7 @@ mono_local_deadce (MonoCompile *cfg) def = prev_f; spec2 = INS_INFO (def->opcode); - /* + /* * Perform a limited kind of reverse copy propagation, i.e. * transform B <- FOO; A <- B into A <- FOO * This isn't copyprop, not deadce, but it can only be performed @@ -953,17 +953,17 @@ mono_local_deadce (MonoCompile *cfg) /* Enabling this on x86 could screw up the fp stack */ if (reg_is_softreg_no_fpstack (ins->dreg, spec [MONO_INST_DEST])) { - /* + /* * Assignments to global vregs can only be eliminated if there is another * assignment to the same vreg later in the same bblock. */ - if (!mono_bitset_test_fast (used, ins->dreg) && + if (!mono_bitset_test_fast (used, ins->dreg) && (!get_vreg_to_inst (cfg, ins->dreg) || (!bb->extended && !vreg_is_volatile (cfg, ins->dreg) && mono_bitset_test_fast (defined, ins->dreg))) && MONO_INS_HAS_NO_SIDE_EFFECT (ins)) { /* Happens with CMOV instructions */ if (prev_f && prev_f->opcode == OP_ICOMPARE_IMM) { MonoInst *prev = prev_f; - /* + /* * Can't use DELETE_INS since that would interfere with the * FOR_EACH_INS loop. */ @@ -996,7 +996,7 @@ mono_local_deadce (MonoCompile *cfg) regpair = (guint32)(gssize)(l->data); reg = regpair & 0xffffff; - + mono_bitset_set_fast (used, reg); } } @@ -1007,7 +1007,7 @@ mono_local_deadce (MonoCompile *cfg) regpair = (guint32)(gssize)(l->data); reg = regpair & 0xffffff; - + mono_bitset_set_fast (used, reg); } } diff --git a/src/mono/mono/mini/main-core.c b/src/mono/mono/mini/main-core.c index 11866090e17044..66e85d713c9473 100644 --- a/src/mono/mono/mini/main-core.c +++ b/src/mono/mono/mini/main-core.c @@ -48,7 +48,7 @@ MONO_API int STDAPICALLTYPE coreclr_create_delegate (void* hostHandle, unsigned // propertyKeys - Keys of properties of the app domain // propertyValues - Values of properties of the app domain // hostHandle - Output parameter, handle of the created host -// domainId - Output parameter, id of the created app domain +// domainId - Output parameter, id of the created app domain // // Returns: // HRESULT indicating status of the operation. S_OK if the assembly was successfully executed @@ -65,7 +65,7 @@ int STDAPICALLTYPE coreclr_initialize (const char* exePath, const char* appDomai // // Parameters: // hostHandle - Handle of the host -// domainId - Id of the domain +// domainId - Id of the domain // argc - Number of arguments passed to the executed assembly // argv - Array of arguments passed to the executed assembly // managedAssemblyPath - Path of the managed assembly to execute (or NULL if using a custom entrypoint). @@ -86,7 +86,7 @@ int STDAPICALLTYPE coreclr_execute_assembly (void* hostHandle, unsigned int doma // // Parameters: // hostHandle - Handle of the host -// domainId - Id of the domain +// domainId - Id of the domain // latchedExitCode - Latched exit code after domain unloaded // // Returns: @@ -102,7 +102,7 @@ int STDAPICALLTYPE coreclr_shutdown_2 (void* hostHandle, unsigned int domainId, // // Parameters: // hostHandle - Handle of the host -// domainId - Id of the domain +// domainId - Id of the domain // entryPointAssemblyName - Name of the assembly which holds the custom entry point // entryPointTypeName - Name of the type which holds the custom entry point // entryPointMethodName - Name of the method which is the custom entry point diff --git a/src/mono/mono/mini/main.c b/src/mono/mono/mini/main.c index 36f5b4dce54bc8..2e1bf2fd6deccf 100644 --- a/src/mono/mono/mini/main.c +++ b/src/mono/mono/mini/main.c @@ -3,7 +3,7 @@ * The main entry point for the mono executable * * The main entry point does a few things: - * + * * * It probes whether the executable has a bundle appended * at the end, and if so, registers the various bundled * resources with Mono and executes the contained bundle @@ -90,7 +90,7 @@ mono_main_with_options (int argc, char *argv []) * "config:NAME" A configuration file (usually file.dll.config) in the payload that is * loaded as the config file for an assembly * "systemconfig:" Treats as a Mono system configuration, payload contains the config file. - * "options:" The payload contains command line options to initialize Mono, as if you + * "options:" The payload contains command line options to initialize Mono, as if you had set them on MONO_ENV_OPTIONS * "config_dir:DIR" Configures the MONO_PATH to point to point to DIR * "machineconfig:" The payload contains the machine.config file to use at runtime @@ -269,7 +269,7 @@ probe_embedded (const char *program, int *ref_argc, char **ref_argv []) p += 8; item_size = STREAM_INT (p); p += 4; - + if (mapaddress == NULL) { char *error_message = NULL; mapaddress = (guchar*)mono_file_map_error (directory_location - offset, MONO_MMAP_READ | MONO_MMAP_PRIVATE, @@ -323,9 +323,9 @@ probe_embedded (const char *program, int *ref_argc, char **ref_argv []) new_argv [j+1] = (*ref_argv)[j]; *ref_argv = new_argv; (*ref_argc)++; - + return TRUE; - + dofree: g_free (directory); doclose: diff --git a/src/mono/mono/mini/memory-access.c b/src/mono/mono/mini/memory-access.c index 51c748c9bbfdbe..4af7668fe83d97 100644 --- a/src/mono/mono/mini/memory-access.c +++ b/src/mono/mono/mini/memory-access.c @@ -20,7 +20,7 @@ #define MAX_INLINE_COPIES 16 #define MAX_INLINE_COPY_SIZE 10000 -void +void mini_emit_memset (MonoCompile *cfg, int destreg, int offset, int size, int val, int align) { int val_reg; @@ -109,7 +109,7 @@ mini_emit_memset (MonoCompile *cfg, int destreg, int offset, int size, int val, } } -void +void mini_emit_memcpy (MonoCompile *cfg, int destreg, int doffset, int srcreg, int soffset, int size, int align) { int cur_reg; diff --git a/src/mono/mono/mini/method-to-ir.c b/src/mono/mono/mini/method-to-ir.c index d6ef76676cfb46..7a5f5db4fab6e8 100644 --- a/src/mono/mono/mini/method-to-ir.c +++ b/src/mono/mono/mini/method-to-ir.c @@ -220,7 +220,7 @@ mini_ins_info[] = { #define MINI_OP(a,b,dest,src1,src2) ((src2) != NONE ? 2 : ((src1) != NONE ? 1 : 0)), #define MINI_OP3(a,b,dest,src1,src2,src3) ((src3) != NONE ? 3 : ((src2) != NONE ? 2 : ((src1) != NONE ? 1 : 0))), -/* +/* * This should contain the index of the last sreg + 1. This is not the same * as the number of sregs for opcodes like IA64_CMP_EQ_IMM. */ @@ -325,7 +325,7 @@ mono_type_to_regmove (MonoCompile *cfg, MonoType *type) case MONO_TYPE_STRING: case MONO_TYPE_OBJECT: case MONO_TYPE_SZARRAY: - case MONO_TYPE_ARRAY: + case MONO_TYPE_ARRAY: return OP_MOVE; case MONO_TYPE_I8: case MONO_TYPE_U8: @@ -450,7 +450,7 @@ mini_set_inline_failure (MonoCompile *cfg, const char *msg) } /* - * When using gsharedvt, some instatiations might be verifiable, and some might be not. i.e. + * When using gsharedvt, some instatiations might be verifiable, and some might be not. i.e. * foo (int i) { ldarg.0; box T; } */ #define UNVERIFIED do { \ @@ -729,7 +729,7 @@ mono_find_leave_clauses (MonoCompile *cfg, guchar *ip, guchar *target) for (i = 0; i < header->num_clauses; ++i) { clause = &header->clauses [i]; - if (MONO_OFFSET_IN_CLAUSE (clause, (ip - header->code)) && + if (MONO_OFFSET_IN_CLAUSE (clause, (ip - header->code)) && (!MONO_OFFSET_IN_CLAUSE (clause, (target - header->code)))) { MonoLeaveClause *leave = mono_mempool_alloc0 (cfg->mempool, sizeof (MonoLeaveClause)); leave->index = i; @@ -820,7 +820,7 @@ mini_type_to_eval_stack_type (MonoCompile *cfg, MonoType *type, MonoInst *inst) case MONO_TYPE_STRING: case MONO_TYPE_OBJECT: case MONO_TYPE_SZARRAY: - case MONO_TYPE_ARRAY: + case MONO_TYPE_ARRAY: inst->type = STACK_OBJ; return; case MONO_TYPE_I8: @@ -884,7 +884,7 @@ bin_num_table [STACK_MAX] [STACK_MAX] = { {STACK_INV, STACK_INV, STACK_INV, STACK_INV, STACK_R8, STACK_INV, STACK_INV, STACK_INV, STACK_R4} }; -static const char +static const char neg_table [] = { STACK_INV, STACK_I4, STACK_I8, STACK_PTR, STACK_R8, STACK_INV, STACK_INV, STACK_INV, STACK_R4 }; @@ -1029,7 +1029,7 @@ type_from_op (MonoCompile *cfg, MonoInst *ins, MonoInst *src1, MonoInst *src2) case OP_ICOMPARE_IMM: ins->type = bin_comp_table [src1->type] [src1->type] ? STACK_I4 : STACK_INV; if ((src1->type == STACK_I8) || ((TARGET_SIZEOF_VOID_P == 8) && ((src1->type == STACK_PTR) || (src1->type == STACK_OBJ) || (src1->type == STACK_MP)))) - ins->opcode = OP_LCOMPARE_IMM; + ins->opcode = OP_LCOMPARE_IMM; break; case MONO_CEE_BEQ: case MONO_CEE_BGE: @@ -1081,7 +1081,7 @@ type_from_op (MonoCompile *cfg, MonoInst *ins, MonoInst *src1, MonoInst *src2) ins->opcode = OP_ICONV_TO_R_UN; break; case STACK_I8: - ins->opcode = OP_LCONV_TO_R_UN; + ins->opcode = OP_LCONV_TO_R_UN; break; case STACK_R4: ins->opcode = OP_RCONV_TO_R8; @@ -1167,7 +1167,7 @@ type_from_op (MonoCompile *cfg, MonoInst *ins, MonoInst *src1, MonoInst *src2) ins->opcode += unops_op_map [src1->type]; break; case OP_CKFINITE: - ins->type = STACK_R8; + ins->type = STACK_R8; break; case MONO_CEE_CONV_U2: case MONO_CEE_CONV_U1: @@ -1330,7 +1330,7 @@ check_values_to_signature (MonoInst *args, MonoType *this_ins, MonoMethodSignatu #endif /* - * The got_var contains the address of the Global Offset Table when AOT + * The got_var contains the address of the Global Offset Table when AOT * compiling. */ MonoInst * @@ -1415,7 +1415,7 @@ mini_type_to_stack_type (MonoCompile *cfg, MonoType *t) case MONO_TYPE_STRING: case MONO_TYPE_OBJECT: case MONO_TYPE_SZARRAY: - case MONO_TYPE_ARRAY: + case MONO_TYPE_ARRAY: return STACK_OBJ; case MONO_TYPE_I8: case MONO_TYPE_U8: @@ -1492,7 +1492,7 @@ mono_compile_get_interface_var (MonoCompile *cfg, int slot, MonoInst *ins) type = type_from_stack_type (ins); - /* inlining can result in deeper stacks */ + /* inlining can result in deeper stacks */ if (cfg->inline_depth || slot >= cfg->header->max_stack) return mono_compile_create_var (cfg, type, OP_LOCAL); @@ -1519,7 +1519,7 @@ mono_compile_get_interface_var (MonoCompile *cfg, int slot, MonoInst *ins) static void mono_save_token_info (MonoCompile *cfg, MonoImage *image, guint32 token, gpointer key) { - /* + /* * Don't use this if a generic_context is set, since that means AOT can't * look up the method using just the image+token. * table == 0 means this is a reference made from a wrapper. @@ -1577,13 +1577,13 @@ handle_stack_args (MonoCompile *cfg, MonoInst **sp, int count) if (!found) { bb->out_stack = (MonoInst **)mono_mempool_alloc (cfg->mempool, sizeof (MonoInst*) * count); for (i = 0; i < count; ++i) { - /* + /* * try to reuse temps already allocated for this purpouse, if they occupy the same * stack slot and if they are of the same type. - * This won't cause conflicts since if 'local' is used to + * This won't cause conflicts since if 'local' is used to * store one of the values in the in_stack of a bblock, then - * the same variable will be used for the same outgoing stack - * slot as well. + * the same variable will be used for the same outgoing stack + * slot as well. * This doesn't work when inlining methods, since the bblocks * in the inlined methods do not inherit their in_stack from * the bblock they are inlined to. See bug #58863 for an @@ -1623,7 +1623,7 @@ handle_stack_args (MonoCompile *cfg, MonoInst **sp, int count) /* * It is possible that the out bblocks already have in_stack assigned, and - * the in_stacks differ. In this case, we will store to all the different + * the in_stacks differ. In this case, we will store to all the different * in_stacks. */ @@ -1880,7 +1880,7 @@ target_type_is_incompatible (MonoCompile *cfg, MonoType *target, MonoInst *arg) case MONO_TYPE_I: case MONO_TYPE_U: case MONO_TYPE_FNPTR: - /* + /* * Some opcodes like ldloca returns 'transient pointers' which can be stored in * in native int. (#688008). */ @@ -1891,7 +1891,7 @@ target_type_is_incompatible (MonoCompile *cfg, MonoType *target, MonoInst *arg) case MONO_TYPE_STRING: case MONO_TYPE_OBJECT: case MONO_TYPE_SZARRAY: - case MONO_TYPE_ARRAY: + case MONO_TYPE_ARRAY: if (arg->type != STACK_OBJ) return 1; /* FIXME: check type compatibility */ @@ -2051,7 +2051,7 @@ check_call_signature (MonoCompile *cfg, MonoMethodSignature *sig, MonoInst **arg case MONO_TYPE_STRING: case MONO_TYPE_OBJECT: case MONO_TYPE_SZARRAY: - case MONO_TYPE_ARRAY: + case MONO_TYPE_ARRAY: if (args [i]->type != STACK_OBJ) return TRUE; continue; @@ -2224,7 +2224,7 @@ mono_emit_jit_icall_by_info (MonoCompile *cfg, int il_offset, MonoJitICallInfo * } return mono_emit_jit_icall_id (cfg, mono_jit_icall_info_id (info), args); } - + static MonoInst* mono_emit_widen_call_res (MonoCompile *cfg, MonoInst *ins, MonoMethodSignature *fsig) { @@ -2232,8 +2232,8 @@ mono_emit_widen_call_res (MonoCompile *cfg, MonoInst *ins, MonoMethodSignature * if ((fsig->pinvoke || LLVM_ENABLED) && !m_type_is_byref (fsig->ret)) { int widen_op = -1; - /* - * Native code might return non register sized integers + /* + * Native code might return non register sized integers * without initializing the upper bits. */ switch (mono_type_to_load_membase (cfg, fsig->ret)) { @@ -2543,7 +2543,7 @@ emit_get_rgctx (MonoCompile *cfg, int context_used) /* We are passed a this pointer, return this->vtable */ EMIT_NEW_VARLOAD (cfg, this_ins, cfg->this_arg, mono_get_object_type ()); - + vtable_reg = alloc_preg (cfg); EMIT_NEW_LOAD_MEMBASE (cfg, ins, OP_LOAD_MEMBASE, vtable_reg, this_ins->dreg, MONO_STRUCT_OFFSET (MonoObject, vtable)); return ins; @@ -3046,14 +3046,14 @@ mini_emit_check_array_type (MonoCompile *cfg, MonoInst *obj, MonoClass *array_cl MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, vtable_reg, (gssize)vtable); } } - + MONO_EMIT_NEW_COND_EXC (cfg, NE_UN, "ArrayTypeMismatchException"); mini_reset_cast_details (cfg); } /** - * Handles unbox of a Nullable. If context_used is non zero, then shared + * Handles unbox of a Nullable. If context_used is non zero, then shared * generic code is generated. */ static MonoInst* @@ -3119,7 +3119,7 @@ handle_unbox (MonoCompile *cfg, MonoClass *klass, MonoInst **sp, int context_use /* FIXME: generics */ g_assert (m_class_get_rank (klass) == 0); - + // Check rank == 0 MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, rank_reg, 0); MONO_EMIT_NEW_COND_EXC (cfg, NE_UN, "InvalidCastException"); @@ -3303,10 +3303,10 @@ handle_alloc (MonoCompile *cfg, MonoClass *klass, gboolean for_box, int context_ return mono_emit_jit_icall_id (cfg, alloc_ftn, iargs); } - + /* * Returns NULL and set the cfg exception on error. - */ + */ MonoInst* mini_emit_box (MonoCompile *cfg, MonoInst *val, MonoClass *klass, int context_used) { @@ -3383,7 +3383,7 @@ mini_emit_box (MonoCompile *cfg, MonoInst *val, MonoClass *klass, int context_us res->type = STACK_OBJ; res->klass = klass; MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_BR, end_bb); - + /* Ref case */ MONO_START_BB (cfg, is_ref_bb); @@ -3607,7 +3607,7 @@ handle_delegate_ctor (MonoCompile *cfg, MonoClass *klass, MonoInst *target, Mono } } - /* + /* * To avoid looking up the compiled code belonging to the target method * in mono_delegate_trampoline (), we allocate a per-domain memory slot to * store it, and we fill it after the method has been compiled. @@ -3842,7 +3842,7 @@ mono_emit_load_got_addr (MonoCompile *cfg) cfg->got_var_allocated = TRUE; - /* + /* * Add a dummy use to keep the got_var alive, since real uses might * only be generated by the back ends. * Add it to end_bblock, so the variable's lifetime covers the whole @@ -4056,7 +4056,7 @@ mono_method_check_inlining (MonoCompile *cfg, MonoMethod *method) if (method_does_not_return (method)) return FALSE; - + return TRUE; } @@ -4169,7 +4169,7 @@ mini_emit_ldelema_1_ins (MonoCompile *cfg, MonoClass *klass, MonoInst *arr, Mono return ins; } -#endif +#endif add_reg = alloc_ireg_mp (cfg); @@ -4235,21 +4235,21 @@ mini_emit_ldelema_2_ins (MonoCompile *cfg, MonoClass *klass, MonoInst *arr, Mono #endif /* range checking */ - MONO_EMIT_NEW_LOAD_MEMBASE (cfg, bounds_reg, + MONO_EMIT_NEW_LOAD_MEMBASE (cfg, bounds_reg, arr->dreg, MONO_STRUCT_OFFSET (MonoArray, bounds)); - MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADI4_MEMBASE, low1_reg, + MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADI4_MEMBASE, low1_reg, bounds_reg, MONO_STRUCT_OFFSET (MonoArrayBounds, lower_bound)); MONO_EMIT_NEW_BIALU (cfg, OP_PSUB, realidx1_reg, index1, low1_reg); - MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADI4_MEMBASE, high1_reg, + MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADI4_MEMBASE, high1_reg, bounds_reg, MONO_STRUCT_OFFSET (MonoArrayBounds, length)); MONO_EMIT_NEW_BIALU (cfg, OP_COMPARE, -1, high1_reg, realidx1_reg); MONO_EMIT_NEW_COND_EXC (cfg, LE_UN, "IndexOutOfRangeException"); - MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADI4_MEMBASE, low2_reg, + MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADI4_MEMBASE, low2_reg, bounds_reg, sizeof (MonoArrayBounds) + MONO_STRUCT_OFFSET (MonoArrayBounds, lower_bound)); MONO_EMIT_NEW_BIALU (cfg, OP_PSUB, realidx2_reg, index2, low2_reg); - MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADI4_MEMBASE, high2_reg, + MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADI4_MEMBASE, high2_reg, bounds_reg, sizeof (MonoArrayBounds) + MONO_STRUCT_OFFSET (MonoArrayBounds, length)); MONO_EMIT_NEW_BIALU (cfg, OP_COMPARE, -1, high2_reg, realidx2_reg); MONO_EMIT_NEW_COND_EXC (cfg, LE_UN, "IndexOutOfRangeException"); @@ -4387,7 +4387,7 @@ mini_emit_memory_barrier (MonoCompile *cfg, int kind) * redirection. */ inline static MonoInst* -mini_redirect_call (MonoCompile *cfg, MonoMethod *method, +mini_redirect_call (MonoCompile *cfg, MonoMethod *method, MonoMethodSignature *signature, MonoInst **args, MonoInst *this_ins) { if (method->klass == mono_defaults.string_class) { @@ -4424,7 +4424,7 @@ mono_save_args (MonoCompile *cfg, MonoMethodSignature *sig, MonoInst **sp) * FIXME: We should use *args++ = sp [0], but that would mean the arg * would be different than the MonoInst's used to represent arguments, and * the ldelema implementation can't deal with that. - * Solution: When ldelema is used on an inline argument, create a var for + * Solution: When ldelema is used on an inline argument, create a var for * it, emit ldelema on that var, and emit the saving code below in * inline_method () if needed. */ @@ -4446,7 +4446,7 @@ check_inline_called_method_name_limit (MonoMethod *called_method) { int strncmp_result; static const char *limit = NULL; - + if (limit == NULL) { const char *limit_string = g_getenv ("MONO_INLINE_CALLED_METHOD_NAME_LIMIT"); @@ -4461,7 +4461,7 @@ check_inline_called_method_name_limit (MonoMethod *called_method) strncmp_result = strncmp (called_method_name, limit, strlen (limit)); g_free (called_method_name); - + //return (strncmp_result <= 0); return (strncmp_result == 0); } else { @@ -4476,7 +4476,7 @@ check_inline_caller_method_name_limit (MonoMethod *caller_method) { int strncmp_result; static const char *limit = NULL; - + if (limit == NULL) { const char *limit_string = g_getenv ("MONO_INLINE_CALLER_METHOD_NAME_LIMIT"); if (limit_string != NULL) { @@ -4491,7 +4491,7 @@ check_inline_caller_method_name_limit (MonoMethod *caller_method) strncmp_result = strncmp (caller_method_name, limit, strlen (limit)); g_free (caller_method_name); - + //return (strncmp_result <= 0); return (strncmp_result == 0); } else { @@ -4731,7 +4731,7 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, prev_cbb->next_bb = sbblock; link_bblock (cfg, prev_cbb, sbblock); - /* + /* * Get rid of the begin and end bblocks if possible to aid local * optimizations. */ @@ -4756,7 +4756,7 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, cfg->cbb = ebblock; } } else { - /* + /* * Its possible that the rvar is set in some prev bblock, but not in others. * (#1835). */ @@ -4779,7 +4779,7 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, if (rvar) { /* - * If the inlined method contains only a throw, then the ret var is not + * If the inlined method contains only a throw, then the ret var is not * set, so set it to a dummy value. */ if (!ret_var_set) @@ -4808,16 +4808,16 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, /* * Some of these comments may well be out-of-date. - * Design decisions: we do a single pass over the IL code (and we do bblock + * Design decisions: we do a single pass over the IL code (and we do bblock * splitting/merging in the few cases when it's required: a back jump to an IL * address that was not already seen as bblock starting point). * Code is validated as we go (full verification is still better left to metadata/verify.c). - * Complex operations are decomposed in simpler ones right away. We need to let the - * arch-specific code peek and poke inside this process somehow (except when the + * Complex operations are decomposed in simpler ones right away. We need to let the + * arch-specific code peek and poke inside this process somehow (except when the * optimizations can take advantage of the full semantic info of coarse opcodes). * All the opcodes of the form opcode.s are 'normalized' to opcode. - * MonoInst->opcode initially is the IL opcode or some simplification of that - * (OP_LOAD, OP_STORE). The arch-specific code may rearrange it to an arch-specific + * MonoInst->opcode initially is the IL opcode or some simplification of that + * (OP_LOAD, OP_STORE). The arch-specific code may rearrange it to an arch-specific * opcode with value bigger than OP_LAST. * At this point the IR can be handed over to an interpreter, a dumb code generator * or to the optimizing code generator that will translate it to SSA form. @@ -4825,7 +4825,7 @@ inline_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, * Profiling directed optimizations. * We may compile by default with few or no optimizations and instrument the code * or the user may indicate what methods to optimize the most either in a config file - * or through repeated runs where the compiler applies offline the optimizations to + * or through repeated runs where the compiler applies offline the optimizations to * each method and then decides if it was worth it. */ @@ -4867,7 +4867,7 @@ get_basic_blocks (MonoCompile *cfg, MonoMethodHeader* header, guint real_offset, opcode = &mono_opcodes [i]; switch (opcode->argument) { case MonoInlineNone: - ip++; + ip++; break; case MonoInlineString: case MonoInlineType: @@ -4907,7 +4907,7 @@ get_basic_blocks (MonoCompile *cfg, MonoMethodHeader* header, guint real_offset, cli_addr += 5 + 4 * n; target = start + cli_addr; GET_BBLOCK (cfg, bblock, target); - + for (j = 0; j < n; ++j) { target = start + cli_addr + (gint32)read32 (ip); GET_BBLOCK (cfg, bblock, target); @@ -4925,7 +4925,7 @@ get_basic_blocks (MonoCompile *cfg, MonoMethodHeader* header, guint real_offset, if (i == CEE_THROW) { guchar *bb_start = ip - 1; - + /* Find the start of the bblock containing the throw */ bblock = NULL; while ((bb_start >= start) && !bblock) { @@ -4998,7 +4998,7 @@ mini_get_signature (MonoMethod *method, guint32 token, MonoGenericContext *conte } /* - * Return the original method is a wrapper is specified. We can only access + * Return the original method is a wrapper is specified. We can only access * the custom attributes from the original method. */ static MonoMethod* @@ -5154,7 +5154,7 @@ initialize_array_data (MonoCompile *cfg, MonoMethod *method, gboolean aot, gucha if (aot && data_ptr) data_ptr = (const char *)GUINT_TO_POINTER (rva); } else { - /*FIXME is it possible to AOT a SRE assembly not meant to be saved? */ + /*FIXME is it possible to AOT a SRE assembly not meant to be saved? */ g_assert (!aot); data_ptr = mono_field_get_data (field); } @@ -5263,7 +5263,7 @@ emit_stloc_ir (MonoCompile *cfg, MonoInst **sp, MonoMethodHeader *header, int n) if (!cfg->deopt && (opcode == OP_MOVE) && cfg->cbb->last_ins == sp [0] && ((sp [0]->opcode == OP_ICONST) || (sp [0]->opcode == OP_I8CONST))) { /* Optimize reg-reg moves away */ - /* + /* * Can't optimize other opcodes, since sp[0] might point to * the last ins of a decomposed opcode. */ @@ -6105,7 +6105,7 @@ mono_opcode_decode (guchar *ip, guint op_size, MonoOpcodeEnum il_op, MonoOpcodeP * * @start_bblock: if not NULL, the starting basic block, used during inlining. * @end_bblock: if not NULL, the ending basic block, used during inlining. - * @return_var: if not NULL, the place where the return value is stored, used during inlining. + * @return_var: if not NULL, the place where the return value is stored, used during inlining. * @inline_args: if not NULL, contains the arguments to the inline call * @inline_offset: if not zero, the real offset from the inline call, or zero otherwise. * @is_virtual_call: whether this method is being called as a result of a call to callvirt @@ -6115,12 +6115,12 @@ mono_opcode_decode (guchar *ip, guint op_size, MonoOpcodeEnum il_op, MonoOpcodeP * inlining existing methods. In the former case, the @start_bblock, * @end_bblock, @return_var, @inline_args are all set to NULL, and the * inline_offset is set to zero. - * + * * Returns: the inline cost, or -1 if there was an error processing this method. */ int -mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_bblock, MonoBasicBlock *end_bblock, - MonoInst *return_var, MonoInst **inline_args, +mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_bblock, MonoBasicBlock *end_bblock, + MonoInst *return_var, MonoInst **inline_args, guint inline_offset, gboolean is_virtual_call) { ERROR_DECL (error); @@ -6251,7 +6251,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b } } - /* + /* * Methods without init_locals set could cause asserts in various passes * (#497220). To work around this, we emit dummy initialization opcodes * (OP_DUMMY_ICONST etc.) which generate no code. These are only supported @@ -6348,7 +6348,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b if (clause->flags == MONO_EXCEPTION_CLAUSE_FINALLY) mono_create_exvar_for_offset (cfg, clause->handler_offset); /* - * Linking the try block with the EH block hinders inlining as we won't be able to + * Linking the try block with the EH block hinders inlining as we won't be able to * merge the bblocks from inlining and produce an artificial hole for no good reason. */ if (COMPILE_LLVM (cfg)) @@ -6401,7 +6401,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b #else MonoInst *dummy_use; - /* + /* * Add a dummy use for the exvar so its liveness info will be * correct. */ @@ -6543,7 +6543,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b ins->sreg1 = dreg; MONO_ADD_INS (cfg->cbb, ins); cfg->gsharedvt_locals_var_ins = ins; - + cfg->flags |= MONO_CFG_HAS_ALLOCA; /* if (init_locals) @@ -7014,7 +7014,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b MONO_ADD_INS (cfg->cbb, ins); } *f = parameter.f; - *sp++ = ins; + *sp++ = ins; break; } case MONO_CEE_LDC_R8: { @@ -7092,7 +7092,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b /* FIXME: check the signature matches */ cmethod = mini_get_method (cfg, method, token, NULL, generic_context); CHECK_CFG_ERROR; - + if (cfg->gshared && mono_method_check_context_used (cmethod)) GENERIC_SHARING_FAILURE (CEE_JMP); @@ -7551,7 +7551,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b MonoBasicBlock *tbb; GET_BBLOCK (cfg, tbb, next_ip); - /* + /* * Only extend try blocks with a finally, to avoid catching exceptions thrown * from Monitor.Enter like ArgumentNullException. */ @@ -7576,7 +7576,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b } CHECK_CFG_ERROR; - /* + /* * If the callee is a shared method, then its static cctor * might not get called after the call was patched. */ @@ -7678,8 +7678,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b g_assert (!vtable_arg); if (!cfg->compile_aot) { - /* - * emit_get_rgctx_method () calls mono_class_vtable () so check + /* + * emit_get_rgctx_method () calls mono_class_vtable () so check * for type load errors before. */ mono_class_setup_vtable (cmethod->klass); @@ -8013,7 +8013,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b if (array_rank) { MonoInst *addr; - if (strcmp (cmethod->name, "Set") == 0) { /* array Set */ + if (strcmp (cmethod->name, "Set") == 0) { /* array Set */ MonoInst *val = sp [fsig->param_count]; if (val->type == STACK_OBJ) { @@ -8199,7 +8199,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b } ins_flag = 0; constrained_class = NULL; - + if (need_seq_point) { //check is is a nested call and remove the non_empty_stack of the last call, only for non native methods if (!(method->flags & METHOD_IMPL_ATTRIBUTE_NATIVE)) { @@ -8222,10 +8222,10 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b if (cfg->method != method) { /* return from inlined method */ - /* + /* * If in_count == 0, that means the ret is unreachable due to * being preceded by a throw. In that case, inline_method () will - * handle setting the return value + * handle setting the return value * (test case: test_0_inline_throw ()). */ if (return_var && cfg->cbb->in_count) { @@ -8242,7 +8242,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b //g_assert (returnvar != -1); EMIT_NEW_TEMPSTORE (cfg, store, return_var->inst_c0, *sp); cfg->ret_var_set = TRUE; - } + } } else { if (cfg->lmf_var && cfg->cbb->in_count && (!cfg->llvm_only || cfg->deopt)) emit_pop_lmf (cfg); @@ -8251,7 +8251,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b MonoType *ret_type = mini_get_underlying_type (mono_method_signature_internal (method)->ret); if (seq_points && !sym_seq_points) { - /* + /* * Place a seq point here too even through the IL stack is not * empty, so a step over on * call @@ -8415,7 +8415,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b n = read32 (ip + 1); --sp; src1 = sp [0]; - if ((src1->type != STACK_I4) && (src1->type != STACK_PTR)) + if ((src1->type != STACK_I4) && (src1->type != STACK_PTR)) UNVERIFIED; ip += 5; @@ -8432,7 +8432,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b } if (sp != stack_start) { - /* + /* * Link the current bb with the targets as well, so handle_stack_args * will set their in_stack correctly. */ @@ -8843,8 +8843,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b MonoInst *iargs [2]; if (image == mono_defaults.corlib) { - /* - * Avoid relocations in AOT and save some space by using a + /* + * Avoid relocations in AOT and save some space by using a * version of helper_ldstr specialized to mscorlib. */ EMIT_NEW_ICONST (cfg, iargs [0], mono_metadata_token_index (n)); @@ -8855,13 +8855,13 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b EMIT_NEW_ICONST (cfg, iargs [1], mono_metadata_token_index (n)); *sp = mono_emit_jit_icall (cfg, mono_helper_ldstr, iargs); } - } + } else if (cfg->compile_aot) { NEW_LDSTRCONST (cfg, ins, image, n); *sp = ins; MONO_ADD_INS (cfg->cbb, ins); - } + } else { NEW_PCONST (cfg, ins, NULL); ins->type = STACK_OBJ; @@ -8930,13 +8930,13 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b n = fsig->param_count; CHECK_STACK (n); - /* + /* * Generate smaller code for the common newobj instruction in * argument checking code. */ if (cfg->cbb->out_of_line && m_class_get_image (cmethod->klass) == mono_defaults.corlib && is_exception_class (cmethod->klass) && n <= 2 && - ((n < 1) || (!m_type_is_byref (fsig->params [0]) && fsig->params [0]->type == MONO_TYPE_STRING)) && + ((n < 1) || (!m_type_is_byref (fsig->params [0]) && fsig->params [0]->type == MONO_TYPE_STRING)) && ((n < 2) || (!m_type_is_byref (fsig->params [1]) && fsig->params [1]->type == MONO_TYPE_STRING))) { MonoInst *iargs [3]; @@ -9047,7 +9047,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b g_assert (!context_used); g_assert (!vtable_arg); /* we simply pass a null pointer */ - EMIT_NEW_PCONST (cfg, *sp, NULL); + EMIT_NEW_PCONST (cfg, *sp, NULL); /* now call the string ctor */ alloc = mini_emit_method_call_full (cfg, cmethod, fsig, FALSE, sp, NULL, NULL, NULL); } else { @@ -9058,7 +9058,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b alloc = NULL; - /* + /* * The code generated by mini_emit_virtual_call () expects * iargs [0] to be a boxed instance, but luckily the vcall * will be transformed into a normal call there. @@ -9113,7 +9113,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b } else { *sp++ = alloc; } - + inline_costs += 5; if (!(seq_point_locs && mono_bitset_test_fast (seq_point_locs, next_ip - header->code))) emit_seq_point (cfg, method, next_ip, FALSE, TRUE); @@ -9278,8 +9278,8 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b } // Optimize - // - // box + // + // box // call object::GetType() // guint32 gettype_token; @@ -9297,7 +9297,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b } ins->type = STACK_OBJ; ins->klass = mono_defaults.systemtype_class; - *sp++ = ins; + *sp++ = ins; next_ip = ip; break; } @@ -9305,13 +9305,13 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b } // Optimize - // + // // box // ldnull // ceq (or cgt.un) - // + // // to just - // + // // ldc.i4.0 (or 1) guchar* ldnull_ip; if ((ldnull_ip = il_read_op (next_ip, end, CEE_LDNULL, MONO_CEE_LDNULL)) && ip_in_bb (cfg, cfg->cbb, ldnull_ip)) { @@ -9321,7 +9321,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b else if ((ip = il_read_op (ldnull_ip, end, CEE_PREFIX1, MONO_CEE_CGT_UN))) is_neq = TRUE; - if ((is_eq || is_neq) && ip_in_bb (cfg, cfg->cbb, ip) && + if ((is_eq || is_neq) && ip_in_bb (cfg, cfg->cbb, ip) && !mono_class_is_nullable (klass) && !mini_is_gsharedvt_klass (klass)) { next_ip = ip; il_op = (MonoOpcodeEnum) (is_eq ? CEE_LDC_I4_0 : CEE_LDC_I4_1); @@ -9331,7 +9331,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b break; } } - + guint32 isinst_tk = 0; if ((ip = il_read_op_and_token (next_ip, end, CEE_ISINST, MONO_CEE_ISINST, &isinst_tk)) && ip_in_bb (cfg, cfg->cbb, ip)) { @@ -9342,13 +9342,13 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b !mono_class_is_open_constructed_type (m_class_get_byval_arg (isinst_class))) { // Optimize - // + // // box // isinst [Type] // brfalse/brtrue - // + // // to - // + // // ldc.i4.0 (or 1) // brfalse/brtrue // @@ -9366,14 +9366,14 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b } // Optimize - // + // // box // isinst [Type] // ldnull // ceq/cgt.un - // + // // to - // + // // ldc.i4.0 (or 1) // guchar* ldnull_ip = NULL; @@ -9384,7 +9384,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b else if ((ip = il_read_op (ldnull_ip, end, CEE_PREFIX1, MONO_CEE_CGT_UN))) is_neq = TRUE; - if ((is_eq || is_neq) && ip_in_bb (cfg, cfg->cbb, ip) && + if ((is_eq || is_neq) && ip_in_bb (cfg, cfg->cbb, ip) && !mono_class_is_nullable (klass) && !mini_is_gsharedvt_klass (klass)) { gboolean isinst = mono_class_is_assignable_from_internal (isinst_class, klass); next_ip = ip; @@ -9399,13 +9399,13 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b } // Optimize - // + // // box // isinst [Type] // unbox.any - // + // // to - // + // // nop // guchar* unbox_ip = NULL; @@ -9448,7 +9448,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b printf ("\n"); } - /* + /* * We need to link both bblocks, since it is needed for handling stack * arguments correctly (See test_0_box_brtrue_opt_regress_81102). * Branching to only one of them would lead to inconsistencies, so @@ -9968,7 +9968,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b case MONO_TYPE_I1: EMIT_NEW_ICONST (cfg, *sp, *((gint8 *)addr)); sp++; - break; + break; case MONO_TYPE_CHAR: case MONO_TYPE_U2: EMIT_NEW_ICONST (cfg, *sp, *((guint16 *)addr)); @@ -9982,7 +9982,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b case MONO_TYPE_I4: EMIT_NEW_ICONST (cfg, *sp, *((gint32 *)addr)); sp++; - break; + break; case MONO_TYPE_U4: EMIT_NEW_ICONST (cfg, *sp, *((guint32 *)addr)); sp++; @@ -10134,7 +10134,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b *sp++ = ins; inline_costs += 1; - /* + /* * we inline/optimize the initialization sequence if possible. * we should also allocate the array as not cleared, since we spend as much time clearing to 0 as initializing * for small sizes open code the memcpy @@ -10515,7 +10515,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b MONO_INST_NEW (cfg, ins, OP_NOT_REACHED); MONO_ADD_INS (cfg->cbb, ins); sp = stack_start; - + link_bblock (cfg, cfg->cbb, end_bblock); start_new_bblock = 1; /* This can complicate code generation for llvm since the return value might not be defined */ @@ -10549,7 +10549,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b g_assert (sp >= stack_start); sp = stack_start; - /* + /* * If this leave statement is in a catch block, check for a * pending exception, and rethrow it if necessary. * We avoid doing this in runtime invoke wrappers, since those are called @@ -10558,7 +10558,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b for (i = 0; i < header->num_clauses; ++i) { MonoExceptionClause *clause = &header->clauses [i]; - /* + /* * Use <= in the final comparison to handle clauses with multiple * leave statements, like in bug #78024. * The ordering of the exception clauses guarantees that we find the @@ -10579,9 +10579,9 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b NEW_BBLOCK (cfg, dont_throw); /* - * Currently, we always rethrow the abort exception, despite the - * fact that this is not correct. See thread6.cs for an example. - * But propagating the abort exception is more important than + * Currently, we always rethrow the abort exception, despite the + * fact that this is not correct. See thread6.cs for an example. + * But propagating the abort exception is more important than * getting the semantics right. */ MONO_EMIT_NEW_BIALU_IMM (cfg, OP_COMPARE_IMM, -1, exc_ins->dreg, 0); @@ -10645,7 +10645,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b if (COMPILE_LLVM (cfg)) { MonoBasicBlock *target_bb; - /* + /* * Link the finally bblock with the target, since it will * conceptually branch there. */ @@ -10654,7 +10654,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b link_bblock (cfg, tblock, target_bb); } } - } + } MONO_INST_NEW (cfg, ins, OP_BR); MONO_ADD_INS (cfg->cbb, ins); @@ -11167,7 +11167,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b case MONO_CEE_ARGLIST: { /* somewhat similar to LDTOKEN */ MonoInst *addr, *vtvar; - vtvar = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.argumenthandle_class), OP_LOCAL); + vtvar = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.argumenthandle_class), OP_LOCAL); EMIT_NEW_TEMPLOADA (cfg, addr, vtvar->inst_c0); EMIT_NEW_UNALU (cfg, ins, OP_ARGLIST, -1, addr->dreg); @@ -11767,7 +11767,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b g_free (mname); } - if ((cfg->verbose_level > 2) && (cfg->method == method)) + if ((cfg->verbose_level > 2) && (cfg->method == method)) mono_print_code (cfg, "AFTER METHOD-TO-IR"); goto cleanup; @@ -11778,7 +11778,7 @@ mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_b g_assert (!is_ok (cfg->error)); goto cleanup; - + exception_exit: if (cfg->verbose_level > 3) g_print ("exiting due to exception"); @@ -11822,7 +11822,7 @@ store_membase_reg_to_store_membase_imm (int opcode) } return -1; -} +} int mono_op_to_op_imm (int opcode) @@ -12128,7 +12128,7 @@ op_to_op_src2_membase (MonoCompile *cfg, int load_opcode, int opcode) #ifdef TARGET_X86 if (!((load_opcode == OP_LOAD_MEMBASE) || (load_opcode == OP_LOADI4_MEMBASE) || (load_opcode == OP_LOADU4_MEMBASE))) return -1; - + switch (opcode) { case OP_COMPARE: case OP_ICOMPARE: @@ -12300,7 +12300,7 @@ mono_handle_global_vregs (MonoCompile *cfg) /* Find local vregs used in more than one bb */ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) { - MonoInst *ins = bb->code; + MonoInst *ins = bb->code; int block_num = bb->block_num; if (cfg->verbose_level > 2) @@ -12439,7 +12439,7 @@ mono_handle_global_vregs (MonoCompile *cfg) /* Putting R4 vars into registers doesn't work currently */ /* The gsharedvt vars are implicitly referenced by ldaddr opcodes, but those opcodes are only generated later */ if ((var->opcode != OP_ARG) && (var != cfg->ret) && !(var->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT)) && (vreg_to_bb [var->dreg] != -1) && (m_class_get_byval_arg (var->klass)->type != MONO_TYPE_R4) && !cfg->disable_vreg_to_lvreg && var != cfg->gsharedvt_info_var && var != cfg->gsharedvt_locals_var && var != cfg->lmf_addr_var) { - /* + /* * Make that the variable's liveness interval doesn't contain a call, since * that would cause the lvreg to be spilled, making the whole optimization * useless. @@ -12488,7 +12488,7 @@ mono_handle_global_vregs (MonoCompile *cfg) } } - /* + /* * Compress the varinfo and vars tables so the liveness computation is faster and * takes up less space. */ @@ -12559,7 +12559,7 @@ mono_allocate_gsharedvt_vars (MonoCompile *cfg) /** * mono_spill_global_vars: * - * Generate spill code for variables which are not allocated to registers, + * Generate spill code for variables which are not allocated to registers, * and replace vregs with their allocated hregs. *need_local_opts is set to TRUE if * code is generated which could be optimized by the local optimization passes. */ @@ -12634,11 +12634,11 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) ins->flags |= MONO_INST_GC_TRACK; } } - + /* FIXME: widening and truncation */ /* - * As an optimization, when a variable allocated to the stack is first loaded into + * As an optimization, when a variable allocated to the stack is first loaded into * an lvreg, we will remember the lvreg and use it the next time instead of loading * the variable again. */ @@ -12648,7 +12648,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) lvregs = (guint32 *)mono_mempool_alloc (cfg->mempool, sizeof (guint32) * lvregs_size); lvregs_len = 0; - /* + /* * These arrays contain the first and last instructions accessing a given * variable. * Since we emit bblocks in the same order we process them here, and we @@ -12665,7 +12665,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) live_range_end = g_new0 (MonoInst*, cfg->next_vreg); live_range_start_bb = g_new (MonoBasicBlock*, cfg->next_vreg); live_range_end_bb = g_new (MonoBasicBlock*, cfg->next_vreg); - + /* Add spill loads/stores */ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) { MonoInst *ins; @@ -12691,7 +12691,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) if (ins->opcode == OP_NOP) continue; - /* + /* * We handle LDADDR here as well, since it can only be decomposed * when variable addresses are known. */ @@ -12835,7 +12835,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) if (var->opcode == OP_REGVAR) { ins->dreg = var->dreg; } else if ((ins->dreg == ins->sreg1) && (spec [MONO_INST_DEST] == 'i') && (spec [MONO_INST_SRC1] == 'i') && !vreg_to_lvreg [ins->dreg] && (op_to_op_dest_membase (store_opcode, ins->opcode) != -1)) { - /* + /* * Instead of emitting a load+store, use a _membase opcode. */ g_assert (var->opcode == OP_REGOFFSET); @@ -12924,7 +12924,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) def_ins = store_ins; - /* + /* * We can't assign ins->dreg to var->dreg here, since the * sregs could use it. So set a flag, and do it after * the sregs. @@ -13142,7 +13142,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) } } } - + /* * Emit LIVERANGE_START/LIVERANGE_END opcodes, the backend will implement them * by storing the current native offset into MonoMethodVar->live_range_start/end. @@ -13199,7 +13199,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) * - get rid of TEMPLOADs if possible and use vregs instead * - clean up usage of OP_P/OP_ opcodes * - cleanup usage of DUMMY_USE - * - cleanup the setting of ins->type for MonoInst's which are pushed on the + * - cleanup the setting of ins->type for MonoInst's which are pushed on the * stack * - set the stack type and allocate a dreg in the EMIT_NEW macros * - get rid of all the 2 stuff when the new JIT is ready. @@ -13211,7 +13211,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) * - most back ends unify fp compare+branch, fp compare+ceq * - integrate mono_save_args into inline_method * - get rid of the empty bblocks created by MONO_EMIT_NEW_BRACH_BLOCK2 - * - handle long shift opts on 32 bit platforms somehow: they require + * - handle long shift opts on 32 bit platforms somehow: they require * 3 sregs (2 for arg1 and 1 for arg2) * - make byref a 'normal' type. * - use vregs for bb->out_stacks if possible, handle_global_vreg will make them a @@ -13232,7 +13232,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) * - promote RuntimeXHandles to vregs * - vtype cleanups: * - add a NEW_VARLOADA_VREG macro - * - the vtype optimizations are blocked by the LDADDR opcodes generated for + * - the vtype optimizations are blocked by the LDADDR opcodes generated for * accessing vtype fields. * - get rid of I8CONST on 64 bit platforms * - dealing with the increase in code size due to branches created during opcode @@ -13255,7 +13255,7 @@ mono_spill_global_vars (MonoCompile *cfg, gboolean *need_local_opts) * specific function. * - unify the float comparison opcodes with the other comparison opcodes, i.e. * fcompare + branchCC. - * - create a helper function for allocating a stack slot, taking into account + * - create a helper function for allocating a stack slot, taking into account * MONO_CFG_HAS_SPILLUP. * - merge r68207. * - optimize mono_regstate2_alloc_int/float. @@ -13281,8 +13281,8 @@ NOTES no longer contains the necessary information. But it is easier to do. - later: harder to implement, enables more optimizations. - Branches inside bblocks: - - created when decomposing complex opcodes. - - branches to another bblock: harmless, but not tracked by the branch + - created when decomposing complex opcodes. + - branches to another bblock: harmless, but not tracked by the branch optimizations, so need to branch to a label at the start of the bblock. - branches to inside the same bblock: very problematic, trips up the local reg allocator. Can be fixed by spitting the current bblock, but that is a @@ -13297,7 +13297,7 @@ NOTES - earlier -> saves work later on since the IR will be smaller/simpler - later -> can work on more instructions - Handling of valuetypes: - - When a vtype is pushed on the stack, a new temporary is created, an + - When a vtype is pushed on the stack, a new temporary is created, an instruction computing its address (LDADDR) is emitted and pushed on the stack. Need to optimize cases when the vtype is used immediately as in argument passing, stloc etc. diff --git a/src/mono/mono/mini/mini-amd64-gsharedvt.c b/src/mono/mono/mini/mini-amd64-gsharedvt.c index 77fc0e3b891899..b2a202195ca58d 100644 --- a/src/mono/mono/mini/mini-amd64-gsharedvt.c +++ b/src/mono/mono/mini/mini-amd64-gsharedvt.c @@ -62,7 +62,7 @@ arg_info_desc (ArgInfo *info) g_string_append_printf (str, "offset %d reg %s storage %s nregs %d", info->offset, mono_arch_regname (info->reg), storage_name (info->storage), info->nregs); if (info->storage == ArgValuetypeInReg) - g_string_append_printf (str, " {(%s %s), (%s %s)", + g_string_append_printf (str, " {(%s %s), (%s %s)", storage_name (info->pair_storage [0]), mono_arch_regname (info->pair_regs [0]), storage_name (info->pair_storage [1]), @@ -432,7 +432,7 @@ mono_arch_get_gsharedvt_call_info (MonoMemoryManager *mem_manager, gpointer addr #ifdef DEBUG_AMD64_GSHAREDVT printf ("final map:\n"); for (i = 0; i < map->len; i += 2) { - printf ("\t[%d] src %x dst %x\n ", + printf ("\t[%d] src %x dst %x\n ", i / 2, GPOINTER_TO_UINT (g_ptr_array_index (map, i)), GPOINTER_TO_UINT (g_ptr_array_index (map, i + 1))); diff --git a/src/mono/mono/mini/mini-amd64.c b/src/mono/mono/mini/mini-amd64.c index 7e1f5a879ea6ec..72c5d1e34060e5 100644 --- a/src/mono/mono/mini/mini-amd64.c +++ b/src/mono/mono/mini/mini-amd64.c @@ -100,7 +100,7 @@ mono_arch_regname (int reg) case AMD64_RBX: return "%rbx"; case AMD64_RCX: return "%rcx"; case AMD64_RDX: return "%rdx"; - case AMD64_RSP: return "%rsp"; + case AMD64_RSP: return "%rsp"; case AMD64_RBP: return "%rbp"; case AMD64_RDI: return "%rdi"; case AMD64_RSI: return "%rsi"; @@ -505,7 +505,7 @@ allocate_storage_for_valuetype_win64 (ArgInfo *arg_info, MonoType *type, gboolea if (!allocate_parameter_register_for_valuetype_win64 (arg_info, !MONO_TYPE_ISSTRUCT (type) ? arg_class : ARG_CLASS_INTEGER, arg_size, current_int_reg, current_float_reg)) { /* No more registers, fallback passing parameter on stack as value. */ assert (arg_info->pair_storage [0] == ArgNone && arg_info->pair_storage [1] == ArgNone && arg_info->pair_size [0] == 0 && arg_info->pair_size [1] == 0 && arg_info->nregs == 0); - + /* Passing value directly on stack, so use size of value. */ arg_info->storage = ArgOnStack; arg_size = ALIGN_TO (arg_size, sizeof (target_mgreg_t)); @@ -519,7 +519,7 @@ allocate_storage_for_valuetype_win64 (ArgInfo *arg_info, MonoType *type, gboolea if (!allocate_parameter_register_for_valuetype_win64 (arg_info, ARG_CLASS_INTEGER, arg_size, current_int_reg, current_float_reg)) { /* No more registers, fallback passing address to parameter on stack. */ assert (arg_info->pair_storage [0] == ArgNone && arg_info->pair_storage [1] == ArgNone && arg_info->pair_size [0] == 0 && arg_info->pair_size [1] == 0 && arg_info->nregs == 0); - + /* Passing an address to value on stack, so use size of register as argument size. */ arg_info->storage = ArgValuetypeAddrOnStack; arg_size = sizeof (target_mgreg_t); @@ -561,7 +561,7 @@ get_valuetype_size_win64 (MonoClass *klass, gboolean pinvoke, ArgInfo *arg_info, *arg_class = ARG_CLASS_NO_CLASS; assert (klass != NULL && arg_info != NULL && type != NULL && arg_class != NULL && arg_size != NULL); - + if (pinvoke) { /* Calculate argument class type and size of marshalled type. */ MonoMarshalType *info = mono_marshal_load_type_info (klass); @@ -602,7 +602,7 @@ add_valuetype_win64 (MonoMethodSignature *signature, ArgInfo *arg_info, MonoType guint32 arg_size = SIZEOF_REGISTER; MonoClass *klass = NULL; ArgumentClass arg_class; - + assert (signature != NULL && arg_info != NULL && type != NULL && current_int_reg != NULL && current_float_reg != NULL && stack_size != NULL); klass = mono_class_from_mono_type_internal (type); @@ -972,7 +972,7 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig) if (!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG) && (n == 0)) { gr = PARAM_REGS; fr = FLOAT_PARAM_REGS; - + /* Emit the signature cookie just before the implicit arguments */ add_general (&gr, &stack_size, &cinfo->sig_cookie); } @@ -991,8 +991,8 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig) if (!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG) && (i == sig->sentinelpos)) { /* We allways pass the sig cookie on the stack for simplicity */ - /* - * Prevent implicit arguments + the sig cookie from being passed + /* + * Prevent implicit arguments + the sig cookie from being passed * in registers. */ gr = PARAM_REGS; @@ -1077,7 +1077,7 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig) if (!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG) && (n > 0) && (sig->sentinelpos == sig->param_count)) { gr = PARAM_REGS; fr = FLOAT_PARAM_REGS; - + /* Emit the signature cookie just before the implicit arguments */ add_general (&gr, &stack_size, &cinfo->sig_cookie); } @@ -1349,7 +1349,7 @@ mono_arch_get_native_call_context_ret (CallContext *ccontext, gpointer frame, Mo * @arg_info: an array to store the result infos * * Gathers information on parameters such as size, alignment and - * padding. arg_info should be large enought to hold param_count + 1 entries. + * padding. arg_info should be large enought to hold param_count + 1 entries. * * Returns the size of the argument area on the stack. */ @@ -1518,7 +1518,7 @@ mono_arch_get_allocatable_int_vars (MonoCompile *cfg) if (vmv->range.first_use.abs_pos >= vmv->range.last_use.abs_pos) continue; - if ((ins->flags & (MONO_INST_IS_DEAD|MONO_INST_VOLATILE|MONO_INST_INDIRECT)) || + if ((ins->flags & (MONO_INST_IS_DEAD|MONO_INST_VOLATILE|MONO_INST_INDIRECT)) || (ins->opcode != OP_LOCAL && ins->opcode != OP_ARG)) continue; @@ -1584,7 +1584,7 @@ mono_arch_compute_omit_fp (MonoCompile *cfg) ArgInfo *ainfo = &cinfo->args [i]; if (ainfo->storage == ArgOnStack || ainfo->storage == ArgValuetypeAddrInIReg || ainfo->storage == ArgValuetypeAddrOnStack) { - /* + /* * The stack offset can only be determined when the frame * size is known. */ @@ -1628,7 +1628,7 @@ mono_arch_get_global_int_regs (MonoCompile *cfg) /* * mono_arch_regalloc_cost: * - * Return the cost, in number of memory references, of the action of + * Return the cost, in number of memory references, of the action of * allocating the variable VMV into a register during global register * allocation. */ @@ -1666,8 +1666,8 @@ mono_arch_fill_argument_info (MonoCompile *cfg) /* * Contrary to mono_arch_allocate_vars (), the information should describe - * where the arguments are at the beginning of the method, not where they can be - * accessed during the execution of the method. The later makes no sense for the + * where the arguments are at the beginning of the method, not where they can be + * accessed during the execution of the method. The later makes no sense for the * global register allocator, since a variable can be in more than one location. */ switch (cinfo->ret.storage) { @@ -1714,7 +1714,7 @@ mono_arch_fill_argument_info (MonoCompile *cfg) } } } - + void mono_arch_allocate_vars (MonoCompile *cfg) { @@ -1832,7 +1832,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) cfg->locals_min_stack_offset = - (offset + locals_stack_size); cfg->locals_max_stack_offset = - offset; } - + for (i = cfg->locals_start; i < cfg->num_varinfo; i++) { if (offsets [i] != -1) { MonoInst *ins = cfg->varinfo [i]; @@ -1863,7 +1863,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) if (ins->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT)) inreg = FALSE; - /* + /* * Under AMD64, all registers used to pass arguments to functions * are volatile across calls. * FIXME: Optimize this. @@ -1910,10 +1910,10 @@ mono_arch_allocate_vars (MonoCompile *cfg) indir->inst_basereg = cfg->frame_reg; indir->inst_offset = ainfo->offset + ARGS_OFFSET; } - + ins->opcode = OP_VTARG_ADDR; ins->inst_left = indir; - + break; } default: @@ -2056,11 +2056,11 @@ emit_sig_cookie (MonoCompile *cfg, MonoCallInst *call, CallInfo *cinfo) NOT_IMPLEMENTED; g_assert (cinfo->sig_cookie.storage == ArgOnStack); - + /* - * mono_ArgIterator_Setup assumes the signature cookie is + * mono_ArgIterator_Setup assumes the signature cookie is * passed first and all the arguments which were before it are - * passed on the stack after the signature. So compensate by + * passed on the stack after the signature. So compensate by * passing a different signature. */ tmp_sig = mono_metadata_signature_dup_full (m_class_get_image (cfg->method->klass), call->signature); @@ -2112,7 +2112,7 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig) /* * LLVM always uses the native ABI while we use our own ABI, the * only difference is the handling of vtypes: - * - we only pass/receive them in registers in some cases, and only + * - we only pass/receive them in registers in some cases, and only * in 1 or 2 integer registers. */ switch (cinfo->ret.storage) { @@ -2228,7 +2228,7 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call) return; } - /* + /* * Emit all arguments which are passed on the stack to prevent register * allocation problems. */ @@ -2460,7 +2460,7 @@ mono_arch_emit_outarg_vt (MonoCompile *cfg, MonoInst *ins, MonoInst *src) MonoInst *vtaddr, *load; g_assert (ainfo->storage == ArgValuetypeAddrInIReg || (ainfo->storage == ArgValuetypeAddrOnStack && ainfo->pair_storage [0] == ArgNone)); - + vtaddr = mono_compile_create_var (cfg, m_class_get_byval_arg (ins->klass), OP_LOCAL); vtaddr->backend.is_pinvoke = call->signature->pinvoke && !call->signature->marshalling_disabled; @@ -2528,7 +2528,7 @@ mono_arch_emit_setret (MonoCompile *cfg, MonoMethod *method, MonoInst *val) MONO_EMIT_NEW_UNALU (cfg, OP_FMOVE, cfg->ret->dreg, val->dreg); return; } - + MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, cfg->ret->dreg, val->dreg); } @@ -2591,7 +2591,7 @@ dyn_call_supported (MonoMethodSignature *sig, CallInfo *cinfo) /* * mono_arch_dyn_call_prepare: * - * Return a pointer to an arch-specific structure which contains information + * Return a pointer to an arch-specific structure which contains information * needed by mono_arch_get_dyn_call_args (). Return NULL if OP_DYN_CALL is not * supported for SIG. * This function is equivalent to ffi_prep_cif in libffi. @@ -2658,7 +2658,7 @@ mono_arch_dyn_call_prepare (MonoMethodSignature *sig) /* Align to 16 bytes */ if (info->nstack_args & 1) info->nstack_args ++; - + return (MonoDynCallInfo*)info; } @@ -2697,7 +2697,7 @@ mono_arch_dyn_call_get_buf_size (MonoDynCallInfo *info) * RET should point to a memory buffer large enought to hold the result of the * call. * This function should be as fast as possible, any work which does not depend - * on the actual values of the arguments should be done in + * on the actual values of the arguments should be done in * mono_arch_dyn_call_prepare (). * start_dyn_call + OP_DYN_CALL + finish_dyn_call is equivalent to ffi_call in * libffi. @@ -2909,7 +2909,7 @@ mono_arch_start_dyn_call (MonoDynCallInfo *info, gpointer **args, guint8 *ret, g * Store the result of a dyn call into the return value buffer passed to * start_dyn_call (). * This function should be as fast as possible, any work which does not depend - * on the actual values of the arguments should be done in + * on the actual values of the arguments should be done in * mono_arch_dyn_call_prepare (). */ void @@ -3014,7 +3014,7 @@ mono_arch_finish_dyn_call (MonoDynCallInfo *info, guint8 *buf) } else { \ EMIT_COND_BRANCH (tins, cond, signed); \ } \ - } while (0); + } while (0); #define EMIT_SSE2_FPFUNC(code, op, dreg, sreg1) do { \ amd64_movsd_membase_reg (code, AMD64_RSP, -8, (sreg1)); \ @@ -3045,7 +3045,7 @@ emit_call (MonoCompile *cfg, MonoCallInst *call, guint8 *code, MonoJitICallId ji patch.target = call->fptr; } - /* + /* * FIXME: Add support for thunks */ { @@ -3053,7 +3053,7 @@ emit_call (MonoCompile *cfg, MonoCallInst *call, guint8 *code, MonoJitICallId ji /* * Indirect calls are expensive so try to make a near call if possible. - * The caller memory is allocated by the code manager so it is + * The caller memory is allocated by the code manager so it is * guaranteed to be at a 32 bit offset. */ @@ -3073,7 +3073,7 @@ emit_call (MonoCompile *cfg, MonoCallInst *call, guint8 *code, MonoJitICallId ji /* The target is in malloc-ed memory */ near_call = FALSE; } else { - /* + /* * The call might go directly to a native function without * the wrapper. */ @@ -3095,7 +3095,7 @@ emit_call (MonoCompile *cfg, MonoCallInst *call, guint8 *code, MonoJitICallId ji near_call = TRUE; no_patch = TRUE; } else { - /* + /* * This is not really an optimization, but required because the * generic class init trampolines use R11 to pass the vtable. */ @@ -3144,7 +3144,7 @@ emit_call (MonoCompile *cfg, MonoCallInst *call, guint8 *code, MonoJitICallId ji } if (near_call) { - /* + /* * Align the call displacement to an address divisible by 4 so it does * not span cache lines. This is required for code patching to work on SMP * systems. @@ -3209,9 +3209,9 @@ mono_arch_peephole_pass_1 (MonoCompile *cfg, MonoBasicBlock *bb) case OP_IADD_IMM: case OP_LADD_IMM: if ((ins->sreg1 < MONO_MAX_IREGS) && (ins->dreg >= MONO_MAX_IREGS) && (ins->inst_imm > 0)) { - /* + /* * X86_LEA is like ADD, but doesn't have the - * sreg1==dreg restriction. inst_imm > 0 is needed since LEA sign-extends + * sreg1==dreg restriction. inst_imm > 0 is needed since LEA sign-extends * its operand to 64 bit. */ ins->opcode = ins->opcode == OP_IADD_IMM ? OP_X86_LEA_MEMBASE : OP_AMD64_LEA_MEMBASE; @@ -3223,8 +3223,8 @@ mono_arch_peephole_pass_1 (MonoCompile *cfg, MonoBasicBlock *bb) if ((ins->sreg1 == ins->sreg2) && (ins->sreg1 == ins->dreg)) { MonoInst *ins2; - /* - * Replace STORE_MEMBASE_IMM 0 with STORE_MEMBASE_REG since + /* + * Replace STORE_MEMBASE_IMM 0 with STORE_MEMBASE_REG since * the latter has length 2-3 instead of 6 (reverse constant * propagation). These instruction sequences are very common * in the initlocals bblock. @@ -3248,9 +3248,9 @@ mono_arch_peephole_pass_1 (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_COMPARE_IMM: case OP_LCOMPARE_IMM: - /* OP_COMPARE_IMM (reg, 0) - * --> - * OP_AMD64_TEST_NULL (reg) + /* OP_COMPARE_IMM (reg, 0) + * --> + * OP_AMD64_TEST_NULL (reg) */ if (!ins->inst_imm) ins->opcode = OP_AMD64_TEST_NULL; @@ -3260,7 +3260,7 @@ mono_arch_peephole_pass_1 (MonoCompile *cfg, MonoBasicBlock *bb) ins->opcode = OP_X86_TEST_NULL; break; case OP_AMD64_ICOMPARE_MEMBASE_IMM: - /* + /* * OP_STORE_MEMBASE_REG reg, offset(basereg) * OP_X86_COMPARE_MEMBASE_IMM offset(basereg), imm * --> @@ -3310,7 +3310,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) } case OP_LXOR: /* - * Use IXOR to avoid a rex prefix if possible. The cpu will sign extend the + * Use IXOR to avoid a rex prefix if possible. The cpu will sign extend the * 0 result into 64 bits. */ if ((ins->sreg1 == ins->sreg2) && (ins->sreg1 == ins->dreg)) { @@ -3321,8 +3321,8 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) if ((ins->sreg1 == ins->sreg2) && (ins->sreg1 == ins->dreg)) { MonoInst *ins2; - /* - * Replace STORE_MEMBASE_IMM 0 with STORE_MEMBASE_REG since + /* + * Replace STORE_MEMBASE_IMM 0 with STORE_MEMBASE_REG since * the latter has length 2-3 instead of 6 (reverse constant * propagation). These instruction sequences are very common * in the initlocals bblock. @@ -3649,7 +3649,7 @@ emit_simd_gt_un_op (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, int typ case MONO_TYPE_U1: USE_MAX: { // dreg = max(sreg1, sreg2) != sreg2 - + int temp_reg1 = mono_alloc_ireg (cfg); int temp_reg2 = mono_alloc_ireg (cfg); int temp_reg3 = mono_alloc_ireg (cfg); @@ -3812,7 +3812,7 @@ mono_arch_lowering_pass (MonoCompile *cfg, MonoBasicBlock *bb) MonoInst *ins, *n, *temp; /* - * FIXME: Need to add more instructions, but the current machine + * FIXME: Need to add more instructions, but the current machine * description can't model some parts of the composite instructions like * cdq. */ @@ -4091,7 +4091,7 @@ mono_arch_lowering_pass (MonoCompile *cfg, MonoBasicBlock *bb) bb->max_vreg = cfg->next_vreg; } -static const int +static const int branch_cc_table [] = { X86_CC_EQ, X86_CC_GE, X86_CC_GT, X86_CC_LE, X86_CC_LT, X86_CC_NE, X86_CC_GE, X86_CC_GT, X86_CC_LE, X86_CC_LT, @@ -4197,19 +4197,19 @@ mono_emit_stack_alloc (MonoCompile *cfg, guchar *code, MonoInst* tree) amd64_push_reg (code, AMD64_RDI); offset += 8; } - + amd64_shift_reg_imm (code, X86_SHR, sreg, 3); if (sreg != AMD64_RCX) amd64_mov_reg_reg (code, AMD64_RCX, sreg, 8); amd64_alu_reg_reg (code, X86_XOR, AMD64_RAX, AMD64_RAX); - + amd64_lea_membase (code, AMD64_RDI, AMD64_RSP, offset); if (cfg->param_area) amd64_alu_reg_imm (code, X86_ADD, AMD64_RDI, cfg->param_area); amd64_cld (code); amd64_prefix (code, X86_REP_PREFIX); amd64_stosl (code); - + if (tree->dreg != AMD64_RDI && sreg != AMD64_RDI) amd64_pop_reg (code, AMD64_RDI); if (tree->dreg != AMD64_RCX && sreg != AMD64_RCX) @@ -4455,10 +4455,10 @@ mono_amd64_emit_tls_set (guint8 *code, int sreg, int tls_offset) static guint8* emit_setup_lmf (MonoCompile *cfg, guint8 *code, gint32 lmf_offset, int cfa_offset) { - /* + /* * The ip field is not set, the exception handling code will obtain it from the stack location pointed to by the sp field. */ - /* + /* * sp is saved right before calls but we need to save it here too so * async stack walks would work. */ @@ -4956,8 +4956,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) amd64_patch (label, code); } - /* - * This is the address which is saved in seq points, + /* + * This is the address which is saved in seq points, */ mono_add_seq_point (cfg, bb, ins, code - cfg->native_code); @@ -5056,7 +5056,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_LMUL_IMM: case OP_IMUL_IMM: { guint32 size = (ins->opcode == OP_IMUL_IMM) ? 4 : 8; - + switch (ins->inst_imm) { case 2: /* MOV r1, r2 */ @@ -5639,7 +5639,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /* Set argument registers */ for (i = 0; i < PARAM_REGS; ++i) amd64_mov_reg_membase (code, param_regs [i], AMD64_R11, MONO_STRUCT_OFFSET (DynCallArgs, regs) + (i * sizeof (target_mgreg_t)), sizeof (target_mgreg_t)); - + /* Make the call */ amd64_call_reg (code, AMD64_R10); @@ -5745,7 +5745,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) for (i = 0; i < size; i += 8) amd64_mov_membase_reg (code, AMD64_RSP, i, ins->dreg, 8); - amd64_mov_reg_reg (code, ins->dreg, AMD64_RSP, 8); + amd64_mov_reg_reg (code, ins->dreg, AMD64_RSP, 8); } else { amd64_mov_reg_imm (code, ins->dreg, size); ins->sreg1 = ins->dreg; @@ -5775,7 +5775,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) ins->backend.pc_offset = code - cfg->native_code; break; } - case OP_CALL_HANDLER: + case OP_CALL_HANDLER: /* Align stack */ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, 8); mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_BB, ins->inst_target_bb); @@ -5830,13 +5830,13 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) //if ((ins->inst_target_bb == bb->next_bb) && ins == bb->last_ins) //break; if (ins->inst_target_bb->native_offset) { - amd64_jump_code (code, cfg->native_code + ins->inst_target_bb->native_offset); + amd64_jump_code (code, cfg->native_code + ins->inst_target_bb->native_offset); } else { mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_BB, ins->inst_target_bb); if (optimize_branch_pred && x86_is_imm8 (ins->inst_target_bb->max_offset - offset)) x86_jump8 (code, 0); - else + else x86_jump32 (code, 0); } break; @@ -5893,14 +5893,14 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_COND_EXC_NO: case OP_COND_EXC_C: case OP_COND_EXC_NC: - EMIT_COND_SYSTEM_EXCEPTION (branch_cc_table [ins->opcode - OP_COND_EXC_EQ], + EMIT_COND_SYSTEM_EXCEPTION (branch_cc_table [ins->opcode - OP_COND_EXC_EQ], (ins->opcode < OP_COND_EXC_NE_UN), (const char *)ins->inst_p1); break; case OP_COND_EXC_IOV: case OP_COND_EXC_INO: case OP_COND_EXC_IC: case OP_COND_EXC_INC: - EMIT_COND_SYSTEM_EXCEPTION (branch_cc_table [ins->opcode - OP_COND_EXC_IEQ], + EMIT_COND_SYSTEM_EXCEPTION (branch_cc_table [ins->opcode - OP_COND_EXC_IEQ], (ins->opcode < OP_COND_EXC_INE_UN), (const char *)ins->inst_p1); break; @@ -6008,7 +6008,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 2, FALSE); break; case OP_FCONV_TO_U4: - code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 4, FALSE); + code = emit_float_to_int (cfg, code, ins->dreg, ins->sreg1, 4, FALSE); break; case OP_FCONV_TO_I4: case OP_FCONV_TO_I: @@ -6053,7 +6053,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) amd64_sse_movss_reg_reg (code, ins->dreg, ins->sreg1); break; - case OP_LCONV_TO_R_UN: { + case OP_LCONV_TO_R_UN: { guint8 *br [2]; /* Based on gcc code */ @@ -6124,13 +6124,13 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_FSUB: amd64_sse_subsd_reg_reg (code, ins->dreg, ins->sreg2); - break; + break; case OP_FMUL: amd64_sse_mulsd_reg_reg (code, ins->dreg, ins->sreg2); - break; + break; case OP_FDIV: amd64_sse_divsd_reg_reg (code, ins->dreg, ins->sreg2); - break; + break; case OP_FNEG: { static double r8_0 = -0.0; @@ -6244,11 +6244,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) g_assert (ins->dreg == ins->sreg1); amd64_alu_reg_reg (code, X86_CMP, ins->sreg1, ins->sreg2); amd64_cmov_reg (code, X86_CC_LT, FALSE, ins->dreg, ins->sreg2); - break; + break; case OP_X86_FPOP: - break; + break; case OP_FCOMPARE: - /* + /* * The two arguments are swapped because the fbranch instructions * depend on this for the non-sse case to work. */ @@ -6264,7 +6264,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_FCNEQ: case OP_FCEQ: { - /* zeroing the register at the start results in + /* zeroing the register at the start results in * shorter and faster code (we can also remove the widening op) */ guchar *unordered_check; @@ -6290,7 +6290,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) } case OP_FCLT: case OP_FCLT_UN: { - /* zeroing the register at the start results in + /* zeroing the register at the start results in * shorter and faster code (we can also remove the widening op) */ amd64_alu_reg_reg (code, X86_XOR, ins->dreg, ins->dreg); @@ -6322,7 +6322,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) } case OP_FCGT: case OP_FCGT_UN: { - /* zeroing the register at the start results in + /* zeroing the register at the start results in * shorter and faster code (we can also remove the widening op) */ guchar *unordered_check; @@ -6576,7 +6576,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) amd64_xadd_membase_reg (code, ins->inst_basereg, ins->inst_offset, dreg, size); /* dreg contains the old value, add with sreg2 value */ amd64_alu_reg_reg_size (code, X86_ADD, dreg, ins->sreg2, size); - + if (ins->dreg != dreg) amd64_mov_reg_reg (code, ins->dreg, dreg, size); @@ -6601,7 +6601,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) else size = 4; - /* + /* * See http://msdn.microsoft.com/en-us/magazine/cc302329.aspx for * an explanation of how this works. */ @@ -6970,7 +6970,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_PMAXD_UN: amd64_sse_pmaxud_reg_reg (code, ins->sreg1, ins->sreg2); break; - + case OP_PMAXB: amd64_sse_pmaxsb_reg_reg (code, ins->sreg1, ins->sreg2); break; @@ -7114,7 +7114,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_PSUBW_SAT: amd64_sse_psubsw_reg_reg (code, ins->sreg1, ins->sreg2); break; - + case OP_PMULW: amd64_sse_pmullw_reg_reg (code, ins->sreg1, ins->sreg2); break; @@ -7179,22 +7179,22 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_PSHRQ_REG: amd64_sse_psrlq_reg_reg (code, ins->dreg, ins->sreg2); break; - + /*TODO: This is appart of the sse spec but not added case OP_PSARQ: amd64_sse_psraq_reg_imm (code, ins->dreg, ins->inst_imm); break; case OP_PSARQ_REG: amd64_sse_psraq_reg_reg (code, ins->dreg, ins->sreg2); - break; + break; */ - + case OP_PSHLQ: amd64_sse_psllq_reg_imm (code, ins->dreg, ins->inst_imm); break; case OP_PSHLQ_REG: amd64_sse_psllq_reg_reg (code, ins->dreg, ins->sreg2); - break; + break; case OP_CVTDQ2PD: amd64_sse_cvtdq2pd_reg_reg (code, ins->dreg, ins->sreg1); break; @@ -7350,7 +7350,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /*FIXME the peephole pass should have killed this*/ if (ins->dreg != ins->sreg1) amd64_sse_movaps_reg_reg (code, ins->dreg, ins->sreg1); - break; + break; case OP_XZERO: amd64_sse_pxor_reg_reg (code, ins->dreg, ins->dreg); break; @@ -7382,7 +7382,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_FCONV_TO_U2: amd64_widen_reg (code, ins->dreg, ins->dreg, FALSE, TRUE); break; - } + } break; case OP_EXPAND_I2: @@ -7544,7 +7544,7 @@ static int get_max_epilog_size (MonoCompile *cfg) { int max_epilog_size = 16; - + if (cfg->method->save_lmf) max_epilog_size += 256; @@ -7625,7 +7625,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) /* Offset between RSP and the CFA */ cfa_offset = 0; - /* + /* * The prolog consists of the following parts: * FP present: * - push rbp @@ -7674,7 +7674,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) } if (cfg->arch.omit_fp) { - /* + /* * On enter, the stack is misaligned by the pushing of the return * address. It is either made aligned by the pushing of %rbp, or by * this. @@ -7778,7 +7778,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) if (mini_debug_options.init_stacks) { /* Fill the stack frame with a dummy value to force deterministic behavior */ - + /* Save registers to the red zone */ amd64_mov_membase_reg (code, AMD64_RSP, -8, AMD64_RDI, 8); amd64_mov_membase_reg (code, AMD64_RSP, -16, AMD64_RCX, 8); @@ -7860,7 +7860,7 @@ MONO_RESTORE_WARNING /* Take prolog and epilog instrumentation into account */ if (bb == cfg->bb_entry || bb == cfg->bb_exit) max_length += max_epilog_size; - + bb->max_length = max_length; } } @@ -8112,7 +8112,7 @@ mono_arch_emit_epilog (MonoCompile *cfg) mono_emit_unwind_op_remember_state (cfg, code); /* the code restoring the registers must be kept in sync with OP_TAILCALL */ - + if (method->save_lmf) { if (cfg->used_int_regs & (1 << AMD64_RBP)) amd64_mov_reg_membase (code, AMD64_RBP, cfg->frame_reg, lmf_offset + MONO_STRUCT_OFFSET (MonoLMF, rbp), 8); @@ -8368,7 +8368,7 @@ mono_arch_flush_register_windows (void) { } -gboolean +gboolean mono_arch_is_inst_imm (int opcode, int imm_opcode, gint64 imm) { return amd64_use_imm32 (imm); @@ -8897,7 +8897,7 @@ mono_arch_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMetho } else if (strcmp (cmethod->name, "Abs") == 0 && fsig->params [0]->type == MONO_TYPE_R8) { opcode = OP_ABS; } - + if (opcode && fsig->param_count == 1) { MONO_INST_NEW (cfg, ins, opcode); ins->type = STACK_R8; @@ -8928,7 +8928,7 @@ mono_arch_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMetho opcode = OP_LMAX_UN; } } - + if (opcode && fsig->param_count == 2) { MONO_INST_NEW (cfg, ins, opcode); ins->type = fsig->params [0]->type == MONO_TYPE_I4 ? STACK_I4 : STACK_I8; @@ -9086,7 +9086,7 @@ mono_arch_skip_breakpoint (MonoContext *ctx, MonoJitInfo *ji) { g_assert_not_reached (); } - + /* * mono_arch_start_single_stepping: * @@ -9097,7 +9097,7 @@ mono_arch_start_single_stepping (void) { ss_trampoline = mini_get_single_step_trampoline (); } - + /* * mono_arch_stop_single_stepping: * diff --git a/src/mono/mono/mini/mini-arch.h b/src/mono/mono/mini/mini-arch.h index da89dbb0439e16..5a4c89f0bf8682 100644 --- a/src/mono/mono/mini/mini-arch.h +++ b/src/mono/mono/mini/mini-arch.h @@ -39,4 +39,4 @@ #define MONO_ARCH_LOCALLOC_ALIGNMENT MONO_ARCH_FRAME_ALIGNMENT #endif -#endif /* __MONO_MINI_ARCH_H__ */ +#endif /* __MONO_MINI_ARCH_H__ */ diff --git a/src/mono/mono/mini/mini-arm.c b/src/mono/mono/mini/mini-arm.c index c9a8c319786a55..69360a1946d649 100644 --- a/src/mono/mono/mini/mini-arm.c +++ b/src/mono/mono/mini/mini-arm.c @@ -89,7 +89,7 @@ static gboolean thumb2_supported = FALSE; */ static gboolean eabi_supported = FALSE; -/* +/* * Whenever to use the iphone ABI extensions: * http://developer.apple.com/library/ios/documentation/Xcode/Conceptual/iPhoneOSABIReference/index.html * Basically, r7 is used as a frame pointer and it should point to the saved r7 + lr. @@ -577,7 +577,7 @@ emit_restore_lmf (MonoCompile *cfg, guint8 *code, gint32 lmf_offset) * @arg_info: an array to store the result infos * * Gathers information on parameters such as size, alignment and - * padding. arg_info should be large enought to hold param_count + 1 entries. + * padding. arg_info should be large enought to hold param_count + 1 entries. * * Returns the size of the activation frame. */ @@ -610,7 +610,7 @@ mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJit /* ignore alignment for now */ align = 1; - frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1); + frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1); arg_info [k].pad = pad; frame_size += size; arg_info [k + 1].pad = 0; @@ -1012,7 +1012,7 @@ mono_arch_get_global_int_regs (MonoCompile *cfg) mono_arch_compute_omit_fp (cfg); - /* + /* * FIXME: Interface calls might go through a static rgctx trampoline which * sets V5, but it doesn't save it, so we need to save it ourselves, and * avoid using it. @@ -1042,7 +1042,7 @@ mono_arch_get_global_int_regs (MonoCompile *cfg) /* * mono_arch_regalloc_cost: * - * Return the cost, in number of memory references, of the action of + * Return the cost, in number of memory references, of the action of * allocating the variable VMV into a register during global register * allocation. */ @@ -1888,7 +1888,7 @@ mono_arch_compute_omit_fp (MonoCompile *cfg) ArgInfo *ainfo = &cinfo->args [i]; if (ainfo->storage == RegTypeBase || ainfo->storage == RegTypeBaseGen || ainfo->storage == RegTypeStructByVal) { - /* + /* * The stack offset can only be determined when the frame * size is known. */ @@ -1963,7 +1963,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) } } /* local vars are at a positive offset from the stack pointer */ - /* + /* * also note that if the function uses alloca, we use FP * to point at the local variables. */ @@ -2147,7 +2147,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) offset &= ~(align - 1); cfg->sig_cookie = offset; offset += size; - } + } for (i = 0; i < sig->param_count; ++i) { ainfo = cinfo->args + i; @@ -2273,11 +2273,11 @@ emit_sig_cookie (MonoCompile *cfg, MonoCallInst *call, CallInfo *cinfo) NOT_IMPLEMENTED; g_assert (cinfo->sig_cookie.storage == RegTypeBase); - + /* - * mono_ArgIterator_Setup assumes the signature cookie is + * mono_ArgIterator_Setup assumes the signature cookie is * passed first and all the arguments which were before it are - * passed on the stack after the signature. So compensate by + * passed on the stack after the signature. So compensate by * passing a different signature. */ tmp_sig = mono_metadata_signature_dup (call->signature); @@ -2309,7 +2309,7 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig) /* * LLVM always uses the native ABI while we use our own ABI, the * only difference is the handling of vtypes: - * - we only pass/receive them in registers in some cases, and only + * - we only pass/receive them in registers in some cases, and only * in 1 or 2 integer registers. */ switch (cinfo->ret.storage) { @@ -2404,7 +2404,7 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call) sig = call->signature; n = sig->param_count + sig->hasthis; - + cinfo = get_call_info (cfg->mempool, sig); switch (cinfo->ret.storage) { @@ -2813,7 +2813,7 @@ mono_arch_emit_setret (MonoCompile *cfg, MonoMethod *method, MonoInst *val) #endif /* #ifndef DISABLE_JIT */ -gboolean +gboolean mono_arch_is_inst_imm (int opcode, int imm_opcode, gint64 imm) { return TRUE; @@ -2920,7 +2920,7 @@ mono_arch_dyn_call_prepare (MonoMethodSignature *sig) info->param_types = g_new0 (MonoType*, sig->param_count); for (i = 0; i < sig->param_count; ++i) info->param_types [i] = mini_get_underlying_type (sig->params [i]); - + return (MonoDynCallInfo*)info; } @@ -3186,7 +3186,7 @@ if (0 && ins->inst_true_bb->native_offset) { \ mono_add_patch_info (cfg, code - cfg->native_code, \ MONO_PATCH_INFO_EXC, exc_name); \ ARM_BL_COND (code, (condcode), 0); \ - } while (0); + } while (0); #define EMIT_COND_SYSTEM_EXCEPTION(cond,exc_name) EMIT_COND_SYSTEM_EXCEPTION_FLAGS(branch_cc_table [(cond)], (exc_name)) @@ -3204,17 +3204,17 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) MonoInst *last_ins = mono_inst_prev (ins, FILTER_IL_SEQ_POINT); switch (ins->opcode) { - case OP_MUL_IMM: - case OP_IMUL_IMM: + case OP_MUL_IMM: + case OP_IMUL_IMM: /* Already done by an arch-independent pass */ break; case OP_LOAD_MEMBASE: case OP_LOADI4_MEMBASE: - /* - * OP_STORE_MEMBASE_REG reg, offset(basereg) + /* + * OP_STORE_MEMBASE_REG reg, offset(basereg) * OP_LOAD_MEMBASE offset(basereg), reg */ - if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_REG + if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_REG || last_ins->opcode == OP_STORE_MEMBASE_REG) && ins->inst_basereg == last_ins->inst_destbasereg && ins->inst_offset == last_ins->inst_offset) { @@ -3227,7 +3227,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) ins->sreg1 = last_ins->sreg1; } - /* + /* * Note: reg1 must be different from the basereg in the second load * OP_LOAD_MEMBASE offset(basereg), reg1 * OP_LOAD_MEMBASE offset(basereg), reg2 @@ -3252,11 +3252,11 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) //g_assert_not_reached (); #if 0 - /* - * OP_STORE_MEMBASE_IMM imm, offset(basereg) + /* + * OP_STORE_MEMBASE_IMM imm, offset(basereg) * OP_LOAD_MEMBASE offset(basereg), reg * --> - * OP_STORE_MEMBASE_IMM imm, offset(basereg) + * OP_STORE_MEMBASE_IMM imm, offset(basereg) * OP_ICONST reg, imm */ } else if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_IMM @@ -3276,7 +3276,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) ins->inst_basereg == last_ins->inst_destbasereg && ins->inst_offset == last_ins->inst_offset) { ins->opcode = (ins->opcode == OP_LOADI1_MEMBASE) ? OP_ICONV_TO_I1 : OP_ICONV_TO_U1; - ins->sreg1 = last_ins->sreg1; + ins->sreg1 = last_ins->sreg1; } break; case OP_LOADU2_MEMBASE: @@ -3285,20 +3285,20 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) ins->inst_basereg == last_ins->inst_destbasereg && ins->inst_offset == last_ins->inst_offset) { ins->opcode = (ins->opcode == OP_LOADI2_MEMBASE) ? OP_ICONV_TO_I2 : OP_ICONV_TO_U2; - ins->sreg1 = last_ins->sreg1; + ins->sreg1 = last_ins->sreg1; } break; case OP_MOVE: ins->opcode = OP_MOVE; - /* - * OP_MOVE reg, reg + /* + * OP_MOVE reg, reg */ if (ins->dreg == ins->sreg1) { MONO_DELETE_INS (bb, ins); continue; } - /* - * OP_MOVE sreg, dreg + /* + * OP_MOVE sreg, dreg * OP_MOVE dreg, sreg */ if (last_ins && last_ins->opcode == OP_MOVE && @@ -3312,7 +3312,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) } } -/* +/* * the branch_cc_table should maintain the order of these * opcodes. case CEE_BEQ: @@ -3326,17 +3326,17 @@ case CEE_BGT_UN: case CEE_BLE_UN: case CEE_BLT_UN: */ -static const guchar +static const guchar branch_cc_table [] = { - ARMCOND_EQ, - ARMCOND_GE, - ARMCOND_GT, + ARMCOND_EQ, + ARMCOND_GE, + ARMCOND_GT, ARMCOND_LE, - ARMCOND_LT, - - ARMCOND_NE, - ARMCOND_HS, - ARMCOND_HI, + ARMCOND_LT, + + ARMCOND_NE, + ARMCOND_HS, + ARMCOND_HI, ARMCOND_LS, ARMCOND_LO }; @@ -3902,7 +3902,7 @@ arm_patch_general (MonoCompile *cfg, guchar *code, const guchar *target) return; } } - + handle_thunk (cfg, code, target); return; } @@ -3930,7 +3930,7 @@ arm_patch_general (MonoCompile *cfg, guchar *code, const guchar *target) * address constant // execution never reaches here */ if ((ins & 0x0ffffff0) == 0x12fff10) { - /* Branch and exchange: the address is constructed in a reg + /* Branch and exchange: the address is constructed in a reg * We can patch BX when the code sequence is the following: * ldr ip, [pc, #0] ; 0x8 * b 0xc @@ -4009,7 +4009,7 @@ arm_patch (guchar *code, const guchar *target) arm_patch_general (NULL, code, target); } -/* +/* * Return the >= 0 uimm8 value if val can be represented with a byte + rotation * (with the rotation amount in *rot_amount. rot_amount is already adjusted * to be used with the emit macros. @@ -4562,8 +4562,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_BREAK: /* - * gdb does not like encountering the hw breakpoint ins in the debugged code. - * So instead of emitting a trap, we emit a call a C function and place a + * gdb does not like encountering the hw breakpoint ins in the debugged code. + * So instead of emitting a trap, we emit a call a C function and place a * breakpoint there. */ //*(int*)code = 0xef9f0001; @@ -4697,7 +4697,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) */ ARM_NOP (code); } else { - /* + /* * A placeholder for a possible breakpoint inserted by * mono_arch_set_breakpoint (). */ @@ -5308,7 +5308,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /* Save result */ ARM_LDR_IMM (code, ARMREG_IP, var->inst_basereg, var->inst_offset); - ARM_STR_IMM (code, ARMREG_R0, ARMREG_IP, MONO_STRUCT_OFFSET (DynCallArgs, res)); + ARM_STR_IMM (code, ARMREG_R0, ARMREG_IP, MONO_STRUCT_OFFSET (DynCallArgs, res)); ARM_STR_IMM (code, ARMREG_R1, ARMREG_IP, MONO_STRUCT_OFFSET (DynCallArgs, res2)); if (IS_HARD_FLOAT) ARM_FSTD (code, ARM_VFP_D0, ARMREG_IP, MONO_STRUCT_OFFSET (DynCallArgs, fpregs)); @@ -5405,7 +5405,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) ARM_MOV_REG_REG (code, ARMREG_PC, ARMREG_IP); break; } - case OP_CALL_HANDLER: + case OP_CALL_HANDLER: mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_BB, ins->inst_target_bb); code = mono_arm_patchable_bl (code, ARMCOND_AL); cfg->thunk_area += THUNK_SIZE; @@ -5423,17 +5423,17 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_BR: /*if (ins->inst_target_bb->native_offset) { ARM_B (code, 0); - //x86_jump_code (code, cfg->native_code + ins->inst_target_bb->native_offset); + //x86_jump_code (code, cfg->native_code + ins->inst_target_bb->native_offset); } else*/ { mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_BB, ins->inst_target_bb); code = mono_arm_patchable_b (code, ARMCOND_AL); - } + } break; case OP_BR_REG: ARM_MOV_REG_REG (code, ARMREG_PC, ins->sreg1); break; case OP_SWITCH: - /* + /* * In the normal case we have: * ldr pc, [pc, ins->sreg1 << 2] * nop @@ -5558,7 +5558,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) *(guint32*)code = ((guint32*)(ins->inst_p0))[1]; code += 4; } else { - /* FIXME: we can optimize the imm load by dealing with part of + /* FIXME: we can optimize the imm load by dealing with part of * the displacement in LDFD (aligning to 512). */ code = mono_arm_emit_load_imm (code, ARMREG_LR, (guint32)(gsize)ins->inst_p0); @@ -5700,7 +5700,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_LCONV_TO_OVF_I4_2: { guint8 *high_bit_not_set, *valid_negative, *invalid_negative, *valid_positive; - /* + /* * Valid ints: 0xffffffff:8000000 to 00000000:0x7f000000 */ @@ -5713,7 +5713,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) ARM_B_COND (code, ARMCOND_EQ, 0); /*branch if upper part == 0xFFFFFFFF (lower part has bit 31 set) */ invalid_negative = code; ARM_B_COND (code, ARMCOND_AL, 0); - + arm_patch (high_bit_not_set, code); ARM_CMP_REG_IMM8 (code, ins->sreg2, 0); @@ -5735,13 +5735,13 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_FSUB: ARM_VFP_SUBD (code, ins->dreg, ins->sreg1, ins->sreg2); - break; + break; case OP_FMUL: ARM_VFP_MULD (code, ins->dreg, ins->sreg1, ins->sreg2); - break; + break; case OP_FDIV: ARM_VFP_DIVD (code, ins->dreg, ins->sreg1, ins->sreg2); - break; + break; case OP_FNEG: ARM_NEGD (code, ins->dreg, ins->sreg1); break; @@ -5925,13 +5925,13 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_RSUB: ARM_VFP_SUBS (code, ins->dreg, ins->sreg1, ins->sreg2); - break; + break; case OP_RMUL: ARM_VFP_MULS (code, ins->dreg, ins->sreg1, ins->sreg2); - break; + break; case OP_RDIV: ARM_VFP_DIVS (code, ins->dreg, ins->sreg1, ins->sreg2); - break; + break; case OP_RNEG: ARM_NEGS (code, ins->dreg, ins->sreg1); break; @@ -6050,7 +6050,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) mono_inst_name (ins->opcode), max_len, code - cfg->native_code - offset); g_assert_not_reached (); } - + cpos += max_len; last_ins = ins; @@ -6141,7 +6141,7 @@ mono_arm_unaligned_stack (MonoMethod *method) /* * Stack frame layout: - * + * * ------------------- fp * MonoLMF structure or saved registers * ------------------- @@ -6176,7 +6176,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) prev_sp_offset = 0; if (iphone_abi) { - /* + /* * The iphone uses R7 as the frame pointer, and it points at the saved * r7+lr: * @@ -6340,7 +6340,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) for (i = 0; i < sig->param_count + sig->hasthis; ++i) { ArgInfo *ainfo = cinfo->args + i; inst = cfg->args [i]; - + if (cfg->verbose_level > 2) g_print ("Saving argument %d (type: %d)\n", i, ainfo->storage); @@ -6716,7 +6716,7 @@ mono_arch_emit_epilog (MonoCompile *cfg) } mono_emit_unwind_op_def_cfa (cfg, code, ARMREG_SP, ((iphone_abi ? 3 : 0) + nused_int_regs) * 4); /* restore iregs */ - ARM_POP (code, regmask); + ARM_POP (code, regmask); if (iphone_abi) { for (i = 0; i < 16; i++) { if (regmask & (1 << i)) @@ -6790,8 +6790,8 @@ mono_arch_emit_exceptions (MonoCompile *cfg) } /* count the number of exception infos */ - - /* + + /* * make sure we have enough space for exceptions */ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) { @@ -7055,14 +7055,14 @@ mono_arch_build_imt_trampoline (MonoVTable *vtable, MonoIMTCheckItem **imt_entri ARM_STR_IMM (code, ARMREG_R1, ARMREG_SP, 3 * sizeof (target_mgreg_t)); /* Restore registers and branch */ ARM_POP4 (code, ARMREG_R0, ARMREG_R1, ARMREG_IP, ARMREG_PC); - + code = arm_emit_value_and_patch_ldr (code, target_code_ins, (gsize)item->value.target_code); } else { vtable_offset = DISTANCE (vtable, &vtable->vtable[item->value.vtable_slot]); if (!arm_is_imm12 (vtable_offset)) { - /* + /* * We need to branch to a computed address but we don't have - * a free register to store it, since IP must contain the + * a free register to store it, since IP must contain the * vtable address. So we push the two values to the stack, and * load them both using LDM. */ @@ -7074,7 +7074,7 @@ mono_arch_build_imt_trampoline (MonoVTable *vtable, MonoIMTCheckItem **imt_entri ARM_STR_IMM (code, ARMREG_R1, ARMREG_SP, 3 * sizeof (target_mgreg_t)); /* Restore registers and branch */ ARM_POP4 (code, ARMREG_R0, ARMREG_R1, ARMREG_IP, ARMREG_PC); - + code = arm_emit_value_and_patch_ldr (code, vtable_offset_ins, vtable_offset); } else { ARM_POP2 (code, ARMREG_R0, ARMREG_R1); @@ -7097,7 +7097,7 @@ mono_arch_build_imt_trampoline (MonoVTable *vtable, MonoIMTCheckItem **imt_entri ARM_STR_IMM (code, ARMREG_R1, ARMREG_SP, 3 * sizeof (target_mgreg_t)); /* Restore registers and branch */ ARM_POP4 (code, ARMREG_R0, ARMREG_R1, ARMREG_IP, ARMREG_PC); - + code = arm_emit_value_and_patch_ldr (code, target_code_ins, (gsize)fail_tramp); item->jmp_code = NULL; } @@ -7233,7 +7233,7 @@ mono_arch_set_breakpoint (MonoJitInfo *ji, guint8 *ip) mono_arch_flush_icache (code - 16, 16); #if 0 - /* This is currently implemented by emitting an SWI instruction, which + /* This is currently implemented by emitting an SWI instruction, which * qemu/linux seems to convert to a SIGILL. */ *(int*)code = (0xef << 24) | 8; @@ -7275,7 +7275,7 @@ mono_arch_clear_breakpoint (MonoJitInfo *ji, guint8 *ip) mono_arch_flush_icache (ip, code - ip); } } - + /* * mono_arch_start_single_stepping: * @@ -7289,7 +7289,7 @@ mono_arch_start_single_stepping (void) else single_step_tramp = mini_get_single_step_trampoline (); } - + /* * mono_arch_stop_single_stepping: * diff --git a/src/mono/mono/mini/mini-arm.h b/src/mono/mono/mini/mini-arm.h index f53c35cad848d7..12581b13992b35 100644 --- a/src/mono/mono/mini/mini-arm.h +++ b/src/mono/mono/mini/mini-arm.h @@ -119,7 +119,7 @@ #define MONO_ARCH_FRAME_ALIGNMENT 8 #endif -/* fixme: align to 16byte instead of 32byte (we align to 32byte to get +/* fixme: align to 16byte instead of 32byte (we align to 32byte to get * reproduceable results for benchmarks */ #define MONO_ARCH_CODE_ALIGNMENT 32 @@ -273,7 +273,7 @@ typedef enum { /* keep the size of the structure a multiple of 8 */ struct MonoLMF { - /* + /* * If the second lowest bit is set to 1, then this is a MonoLMFExt structure, and * the other fields are not valid. */ diff --git a/src/mono/mono/mini/mini-arm64.c b/src/mono/mono/mini/mini-arm64.c index b93b4aa6a8567e..64ed1fadc63f83 100644 --- a/src/mono/mono/mini/mini-arm64.c +++ b/src/mono/mono/mini/mini-arm64.c @@ -3,7 +3,7 @@ * ARM64 backend for the Mono code generator * * Copyright 2013 Xamarin, Inc (http://www.xamarin.com) - * + * * Based on mini-arm.c: * * Authors: @@ -1738,7 +1738,7 @@ mono_arch_dyn_call_prepare (MonoMethodSignature *sig) break; } } - + return (MonoDynCallInfo*)info; } @@ -2104,7 +2104,7 @@ mono_arch_get_allocatable_int_vars (MonoCompile *cfg) if (vmv->range.first_use.abs_pos >= vmv->range.last_use.abs_pos) continue; - if ((ins->flags & (MONO_INST_IS_DEAD|MONO_INST_VOLATILE|MONO_INST_INDIRECT)) || + if ((ins->flags & (MONO_INST_IS_DEAD|MONO_INST_VOLATILE|MONO_INST_INDIRECT)) || (ins->opcode != OP_LOCAL && ins->opcode != OP_ARG)) continue; @@ -2587,11 +2587,11 @@ emit_sig_cookie (MonoCompile *cfg, MonoCallInst *call, CallInfo *cinfo) NOT_IMPLEMENTED; g_assert (cinfo->sig_cookie.storage == ArgOnStack); - + /* - * mono_ArgIterator_Setup assumes the signature cookie is + * mono_ArgIterator_Setup assumes the signature cookie is * passed first and all the arguments which were before it are - * passed on the stack after the signature. So compensate by + * passed on the stack after the signature. So compensate by * passing a different signature. */ tmp_sig = mono_metadata_signature_dup (call->signature); @@ -2876,7 +2876,7 @@ mono_arch_tailcall_supported (MonoCompile *cfg, MonoMethodSignature *caller_sig, #endif -gboolean +gboolean mono_arch_is_inst_imm (int opcode, int imm_opcode, gint64 imm) { return (imm >= -((gint64)1<<31) && imm <= (((gint64)1<<31)-1)); @@ -3314,8 +3314,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_BREAK: /* - * gdb does not like encountering the hw breakpoint ins in the debugged code. - * So instead of emitting a trap, we emit a call a C function and place a + * gdb does not like encountering the hw breakpoint ins in the debugged code. + * So instead of emitting a trap, we emit a call a C function and place a * breakpoint there. */ code = emit_call (cfg, code, MONO_PATCH_INFO_JIT_ICALL_ID, GUINT_TO_POINTER (MONO_JIT_ICALL_mono_break)); @@ -3428,7 +3428,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) g_assert (var->opcode == OP_REGOFFSET); /* Load the address of the bp trampoline into IP0 */ arm_ldrx (code, ARMREG_IP0, var->inst_basereg, var->inst_offset); - /* + /* * A placeholder for a possible breakpoint inserted by * mono_arch_set_breakpoint (). */ @@ -5148,12 +5148,12 @@ mono_arch_emit_prolog (MonoCompile *cfg) g_assert (ins->opcode == OP_REGOFFSET); - code = emit_strx (code, MONO_ARCH_RGCTX_REG, ins->inst_basereg, ins->inst_offset); + code = emit_strx (code, MONO_ARCH_RGCTX_REG, ins->inst_basereg, ins->inst_offset); mono_add_var_location (cfg, cfg->rgctx_var, TRUE, MONO_ARCH_RGCTX_REG, 0, 0, code - cfg->native_code); mono_add_var_location (cfg, cfg->rgctx_var, FALSE, ins->inst_basereg, ins->inst_offset, code - cfg->native_code, 0); } - + /* * Move arguments to their registers/stack locations. */ diff --git a/src/mono/mono/mini/mini-arm64.h b/src/mono/mono/mini/mini-arm64.h index 7555c5e7854f0e..8feacf8f81e494 100644 --- a/src/mono/mono/mini/mini-arm64.h +++ b/src/mono/mono/mini/mini-arm64.h @@ -82,7 +82,7 @@ #define MONO_ARCH_LMF_REG_SP 11 struct MonoLMF { - /* + /* * If the second lowest bit is set to 1, then this is a MonoLMFExt structure, and * the other fields are not valid. */ diff --git a/src/mono/mono/mini/mini-codegen.c b/src/mono/mono/mini/mini-codegen.c index 77464dcf88cbb7..171520d2818c1b 100644 --- a/src/mono/mono/mini/mini-codegen.c +++ b/src/mono/mono/mini/mini-codegen.c @@ -69,9 +69,9 @@ static int translate_bank (MonoRegState *rs, int bank, int hreg) { } /* - * Every hardware register belongs to a register type or register bank. bank 0 + * Every hardware register belongs to a register type or register bank. bank 0 * contains the int registers, bank 1 contains the fp registers. - * int registers are used 99% of the time, so they are special cased in a lot of + * int registers are used 99% of the time, so they are special cased in a lot of * places. */ @@ -83,7 +83,7 @@ static const int regbank_size [] = { MONO_MAX_XREGS }; -static const int regbank_load_ops [] = { +static const int regbank_load_ops [] = { OP_LOADR_MEMBASE, OP_LOADR8_MEMBASE, OP_LOADR_MEMBASE, @@ -91,7 +91,7 @@ static const int regbank_load_ops [] = { OP_LOADX_MEMBASE }; -static const int regbank_store_ops [] = { +static const int regbank_store_ops [] = { OP_STORER_MEMBASE_REG, OP_STORER8_MEMBASE_REG, OP_STORER_MEMBASE_REG, @@ -99,7 +99,7 @@ static const int regbank_store_ops [] = { OP_STOREX_MEMBASE }; -static const int regbank_move_ops [] = { +static const int regbank_move_ops [] = { OP_MOVE, OP_FMOVE, OP_MOVE, @@ -315,7 +315,7 @@ resize_spill_info (MonoCompile *cfg, int bank) /* * returns the offset used by spillvar. It allocates a new - * spill variable if necessary. + * spill variable if necessary. */ static int mono_spillvar_offset (MonoCompile *cfg, int spillvar, int bank) @@ -381,7 +381,7 @@ mono_spillvar_offset (MonoCompile *cfg, int spillvar, int bank) #define sreg1_is_fp(spec) sreg_is_fp (0,(spec)) #define sreg2_is_fp(spec) sreg_is_fp (1,(spec)) -#define reg_is_simd(desc) ((desc) == 'x') +#define reg_is_simd(desc) ((desc) == 'x') #ifdef MONO_ARCH_NEED_SIMD_BANK @@ -612,7 +612,7 @@ mono_print_ins_index_strbuf (int i, MonoInst *ins) if (ins->opcode == OP_VCALL || ins->opcode == OP_VCALL_REG || ins->opcode == OP_VCALL_MEMBASE) { /* - * These are lowered opcodes, but they are in the .md files since the old + * These are lowered opcodes, but they are in the .md files since the old * JIT passes them to backends. */ if (ins->dreg != -1) @@ -744,7 +744,7 @@ print_regtrack (RegTrack *t, int num) int i; char buf [32]; const char *r; - + for (i = 0; i < num; ++i) { if (!t [i].born_in) continue; @@ -804,7 +804,7 @@ get_vreg_bank (MonoCompile *cfg, int reg, int bank) } /* - * Force the spilling of the variable in the symbolic register 'reg', and free + * Force the spilling of the variable in the symbolic register 'reg', and free * the hreg it was assigned to. */ static void @@ -923,7 +923,7 @@ get_register_spilling (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst **last, Mo else i = mono_regstate_alloc_int (rs, regmask (sel)); g_assert (i == sel); - + return sel; } @@ -983,7 +983,7 @@ static void create_spilled_store (MonoCompile *cfg, MonoBasicBlock *bb, int spill, int reg, int prev_reg, MonoInst **last, MonoInst *ins, MonoInst *insert_before, int bank) { MonoInst *store, *def; - + bank = get_vreg_bank (cfg, prev_reg, bank); MONO_INST_NEW (cfg, store, regbank_store_ops [bank]); @@ -1120,7 +1120,7 @@ static gboolean desc_to_fixed_reg_inited = FALSE; * Local register allocation. * We first scan the list of instructions and we save the liveness info of * each register (when the register is first used, when it's value is set etc.). - * We also reverse the list of instructions because assigning registers backwards allows + * We also reverse the list of instructions because assigning registers backwards allows * for more tricks to be used. */ void @@ -1187,7 +1187,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) cfg->reginfo_len = MAX (1024, max * 2); reginfo = (RegTrack *)mono_mempool_alloc (cfg->mempool, sizeof (RegTrack) * cfg->reginfo_len); cfg->reginfo = reginfo; - } + } else g_assert (cfg->reginfo_len >= rs->next_vreg); @@ -1196,9 +1196,9 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) memset (cfg->reginfo, 0, cfg->reginfo_len * sizeof (RegTrack)); } - /* + /* * For large methods, next_vreg can be very large, so g_malloc0 time can - * be prohibitive. So we manually init the reginfo entries used by the + * be prohibitive. So we manually init the reginfo entries used by the * bblock. */ for (ins = bb->code; ins; ins = ins->next) { @@ -1212,7 +1212,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) if (MONO_ARCH_INST_IS_REGPAIR (spec [MONO_INST_DEST])) { /** * In the new IR, the two vregs of the regpair do not alias the - * original long vreg. shift the vreg here so the rest of the + * original long vreg. shift the vreg here so the rest of the * allocator doesn't have to care about it. */ ins->dreg ++; @@ -1252,7 +1252,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) if (G_UNLIKELY (spec == (gpointer)/*FIXME*/MONO_ARCH_CPU_SPEC)) { g_error ("Opcode '%s' missing from machine description file.", mono_inst_name (ins->opcode)); } - + DEBUG (mono_print_ins_index (i, ins)); num_sregs = mono_inst_get_src_registers (ins, sregs); @@ -1416,7 +1416,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) for (k = 0; k < num_sregs; ++k) { if (k != j) sreg_masks [k] &= ~ (regmask (dest_sreg)); - } + } /* * Spill sreg1/2 if they are assigned to dest_sreg. @@ -1466,9 +1466,9 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) if (k != j) sreg_masks [k] &= ~ (regmask (dest_sreg)); } - /* + /* * Prevent the dreg from being allocated to dest_sreg - * too, since it could force sreg1 to be allocated to + * too, since it could force sreg1 to be allocated to * the same reg on x86. */ dreg_mask &= ~ (regmask (dest_sreg)); @@ -1485,7 +1485,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) sreg_masks [k] &= ~ (regmask (dest_sreg)); } - /* + /* * First check if dreg is assigned to dest_sreg2, since we * can't spill a dreg. */ @@ -1494,9 +1494,9 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) else val = -1; if (val == dest_sreg && ins->dreg != sreg) { - /* - * the destination register is already assigned to - * dest_sreg2: we need to allocate another register for it + /* + * the destination register is already assigned to + * dest_sreg2: we need to allocate another register for it * and then copy from this to dest_sreg2. */ int new_dest; @@ -1527,7 +1527,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) /* sreg2 already assigned to another register */ /* * We couldn't emit a copy from val to dest_sreg2, because - * val might be spilled later while processing this + * val might be spilled later while processing this * instruction. So we spill sreg2 so it can be allocated to * dest_sreg2. */ @@ -1564,7 +1564,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) } if (spec_dest == 'b') { - /* + /* * The dest reg is read by the instruction, not written, so * avoid allocating sreg1/sreg2 to the same reg. */ @@ -1607,7 +1607,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) if (dreg_fixed_mask) { g_assert (!bank); if (is_global_ireg (ins->dreg)) { - /* + /* * The argument is already in a hard reg, but that reg is * not usable by this instruction, so allocate a new one. */ @@ -1678,7 +1678,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) mono_regstate_free_int (rs, rs->vassign [reg2]); } - } + } DEBUG (printf ("\tassigned dreg-high %s to dest R%d\n", mono_arch_regname (val), reg2)); assign_reg (cfg, rs, reg2, val, bank); @@ -1693,7 +1693,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) } if (prev_dreg >= 0 && is_soft_reg (prev_dreg, bank) && (spec_dest != 'b')) { - /* + /* * In theory, we could free up the hreg even if the vreg is alive, * but branches inside bblocks force us to assign the same hreg * to a vreg every time it is encountered. @@ -1728,7 +1728,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) } if (spec_dest == 'b') { - /* + /* * The dest reg is read by the instruction, not written, so * avoid allocating sreg1/sreg2 to the same reg. */ @@ -1818,13 +1818,13 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) MonoCallInst *call = (MonoCallInst*)ins; GSList *list; - /* + /* * This needs to be done before assigning sreg1, so sreg1 will * not be assigned one of the argument regs. */ - /* - * Assign all registers in call->out_reg_args to the proper + /* + * Assign all registers in call->out_reg_args to the proper * argument registers. */ @@ -1910,7 +1910,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) if (sreg_fixed_masks [0]) { g_assert (!bank); if (is_global_ireg (sregs [0])) { - /* + /* * The argument is already in a hard reg, but that reg is * not usable by this instruction, so allocate a new one. */ @@ -1951,8 +1951,8 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) } if ((ins->opcode == OP_MOVE) && !spill && !bank && is_local_ireg (ins->dreg) && (rs->ifree_mask & (regmask (ins->dreg)))) { - /* - * Allocate the same hreg to sreg1 as well so the + /* + * Allocate the same hreg to sreg1 as well so the * peephole can get rid of the move. */ sreg_masks [0] = regmask (ins->dreg); @@ -1981,7 +1981,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) sreg_masks [j] &= ~(regmask (dest_sregs [0])); val = dest_sregs [0]; } - + sregs [0] = val; } else { @@ -2029,7 +2029,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) mono_regstate_free_int (rs, rs->vassign [reg2]); #endif } - } + } sreg1_high = val; DEBUG (printf ("\tassigned sreg1 hreg %s to dest R%d\n", mono_arch_regname (val), reg2)); @@ -2043,7 +2043,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) int bank = reg_bank (spec_src1); if (ins->dreg == sregs [1]) { - /* + /* * copying sreg1 to dreg could clobber sreg2, so allocate a new * register for it. */ @@ -2065,7 +2065,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) /* FIXME: */ g_assert_not_reached (); - /* + /* * sreg1 and dest are already allocated to the same regpair by the * SREG1 allocation code. */ @@ -2176,7 +2176,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) DEBUG (printf ("freeable %s\n", mono_arch_regname (ins->sreg2))); mono_regstate_free_int (rs, ins->sreg2); }*/ - + DEBUG (mono_print_ins_index (i, ins)); } @@ -2222,7 +2222,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) if (sp - 1 - i > 0) { /* First move it to %st(0) */ DEBUG (printf ("\tswap %%st(0) and %%st(%d)\n", sp - 1 - i)); - + MONO_INST_NEW (cfg, fxch, OP_X86_FXCH); fxch->inst_imm = sp - 1 - i; @@ -2233,10 +2233,10 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) fpstack [sp - 1] = fpstack [i]; fpstack [i] = tmp; } - + /* Then move it to %st(1) */ DEBUG (printf ("\tswap %%st(0) and %%st(1)\n")); - + MONO_INST_NEW (cfg, fxch, OP_X86_FXCH); fxch->inst_imm = 1; @@ -2319,7 +2319,7 @@ mono_local_regalloc (MonoCompile *cfg, MonoBasicBlock *bb) if (sp && bb != cfg->bb_exit && !(bb->out_count == 1 && bb->out_bb [0] == cfg->bb_exit)) { /* Remove remaining items from the fp stack */ - /* + /* * These can remain for example as a result of a dead fmove like in * System.Collections.Generic.EqualityComparer.Equals (). */ @@ -2534,7 +2534,7 @@ mono_peephole_ins (MonoBasicBlock *bb, MonoInst *ins) MonoInst *last_ins = mono_inst_prev (ins, filter); switch (ins->opcode) { - case OP_MUL_IMM: + case OP_MUL_IMM: /* remove unnecessary multiplication with 1 */ if (ins->inst_imm == 1) { if (ins->dreg != ins->sreg1) @@ -2545,10 +2545,10 @@ mono_peephole_ins (MonoBasicBlock *bb, MonoInst *ins) break; case OP_LOAD_MEMBASE: case OP_LOADI4_MEMBASE: - /* + /* * Note: if reg1 = reg2 the load op is removed * - * OP_STORE_MEMBASE_REG reg1, offset(basereg) + * OP_STORE_MEMBASE_REG reg1, offset(basereg) * OP_LOAD_MEMBASE offset(basereg), reg2 * --> * OP_STORE_MEMBASE_REG reg1, offset(basereg) @@ -2568,8 +2568,8 @@ mono_peephole_ins (MonoBasicBlock *bb, MonoInst *ins) ins->opcode = OP_MOVE; ins->sreg1 = last_ins->sreg1; } - - /* + + /* * Note: reg1 must be different from the basereg in the second load * Note: if reg1 = reg2 is equal then second load is removed * @@ -2595,11 +2595,11 @@ mono_peephole_ins (MonoBasicBlock *bb, MonoInst *ins) //g_assert_not_reached (); #if 0 - /* - * OP_STORE_MEMBASE_IMM imm, offset(basereg) + /* + * OP_STORE_MEMBASE_IMM imm, offset(basereg) * OP_LOAD_MEMBASE offset(basereg), reg * --> - * OP_STORE_MEMBASE_IMM imm, offset(basereg) + * OP_STORE_MEMBASE_IMM imm, offset(basereg) * OP_ICONST reg, imm */ } else if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_IMM @@ -2614,10 +2614,10 @@ mono_peephole_ins (MonoBasicBlock *bb, MonoInst *ins) break; case OP_LOADI1_MEMBASE: case OP_LOADU1_MEMBASE: - /* + /* * Note: if reg1 = reg2 the load op is removed * - * OP_STORE_MEMBASE_REG reg1, offset(basereg) + * OP_STORE_MEMBASE_REG reg1, offset(basereg) * OP_LOAD_MEMBASE offset(basereg), reg2 * --> * OP_STORE_MEMBASE_REG reg1, offset(basereg) @@ -2632,10 +2632,10 @@ mono_peephole_ins (MonoBasicBlock *bb, MonoInst *ins) break; case OP_LOADI2_MEMBASE: case OP_LOADU2_MEMBASE: - /* + /* * Note: if reg1 = reg2 the load op is removed * - * OP_STORE_MEMBASE_REG reg1, offset(basereg) + * OP_STORE_MEMBASE_REG reg1, offset(basereg) * OP_LOAD_MEMBASE offset(basereg), reg2 * --> * OP_STORE_MEMBASE_REG reg1, offset(basereg) @@ -2671,16 +2671,16 @@ mono_peephole_ins (MonoBasicBlock *bb, MonoInst *ins) /* * Removes: * - * OP_MOVE reg, reg + * OP_MOVE reg, reg */ if (ins->dreg == ins->sreg1) { MONO_DELETE_INS (bb, ins); break; } - /* + /* * Removes: * - * OP_MOVE sreg, dreg + * OP_MOVE sreg, dreg * OP_MOVE dreg, sreg */ if (last_ins && last_ins->opcode == ins->opcode && diff --git a/src/mono/mono/mini/mini-cross-helpers.c b/src/mono/mono/mini/mini-cross-helpers.c index e61ed81727d1f7..3ccb2bc72d18d5 100644 --- a/src/mono/mono/mini/mini-cross-helpers.c +++ b/src/mono/mono/mini/mini-cross-helpers.c @@ -66,7 +66,7 @@ mono_cross_helpers_run (void) if (g_hasenv ("DUMP_CROSS_OFFSETS")) mono_dump_jit_offsets (); #endif - + #if defined (HAS_CROSS_COMPILER_OFFSETS) && !defined (MONO_CROSS_COMPILE) mono_metadata_cross_helpers_run (); diff --git a/src/mono/mono/mini/mini-exceptions.c b/src/mono/mono/mini/mini-exceptions.c index 266c451c1715ca..f814096630b0bd 100644 --- a/src/mono/mono/mini/mini-exceptions.c +++ b/src/mono/mono/mini/mini-exceptions.c @@ -335,7 +335,7 @@ mono_get_rethrow_preserve_exception_addr (void) return &rethrow_preserve_exception_func; } -static gboolean +static gboolean is_address_protected (MonoJitInfo *ji, MonoJitExceptionInfo *ei, gpointer ip) { MonoTryBlockHoleTableJitInfo *table; @@ -554,11 +554,11 @@ find_jit_info (MonoJitTlsData *jit_tls, MonoJitInfo *res, MonoJitInfo *prev_ji, /* mono_find_jit_info: * - * This function is used to gather information from @ctx. It return the + * This function is used to gather information from @ctx. It return the * MonoJitInfo of the corresponding function, unwinds one stack frame and - * stores the resulting context into @new_ctx. It also stores a string + * stores the resulting context into @new_ctx. It also stores a string * describing the stack location into @trace (if not NULL), and modifies - * the @lmf if necessary. @native_offset return the IP offset from the + * the @lmf if necessary. @native_offset return the IP offset from the * start of the function or -1 if that info is not available. */ MonoJitInfo * @@ -883,7 +883,7 @@ mono_get_generic_context_from_stack_frame (MonoJitInfo *ji, gpointer generic_inf klass = mrgctx->class_vtable->klass; context.method_inst = mrgctx->method_inst; if (!mini_method_is_default_method (method)) - g_assert (context.method_inst); + g_assert (context.method_inst); } else { MonoVTable *vtable = (MonoVTable *)generic_info; @@ -926,7 +926,7 @@ get_method_from_stack_frame (MonoJitInfo *ji, gpointer generic_info) ERROR_DECL (error); MonoGenericContext context; MonoMethod *method; - + if (!ji->has_generic_jit_info || !mono_jit_info_get_generic_jit_info (ji)->has_this) return jinfo_get_method (ji); context = mono_get_generic_context_from_stack_frame (ji, generic_info); @@ -949,7 +949,7 @@ get_method_from_stack_frame (MonoJitInfo *ji, gpointer generic_info) * The walk ends when no more stack frames are found or when the callback * returns a TRUE value. */ - + gboolean mono_exception_walk_trace (MonoException *ex, MonoExceptionFrameWalk func, gpointer user_data) { @@ -1225,7 +1225,7 @@ mono_walk_stack_with_ctx (MonoJitStackWalk func, MonoContext *start_ctx, MonoUnw * State must be valid (state->valid == TRUE). * * If you are using this function to unwind another thread, make sure it is suspended. - * + * * If \p state is null, we capture the current context. */ void @@ -1246,7 +1246,7 @@ mono_walk_stack_with_state (MonoJitStackWalk func, MonoThreadUnwindState *state, return; mono_walk_stack_full (func, - &state->ctx, + &state->ctx, (MonoJitTlsData *)state->unwind_data [MONO_UNWIND_DATA_JIT_TLS], (MonoLMF *)state->unwind_data [MONO_UNWIND_DATA_LMF], unwind_options, user_data, FALSE); @@ -1403,14 +1403,14 @@ mono_walk_stack_full (MonoJitStackWalk func, MonoContext *start_ctx, MonoJitTlsD if (new_reg_locations [i]) reg_locations [i] = new_reg_locations [i]; } - + ctx = new_ctx; } } MonoBoolean -ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info, - MonoReflectionMethod **method, +ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info, + MonoReflectionMethod **method, gint32 *iloffset, gint32 *native_offset, MonoString **file, gint32 *line, gint32 *column) { @@ -1864,7 +1864,7 @@ handle_exception_first_pass (MonoContext *ctx, MonoObject *obj, gint32 *out_filt guint32 free_stack; int clause_index_start = 0; gboolean unwind_res = TRUE; - + StackFrameInfo frame; if (out_prev_ji) @@ -1944,7 +1944,7 @@ handle_exception_first_pass (MonoContext *ctx, MonoObject *obj, gint32 *out_filt MonoJitExceptionInfo *ei = &ji->clauses [i]; gboolean filtered = FALSE; - /* + /* * During stack overflow, wait till the unwinding frees some stack * space before running handlers/finalizers. */ @@ -2124,7 +2124,7 @@ mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resu mono_error_assert_ok (error); MONO_OBJECT_SETREF_INTERNAL (ex, message, msg); obj = (MonoObject *)ex; - } + } /* * Allocate a new exception object instead of the preconstructed ones. @@ -2157,7 +2157,7 @@ mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resu if (mono_ex->caught_in_unmanaged) is_caught_unmanaged = TRUE; - + if (mono_object_isinst_checked (obj, mono_defaults.exception_class, error)) { mono_ex = (MonoException*)obj; @@ -2305,7 +2305,7 @@ mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resu gboolean unwind_res = TRUE; StackFrameInfo frame; gpointer ip; - + if (resume) { resume = FALSE; ji = jit_tls->resume_state.ji; @@ -2377,7 +2377,7 @@ mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resu MonoJitExceptionInfo *ei = &ji->clauses [i]; gboolean filtered = FALSE; - /* + /* * During stack overflow, wait till the unwinding frees some stack * space before running handlers/finalizers. */ @@ -2415,8 +2415,8 @@ mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resu #endif if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER) { - /* - * Filter clauses should only be run in the + /* + * Filter clauses should only be run in the * first pass of exception handling. */ filtered = (filter_idx == first_filter_idx); @@ -2424,7 +2424,7 @@ mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resu } error_init (error); - if ((ei->flags == MONO_EXCEPTION_CLAUSE_NONE && + if ((ei->flags == MONO_EXCEPTION_CLAUSE_NONE && mono_object_isinst_checked (ex_obj, catch_class, error)) || filtered) { /* * This guards against the situation that we abort a thread that is executing a finally clause @@ -2534,7 +2534,7 @@ mono_handle_exception_internal (MonoContext *ctx, MonoObject *obj, gboolean resu if (ei->flags == MONO_EXCEPTION_CLAUSE_FAULT || ei->flags == MONO_EXCEPTION_CLAUSE_FINALLY) { mono_set_lmf (lmf); if (ji->from_llvm) { - /* + /* * LLVM compiled finally handlers follow the design * of the c++ ehabi, i.e. they call a resume function * at the end instead of returning to the caller. @@ -2978,7 +2978,7 @@ mono_handle_native_crash (const char *signal, MonoContext *mctx, MONO_SIG_HANDLE /* * A crash indicates something went very wrong so we can no longer depend - * on anything working. So try to print out lots of diagnostics, starting + * on anything working. So try to print out lots of diagnostics, starting * with ones which have a greater chance of working. */ @@ -3047,7 +3047,7 @@ mono_print_thread_dump_internal (void *sigctx, MonoContext *start_ctx) mono_runtime_printf_err ("%s\n", text->str); //to print the native callstack #else mono_runtime_printf ("%s", text->str); -#endif +#endif #if HOST_WIN32 && TARGET_WIN32 && _DEBUG OutputDebugStringA(text->str); @@ -3627,7 +3627,7 @@ mono_llvm_match_exception (MonoJitInfo *jinfo, guint32 region_start, guint32 reg break; } else mono_error_assert_ok (error); - + if (ei->flags == MONO_EXCEPTION_CLAUSE_FILTER) { g_assert_not_reached (); } diff --git a/src/mono/mono/mini/mini-gc.c b/src/mono/mono/mini/mini-gc.c index 8e44adf6e81f7d..9c1477bb68aa07 100644 --- a/src/mono/mono/mini/mini-gc.c +++ b/src/mono/mono/mini/mini-gc.c @@ -80,7 +80,7 @@ typedef struct { * runtime, since it includes columns which are 0. */ int stack_bitmap_width; - /* + /* * A bitmap whose width equals nslots, and whose height equals ncallsites. * The bitmap contains a 1 if the corresponding stack slot has type SLOT_REF at the * given callsite. @@ -157,7 +157,7 @@ typedef struct { /* Number of registers stored in gc maps */ #define NREGS MONO_MAX_IREGS -/* +/* * The GC Map itself. * Contains information needed to mark a stack frame. * This is a transient structure, created from a compressed representation on-demand. @@ -187,7 +187,7 @@ typedef struct { /* The offsets below are into an external bitmaps array */ - /* + /* * A bitmap whose width is equal to bitmap_width, and whose height is equal to ncallsites. * The bitmap contains a 1 if the corresponding stack slot has type SLOT_REF at the * given callsite. @@ -262,7 +262,7 @@ typedef struct { gint32 scanned_registers; gint32 scanned_native; gint32 scanned_other; - + gint32 all_slots; gint32 noref_slots; gint32 ref_slots; @@ -544,7 +544,7 @@ encode_gc_map (GCMap *map, guint8 *buf, guint8 **endbuf) encode_uleb128 (map->ncallsites, buf, &buf); *endbuf = buf; -} +} /* * decode_gc_map: @@ -907,7 +907,7 @@ conservative_pass (TlsData *tls, guint8 *stack_start, guint8 *stack_end) /* All the other frames are at a call site */ if (tls->nframes == MAX_FRAMES) { - /* + /* * Can't save information since the array is full. So scan the rest of the * stack conservatively. */ @@ -949,7 +949,7 @@ conservative_pass (TlsData *tls, guint8 *stack_start, guint8 *stack_end) } precise_frame_limit_inited = TRUE; } - + if (precise_frame_limit != -1) { if (precise_frame_count [FALSE] == precise_frame_limit) printf ("LAST PRECISE FRAME: %s\n", mono_method_full_name (method, TRUE)); @@ -1000,7 +1000,7 @@ conservative_pass (TlsData *tls, guint8 *stack_start, guint8 *stack_end) } cindex = i; - /* + /* * This is not neccessary true on x86 because frames have a different size at each * call site. */ @@ -1048,7 +1048,7 @@ conservative_pass (TlsData *tls, guint8 *stack_start, guint8 *stack_end) for (i = 0; i < NREGS; ++i) { if (!(map->used_int_regs & (1 << i))) continue; - + if (!(map->reg_pin_mask & (1 << i))) continue; @@ -1176,8 +1176,8 @@ precise_pass (TlsData *tls, guint8 *stack_start, guint8 *stack_end, void *gc_dat DEBUG (char *fname = mono_method_full_name (jinfo_get_method (fi->ji), TRUE); fprintf (logfile, "Mark(1): %s\n", fname); g_free (fname)); - /* - * FIXME: Add a function to mark using a bitmap, to avoid doing a + /* + * FIXME: Add a function to mark using a bitmap, to avoid doing a * call for each object. */ @@ -1241,7 +1241,7 @@ precise_pass (TlsData *tls, guint8 *stack_start, guint8 *stack_end, void *gc_dat } else { DEBUG (fprintf (logfile, "\treg %s saved at %p: %p\n", mono_arch_regname (fi->regs [i]), ptr, obj)); } - } + } } /* @@ -1261,7 +1261,7 @@ precise_pass (TlsData *tls, guint8 *stack_start, guint8 *stack_end, void *gc_dat * * This is called by the GC twice to mark a thread stack. PRECISE is FALSE at the first * call, and TRUE at the second. USER_DATA points to a TlsData - * structure filled up by thread_suspend_func. + * structure filled up by thread_suspend_func. */ static void thread_mark_func (gpointer user_data, guint8 *stack_start, guint8 *stack_end, gboolean precise, void *gc_data) @@ -1571,7 +1571,7 @@ process_other_slots (MonoCompile *cfg) int cfa_slot = data >> 16; GCSlotType type = data & 0xff; int slot; - + /* * Map the cfa relative slot to an fp relative slot. * slot_addr == cfa - *4/8 @@ -1595,7 +1595,7 @@ process_other_slots (MonoCompile *cfg) int offset = data >> 16; GCSlotType type = data & 0xff; int slot; - + slot = fp_offset_to_slot (cfg, offset); set_slot_everywhere (gcfg, slot, type); @@ -1760,7 +1760,7 @@ process_variables (MonoCompile *cfg) gboolean pin = FALSE; int size; int size_in_slots; - + if (ins->backend.is_pinvoke) size = mono_class_native_size (ins->klass, NULL); else @@ -1912,7 +1912,7 @@ process_variables (MonoCompile *cfg) static int sp_offset_to_fp_offset (MonoCompile *cfg, int sp_offset) { - /* + /* * Convert a sp relative offset to a slot index. This is * platform specific. */ @@ -1926,7 +1926,7 @@ sp_offset_to_fp_offset (MonoCompile *cfg, int sp_offset) #ifdef MONO_X86_NO_PUSHES return (- cfg->arch.sp_fp_offset + sp_offset); #else - return (- cfg->arch.sp_fp_offset - sp_offset); + return (- cfg->arch.sp_fp_offset - sp_offset); #endif #else NOT_IMPLEMENTED; @@ -2028,7 +2028,7 @@ process_finally_clauses (MonoCompile *cfg) for (i = 0; i < cfg->header->num_clauses; ++i) { clause = &cfg->header->clauses [i]; - + if (MONO_OFFSET_IN_HANDLER (clause, bb->real_offset)) { if (clause->flags == MONO_EXCEPTION_CLAUSE_FINALLY) { is_in_finally = TRUE; @@ -2237,7 +2237,7 @@ create_map (MonoCompile *cfg) nregs = gcfg->nregs; callsites = gcfg->callsites; - /* + /* * Compute the real size of the bitmap i.e. ignore NOREF columns at the beginning and at * the end. Also, compute whenever the map needs ref/pin bitmaps, and collect stats. */ @@ -2323,7 +2323,7 @@ create_map (MonoCompile *cfg) reg_pin_bitmap_width = ALIGN_TO (npin_regs, 8) / 8; reg_pin_bitmap_size = reg_pin_bitmap_width * ncallsites; bitmaps_size = (has_ref_slots ? stack_bitmap_size : 0) + (has_pin_slots ? stack_bitmap_size : 0) + (has_ref_regs ? reg_ref_bitmap_size : 0) + (has_pin_regs ? reg_pin_bitmap_size : 0); - + map = mono_mempool_alloc0 (cfg->mempool, sizeof (GCMap)); map->frame_reg = cfg->frame_reg; diff --git a/src/mono/mono/mini/mini-llvm-cpp.h b/src/mono/mono/mini/mini-llvm-cpp.h index aaf2ef031f30eb..5d376c1de80e37 100644 --- a/src/mono/mono/mini/mini-llvm-cpp.h +++ b/src/mono/mono/mini/mini-llvm-cpp.h @@ -63,15 +63,15 @@ void mono_llvm_dump_type (LLVMTypeRef type); LLVMValueRef -mono_llvm_build_alloca (LLVMBuilderRef builder, LLVMTypeRef Ty, +mono_llvm_build_alloca (LLVMBuilderRef builder, LLVMTypeRef Ty, LLVMValueRef ArraySize, int alignment, const char *Name); -LLVMValueRef +LLVMValueRef mono_llvm_build_load (LLVMBuilderRef builder, LLVMValueRef PointerVal, const char *Name, gboolean is_volatile); -LLVMValueRef +LLVMValueRef mono_llvm_build_atomic_load (LLVMBuilderRef builder, LLVMValueRef PointerVal, const char *Name, gboolean is_volatile, int alignment, BarrierKind barrier); @@ -79,11 +79,11 @@ LLVMValueRef mono_llvm_build_aligned_load (LLVMBuilderRef builder, LLVMValueRef PointerVal, const char *Name, gboolean is_volatile, int alignment); -LLVMValueRef +LLVMValueRef mono_llvm_build_store (LLVMBuilderRef builder, LLVMValueRef Val, LLVMValueRef PointerVal, gboolean is_volatile, BarrierKind kind); -LLVMValueRef +LLVMValueRef mono_llvm_build_aligned_store (LLVMBuilderRef builder, LLVMValueRef Val, LLVMValueRef PointerVal, gboolean is_volatile, int alignment); @@ -233,4 +233,4 @@ mono_llvm_inline_asm (LLVMBuilderRef builder, LLVMTypeRef type, G_END_DECLS -#endif /* __MONO_MINI_LLVM_CPP_H__ */ +#endif /* __MONO_MINI_LLVM_CPP_H__ */ diff --git a/src/mono/mono/mini/mini-mips.c b/src/mono/mono/mini/mini-mips.c index 3db3a9debab419..d8fe51f52c8e05 100644 --- a/src/mono/mono/mini/mini-mips.c +++ b/src/mono/mono/mini/mini-mips.c @@ -95,7 +95,7 @@ static gpointer bp_trigger_page; do { \ code = mips_emit_exc_by_name (code, exc_name); \ cfg->bb_exit->max_offset += 16; \ - } while (0) + } while (0) #define MONO_EMIT_NEW_LOAD_R8(cfg,dr,addr) do { \ MonoInst *inst; \ @@ -192,7 +192,7 @@ mono_arch_flush_register_windows (void) { } -gboolean +gboolean mono_arch_is_inst_imm (int opcode, int imm_opcode, gint64 imm) { return TRUE; @@ -462,7 +462,7 @@ emit_memcpy (guint8 *code, int size, int dreg, int doffset, int sreg, int soffse * @arg_info: an array to store the result infos * * Gathers information on parameters such as size, alignment and - * padding. arg_info should be large enought to hold param_count + 1 entries. + * padding. arg_info should be large enought to hold param_count + 1 entries. * * Returns the size of the activation frame. */ @@ -473,7 +473,7 @@ mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJit guint32 size, align, pad; int offset = 0; - if (MONO_TYPE_ISSTRUCT (csig->ret)) { + if (MONO_TYPE_ISSTRUCT (csig->ret)) { frame_size += sizeof (target_mgreg_t); offset += 4; } @@ -493,7 +493,7 @@ mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJit /* ignore alignment for now */ align = 1; - frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1); + frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1); arg_info [k].pad = pad; frame_size += size; arg_info [k + 1].pad = 0; @@ -768,7 +768,7 @@ mono_arch_get_global_int_regs (MonoCompile *cfg) /* * mono_arch_regalloc_cost: * - * Return the cost, in number of memory references, of the action of + * Return the cost, in number of memory references, of the action of * allocating the variable VMV into a register during global register * allocation. */ @@ -1390,7 +1390,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) /* spill down, we'll fix it in a separate pass */ // cfg->flags |= MONO_CFG_HAS_SPILLUP; - /* this is bug #60332: remove when #59509 is fixed, so no weird vararg + /* this is bug #60332: remove when #59509 is fixed, so no weird vararg * call convs needs to be handled this way. */ if (cfg->flags & MONO_CFG_HAS_VARARGS) @@ -1480,7 +1480,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) offset &= ~(align - 1); cfg->sig_cookie = offset; offset += size; - } + } offset += SIZEOF_REGISTER - 1; offset &= ~(SIZEOF_REGISTER - 1); @@ -1537,7 +1537,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) inst = cfg->args [i]; if (inst->opcode != OP_REGVAR) { MonoType *arg_type; - + if (sig->hasthis && (i == 0)) arg_type = mono_get_object_type (); else @@ -1599,10 +1599,10 @@ mono_arch_create_vars (MonoCompile *cfg) } /* Fixme: we need an alignment solution for enter_method and mono_arch_call_opcode, - * currently alignment in mono_arch_call_opcode is computed without arch_get_argument_info + * currently alignment in mono_arch_call_opcode is computed without arch_get_argument_info */ -/* +/* * take the arguments and generate the arch-specific * instructions to properly call the function in call. * This includes pushing, moving arguments to the right register @@ -1622,9 +1622,9 @@ emit_sig_cookie (MonoCompile *cfg, MonoCallInst *call, CallInfo *cinfo) cfg->disable_aot = TRUE; /* - * mono_ArgIterator_Setup assumes the signature cookie is + * mono_ArgIterator_Setup assumes the signature cookie is * passed first and all the arguments which were before it are - * passed on the stack after the signature. So compensate by + * passed on the stack after the signature. So compensate by * passing a different signature. */ tmp_sig = mono_metadata_signature_dup (call->signature); @@ -1651,7 +1651,7 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call) sig = call->signature; n = sig->param_count + sig->hasthis; - + cinfo = get_call_info (cfg->mempool, sig); if (cinfo->struct_ret) call->used_iregs |= 1 << cinfo->struct_ret; @@ -1827,7 +1827,7 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call) #endif cfg->param_area = (cfg->param_area + MIPS_STACK_ALIGNMENT - 1) & ~(MIPS_STACK_ALIGNMENT - 1); cfg->flags |= MONO_CFG_HAS_CALLS; - /* + /* * should set more info in call, such as the stack space * used by the args that needs to be added back to esp */ @@ -1846,7 +1846,7 @@ mono_arch_emit_outarg_vt (MonoCompile *cfg, MonoInst *ins, MonoInst *src) #if 0 if (cfg->verbose_level > 0) { char* nm = mono_method_full_name (cfg->method, TRUE); - g_print ("Method %s outarg_vt struct doffset=%d ainfo->size=%d ovf_size=%d\n", + g_print ("Method %s outarg_vt struct doffset=%d ainfo->size=%d ovf_size=%d\n", nm, doffset, ainfo->size, ovf_size); g_free (nm); } @@ -1978,7 +1978,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) MonoInst *last_ins = ins->prev; switch (ins->opcode) { - case OP_MUL_IMM: + case OP_MUL_IMM: /* remove unnecessary multiplication with 1 */ if (ins->inst_imm == 1) { if (ins->dreg != ins->sreg1) { @@ -1997,11 +1997,11 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_LOAD_MEMBASE: case OP_LOADI4_MEMBASE: - /* - * OP_STORE_MEMBASE_REG reg, offset(basereg) + /* + * OP_STORE_MEMBASE_REG reg, offset(basereg) * OP_LOAD_MEMBASE offset(basereg), reg */ - if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_REG + if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_REG || last_ins->opcode == OP_STORE_MEMBASE_REG) && ins->inst_basereg == last_ins->inst_destbasereg && ins->inst_offset == last_ins->inst_offset) { @@ -2015,7 +2015,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) } break; } - /* + /* * Note: reg1 must be different from the basereg in the second load * OP_LOAD_MEMBASE offset(basereg), reg1 * OP_LOAD_MEMBASE offset(basereg), reg2 @@ -2041,11 +2041,11 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) break; } #if 0 - /* - * OP_STORE_MEMBASE_IMM imm, offset(basereg) + /* + * OP_STORE_MEMBASE_IMM imm, offset(basereg) * OP_LOAD_MEMBASE offset(basereg), reg * --> - * OP_STORE_MEMBASE_IMM imm, offset(basereg) + * OP_STORE_MEMBASE_IMM imm, offset(basereg) * OP_ICONST reg, imm */ if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_IMM @@ -2066,7 +2066,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) ins->inst_basereg == last_ins->inst_destbasereg && ins->inst_offset == last_ins->inst_offset) { ins->opcode = (ins->opcode == OP_LOADI1_MEMBASE) ? OP_ICONV_TO_I1 : OP_ICONV_TO_U1; - ins->sreg1 = last_ins->sreg1; + ins->sreg1 = last_ins->sreg1; } break; case OP_LOADU2_MEMBASE: @@ -2075,22 +2075,22 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) ins->inst_basereg == last_ins->inst_destbasereg && ins->inst_offset == last_ins->inst_offset) { ins->opcode = (ins->opcode == OP_LOADI2_MEMBASE) ? OP_ICONV_TO_I2 : OP_ICONV_TO_U2; - ins->sreg1 = last_ins->sreg1; + ins->sreg1 = last_ins->sreg1; } break; case OP_ICONV_TO_I4: case OP_ICONV_TO_U4: case OP_MOVE: ins->opcode = OP_MOVE; - /* - * OP_MOVE reg, reg + /* + * OP_MOVE reg, reg */ if (ins->dreg == ins->sreg1) { MONO_DELETE_INS (bb, ins); continue; } - /* - * OP_MOVE sreg, dreg + /* + * OP_MOVE sreg, dreg * OP_MOVE dreg, sreg */ if (last_ins && last_ins->opcode == OP_MOVE && @@ -2537,7 +2537,7 @@ mono_arch_lowering_pass (MonoCompile *cfg, MonoBasicBlock *bb) MONO_BB_FOR_EACH_INS (bb, ins) { mono_print_ins_index (idx++, ins); } - + } #endif @@ -2999,7 +2999,7 @@ mono_arch_lowering_pass (MonoCompile *cfg, MonoBasicBlock *bb) MONO_BB_FOR_EACH_INS (bb, ins) { mono_print_ins_index (idx++, ins); } - + } #endif @@ -3422,8 +3422,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_BREAK: /* - * gdb does not like encountering the hw breakpoint ins in the debugged code. - * So instead of emitting a trap, we emit a call a C function and place a + * gdb does not like encountering the hw breakpoint ins in the debugged code. + * So instead of emitting a trap, we emit a call a C function and place a * breakpoint there. */ mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_JIT_ICALL_ID, GUINT_TO_POINTER (MONO_JIT_ICALL_mono_break)); @@ -3516,7 +3516,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) mips_mfhi (code, ins->dreg); break; } - case OP_IDIV_UN: + case OP_IDIV_UN: case OP_IREM_UN: { guint32 *divisor_is_zero = (guint32 *)(void *)code; @@ -3927,7 +3927,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) mips_nop (code); break; } - case OP_CALL_HANDLER: + case OP_CALL_HANDLER: mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_BB, ins->inst_target_bb); mips_lui (code, mips_t9, mips_zero, 0); mips_addiu (code, mips_t9, mips_t9, 0); @@ -4281,16 +4281,16 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_FSUB: mips_fsubd (code, ins->dreg, ins->sreg1, ins->sreg2); - break; + break; case OP_FMUL: mips_fmuld (code, ins->dreg, ins->sreg1, ins->sreg2); - break; + break; case OP_FDIV: mips_fdivd (code, ins->dreg, ins->sreg1, ins->sreg2); - break; + break; case OP_FNEG: mips_fnegd (code, ins->dreg, ins->sreg1); - break; + break; case OP_FCEQ: mips_fcmpd (code, MIPS_FPU_EQ, ins->sreg1, ins->sreg2); mips_addiu (code, ins->dreg, mips_zero, 1); @@ -4399,7 +4399,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) mips_fbtrue (code, 0); mips_nop (code); } - + mips_fcmpd (code, cond, ins->sreg1, ins->sreg2); mips_nop (code); mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_BB, ins->inst_true_bb); @@ -4460,7 +4460,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) mono_inst_name (ins->opcode), max_len, code - cfg->native_code - offset); g_assert_not_reached (); } - + cpos += max_len; last_ins = ins; @@ -4654,7 +4654,7 @@ mips_adjust_stackframe(MonoCompile *cfg) /* * Stack frame layout: - * + * * ------------------- sp + cfg->stack_usage + cfg->param_area * param area incoming * ------------------- sp + cfg->stack_usage + MIPS_STACK_PARAM_OFFSET @@ -4663,7 +4663,7 @@ mips_adjust_stackframe(MonoCompile *cfg) * ra * ------------------- sp + cfg->stack_usage-4 * spilled regs - * ------------------- sp + + * ------------------- sp + * MonoLMF structure optional * ------------------- sp + cfg->arch.lmf_offset * saved registers s0-s8 @@ -4694,12 +4694,12 @@ mono_arch_emit_prolog (MonoCompile *cfg) guint32 lmf_offset = cfg->arch.lmf_offset; int cfa_offset = 0; MonoBasicBlock *bb; - + sig = mono_method_signature_internal (method); cfg->code_size = 768 + sig->param_count * 20; code = cfg->native_code = g_malloc (cfg->code_size); - /* + /* * compute max_offset in order to use short forward jumps. */ max_offset = 0; @@ -4872,7 +4872,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) for (i = 0; i < sig->param_count + sig->hasthis; ++i) { ArgInfo *ainfo = cinfo->args + i; inst = cfg->args [pos]; - + if (cfg->verbose_level > 2) g_print ("Saving argument %d (type: %d)\n", i, ainfo->storage); if (inst->opcode == OP_REGVAR) { @@ -5184,8 +5184,8 @@ mono_arch_emit_exceptions (MonoCompile *cfg) int max_epilog_size = 50; /* count the number of exception infos */ - - /* + + /* * make sure we have enough space for exceptions * 24 is the simulated call to throw_exception_by_name */ @@ -5230,7 +5230,7 @@ void mono_arch_emit_this_vret_args (MonoCompile *cfg, MonoCallInst *inst, int this_reg, int this_type, int vt_reg) { int this_dreg = mips_a0; - + if (vt_reg != -1) this_dreg = mips_a1; @@ -5480,7 +5480,7 @@ mono_arch_clear_breakpoint (MonoJitInfo *ji, guint8 *ip) mono_arch_flush_icache (ip, code - ip); } - + /* * mono_arch_start_single_stepping: * @@ -5491,7 +5491,7 @@ mono_arch_start_single_stepping (void) { mono_mprotect (ss_trigger_page, mono_pagesize (), 0); } - + /* * mono_arch_stop_single_stepping: * diff --git a/src/mono/mono/mini/mini-mips.h b/src/mono/mono/mini/mini-mips.h index e3fabff76d4903..b3a9920adf4e7e 100644 --- a/src/mono/mono/mini/mini-mips.h +++ b/src/mono/mono/mini/mini-mips.h @@ -193,7 +193,7 @@ typedef gdouble mips_freg; #define MONO_ARCH_FRAME_ALIGNMENT 8 -/* fixme: align to 16byte instead of 32byte (we align to 32byte to get +/* fixme: align to 16byte instead of 32byte (we align to 32byte to get * reproduceable results for benchmarks */ #define MONO_ARCH_CODE_ALIGNMENT 32 @@ -423,4 +423,4 @@ typedef struct { guint8 *mips_emit_load_const (guint8 *code, int dreg, target_mgreg_t v); -#endif /* __MONO_MINI_MIPS_H__ */ +#endif /* __MONO_MINI_MIPS_H__ */ diff --git a/src/mono/mono/mini/mini-ops.h b/src/mono/mono/mini/mini-ops.h index f41585485a9111..f4b6fa56581dd2 100644 --- a/src/mono/mono/mini/mini-ops.h +++ b/src/mono/mono/mini/mini-ops.h @@ -982,7 +982,7 @@ MINI_OP(OP_PMULQ, "pmulq", XREG, XREG, XREG) MINI_OP(OP_PMULW_HIGH_UN, "pmulw_high_un", XREG, XREG, XREG) MINI_OP(OP_PMULW_HIGH, "pmulw_high", XREG, XREG, XREG) -/*SSE2 Shift ops must have the _reg version right after as code depends on this ordering.*/ +/*SSE2 Shift ops must have the _reg version right after as code depends on this ordering.*/ MINI_OP(OP_PSHRW, "pshrw", XREG, XREG, NONE) MINI_OP(OP_PSHRW_REG, "pshrw_reg", XREG, XREG, XREG) @@ -1254,12 +1254,12 @@ MINI_OP(OP_CMOV_LLE_UN, "cmov_lle_un", IREG, IREG, IREG) MINI_OP(OP_CMOV_LLT_UN, "cmov_llt_un", IREG, IREG, IREG) /* Debugging support */ -/* +/* * Marks the start of the live range of the variable in inst_c0, that is the * first instruction where the variable has a value. */ MINI_OP(OP_LIVERANGE_START, "liverange_start", NONE, NONE, NONE) -/* +/* * Marks the end of the live range of the variable in inst_c0, that is the * first instruction where the variable no longer has a value. */ diff --git a/src/mono/mono/mini/mini-posix.c b/src/mono/mono/mini/mini-posix.c index a173516415bcb4..b706de969f5ce6 100644 --- a/src/mono/mono/mini/mini-posix.c +++ b/src/mono/mono/mini/mini-posix.c @@ -176,7 +176,7 @@ save_old_signal_handler (int signo, struct sigaction *old_action) } handler_to_save->sa_mask = old_action->sa_mask; handler_to_save->sa_flags = old_action->sa_flags; - + if (!mono_saved_signal_handlers) mono_saved_signal_handlers = g_hash_table_new_full (NULL, NULL, NULL, g_free); g_hash_table_insert (mono_saved_signal_handlers, GINT_TO_POINTER (signo), handler_to_save); @@ -321,7 +321,7 @@ add_signal_handler (int signo, MonoSignalHandler handler, int flags) #endif sa.sa_flags |= SA_ONSTACK; - /* + /* * libgc will crash when trying to do stack marking for threads which are on * an altstack, so delay the suspend signal after the signal handler has * executed. @@ -331,11 +331,11 @@ add_signal_handler (int signo, MonoSignalHandler handler, int flags) } #endif if (signo == SIGSEGV) { - /* + /* * Delay abort signals while handling SIGSEGVs since they could go unnoticed. */ sigset_t block_mask; - + sigemptyset (&block_mask); } #else @@ -347,7 +347,7 @@ add_signal_handler (int signo, MonoSignalHandler handler, int flags) /* if there was already a handler in place for this signal, store it */ if (! (previous_sa.sa_flags & SA_SIGINFO) && - (SIG_DFL == previous_sa.sa_handler)) { + (SIG_DFL == previous_sa.sa_handler)) { /* it there is no sa_sigaction function and the sa_handler is default, we can safely ignore this */ } else { if (mono_do_signal_chaining) @@ -958,7 +958,7 @@ mono_gdb_render_native_backtraces (pid_t crashed_pid) const char *argv [10]; memset (argv, 0, sizeof (char*) * 10); - char commands_filename [100]; + char commands_filename [100]; commands_filename [0] = '\0'; g_snprintf (commands_filename, sizeof (commands_filename), "/tmp/mono-gdb-commands.%d", crashed_pid); diff --git a/src/mono/mono/mini/mini-ppc.c b/src/mono/mono/mini/mini-ppc.c index 48174a3130ac32..ed8bf63f631a1a 100644 --- a/src/mono/mono/mini/mini-ppc.c +++ b/src/mono/mono/mini/mini-ppc.c @@ -155,7 +155,7 @@ emit_memcpy (guint8 *code, int size, int dreg, int doffset, int sreg, int soffse /* the hardware has multiple load/store units and the move is long enough to use more then one register, then use load/load/store/store to execute 2 instructions per cycle. */ - if ((cpu_hw_caps & PPC_MULTIPLE_LS_UNITS) && (dreg != ppc_r11) && (sreg != ppc_r11)) { + if ((cpu_hw_caps & PPC_MULTIPLE_LS_UNITS) && (dreg != ppc_r11) && (sreg != ppc_r11)) { while (size >= 16) { ppc_ldptr (code, ppc_r0, soffset, sreg); ppc_ldptr (code, ppc_r11, soffset+8, sreg); @@ -163,7 +163,7 @@ emit_memcpy (guint8 *code, int size, int dreg, int doffset, int sreg, int soffse ppc_stptr (code, ppc_r11, doffset+8, dreg); size -= 16; soffset += 16; - doffset += 16; + doffset += 16; } } while (size >= 8) { @@ -174,7 +174,7 @@ emit_memcpy (guint8 *code, int size, int dreg, int doffset, int sreg, int soffse doffset += 8; } #else - if ((cpu_hw_caps & PPC_MULTIPLE_LS_UNITS) && (dreg != ppc_r11) && (sreg != ppc_r11)) { + if ((cpu_hw_caps & PPC_MULTIPLE_LS_UNITS) && (dreg != ppc_r11) && (sreg != ppc_r11)) { while (size >= 8) { ppc_lwz (code, ppc_r0, soffset, sreg); ppc_lwz (code, ppc_r11, soffset+4, sreg); @@ -182,7 +182,7 @@ emit_memcpy (guint8 *code, int size, int dreg, int doffset, int sreg, int soffse ppc_stw (code, ppc_r11, doffset+4, dreg); size -= 8; soffset += 8; - doffset += 8; + doffset += 8; } } #endif @@ -217,7 +217,7 @@ emit_memcpy (guint8 *code, int size, int dreg, int doffset, int sreg, int soffse * @arg_info: an array to store the result infos * * Gathers information on parameters such as size, alignment and - * padding. arg_info should be large enought to hold param_count + 1 entries. + * padding. arg_info should be large enought to hold param_count + 1 entries. * * Returns the size of the activation frame. */ @@ -232,7 +232,7 @@ mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJit int size, align, pad; int offset = 8; - if (MONO_TYPE_ISSTRUCT (csig->ret)) { + if (MONO_TYPE_ISSTRUCT (csig->ret)) { frame_size += sizeof (target_mgreg_t); offset += 4; } @@ -247,7 +247,7 @@ mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJit arg_info [0].size = frame_size; for (k = 0; k < param_count; k++) { - + if (csig->pinvoke && !csig->marshalling_disabled) size = mono_type_native_stack_size (csig->params [k], (guint32*)&align); else @@ -256,7 +256,7 @@ mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJit /* ignore alignment for now */ align = 1; - frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1); + frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1); arg_info [k].pad = pad; frame_size += size; arg_info [k + 1].pad = 0; @@ -483,7 +483,7 @@ typedef struct { } AuxVec; #define MAX_AUX_ENTRIES 128 -/* +/* * PPC_FEATURE_POWER4, PPC_FEATURE_POWER5, PPC_FEATURE_POWER5_PLUS, PPC_FEATURE_CELL, * PPC_FEATURE_PA6T, PPC_FEATURE_ARCH_2_05 are considered supporting 2X ISA features */ @@ -709,7 +709,7 @@ mono_arch_get_global_int_regs (MonoCompile *cfg) /* * mono_arch_regalloc_cost: * - * Return the cost, in number of memory references, of the action of + * Return the cost, in number of memory references, of the action of * allocating the variable VMV into a register during global register * allocation. */ @@ -862,7 +862,7 @@ struct CallInfo { static gboolean is_float_struct_returnable_via_regs (MonoType *type, int* member_cnt, int* member_size) { - int local_member_cnt, local_member_size; + int local_member_cnt, local_member_size; if (!member_cnt) { member_cnt = &local_member_cnt; } @@ -1375,7 +1375,7 @@ mono_arch_allocate_vars (MonoCompile *m) m->flags |= MONO_CFG_HAS_SPILLUP; - /* this is bug #60332: remove when #59509 is fixed, so no weird vararg + /* this is bug #60332: remove when #59509 is fixed, so no weird vararg * call convs needs to be handled this way. */ if (m->flags & MONO_CFG_HAS_VARARGS) @@ -1389,7 +1389,7 @@ mono_arch_allocate_vars (MonoCompile *m) header = m->header; - /* + /* * We use the frame register also for any method that has * exception clauses. This way, when the handlers are called, * the code will reference local variables using the frame reg instead of @@ -1397,7 +1397,7 @@ mono_arch_allocate_vars (MonoCompile *m) * corrupt the method frames that are already on the stack (since * filters get called before stack unwinding happens) when the filter * code would call any method (this also applies to finally etc.). - */ + */ if ((m->flags & MONO_CFG_HAS_ALLOCA) || header->num_clauses) frame_reg = ppc_r31; m->frame_reg = frame_reg; @@ -1406,7 +1406,7 @@ mono_arch_allocate_vars (MonoCompile *m) } sig = mono_method_signature_internal (m->method); - + offset = 0; curinst = 0; if (MONO_TYPE_ISSTRUCT (sig->ret)) { @@ -1429,7 +1429,7 @@ mono_arch_allocate_vars (MonoCompile *m) } } /* local vars are at a positive offset from the stack pointer */ - /* + /* * also note that if the function uses alloca, we use ppc_r31 * to point at the local variables. */ @@ -1506,7 +1506,7 @@ mono_arch_allocate_vars (MonoCompile *m) } if (MONO_TYPE_ISSTRUCT (sig->params [i]) && size < sizeof (target_mgreg_t)) size = align = sizeof (target_mgreg_t); - /* + /* * Use at least 4/8 byte alignment, since these might be passed in registers, and * they are saved using std in the prolog. */ @@ -1552,7 +1552,7 @@ mono_arch_create_vars (MonoCompile *cfg) } /* Fixme: we need an alignment solution for enter_method and mono_arch_call_opcode, - * currently alignment in mono_arch_call_opcode is computed without arch_get_argument_info + * currently alignment in mono_arch_call_opcode is computed without arch_get_argument_info */ static void @@ -1578,7 +1578,7 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call) sig = call->signature; n = sig->param_count + sig->hasthis; - + cinfo = get_call_info (sig); for (i = 0; i < n; ++i) { @@ -1913,7 +1913,7 @@ if (0 && ins->inst_true_bb->native_offset) { \ MONO_PATCH_INFO_EXC, exc_name); \ ppc_bcl (code, (b0), (b1), 0); \ } \ - } while (0); + } while (0); #define EMIT_COND_SYSTEM_EXCEPTION(cond,exc_name) EMIT_COND_SYSTEM_EXCEPTION_FLAGS(branch_b0_table [(cond)], branch_b1_table [(cond)], (exc_name)) @@ -1954,7 +1954,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) MONO_BB_FOR_EACH_INS_SAFE (bb, n, ins) { switch (normalize_opcode (ins->opcode)) { - case OP_MUL_IMM: + case OP_MUL_IMM: /* remove unnecessary multiplication with 1 */ if (ins->inst_imm == 1) { if (ins->dreg != ins->sreg1) { @@ -1972,8 +1972,8 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) } break; case OP_LOAD_MEMBASE: - /* - * OP_STORE_MEMBASE_REG reg, offset(basereg) + /* + * OP_STORE_MEMBASE_REG reg, offset(basereg) * OP_LOAD_MEMBASE offset(basereg), reg */ if (last_ins && normalize_opcode (last_ins->opcode) == OP_STORE_MEMBASE_REG && @@ -1988,7 +1988,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) ins->sreg1 = last_ins->sreg1; } - /* + /* * Note: reg1 must be different from the basereg in the second load * OP_LOAD_MEMBASE offset(basereg), reg1 * OP_LOAD_MEMBASE offset(basereg), reg2 @@ -2012,11 +2012,11 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) //g_assert_not_reached (); #if 0 - /* - * OP_STORE_MEMBASE_IMM imm, offset(basereg) + /* + * OP_STORE_MEMBASE_IMM imm, offset(basereg) * OP_LOAD_MEMBASE offset(basereg), reg * --> - * OP_STORE_MEMBASE_IMM imm, offset(basereg) + * OP_STORE_MEMBASE_IMM imm, offset(basereg) * OP_ICONST reg, imm */ } else if (last_ins && normalize_opcode (last_ins->opcode) == OP_STORE_MEMBASE_IMM && @@ -2035,7 +2035,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) ins->inst_basereg == last_ins->inst_destbasereg && ins->inst_offset == last_ins->inst_offset) { ins->opcode = (ins->opcode == OP_LOADI1_MEMBASE) ? OP_ICONV_TO_I1 : OP_ICONV_TO_U1; - ins->sreg1 = last_ins->sreg1; + ins->sreg1 = last_ins->sreg1; } break; case OP_LOADU2_MEMBASE: @@ -2044,7 +2044,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) ins->inst_basereg == last_ins->inst_destbasereg && ins->inst_offset == last_ins->inst_offset) { ins->opcode = (ins->opcode == OP_LOADI2_MEMBASE) ? OP_ICONV_TO_I2 : OP_ICONV_TO_U2; - ins->sreg1 = last_ins->sreg1; + ins->sreg1 = last_ins->sreg1; } break; #ifdef __mono_ppc64__ @@ -2060,15 +2060,15 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) #endif case OP_MOVE: ins->opcode = OP_MOVE; - /* - * OP_MOVE reg, reg + /* + * OP_MOVE reg, reg */ if (ins->dreg == ins->sreg1) { MONO_DELETE_INS (bb, ins); continue; } - /* - * OP_MOVE sreg, dreg + /* + * OP_MOVE sreg, dreg * OP_MOVE dreg, sreg */ if (last_ins && last_ins->opcode == OP_MOVE && @@ -2232,7 +2232,7 @@ mono_arch_decompose_long_opts (MonoCompile *cfg, MonoInst *ins) } } -/* +/* * the branch_b0_table should maintain the order of these * opcodes. case CEE_BEQ: @@ -2246,34 +2246,34 @@ case CEE_BGT_UN: case CEE_BLE_UN: case CEE_BLT_UN: */ -static const guchar +static const guchar branch_b0_table [] = { - PPC_BR_TRUE, - PPC_BR_FALSE, - PPC_BR_TRUE, - PPC_BR_FALSE, - PPC_BR_TRUE, - - PPC_BR_FALSE, - PPC_BR_FALSE, - PPC_BR_TRUE, + PPC_BR_TRUE, + PPC_BR_FALSE, + PPC_BR_TRUE, + PPC_BR_FALSE, + PPC_BR_TRUE, + + PPC_BR_FALSE, + PPC_BR_FALSE, + PPC_BR_TRUE, PPC_BR_FALSE, PPC_BR_TRUE }; -static const guchar +static const guchar branch_b1_table [] = { - PPC_BR_EQ, - PPC_BR_LT, - PPC_BR_GT, + PPC_BR_EQ, + PPC_BR_LT, PPC_BR_GT, - PPC_BR_LT, - - PPC_BR_EQ, - PPC_BR_LT, - PPC_BR_GT, PPC_BR_GT, - PPC_BR_LT + PPC_BR_LT, + + PPC_BR_EQ, + PPC_BR_LT, + PPC_BR_GT, + PPC_BR_GT, + PPC_BR_LT }; #define NEW_INS(cfg,dest,op) do { \ @@ -2621,7 +2621,7 @@ mono_arch_lowering_pass (MonoCompile *cfg, MonoBasicBlock *bb) last_ins = ins; } bb->last_ins = last_ins; - bb->max_vreg = cfg->next_vreg; + bb->max_vreg = cfg->next_vreg; } static guchar* @@ -2814,7 +2814,7 @@ ppc_patch_full (MonoCompile *cfg, guchar *code, const guchar *target, gboolean i return; } } - + if ((glong)target >= 0){ if ((glong)target <= 33554431){ ins = (18 << 26) | ((gulong) target) | (ins & 1) | 2; @@ -2834,8 +2834,8 @@ ppc_patch_full (MonoCompile *cfg, guchar *code, const guchar *target, gboolean i g_assert_not_reached (); } - - + + if (prim == 16) { g_assert (!is_fd); // absolute address @@ -3054,7 +3054,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) if (cfg->compile_aot) NOT_IMPLEMENTED; - /* + /* * Read from the single stepping trigger page. This will cause a * SIGSEGV when single stepping is enabled. * We do this _before_ the breakpoint, so single stepping after @@ -3067,7 +3067,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) mono_add_seq_point (cfg, bb, ins, code - cfg->native_code); - /* + /* * A placeholder for a possible breakpoint inserted by * mono_arch_set_breakpoint (). */ @@ -3313,8 +3313,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_BREAK: /* - * gdb does not like encountering a trap in the debugged code. So - * instead of emitting a trap, we emit a call a C function and place a + * gdb does not like encountering a trap in the debugged code. So + * instead of emitting a trap, we emit a call a C function and place a * breakpoint there. */ //ppc_break (code); @@ -3590,7 +3590,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_IMUL_OVF: CASE_PPC64 (OP_LMUL_OVF) - /* we annot use mcrxr, since it's not implemented on some processors + /* we annot use mcrxr, since it's not implemented on some processors * XER format: SO, OV, CA, reserved [21 bits], count [8 bits] */ if (ins->opcode == OP_IMUL_OVF) @@ -3606,7 +3606,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_IMUL_OVF_UN: CASE_PPC64 (OP_LMUL_OVF_UN) /* we first multiply to get the high word and compare to 0 - * to set the flags, then the result is discarded and then + * to set the flags, then the result is discarded and then * we multiply to get the lower * bits result */ if (ins->opcode == OP_IMUL_OVF_UN) @@ -3958,7 +3958,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) ppc_blr (code); break; } - case OP_CALL_HANDLER: + case OP_CALL_HANDLER: mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_BB, ins->inst_target_bb); ppc_bl (code, 0); for (GList *tmp = ins->inst_eh_blocks; tmp != bb->clause_holes; tmp = tmp->prev) @@ -3970,7 +3970,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_BR: /*if (ins->inst_target_bb->native_offset) { ppc_b (code, 0); - //x86_jump_code (code, cfg->native_code + ins->inst_target_bb->native_offset); + //x86_jump_code (code, cfg->native_code + ins->inst_target_bb->native_offset); } else*/ { mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_BB, ins->inst_target_bb); ppc_b (code, 0); @@ -4193,7 +4193,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) msword_negative_branch = code; ppc_bc (code, PPC_BR_FALSE, PPC_BR_EQ, 0); ppc_patch (msword_negative_branch, ovf_ex_target); - + ppc_patch (msword_positive_branch, code); if (ins->dreg != ins->sreg1) ppc_mr (code, ins->dreg, ins->sreg1); @@ -4226,16 +4226,16 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_FSUB: ppc_fsub (code, ins->dreg, ins->sreg1, ins->sreg2); - break; + break; case OP_FMUL: ppc_fmul (code, ins->dreg, ins->sreg1, ins->sreg2); - break; + break; case OP_FDIV: ppc_fdiv (code, ins->dreg, ins->sreg1, ins->sreg2); - break; + break; case OP_FNEG: ppc_fneg (code, ins->dreg, ins->sreg1); - break; + break; case OP_FREM: /* emulated */ g_assert_not_reached (); @@ -4562,7 +4562,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) mono_inst_name (ins->opcode), max_len, (glong)(code - cfg->native_code - offset)); g_assert_not_reached (); } - + cpos += max_len; last_ins = ins; @@ -4710,7 +4710,7 @@ save_registers (MonoCompile *cfg, guint8* code, int pos, int base_reg, gboolean /* * Stack frame layout: - * + * * ------------------- sp * MonoLMF structure or saved registers * ------------------- @@ -4806,7 +4806,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) /* compute max_offset in order to use short forward jumps * we always do it on ppc because the immediate displacement - * for jumps is too small + * for jumps is too small */ max_offset = 0; for (bb = cfg->bb_entry; bb; bb = bb->next_bb) { @@ -4840,7 +4840,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) for (i = 0; i < sig->param_count + sig->hasthis; ++i) { ArgInfo *ainfo = cinfo->args + i; inst = cfg->args [pos]; - + if (cfg->verbose_level > 2) g_print ("Saving argument %d (type: %d)\n", i, ainfo->regtype); if (inst->opcode == OP_REGVAR) { @@ -5204,7 +5204,7 @@ mono_arch_emit_epilog (MonoCompile *cfg) if (cfg->method->save_lmf) max_epilog_size += 128; - + code = realloc_code (cfg, max_epilog_size); pos = 0; @@ -5332,8 +5332,8 @@ mono_arch_emit_exceptions (MonoCompile *cfg) } /* count the number of exception infos */ - - /* + + /* * make sure we have enough space for exceptions */ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) { @@ -5801,7 +5801,7 @@ mono_arch_emit_load_got_addr (guint8 *start, guint8 *code, MonoCompile *cfg, Mon * * Emit code to load the contents of the GOT slot identified by TRAMP_TYPE and * TARGET from the mscorlib GOT in full-aot code. - * On PPC, the GOT address is assumed to be in r30, and the result is placed into + * On PPC, the GOT address is assumed to be in r30, and the result is placed into * r12. */ guint8* @@ -5891,7 +5891,7 @@ mono_arch_skip_breakpoint (MonoContext *ctx, MonoJitInfo *ji) /* * SINGLE STEPPING */ - + /* * mono_arch_start_single_stepping: * @@ -5902,7 +5902,7 @@ mono_arch_start_single_stepping (void) { mono_mprotect (ss_trigger_page, mono_pagesize (), 0); } - + /* * mono_arch_stop_single_stepping: * diff --git a/src/mono/mono/mini/mini-ppc.h b/src/mono/mono/mini/mini-ppc.h index 6f1ce5ff2e9a18..88a5415c5a925a 100644 --- a/src/mono/mono/mini/mini-ppc.h +++ b/src/mono/mono/mini/mini-ppc.h @@ -28,7 +28,7 @@ #define MONO_ARCH_FRAME_ALIGNMENT 16 -/* fixme: align to 16byte instead of 32byte (we align to 32byte to get +/* fixme: align to 16byte instead of 32byte (we align to 32byte to get * reproduceable results for benchmarks */ #define MONO_ARCH_CODE_ALIGNMENT 32 @@ -71,9 +71,9 @@ typedef struct MonoCompileArch { * - for variables which contain values of registers, use host_mgreg_t or target_mgreg_t. * - for loading/saving pointers/ints, use the normal ppc_load_reg/ppc_save_reg () * macros. - * - for loading/saving register sized quantities, use the ppc_ldr/ppc_str + * - for loading/saving register sized quantities, use the ppc_ldr/ppc_str * macros. - * - make sure to not mix the two kinds of macros for the same memory location, + * - make sure to not mix the two kinds of macros for the same memory location, * since ppc is big endian, so a 8 byte store followed by a 4 byte load will * load the upper 32 bit of the value. * - use OP_LOADR_MEMBASE/OP_STORER_MEMBASE to load/store register sized diff --git a/src/mono/mono/mini/mini-profiler.c b/src/mono/mono/mini/mini-profiler.c index cc20f01d4a2ad3..c3a78238e4d316 100644 --- a/src/mono/mono/mini/mini-profiler.c +++ b/src/mono/mono/mini/mini-profiler.c @@ -149,7 +149,7 @@ mini_profiler_emit_tail_call (MonoCompile *cfg, MonoMethod *target) EMIT_NEW_PCONST (cfg, iargs [1], NULL); if (target) - EMIT_NEW_METHODCONST (cfg, iargs [2], target); + EMIT_NEW_METHODCONST (cfg, iargs [2], target); else EMIT_NEW_PCONST (cfg, iargs [2], NULL); diff --git a/src/mono/mono/mini/mini-runtime.c b/src/mono/mono/mini/mini-runtime.c index 78d588f38a435b..a52e6cb1a76288 100644 --- a/src/mono/mono/mini/mini-runtime.c +++ b/src/mono/mono/mini/mini-runtime.c @@ -126,7 +126,7 @@ gboolean mono_use_llvm = FALSE; gboolean mono_use_fast_math = FALSE; -// Lists of allowlisted and blocklisted CPU features +// Lists of allowlisted and blocklisted CPU features MonoCPUFeatures mono_cpu_features_enabled = (MonoCPUFeatures)0; #ifdef DISABLE_SIMD @@ -2021,7 +2021,7 @@ mono_enable_jit_dump (void) { if (perf_dump_pid == 0) perf_dump_pid = getpid(); - + if (!perf_dump_file) { char name [64]; FileHeader header; @@ -2029,18 +2029,18 @@ mono_enable_jit_dump (void) mono_os_mutex_init (&perf_dump_mutex); mono_os_mutex_lock (&perf_dump_mutex); - + g_snprintf (name, sizeof (name), "/tmp/jit-%d.dump", perf_dump_pid); unlink (name); perf_dump_file = fopen (name, "w"); - + add_file_header_info (&header); if (perf_dump_file) { fwrite (&header, sizeof (header), 1, perf_dump_file); //This informs perf of the presence of the jitdump file and support for the feature. perf_dump_mmap_addr = mmap (NULL, sizeof (header), PROT_READ | PROT_EXEC, MAP_PRIVATE, fileno (perf_dump_file), 0); } - + mono_os_mutex_unlock (&perf_dump_mutex); } } @@ -2062,12 +2062,12 @@ void mono_emit_jit_dump (MonoJitInfo *jinfo, gpointer code) { static uint64_t code_index; - + if (perf_dump_file) { JitCodeLoadRecord record; size_t nameLen = strlen (jinfo->d.method->name); memset (&record, 0, sizeof (record)); - + add_basic_JitCodeLoadRecord_info (&record); record.header.total_size = sizeof (record) + nameLen + 1 + jinfo->code_size; record.vma = (guint64)jinfo->code_start; @@ -2075,13 +2075,13 @@ mono_emit_jit_dump (MonoJitInfo *jinfo, gpointer code) record.code_size = (guint64)jinfo->code_size; mono_os_mutex_lock (&perf_dump_mutex); - + record.code_index = ++code_index; - + // TODO: write debugInfo and unwindInfo immediately before the JitCodeLoadRecord (while lock is held). - + record.header.timestamp = mono_clock_get_time_ns (clock_id); - + fwrite (&record, sizeof (record), 1, perf_dump_file); fwrite (jinfo->d.method->name, nameLen + 1, 1, perf_dump_file); fwrite (code, jinfo->code_size, 1, perf_dump_file); @@ -2812,7 +2812,7 @@ mono_jit_free_method (MonoMethod *method) mono_debug_remove_method (method, NULL); mono_lldb_remove_method (method, ji); - + //seq_points are always on get_default_jit_mm jit_mm = get_default_jit_mm (); jit_mm_lock (jit_mm); @@ -4402,7 +4402,7 @@ mini_init (const char *filename, const char *runtime_version) mono_ee_interp_init (mono_interp_opts_string); #endif mono_components_init (); - + mono_component_debugger ()->parse_options (mono_debugger_agent_get_sdb_options ()); mono_os_mutex_init_recursive (&jit_mutex); diff --git a/src/mono/mono/mini/mini-runtime.h b/src/mono/mono/mini/mini-runtime.h index d1e822a35e7a22..4f348797326d30 100644 --- a/src/mono/mono/mini/mini-runtime.h +++ b/src/mono/mono/mini/mini-runtime.h @@ -159,14 +159,14 @@ struct MonoJitTlsData { /* context to be used by the guard trampoline when resuming interruption.*/ MonoContext handler_block_context; - /* + /* * Stores the state at the exception throw site to be used by mono_stack_walk () * when it is called from profiler functions during exception handling. */ MonoContext orig_ex_ctx; gboolean orig_ex_ctx_set; - /* + /* * The current exception in flight */ MonoGCHandle thrown_exc; diff --git a/src/mono/mono/mini/mini-s390x.c b/src/mono/mono/mini/mini-s390x.c index 5e4aca54eadb60..3cc263ec280dae 100644 --- a/src/mono/mono/mini/mini-s390x.c +++ b/src/mono/mono/mini/mini-s390x.c @@ -62,7 +62,7 @@ if (ins->inst_target_bb->native_offset) { \ mono_add_patch_info (cfg, code - cfg->native_code, \ MONO_PATCH_INFO_EXC, exc_name); \ s390_jcl (code, cond, 0); \ - } while (0); + } while (0); #define EMIT_COMP_AND_BRANCH(ins, cab, cmp) \ { \ @@ -213,7 +213,7 @@ if (ins->inst_true_bb->native_offset) { \ } \ s390_ ## op (code, ins->dreg, ins->sreg2, m, s390_f14); \ } \ - s390_ldgr (code, s390_f14, s390_r1); + s390_ldgr (code, s390_f14, s390_r1); #undef DEBUG #define DEBUG(a) if (cfg->verbose_level > 1) a @@ -279,7 +279,7 @@ typedef struct { code_size, parm_size, retStruct; -} size_data; +} size_data; /** * ABI - register use in calls etc. @@ -390,7 +390,7 @@ static const char * fpNames[] = { * Constants used in debugging - map vector register names */ static const char * vrNames[] = { - "vr0", "vr1", "vr2", "vr3", "vr4", "vr5", "vr6", "vr7", + "vr0", "vr1", "vr2", "vr3", "vr4", "vr5", "vr6", "vr7", "vr8", "vr9", "vr10", "vr11", "vr12", "vr13", "vr14", "vr15", "vr16", "vr17", "vr18", "vr19", "vr20", "vr21", "vr22", "vr23", "vr24", "vr25", "vr26", "vr27", "vr28", "vr29", "vr30", "vr31" @@ -400,7 +400,7 @@ static const char * vrNames[] = { /** * Constants used in debugging - ABI register types */ -static const char *typeParm[] = { "General", "Base", "FPR8", "FPR4", "StructByVal", +static const char *typeParm[] = { "General", "Base", "FPR8", "FPR4", "StructByVal", "StructByValInFP", "ByAddr"}; #endif @@ -410,9 +410,9 @@ static GENERATE_TRY_GET_CLASS_WITH_CACHE (math, "System", "Math") static GENERATE_TRY_GET_CLASS_WITH_CACHE (mathf, "System", "MathF") /** - * + * * @brief Return general register name - * + * * @param[in] register number * @returns Name of register * @@ -420,7 +420,7 @@ static GENERATE_TRY_GET_CLASS_WITH_CACHE (mathf, "System", "MathF") */ const char* -mono_arch_regname (int reg) +mono_arch_regname (int reg) { if (reg >= 0 && reg < 16) return grNames [reg]; @@ -431,9 +431,9 @@ mono_arch_regname (int reg) /*========================= End of Function ========================*/ /** - * + * * @brief Return floating point register name - * + * * @param[in] register number * @returns Name of register * @@ -441,7 +441,7 @@ mono_arch_regname (int reg) */ const char* -mono_arch_fregname (int reg) +mono_arch_fregname (int reg) { if (reg >= 0 && reg < 16) return fpNames [reg]; @@ -452,9 +452,9 @@ mono_arch_fregname (int reg) /*========================= End of Function ========================*/ /** - * + * * @brief Return vector register name - * + * * @param[in] register number * @returns Name of register * @@ -473,28 +473,28 @@ mono_arch_xregname (int reg) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific return argument information - * + * * @param[in] @csig - Method signature * @param[in] @param_count - Number of parameters to consider * @param[out] @arg_info - An array in which to store results * @returns Size of the activation frame * - * Gathers information on parameters such as size, alignment, and padding. - * arg_info should be large * enough to hold param_count + 1 entries. + * Gathers information on parameters such as size, alignment, and padding. + * arg_info should be large * enough to hold param_count + 1 entries. */ int -mono_arch_get_argument_info (MonoMethodSignature *csig, - int param_count, +mono_arch_get_argument_info (MonoMethodSignature *csig, + int param_count, MonoJitArgumentInfo *arg_info) { int k, frame_size = 0; int size, align, pad; int offset = 8; - if (MONO_TYPE_ISSTRUCT (csig->ret)) { + if (MONO_TYPE_ISSTRUCT (csig->ret)) { frame_size += sizeof (target_mgreg_t); offset += 8; } @@ -509,13 +509,13 @@ mono_arch_get_argument_info (MonoMethodSignature *csig, arg_info [0].size = frame_size; for (k = 0; k < param_count; k++) { - + if (csig->pinvoke && !csig->marshalling_disabled) size = mono_type_native_stack_size (csig->params [k], (guint32 *) &align); else size = mini_type_stack_size (csig->params [k], &align); - frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1); + frame_size += pad = (align - (frame_size & (align - 1))) & (align - 1); arg_info [k].pad = pad; frame_size += size; arg_info [k + 1].pad = 0; @@ -535,9 +535,9 @@ mono_arch_get_argument_info (MonoMethodSignature *csig, /*========================= End of Function ========================*/ /** - * + * * @brief Emit an s390x move operation - * + * * @param[in] @cfg - MonoCompile control block * @param[in] @dr - Destination register * @param[in] @ins - Current instruction @@ -553,9 +553,9 @@ emit_new_move(MonoCompile *cfg, int dr, MonoInst *ins, MonoInst *src) ArgInfo *ainfo = (ArgInfo *) ins->inst_p1; MonoInst *vtcopy = mono_compile_create_var (cfg, m_class_get_byval_arg (src->klass), OP_LOCAL); MonoInst *load; - MonoInst *move; + MonoInst *move; int size; - + if (call->signature->pinvoke && !call->signature->marshalling_disabled) { size = mono_type_native_stack_size (m_class_get_byval_arg (src->klass), NULL); vtcopy->backend.is_pinvoke = 1; @@ -570,26 +570,26 @@ emit_new_move(MonoCompile *cfg, int dr, MonoInst *ins, MonoInst *src) move->inst_offset = 0; move->sreg1 = src->dreg; move->inst_imm = 0; - move->backend.size = size; - MONO_ADD_INS (cfg->cbb, move); + move->backend.size = size; + MONO_ADD_INS (cfg->cbb, move); if (dr != 0) MONO_EMIT_NEW_UNALU(cfg, OP_MOVE, dr, load->dreg); else MONO_EMIT_NEW_STORE_MEMBASE(cfg, OP_STORE_MEMBASE_REG, ainfo->reg, ainfo->offset, load->dreg); -} +} /*========================= End of Function ========================*/ /** - * + * * @brief Generate output sequence for VT register parameters - * + * * @param[in] @cfg - MonoCompile control block * @param[in] @dr - Destination register * @param[in] @ins - Current instruction - * @param[in] @src - Instruction representing the source - * + * @param[in] @src - Instruction representing the source + * * Emit the output of structures for calls whose address is placed in a register. */ @@ -620,7 +620,7 @@ emit_outarg_vtr(MonoCompile *cfg, MonoInst *ins, MonoInst *src) MONO_EMIT_NEW_LOAD_MEMBASE_OP(cfg, OP_LOADI8_MEMBASE, reg, src->dreg, 0); break; - default: + default: emit_new_move (cfg, reg, ins, src); } mono_call_inst_add_outarg_reg(cfg, call, reg, ainfo->reg, FALSE); @@ -629,14 +629,14 @@ emit_outarg_vtr(MonoCompile *cfg, MonoInst *ins, MonoInst *src) /*========================= End of Function ========================*/ /** - * + * * @brief Generate output sequence for VT stack parameters - * + * * @param[in] @cfg - MonoCompile control block * @param[in] @dr - Destination register * @param[in] @ins - Current instruction - * @param[in] @src - Instruction representing the source - * + * @param[in] @src - Instruction representing the source + * * Emit the output of structures for calls whose address is placed on the stack */ @@ -644,12 +644,12 @@ static void __inline__ emit_outarg_vts(MonoCompile *cfg, MonoInst *ins, MonoInst *src) { ArgInfo *ainfo = (ArgInfo *) ins->inst_p1; - int tmpr = mono_alloc_preg (cfg); + int tmpr = mono_alloc_preg (cfg); switch (ins->backend.size) { case 0: MONO_EMIT_NEW_ICONST(cfg, tmpr, 0); - MONO_EMIT_NEW_STORE_MEMBASE(cfg, OP_STORE_MEMBASE_REG, + MONO_EMIT_NEW_STORE_MEMBASE(cfg, OP_STORE_MEMBASE_REG, ainfo->reg, ainfo->offset, tmpr); break; case 1: @@ -685,15 +685,15 @@ emit_outarg_vts(MonoCompile *cfg, MonoInst *ins, MonoInst *src) /*========================= End of Function ========================*/ /** - * + * * @brief Generate unwind information for range of registers - * + * * @param[in] @cfg - MonoCompile control block * @param[in] @code - Location of code * @param[in] @start - Starting register * @param[in] @end - Ending register * @param[in] @offset - Offset in stack - * + * * Emit unwind information for a range of registers. */ @@ -712,13 +712,13 @@ emit_unwind_regs(MonoCompile *cfg, guint8 *code, int start, int end, long offset /*========================= End of Function ========================*/ /** - * + * * @brief Get previous stack frame pointer - * + * * @param[in] @cfg - MonoCompile control block * @param[in] @code - Location of code * @returns Previous stack pointer - * + * * Retrieve the stack pointer of the previous frame */ @@ -751,9 +751,9 @@ backUpStackPtr(MonoCompile *cfg, guint8 *code) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific CPU initialization - * + * * Perform CPU specific initialization to execute managed code. */ @@ -765,10 +765,10 @@ mono_arch_cpu_init (void) /*========================= End of Function ========================*/ /** - * + * * @brief Archictecture specific initialization - * - * + * + * * Initialize architecture specific code: * - Define trigger pages for debugger * - Generate breakpoint code stub @@ -786,10 +786,10 @@ mono_arch_init (void) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific cleaup code - * - * + * + * * Clean up before termination: * - Free the trigger pages */ @@ -802,12 +802,12 @@ mono_arch_cleanup (void) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific check for fast TLS access - * + * * @returns True - * - * Returns whether we use fast inlined thread local storage managed access, + * + * Returns whether we use fast inlined thread local storage managed access, * instead of falling back to native code. */ @@ -820,12 +820,12 @@ mono_arch_have_fast_tls (void) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific check of mono optimizations - * + * * @param[out] @exclude_mask - Optimization exclusion mask * @returns Optimizations supported on this CPU - * + * * Returns the optimizations supported on this CPU */ @@ -844,12 +844,12 @@ mono_arch_cpu_optimizations (guint32 *exclude_mask) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific allocation of integer variables - * + * * @param[in] @cfg - MonoCompile control block * @returns A list of integer variables - * + * * Returns a list of allocatable integer variables */ @@ -867,7 +867,7 @@ mono_arch_get_allocatable_int_vars (MonoCompile *cfg) if (vmv->range.first_use.abs_pos >= vmv->range.last_use.abs_pos) continue; - if (ins->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT) || + if (ins->flags & (MONO_INST_VOLATILE|MONO_INST_INDIRECT) || (ins->opcode != OP_LOCAL && ins->opcode != OP_ARG)) continue; @@ -885,12 +885,12 @@ mono_arch_get_allocatable_int_vars (MonoCompile *cfg) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific determination of usable integer registers - * + * * @param[in] @cfg - MonoCompile control block * @returns A list of allocatable registers - * + * * Returns a list of usable integer registers */ @@ -909,7 +909,7 @@ mono_arch_get_global_int_regs (MonoCompile *cfg) /* FIXME: s390_r12 is reserved for bkchain_reg. Only reserve it if needed */ top = 12; for (i = 8; i < top; ++i) { - if ((cfg->frame_reg != i) && + if ((cfg->frame_reg != i) && //!((cfg->uses_rgctx_reg) && (i == MONO_ARCH_IMT_REG))) (i != MONO_ARCH_IMT_REG)) regs = g_list_prepend (regs, GUINT_TO_POINTER (i)); @@ -921,12 +921,12 @@ mono_arch_get_global_int_regs (MonoCompile *cfg) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific flush of instruction cache - * + * * @param[in] @code - Start of code * @param[in] @size - Amount to be flushed - * + * * Flush the CPU icache. */ @@ -938,13 +938,13 @@ mono_arch_flush_icache (guint8 *code, gint size) /*========================= End of Function ========================*/ /** - * - * @brief Add an integer register parameter - * + * + * @brief Add an integer register parameter + * * @param[in] @gr - Address of current register number * @param[in] @sz - Stack size data * @param[in] @ainfo - Parameter information - * + * * Assign a parameter to a general register or spill it onto the stack */ @@ -957,11 +957,11 @@ add_general (guint *gr, size_data *sz, ArgInfo *ainfo) ainfo->reg = STK_BASE; ainfo->regtype = RegTypeBase; sz->stack_size += sizeof(long); - sz->code_size += 12; + sz->code_size += 12; } else { ainfo->reg = *gr; ainfo->regtype = RegTypeGeneral; - sz->code_size += 8; + sz->code_size += 8; } (*gr) ++; } @@ -969,15 +969,15 @@ add_general (guint *gr, size_data *sz, ArgInfo *ainfo) /*========================= End of Function ========================*/ /** - * + * * @brief Add a structure variable to parameter list - * + * * @param[in] @gr - Address of current register number * @param[in] @sz - Stack size data * @param[in] @ainfo - Parameter information * @param[in] @size - Size of parameter * @param[in] @type - Type of stack parameter (reference or value) - * + * * Assign a structure address to a register or spill it onto the stack */ @@ -1003,14 +1003,14 @@ add_stackParm (guint *gr, size_data *sz, ArgInfo *ainfo, gint size, ArgStorage t /*========================= End of Function ========================*/ /** - * + * * @brief Add a floating point register parameter - * + * * @param[in] @fr - Address of current register number * @param[in] @sz - Stack size data * @param[in] @ainfo - Parameter information * @param[in] @isDouble - Precision of parameter - * + * * Assign a parameter to a FP register or spill it onto the stack */ @@ -1038,15 +1038,15 @@ add_float (guint *fr, size_data *sz, ArgInfo *ainfo, gboolean isDouble) /*========================= End of Function ========================*/ /** - * + * * @brief Extract information about call parameters and stack use - * + * * @param[in] @mp - Mono Memory Pool * @param[in] @sig - Mono Method Signature * @returns Information about the parameters and stack usage for a call - * - * Determine the amount of space required for code and stack. In addition - * determine starting points for stack-based parameters, and area for + * + * Determine the amount of space required for code and stack. In addition + * determine starting points for stack-based parameters, and area for * structures being returned on the stack. */ @@ -1131,7 +1131,7 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig) goto enum_retvalue; } size = mini_type_stack_size_full (m_class_get_byval_arg (klass), NULL, sig->pinvoke && !sig->marshalling_disabled); - + cinfo->struct_ret = 1; cinfo->ret.size = size; cinfo->ret.vtsize = size; @@ -1140,7 +1140,7 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig) case MONO_TYPE_TYPEDBYREF: { MonoClass *klass = mono_class_from_mono_type_internal (sig->ret); size = mini_type_stack_size_full (m_class_get_byval_arg (klass), NULL, sig->pinvoke && !sig->marshalling_disabled); - + cinfo->struct_ret = 1; cinfo->ret.size = size; cinfo->ret.vtsize = size; @@ -1161,9 +1161,9 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig) * are sometimes made using calli without sig->hasthis set, like in the delegate * invoke wrappers. */ - if (cinfo->struct_ret && !is_pinvoke && - (sig->hasthis || - (sig->param_count > 0 && + if (cinfo->struct_ret && !is_pinvoke && + (sig->hasthis || + (sig->param_count > 0 && MONO_TYPE_IS_REFERENCE (mini_get_underlying_type (sig->params [0]))))) { if (sig->hasthis) { cinfo->args[nParm].size = sizeof (target_mgreg_t); @@ -1331,7 +1331,7 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig) case 8: add_general(&gr, sz, cinfo->args+nParm); cinfo->args[nParm].size = size; - cinfo->args[nParm].regtype = RegTypeStructByVal; + cinfo->args[nParm].regtype = RegTypeStructByVal; nParm++; break; default: @@ -1364,7 +1364,7 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig) /* * If we are passing a structure back then we make room at - * the end of the parameters that may have been placed on + * the end of the parameters that may have been placed on * the stack */ if (cinfo->struct_ret) { @@ -1382,13 +1382,13 @@ get_call_info (MonoMemPool *mp, MonoMethodSignature *sig) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific allocation of variables - * + * * @param[in] @cfg - Compile control block - * - * Set var information according to the calling convention for s390x. - * + * + * Set var information according to the calling convention for s390x. + * */ void @@ -1406,8 +1406,8 @@ mono_arch_allocate_vars (MonoCompile *cfg) cfg->flags |= MONO_CFG_HAS_SPILLUP; - /*---------------------------------------------------------*/ - /* We use the frame register also for any method that has */ + /*---------------------------------------------------------*/ + /* We use the frame register also for any method that has */ /* filter clauses. This way, when the handlers are called, */ /* the code will reference local variables using the frame */ /* reg instead of the stack pointer: if we had to restore */ @@ -1415,7 +1415,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) /* are already on the stack (since filters get called */ /* before stack unwinding happens) when the filter code */ /* would call any method. */ - /*---------------------------------------------------------*/ + /*---------------------------------------------------------*/ if ((cfg->flags & MONO_CFG_HAS_ALLOCA) || header->num_clauses) frame_reg = s390_r11; @@ -1423,11 +1423,11 @@ mono_arch_allocate_vars (MonoCompile *cfg) cfg->arch.bkchain_reg = -1; - if (frame_reg != STK_BASE) - cfg->used_int_regs |= (1LL << frame_reg); + if (frame_reg != STK_BASE) + cfg->used_int_regs |= (1LL << frame_reg); sig = mono_method_signature_internal (cfg->method); - + if (!cfg->arch.cinfo) cfg->arch.cinfo = get_call_info (cfg->mempool, sig); cinfo = cfg->arch.cinfo; @@ -1525,7 +1525,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) switch(size) { case 0: case 1: case 2: case 4: case 8: offStruct = (size < 8 ? sizeof(uintptr_t) - size : 0); - default: + default: inst->opcode = OP_REGOFFSET; inst->dreg = mono_alloc_preg (cfg); inst->inst_basereg = cfg->arch.bkchain_reg; @@ -1552,9 +1552,9 @@ mono_arch_allocate_vars (MonoCompile *cfg) default : if (cinfo->args [iParm].reg == STK_BASE) { /* - * These arguments are in the previous frame, so we can't + * These arguments are in the previous frame, so we can't * compute their offset from the current frame pointer right - * now, since cfg->stack_offset is not yet known, so dedicate a + * now, since cfg->stack_offset is not yet known, so dedicate a * register holding the previous frame pointer. */ cfg->arch.bkchain_reg = s390_r12; @@ -1571,10 +1571,10 @@ mono_arch_allocate_vars (MonoCompile *cfg) inst->opcode = OP_REGOFFSET; inst->inst_basereg = frame_reg; size = (cinfo->args[iParm].size < 8 - ? sizeof(int) + ? sizeof(int) : sizeof(long)); offset = S390_ALIGN(offset, size); - if (cfg->method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE) + if (cfg->method->wrapper_type == MONO_WRAPPER_MANAGED_TO_NATIVE) inst->inst_offset = offset; else inst->inst_offset = offset + (8 - size); @@ -1590,7 +1590,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) curinst = cfg->locals_start; for (iVar = curinst; iVar < cfg->num_varinfo; ++iVar) { inst = cfg->varinfo [iVar]; - if ((inst->flags & MONO_INST_IS_DEAD) || + if ((inst->flags & MONO_INST_IS_DEAD) || (inst->opcode == OP_REGVAR)) continue; @@ -1600,7 +1600,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) /* when they call functions returning structure */ /*--------------------------------------------------*/ if (inst->backend.is_pinvoke && MONO_TYPE_ISSTRUCT (inst->inst_vtype)) - size = mono_class_native_size (mono_class_from_mono_type_internal (inst->inst_vtype), + size = mono_class_native_size (mono_class_from_mono_type_internal (inst->inst_vtype), (guint32 *) &align); else size = mono_type_size (inst->inst_vtype, &align); @@ -1610,7 +1610,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) inst->opcode = OP_REGOFFSET; inst->inst_basereg = frame_reg; offset += size; - DEBUG (g_print("allocating local %d to %ld, size: %d\n", + DEBUG (g_print("allocating local %d to %ld, size: %d\n", iVar, inst->inst_offset, size)); } offset = S390_ALIGN(offset, sizeof(uintptr_t)); @@ -1644,13 +1644,13 @@ mono_arch_allocate_vars (MonoCompile *cfg) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific creation of variables - * + * * @param[in] @cfg - Compile control block - * + * * Create variables for the method. - * + * */ void @@ -1687,15 +1687,15 @@ mono_arch_create_vars (MonoCompile *cfg) /*========================= End of Function ========================*/ /** - * + * * @brief Add a register to the call operation - * + * * @param[in] @cfg - Compile control block * @param[in] @call - Call Instruction * @param[in] @storage - Register use type * @param[in] @reg - Register number * @param[in] @tree - Call arguments - * + * * Add register use information to the call sequence */ @@ -1734,13 +1734,13 @@ add_outarg_reg2 (MonoCompile *cfg, MonoCallInst *call, ArgStorage storage, int r /*========================= End of Function ========================*/ /** - * + * * @brief Emit a signature cookine - * + * * @param[in] @cfg - Compile control block * @param[in] @call - Call Instruction * @param[in] @cinfo - Call Information - * + * * Emit the signature cooke as a parameter */ @@ -1749,7 +1749,7 @@ emit_sig_cookie (MonoCompile *cfg, MonoCallInst *call, CallInfo *cinfo) { MonoMethodSignature *tmpSig; MonoInst *sig_arg; - + cfg->disable_aot = TRUE; /* @@ -1762,8 +1762,8 @@ emit_sig_cookie (MonoCompile *cfg, MonoCallInst *call, CallInfo *cinfo) tmpSig->param_count -= call->signature->sentinelpos; tmpSig->sentinelpos = 0; if (tmpSig->param_count > 0) - memcpy (tmpSig->params, - call->signature->params + call->signature->sentinelpos, + memcpy (tmpSig->params, + call->signature->params + call->signature->sentinelpos, tmpSig->param_count * sizeof(MonoType *)); MONO_INST_NEW (cfg, sig_arg, OP_ICONST); @@ -1771,20 +1771,20 @@ emit_sig_cookie (MonoCompile *cfg, MonoCallInst *call, CallInfo *cinfo) sig_arg->inst_p0 = tmpSig; MONO_ADD_INS (cfg->cbb, sig_arg); - MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, STK_BASE, + MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, STK_BASE, cinfo->sigCookie.offset, sig_arg->dreg); } /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific emission of a call operation - * + * * @param[in] @cfg - Compile control block * @param[in] @call - Call Instruction - * - * Process all parameters for a call and generate the sequence of + * + * Process all parameters for a call and generate the sequence of * operations to perform the call according to the s390x ABI. */ @@ -1797,12 +1797,12 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call) int i, n, lParamArea; CallInfo *cinfo; ArgInfo *ainfo = NULL; - int stackSize; + int stackSize; sig = call->signature; n = sig->param_count + sig->hasthis; DEBUG (g_print ("Call requires: %d parameters\n",n)); - + cinfo = get_call_info (cfg->mempool, sig); stackSize = cinfo->sz.stack_size + cinfo->sz.parm_size; @@ -1870,11 +1870,11 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call) } case RegTypeBase : if (!m_type_is_byref (t) && t->type == MONO_TYPE_R4) { - MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORER4_MEMBASE_REG, + MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORER4_MEMBASE_REG, STK_BASE, ainfo->offset + 4, in->dreg); } else if (!m_type_is_byref (t) && (t->type == MONO_TYPE_R8)) { - MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORER8_MEMBASE_REG, + MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORER8_MEMBASE_REG, STK_BASE, ainfo->offset, in->dreg); } else { @@ -1892,7 +1892,7 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call) } /* - * Handle the case where there are no implicit arguments + * Handle the case where there are no implicit arguments */ if ((sig->call_convention == MONO_CALL_VARARG) && (!sig->pinvoke) && @@ -1905,13 +1905,13 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific Value Type parameter processing - * + * * @param[in] @cfg - Compile control block * @param[in] @call - Call Instruction * @param[in] @src - Source parameter - * + * * Process value type parameters for a call operation */ @@ -1926,7 +1926,7 @@ mono_arch_emit_outarg_vt (MonoCompile *cfg, MonoInst *ins, MonoInst *src) emit_outarg_vtr (cfg, ins, src); } else { emit_outarg_vts (cfg, ins, src); - } + } } else if (ainfo->regtype == RegTypeStructByValInFP) { int dreg = mono_alloc_freg (cfg); @@ -1985,13 +1985,13 @@ mono_arch_emit_outarg_vt (MonoCompile *cfg, MonoInst *ins, MonoInst *src) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific call value return processing - * + * * @param[in] @cfg - Compile control block * @param[in] @method - Method * @param[in] @val - Instruction representing the result returned to method - * + * * Create the sequence to unload the value returned from a call */ @@ -2009,21 +2009,21 @@ mono_arch_emit_setret (MonoCompile *cfg, MonoMethod *method, MonoInst *val) return; } } - + MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, cfg->ret->dreg, val->dreg); } /*========================= End of Function ========================*/ /** - * + * * @brief Replace compound compare/branch operations with single operation - * + * * @param[in] @bb - Basic block * @param[in] @ins - Current instruction * @param[in] @cc - Condition code of branch * @param[in] @logical - Whether comparison is signed or logical - * + * * Form a peephole pass at the code looking for simple optimizations * that will combine compare/branch instructions into a single operation. */ @@ -2078,12 +2078,12 @@ compare_and_branch(MonoBasicBlock *bb, MonoInst *ins, int cc, gboolean logical) /*========================= End of Function ========================*/ /** - * + * * @brief Architecure-specific peephole pass 1 processing - * + * * @param[in] @cfg - Compile control block * @param[in] @bb - Basic block - * + * * Form a peephole pass at the code looking for compare and branch * optimizations. */ @@ -2145,12 +2145,12 @@ mono_arch_peephole_pass_1 (MonoCompile *cfg, MonoBasicBlock *bb) /*========================= End of Function ========================*/ /** - * + * * @brief Architecure-specific peephole pass 2 processing - * + * * @param[in] @cfg - Compile control block * @param[in] @bb - Basic block - * + * * Form a peephole pass at the code looking for simple optimizations. */ @@ -2178,12 +2178,12 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) /*========================= End of Function ========================*/ /** - * + * * @brief Architecure-specific lowering pass processing - * + * * @param[in] @cfg - Compile control block * @param[in] @bb - Basic block - * + * * Form a lowering pass at the code looking for simple optimizations. */ @@ -2223,9 +2223,9 @@ mono_arch_lowering_pass (MonoCompile *cfg, MonoBasicBlock *bb) /*========================= End of Function ========================*/ /** - * + * * @brief Emit float-to-int sequence - * + * * @param[in] @cfg - Compile control block * @param[in] @code - Current instruction area * @param[in] @dreg - Destination general register @@ -2233,7 +2233,7 @@ mono_arch_lowering_pass (MonoCompile *cfg, MonoBasicBlock *bb) * @param[in] @size - Size of destination * @param[in] @is_signed - Destination is signed/unsigned * @returns Next instruction location - * + * * Emit instructions to convert a single precision floating point value to an integer */ @@ -2276,7 +2276,7 @@ emit_float_to_int (MonoCompile *cfg, guchar *code, int dreg, int sreg, int size, PTRSLOT (code, o[0]); s390_cfebr (code, dreg, 5, sreg); switch (size) { - case 1: + case 1: s390_lghi (code, s390_r0, 0xff); s390_ngr (code, dreg, s390_r0); break; @@ -2294,9 +2294,9 @@ emit_float_to_int (MonoCompile *cfg, guchar *code, int dreg, int sreg, int size, /*========================= End of Function ========================*/ /** - * + * * @brief Emit double-to-int sequence - * + * * @param[in] @cfg - Compile control block * @param[in] @code - Current instruction area * @param[in] @dreg - Destination general register @@ -2304,7 +2304,7 @@ emit_float_to_int (MonoCompile *cfg, guchar *code, int dreg, int sreg, int size, * @param[in] @size - Size of destination * @param[in] @is_signed - Destination is signed/unsigned * @returns Next instruction location - * + * * Emit instructions to convert a single precision floating point value to an integer */ @@ -2347,7 +2347,7 @@ emit_double_to_int (MonoCompile *cfg, guchar *code, int dreg, int sreg, int size PTRSLOT (code, o[0]); s390_cfdbr (code, dreg, 5, sreg); switch (size) { - case 1: + case 1: s390_lghi (code, s390_r0, 0xff); s390_ngr (code, dreg, s390_r0); break; @@ -2365,21 +2365,21 @@ emit_double_to_int (MonoCompile *cfg, guchar *code, int dreg, int sreg, int size /*========================= End of Function ========================*/ /** - * + * * @brief Check if branch is for unsigned comparison - * + * * @param[in] @next - Next instruction * @returns True if the branch is for an unsigned comparison - * + * * Determine if next instruction is a branch for an unsigned comparison */ -static gboolean +static gboolean is_unsigned (MonoInst *next) { - if ((next) && + if ((next) && (((next->opcode >= OP_IBNE_UN) && - (next->opcode <= OP_IBLT_UN)) || + (next->opcode <= OP_IBLT_UN)) || ((next->opcode >= OP_LBNE_UN) && (next->opcode <= OP_LBLT_UN)) || ((next->opcode >= OP_COND_EXC_NE_UN) && @@ -2402,12 +2402,12 @@ is_unsigned (MonoInst *next) /*========================= End of Function ========================*/ /** - * + * * @brief Architecutre-specific processing of a basic block - * + * * @param[in] @cfg - Compile control block * @param[in] @bb - Basic block - * + * * Process instructions within basic block emitting s390x instructions * based on the VM operation codes */ @@ -2436,47 +2436,47 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) switch (ins->opcode) { case OP_STOREI1_MEMBASE_IMM: { s390_lghi (code, s390_r0, ins->inst_imm); - S390_LONG (code, stcy, stc, s390_r0, 0, + S390_LONG (code, stcy, stc, s390_r0, 0, ins->inst_destbasereg, ins->inst_offset); } break; case OP_STOREI2_MEMBASE_IMM: { s390_lghi (code, s390_r0, ins->inst_imm); - S390_LONG (code, sthy, sth, s390_r0, 0, + S390_LONG (code, sthy, sth, s390_r0, 0, ins->inst_destbasereg, ins->inst_offset); } break; case OP_STOREI4_MEMBASE_IMM: { s390_lgfi (code, s390_r0, ins->inst_imm); - S390_LONG (code, sty, st, s390_r0, 0, + S390_LONG (code, sty, st, s390_r0, 0, ins->inst_destbasereg, ins->inst_offset); } break; case OP_STORE_MEMBASE_IMM: case OP_STOREI8_MEMBASE_IMM: { S390_SET (code, s390_r0, ins->inst_imm); - S390_LONG (code, stg, stg, s390_r0, 0, + S390_LONG (code, stg, stg, s390_r0, 0, ins->inst_destbasereg, ins->inst_offset); } break; case OP_STOREI1_MEMBASE_REG: { - S390_LONG (code, stcy, stc, ins->sreg1, 0, + S390_LONG (code, stcy, stc, ins->sreg1, 0, ins->inst_destbasereg, ins->inst_offset); } break; case OP_STOREI2_MEMBASE_REG: { - S390_LONG (code, sthy, sth, ins->sreg1, 0, + S390_LONG (code, sthy, sth, ins->sreg1, 0, ins->inst_destbasereg, ins->inst_offset); } break; case OP_STOREI4_MEMBASE_REG: { - S390_LONG (code, sty, st, ins->sreg1, 0, + S390_LONG (code, sty, st, ins->sreg1, 0, ins->inst_destbasereg, ins->inst_offset); } break; case OP_STORE_MEMBASE_REG: case OP_STOREI8_MEMBASE_REG: { - S390_LONG (code, stg, stg, ins->sreg1, 0, + S390_LONG (code, stg, stg, ins->sreg1, 0, ins->inst_destbasereg, ins->inst_offset); } break; @@ -2485,37 +2485,37 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_LOAD_MEMBASE: case OP_LOADI8_MEMBASE: { - S390_LONG (code, lg, lg, ins->dreg, 0, + S390_LONG (code, lg, lg, ins->dreg, 0, ins->inst_basereg, ins->inst_offset); } break; case OP_LOADI4_MEMBASE: { - S390_LONG (code, lgf, lgf, ins->dreg, 0, + S390_LONG (code, lgf, lgf, ins->dreg, 0, ins->inst_basereg, ins->inst_offset); } break; case OP_LOADU4_MEMBASE: { - S390_LONG (code, llgf, llgf, ins->dreg, 0, + S390_LONG (code, llgf, llgf, ins->dreg, 0, ins->inst_basereg, ins->inst_offset); } break; case OP_LOADU1_MEMBASE: { - S390_LONG (code, llgc, llgc, ins->dreg, 0, + S390_LONG (code, llgc, llgc, ins->dreg, 0, ins->inst_basereg, ins->inst_offset); } break; case OP_LOADI1_MEMBASE: { - S390_LONG (code, lgb, lgb, ins->dreg, 0, + S390_LONG (code, lgb, lgb, ins->dreg, 0, ins->inst_basereg, ins->inst_offset); } break; case OP_LOADU2_MEMBASE: { - S390_LONG (code, llgh, llgh, ins->dreg, 0, + S390_LONG (code, llgh, llgh, ins->dreg, 0, ins->inst_basereg, ins->inst_offset); } break; case OP_LOADI2_MEMBASE: { - S390_LONG (code, lgh, lgh, ins->dreg, 0, + S390_LONG (code, lgh, lgh, ins->dreg, 0, ins->inst_basereg, ins->inst_offset); } break; @@ -2559,7 +2559,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) s390_lgfr (code, ins->dreg, ins->sreg1); } break; - case OP_COMPARE: + case OP_COMPARE: case OP_LCOMPARE: { if (is_unsigned (ins->next)) s390_clgr (code, ins->sreg1, ins->sreg2); @@ -2660,7 +2660,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) S390_SET (code, s390_r0, ins->inst_imm); s390_agrk (code, ins->dreg, ins->sreg1, s390_r0); } - } else { + } else { if (ins->dreg != ins->sreg1) { s390_lgr (code, ins->dreg, ins->sreg1); } @@ -2806,10 +2806,10 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) } else { if (ins->sreg1 == ins->dreg) { s390_ngr (code, ins->dreg, ins->sreg2); - } else { - if (ins->sreg2 == ins->dreg) { + } else { + if (ins->sreg2 == ins->dreg) { s390_ngr (code, ins->dreg, ins->sreg1); - } else { + } else { s390_lgr (code, ins->dreg, ins->sreg1); s390_ngr (code, ins->dreg, ins->sreg2); } @@ -2872,10 +2872,10 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) } else { if (ins->sreg1 == ins->dreg) { s390_ogr (code, ins->dreg, ins->sreg2); - } else { - if (ins->sreg2 == ins->dreg) { + } else { + if (ins->sreg2 == ins->dreg) { s390_ogr (code, ins->dreg, ins->sreg1); - } else { + } else { s390_lgr (code, ins->dreg, ins->sreg1); s390_ogr (code, ins->dreg, ins->sreg2); } @@ -2901,12 +2901,12 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) } else { if (ins->sreg1 == ins->dreg) { s390_xgr (code, ins->dreg, ins->sreg2); - } - else { - if (ins->sreg2 == ins->dreg) { + } + else { + if (ins->sreg2 == ins->dreg) { s390_xgr (code, ins->dreg, ins->sreg1); } - else { + else { s390_lgr (code, ins->dreg, ins->sreg1); s390_xgr (code, ins->dreg, ins->sreg2); } @@ -2931,7 +2931,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) s390_sllg (code, ins->dreg, ins->dreg, src2, 0); } break; - case OP_SHL_IMM: + case OP_SHL_IMM: case OP_LSHL_IMM: { if (ins->sreg1 != ins->dreg) { s390_lgr (code, ins->dreg, ins->sreg1); @@ -2952,7 +2952,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) s390_srag (code, ins->dreg, ins->dreg, 0, (ins->inst_imm & 0x3f)); } break; - case OP_SHR_UN_IMM: + case OP_SHR_UN_IMM: case OP_LSHR_UN_IMM: { if (ins->sreg1 != ins->dreg) { s390_lgr (code, ins->dreg, ins->sreg1); @@ -2982,7 +2982,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) s390_msgr (code, ins->dreg, src2); } break; - case OP_MUL_IMM: + case OP_MUL_IMM: case OP_LMUL_IMM: { if (ins->dreg != ins->sreg1) { s390_lgr (code, ins->dreg, ins->sreg1); @@ -3020,7 +3020,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) s390_srlg (code, s390_r0, s390_r0, 0, 63); s390_ltgr (code, s390_r0, s390_r0); EMIT_COND_SYSTEM_EXCEPTION (S390_CC_NZ, "OverflowException"); - PTRSLOT (code, o[0]); + PTRSLOT (code, o[0]); PTRSLOT (code, o[1]); s390_lgr (code, ins->dreg, s390_r1); } @@ -3066,7 +3066,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_IADC_IMM: { if (ins->dreg != ins->sreg1) { s390_lgfr (code, ins->dreg, ins->sreg1); - } + } if (s390_is_imm16 (ins->inst_imm)) { s390_lghi (code, s390_r0, ins->inst_imm); s390_alcgr (code, ins->dreg, s390_r0); @@ -3080,7 +3080,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_S390_LADD_OVF: { if (mono_hwcap_s390x_has_mlt) { s390_agrk (code, ins->dreg, ins->sreg1, ins->sreg2); - } else { + } else { CHECK_SRCDST_COM; s390_agr (code, ins->dreg, src2); } @@ -3091,7 +3091,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_S390_LADD_OVF_UN: { if (mono_hwcap_s390x_has_mlt) { s390_algrk (code, ins->dreg, ins->sreg1, ins->sreg2); - } else { + } else { CHECK_SRCDST_COM; s390_algr (code, ins->dreg, src2); } @@ -3142,7 +3142,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) if (mono_hwcap_s390x_has_mlt) { s390_srk (code, ins->dreg, ins->sreg1, ins->sreg2); EMIT_COND_SYSTEM_EXCEPTION (S390_CC_OV, "OverflowException"); - } else { + } else { CHECK_SRCDST_NCOM; s390_sr (code, ins->dreg, src2); EMIT_COND_SYSTEM_EXCEPTION (S390_CC_OV, "OverflowException"); @@ -3393,19 +3393,19 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) s390_lgfr (code, ins->dreg, s390_r1); } break; - case OP_ICONST: + case OP_ICONST: case OP_I8CONST: { S390_SET (code, ins->dreg, ins->inst_c0); } break; case OP_AOTCONST: { - mono_add_patch_info (cfg, code - cfg->native_code, + mono_add_patch_info (cfg, code - cfg->native_code, (MonoJumpInfoType)ins->inst_i1, ins->inst_p0); S390_LOAD_TEMPLATE (code, ins->dreg); } break; case OP_JUMP_TABLE: { - mono_add_patch_info (cfg, code - cfg->native_code, + mono_add_patch_info (cfg, code - cfg->native_code, (MonoJumpInfoType)ins->inst_i1, ins->inst_p0); S390_LOAD_TEMPLATE (code, ins->dreg); } @@ -3460,10 +3460,10 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) if (ins->dreg != ins->sreg1) s390_ldr (code, ins->dreg, ins->sreg1); break; - case OP_MOVE_F_TO_I8: + case OP_MOVE_F_TO_I8: s390_lgdr (code, ins->dreg, ins->sreg1); break; - case OP_MOVE_I8_TO_F: + case OP_MOVE_I8_TO_F: s390_ldgr (code, ins->dreg, ins->sreg1); break; case OP_MOVE_F_TO_I4: @@ -3475,7 +3475,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) } s390_srag (code, ins->dreg, ins->dreg, 0, 32); break; - case OP_MOVE_I4_TO_F: + case OP_MOVE_I4_TO_F: s390_slag (code, s390_r0, ins->sreg1, 0, 32); s390_ldgr (code, ins->dreg, s390_r0); if (!cfg->r4fp) @@ -3532,13 +3532,13 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /* * Restore SP to caller's SP - */ + */ code = backUpStackPtr(cfg, code); /* * If the destination is specified as a register or membase then * save destination so it doesn't get overwritten by the restores - */ + */ if (ins->opcode != OP_TAILCALL) s390_lgr (code, s390_r1, ins->sreg1); @@ -3561,7 +3561,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /* * Restore any FP registers that have been altered - */ + */ if (cfg->arch.fpSize != 0) { int fpOffset = -cfg->arch.fpSize; for (int i = 8; i < 16; i++) { @@ -3574,7 +3574,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) if (ins->opcode == OP_TAILCALL_REG) { s390_br (code, s390_r1); - } else { + } else { if (ins->opcode == OP_TAILCALL_MEMBASE) { if (mono_hwcap_s390x_has_mie2) { s390_bi (code, 0, s390_r1, ins->inst_offset); @@ -3584,7 +3584,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) } } else { mono_add_patch_info_rel (cfg, code - cfg->native_code, - MONO_PATCH_INFO_METHOD_JUMP, + MONO_PATCH_INFO_METHOD_JUMP, call->method, MONO_R_S390_THUNKED); S390_BR_TEMPLATE (code, s390_r1); cfg->thunk_area += THUNK_SIZE; @@ -3692,7 +3692,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) s390_lg (code, s390_r13, 0, STK_BASE, 0); /* - * Round object size to doubleword + * Round object size to doubleword */ s390_lgr (code, s390_r1, ins->sreg1); s390_aghi (code, s390_r1, 7); @@ -3701,7 +3701,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) if (mono_hwcap_s390x_has_gie) { if (ins->flags & MONO_INST_INIT) - s390_lgr (code, s390_r0, s390_r1); + s390_lgr (code, s390_r0, s390_r1); s390_risbg (code, ins->dreg, s390_r1, 0, 0xb3, 0); s390_sgrk (code, ins->dreg, STK_BASE, ins->dreg); @@ -3734,7 +3734,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) s390_lghi (code, s390_r0, 0); s390_stg (code, s390_r0, 0, STK_BASE, 4088); s390_j (code, -11); /* j L0 */ - + s390_lghi (code, ins->dreg, 4095); /* L1: */ s390_ngr (code, ins->dreg, s390_r1); s390_ltgr (code, ins->dreg, ins->dreg); @@ -3744,11 +3744,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) s390_stg (code, ins->dreg, s390_r1, STK_BASE, -8); /* L2: */ if (ins->flags & MONO_INST_INIT) - s390_lgr (code, s390_r0, s390_r1); + s390_lgr (code, s390_r0, s390_r1); } - /* - * Compute address of localloc'd object + /* + * Compute address of localloc'd object */ s390_lgr (code, s390_r1, STK_BASE); if (s390_is_imm16(area_offset)) @@ -3811,7 +3811,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) MonoInst *spvar = mono_find_spvar_for_region (cfg, bb->region); S390_LONG (code, stg, stg, s390_r14, 0, - spvar->inst_basereg, + spvar->inst_basereg, spvar->inst_offset); } break; @@ -3821,7 +3821,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) if (ins->sreg1 != s390_r2) s390_lgr(code, s390_r2, ins->sreg1); S390_LONG (code, lg, lg, s390_r14, 0, - spvar->inst_basereg, + spvar->inst_basereg, spvar->inst_offset); s390_br (code, s390_r14); } @@ -3830,7 +3830,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) MonoInst *spvar = mono_find_spvar_for_region (cfg, bb->region); S390_LONG (code, lg, lg, s390_r14, 0, - spvar->inst_basereg, + spvar->inst_basereg, spvar->inst_offset); s390_br (code, s390_r14); } @@ -3887,9 +3887,9 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) displace = ((uintptr_t) code - (uintptr_t) o[0]) / 2; o[0]->i2 = displace; } - - /* - * This is the address which is saved in seq points, + + /* + * This is the address which is saved in seq points, */ mono_add_seq_point (cfg, bb, ins, code - cfg->native_code); @@ -3944,14 +3944,14 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) ins->backend.pc_offset = code - cfg->native_code; break; } - case OP_BR: + case OP_BR: EMIT_UNCOND_BRANCH(ins); break; case OP_BR_REG: { s390_br (code, ins->sreg1); } break; - case OP_CEQ: + case OP_CEQ: case OP_ICEQ: case OP_LCEQ: { s390_lghi(code, ins->dreg, 1); @@ -3959,7 +3959,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) s390_lghi(code, ins->dreg, 0); } break; - case OP_CLT: + case OP_CLT: case OP_ICLT: case OP_LCLT: { s390_lghi(code, ins->dreg, 1); @@ -3975,7 +3975,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) s390_lghi(code, ins->dreg, 0); } break; - case OP_CGT: + case OP_CGT: case OP_ICGT: case OP_LCGT: { s390_lghi(code, ins->dreg, 1); @@ -4072,29 +4072,29 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_LBEQ: case OP_IBEQ: EMIT_COND_BRANCH (ins, S390_CC_EQ); - break; + break; case OP_LBNE_UN: case OP_IBNE_UN: EMIT_COND_BRANCH (ins, S390_CC_NE); - break; + break; case OP_LBLT: case OP_LBLT_UN: case OP_IBLT: case OP_IBLT_UN: EMIT_COND_BRANCH (ins, S390_CC_LT); - break; + break; case OP_LBGT: case OP_LBGT_UN: case OP_IBGT: case OP_IBGT_UN: EMIT_COND_BRANCH (ins, S390_CC_GT); - break; + break; case OP_LBGE: case OP_LBGE_UN: case OP_IBGE: case OP_IBGE_UN: EMIT_COND_BRANCH (ins, S390_CC_GE); - break; + break; case OP_LBLE: case OP_LBLE_UN: case OP_IBLE: @@ -4170,22 +4170,22 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) } break; case OP_STORER8_MEMBASE_REG: { - S390_LONG (code, stdy, std, ins->sreg1, 0, + S390_LONG (code, stdy, std, ins->sreg1, 0, ins->inst_destbasereg, ins->inst_offset); } break; case OP_LOADR8_MEMBASE: { - S390_LONG (code, ldy, ld, ins->dreg, 0, + S390_LONG (code, ldy, ld, ins->dreg, 0, ins->inst_basereg, ins->inst_offset); } break; case OP_STORER4_MEMBASE_REG: { if (cfg->r4fp) { - S390_LONG (code, stey, ste, ins->sreg1, 0, + S390_LONG (code, stey, ste, ins->sreg1, 0, ins->inst_destbasereg, ins->inst_offset); } else { s390_ledbr (code, ins->sreg1, ins->sreg1); - S390_LONG (code, stey, ste, ins->sreg1, 0, + S390_LONG (code, stey, ste, ins->sreg1, 0, ins->inst_destbasereg, ins->inst_offset); s390_ldebr (code, ins->sreg1, ins->sreg1); } @@ -4193,10 +4193,10 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_LOADR4_MEMBASE: { if (cfg->r4fp) { - S390_LONG (code, ley, le, ins->dreg, 0, + S390_LONG (code, ley, le, ins->dreg, 0, ins->inst_basereg, ins->inst_offset); } else { - S390_LONG (code, ley, le, ins->dreg, 0, + S390_LONG (code, ley, le, ins->dreg, 0, ins->inst_basereg, ins->inst_offset); s390_ldebr (code, ins->dreg, ins->dreg); } @@ -4379,7 +4379,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) s390_jz (code, 0); CODEPTR(code, o[4]); PTRSLOT(code, o[1]); PTRSLOT(code, o[2]); - mono_add_patch_info (cfg, code - cfg->native_code, + mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_EXC, "OverflowException"); s390_brasl (code, s390_r14, 0); PTRSLOT(code, o[3]); @@ -4435,37 +4435,37 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_FSUB: { CHECK_SRCDST_NCOM_F(sdbr); } - break; + break; case OP_RSUB: { CHECK_SRCDST_NCOM_F(sebr); } - break; + break; case OP_FMUL: { CHECK_SRCDST_COM_F; s390_mdbr (code, ins->dreg, src2); } - break; + break; case OP_RMUL: { CHECK_SRCDST_COM_F; s390_meer (code, ins->dreg, src2); } - break; + break; case OP_FDIV: { CHECK_SRCDST_NCOM_F(ddbr); } - break; + break; case OP_RDIV: { CHECK_SRCDST_NCOM_F(debr); } - break; + break; case OP_FNEG: { s390_lcdbr (code, ins->dreg, ins->sreg1); } - break; + break; case OP_RNEG: { s390_lcebr (code, ins->dreg, ins->sreg1); } - break; + break; case OP_FREM: { CHECK_SRCDST_NCOM_FR(didbr, 5); } @@ -4673,7 +4673,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) s390_lhi (code, s390_r13, 0x7f); s390_tcdb (code, ins->sreg1, 0, s390_r13, 0); s390_jz (code, 0); CODEPTR(code, o); - mono_add_patch_info (cfg, code - cfg->native_code, + mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_EXC, "OverflowException"); s390_brasl (code, s390_r14,0); PTRSLOT(code, o); @@ -4682,7 +4682,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_S390_MOVE: { if (ins->backend.size > 0) { if (ins->backend.size <= 256) { - s390_mvc (code, ins->backend.size, ins->sreg2, + s390_mvc (code, ins->backend.size, ins->sreg2, ins->inst_offset, ins->sreg1, ins->inst_imm); } else { s390_lgr (code, s390_r0, ins->sreg2); @@ -4740,14 +4740,14 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) s390_lgr (code, ins->dreg, s390_r1); } } - break; + break; case OP_ATOMIC_EXCHANGE_I8: { s390_lg (code, s390_r0, 0, ins->inst_basereg, ins->inst_offset); s390_csg (code, s390_r0, ins->sreg2, ins->inst_basereg, ins->inst_offset); s390_jnz (code, -6); s390_lgr (code, ins->dreg, s390_r0); } - break; + break; case OP_ATOMIC_ADD_I4: { if (mono_hwcap_s390x_has_ia) { s390_laa (code, s390_r0, ins->sreg2, ins->inst_basereg, ins->inst_offset); @@ -4762,14 +4762,14 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) s390_lgfr(code, ins->dreg, s390_r1); } } - break; + break; case OP_ATOMIC_EXCHANGE_I4: { s390_l (code, s390_r0, 0, ins->inst_basereg, ins->inst_offset); s390_cs (code, s390_r0, ins->sreg2, ins->inst_basereg, ins->inst_offset); s390_jnz (code, -4); s390_lgfr(code, ins->dreg, s390_r0); } - break; + break; case OP_S390_BKCHAIN: { s390_lgr (code, ins->dreg, ins->sreg1); if (s390_is_imm16 (cfg->stack_offset)) { @@ -4781,7 +4781,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) s390_agr (code, ins->dreg, s390_r13); } } - break; + break; case OP_MEMORY_BARRIER: s390_mem (code); break; @@ -4826,7 +4826,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_GC_SAFE_POINT: { short *br; - s390_ltg (code, s390_r0, 0, ins->sreg1, 0); + s390_ltg (code, s390_r0, 0, ins->sreg1, 0); s390_jz (code, 0); CODEPTR(code, br); code = emit_call (cfg, code, MONO_PATCH_INFO_JIT_ICALL_ID, GUINT_TO_POINTER (MONO_JIT_ICALL_mono_threads_state_poll)); @@ -5022,7 +5022,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_PMAXD_UN: s390x_pmaxud (code, ins->sreg1, ins->sreg2); break; - + case OP_PMAXB: s390x_pmaxsb (code, ins->sreg1, ins->sreg2); break; @@ -5166,7 +5166,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_PSUBW_SAT: s390x_psubsw (code, ins->sreg1, ins->sreg2); break; - + case OP_PMULW: s390x_pmullw (code, ins->sreg1, ins->sreg2); break; @@ -5231,22 +5231,22 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_PSHRQ_REG: s390x_psrlq (code, ins->dreg, ins->sreg2); break; - + /*TODO: This is appart of the sse spec but not added case OP_PSARQ: s390x_psraq_reg_imm (code, ins->dreg, ins->inst_imm); break; case OP_PSARQ_REG: s390x_psraq (code, ins->dreg, ins->sreg2); - break; + break; */ - + case OP_PSHLQ: s390x_psllq_reg_imm (code, ins->dreg, ins->inst_imm); break; case OP_PSHLQ_REG: s390x_psllq (code, ins->dreg, ins->sreg2); - break; + break; case OP_CVTDQ2PD: s390x_cvtdq2pd (code, ins->dreg, ins->sreg1); break; @@ -5404,7 +5404,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /*FIXME the peephole pass should have killed this*/ if (ins->dreg != ins->sreg1) s390x_movaps (code, ins->dreg, ins->sreg1); - break; + break; case OP_XZERO: s390x_pxor (code, ins->dreg, ins->dreg); break; @@ -5431,7 +5431,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_FCONV_TO_U2: amd64_widen_reg (code, ins->dreg, ins->dreg, FALSE, TRUE); break; - } + } break; case OP_EXPAND_I2: @@ -5479,9 +5479,9 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific registration of lowlevel calls - * + * * Register routines to register optimized lowlevel operations */ @@ -5493,7 +5493,7 @@ mono_arch_register_lowlevel_calls (void) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific patching * @param[in] @cfg - Compilation control block * @param[in] @code - Start of code @@ -5544,14 +5544,14 @@ emit_patch_full (MonoCompile *cfg, MonoJumpInfo *ji, guint8 *code, /** * * @brief Architecture-specific patching of instructions and data - * + * * @param[in] @cfg - Compile control block * @param[in] @method - Current method * @param[in] @code - Current code block - * @param[in] @ji - Jump information + * @param[in] @ji - Jump information * @param[in] @target - Target of patch * - * Process the patch data created during the instruction build process. + * Process the patch data created during the instruction build process. * This resolves jumps, calls, variables etc. */ @@ -5561,8 +5561,8 @@ mono_arch_patch_code_new (MonoCompile *cfg, guint8 *code, MonoJumpInfo *ji, gpoi switch (ji->type) { case MONO_PATCH_INFO_IP: case MONO_PATCH_INFO_LDSTR: - case MONO_PATCH_INFO_TYPE_FROM_HANDLE: - case MONO_PATCH_INFO_LDTOKEN: + case MONO_PATCH_INFO_TYPE_FROM_HANDLE: + case MONO_PATCH_INFO_LDTOKEN: case MONO_PATCH_INFO_EXC: emit_patch_full (cfg, ji, code, target, MONO_R_S390_ADDR); break; @@ -5578,7 +5578,7 @@ mono_arch_patch_code_new (MonoCompile *cfg, guint8 *code, MonoJumpInfo *ji, gpoi case MONO_PATCH_INFO_ABS: emit_patch_full (cfg, ji, code, target, MONO_R_S390_THUNKED); break; - case MONO_PATCH_INFO_SWITCH: + case MONO_PATCH_INFO_SWITCH: emit_patch_full(cfg, ji, code, target, MONO_R_S390_SWITCH); break; case MONO_PATCH_INFO_METHODCONST: @@ -5599,9 +5599,9 @@ mono_arch_patch_code_new (MonoCompile *cfg, guint8 *code, MonoJumpInfo *ji, gpoi /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific prolog generation - * + * * @param[in] @cfg - Compile control block * @returns Location of code code generated * @@ -5636,7 +5636,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) /** * Create unwind information - */ + */ mono_emit_unwind_op_def_cfa (cfg, code, STK_BASE, S390_CFA_OFFSET); s390_stmg (code, s390_r6, s390_r15, STK_BASE, S390_REG_SAVE_OFFSET); emit_unwind_regs(cfg, code, s390_r6, s390_r15, S390_REG_SAVE_OFFSET - S390_CFA_OFFSET); @@ -5645,17 +5645,17 @@ mono_arch_emit_prolog (MonoCompile *cfg) /* * If there are local allocations the R11 becomes the frame register - */ + */ if (cfg->flags & MONO_CFG_HAS_ALLOCA) { cfg->used_int_regs |= 1 << s390_r11; } /* * Check if FP registers need preserving - */ + */ if ((cfg->arch.used_fp_regs & S390_FP_SAVE_MASK) != 0) { for (int i = s390_f8; i <= s390_f15; i++) { - if (cfg->arch.used_fp_regs & (1 << i)) + if (cfg->arch.used_fp_regs & (1 << i)) fpOffset += sizeof(double); } fpOffset = S390_ALIGN(fpOffset, sizeof(double)); @@ -5664,14 +5664,14 @@ mono_arch_emit_prolog (MonoCompile *cfg) /* * Calculate stack requirements - */ + */ alloc_size = cfg->stack_offset + fpOffset; cfg->stack_usage = cfa_offset = alloc_size; s390_lgr (code, s390_r11, STK_BASE); if (s390_is_imm16 (alloc_size)) { s390_aghi (code, STK_BASE, -alloc_size); - } else if (s390_is_imm32 (alloc_size)) { + } else if (s390_is_imm32 (alloc_size)) { s390_agfi (code, STK_BASE, -alloc_size); } else { int stackSize = alloc_size; @@ -5692,7 +5692,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) for (int i = s390_f8; i <= s390_f15; i++) { if (cfg->arch.used_fp_regs & (1 << i)) { s390_std (code, i, 0, s390_r1, stkOffset); - emit_unwind_regs(cfg, code, 16+i, 16+i, stkOffset+fpOffset - S390_CFA_OFFSET); + emit_unwind_regs(cfg, code, 16+i, 16+i, stkOffset+fpOffset - S390_CFA_OFFSET); stkOffset += sizeof(double); } } @@ -5707,8 +5707,8 @@ mono_arch_emit_prolog (MonoCompile *cfg) if (cfg->rgctx_var) { g_assert (cfg->rgctx_var->opcode == OP_REGOFFSET); - s390_stg (code, MONO_ARCH_RGCTX_REG, 0, - cfg->rgctx_var->inst_basereg, + s390_stg (code, MONO_ARCH_RGCTX_REG, 0, + cfg->rgctx_var->inst_basereg, cfg->rgctx_var->inst_offset); } @@ -5717,7 +5717,7 @@ char *methodName = getenv("MONO_TRACE_METHOD"); if (methodName != NULL) { printf("ns: %s k: %s m: %s\n",method->klass->name_space,method->klass->name,method->name);fflush(stdout); // Tests:set_ip -//if ((strcmp(method->klass->name_space,"") == 0) && +//if ((strcmp(method->klass->name_space,"") == 0) && // (strcmp(method->klass->name,"Tests") == 0) && // (strcmp(method->name, "set_ip") == 0)) { // (strcmp("CancellationToken,TaskCreationOptions,TaskContinuationOptions,TaskScheduler",mono_signature_get_desc(method->signature, FALSE)) != 0)) { @@ -5730,7 +5730,7 @@ printf("ns: %s k: %s m: %s\n",method->klass->name_space,method->klass->name,meth /* compute max_offset in order to use short forward jumps * we always do it on s390 because the immediate displacement - * for jumps is too small + * for jumps is too small */ max_offset = 0; for (bb = cfg->bb_entry; bb; bb = bb->next_bb) { @@ -5764,7 +5764,7 @@ printf("ns: %s k: %s m: %s\n",method->klass->name_space,method->klass->name,meth for (i = 0; i < sig->param_count + sig->hasthis; ++i) { ArgInfo *ainfo = cinfo->args + i; inst = cfg->args [pos]; - + if (inst->opcode == OP_VTARG_ADDR) inst = inst->inst_left; @@ -5776,7 +5776,7 @@ printf("ns: %s k: %s m: %s\n",method->klass->name_space,method->klass->name,meth s390_ldr (code, inst->dreg, ainfo->reg); } } else if (ainfo->regtype == RegTypeFPR4) { - if (!cfg->r4fp) + if (!cfg->r4fp) s390_ledbr (code, inst->dreg, ainfo->reg); } else if (ainfo->regtype == RegTypeBase) { s390_lgr (code, s390_r13, STK_BASE); @@ -5786,7 +5786,7 @@ printf("ns: %s k: %s m: %s\n",method->klass->name_space,method->klass->name,meth g_assert_not_reached (); if (cfg->verbose_level > 2) - g_print ("Argument %d assigned to register %s\n", + g_print ("Argument %d assigned to register %s\n", pos, mono_arch_regname (inst->dreg)); } else { if (ainfo->regtype == RegTypeGeneral) { @@ -5799,7 +5799,7 @@ printf("ns: %s k: %s m: %s\n",method->klass->name_space,method->klass->name,meth case 2: s390_sth (code, ainfo->reg, 0, inst->inst_basereg, inst->inst_offset); break; - case 4: + case 4: s390_st (code, ainfo->reg, 0, inst->inst_basereg, inst->inst_offset); break; case 8: @@ -5849,15 +5849,15 @@ printf("ns: %s k: %s m: %s\n",method->klass->name_space,method->klass->name,meth if (method->save_lmf) { /** - * Build the MonoLMF structure on the stack - see mini-s390x.h + * Build the MonoLMF structure on the stack - see mini-s390x.h */ - lmfOffset = alloc_size - sizeof(MonoLMF); - - s390_lgr (code, s390_r13, cfg->frame_reg); - s390_aghi (code, s390_r13, lmfOffset); - + lmfOffset = alloc_size - sizeof(MonoLMF); + + s390_lgr (code, s390_r13, cfg->frame_reg); + s390_aghi (code, s390_r13, lmfOffset); + /* - * Preserve the parameter registers while we fix up the lmf + * Preserve the parameter registers while we fix up the lmf */ s390_stmg (code, s390_r2, s390_r6, s390_r13, MONO_STRUCT_OFFSET(MonoLMF, pregs)); @@ -5874,65 +5874,65 @@ printf("ns: %s k: %s m: %s\n",method->klass->name_space,method->klass->name,meth /* * Set lmf.lmf_addr = jit_tls->lmf */ - s390_stg (code, s390_r2, 0, s390_r13, - MONO_STRUCT_OFFSET(MonoLMF, lmf_addr)); + s390_stg (code, s390_r2, 0, s390_r13, + MONO_STRUCT_OFFSET(MonoLMF, lmf_addr)); mini_gc_set_slot_type_from_fp (cfg, lmfOffset + MONO_STRUCT_OFFSET (MonoLMF, lmf_addr), SLOT_NOREF); - + /* * Get current lmf */ - s390_lg (code, s390_r0, 0, s390_r2, 0); - + s390_lg (code, s390_r0, 0, s390_r2, 0); + /* * Set our lmf as the current lmf */ - s390_stg (code, s390_r13, 0, s390_r2, 0); - + s390_stg (code, s390_r13, 0, s390_r2, 0); + /* * Have our lmf.previous_lmf point to the last lmf */ - s390_stg (code, s390_r0, 0, s390_r13, - MONO_STRUCT_OFFSET(MonoLMF, previous_lmf)); + s390_stg (code, s390_r0, 0, s390_r13, + MONO_STRUCT_OFFSET(MonoLMF, previous_lmf)); mini_gc_set_slot_type_from_fp (cfg, lmfOffset + MONO_STRUCT_OFFSET (MonoLMF, previous_lmf), SLOT_NOREF); - + /* * Save method info */ S390_SET (code, s390_r1, method); - s390_stg (code, s390_r1, 0, s390_r13, - MONO_STRUCT_OFFSET(MonoLMF, method)); + s390_stg (code, s390_r1, 0, s390_r13, + MONO_STRUCT_OFFSET(MonoLMF, method)); mini_gc_set_slot_type_from_fp (cfg, lmfOffset + MONO_STRUCT_OFFSET (MonoLMF, method), SLOT_NOREF); - + /* * Save the current IP */ s390_stg (code, STK_BASE, 0, s390_r13, MONO_STRUCT_OFFSET(MonoLMF, ebp)); s390_basr (code, s390_r1, 0); - s390_stg (code, s390_r1, 0, s390_r13, MONO_STRUCT_OFFSET(MonoLMF, eip)); + s390_stg (code, s390_r1, 0, s390_r13, MONO_STRUCT_OFFSET(MonoLMF, eip)); mini_gc_set_slot_type_from_fp (cfg, lmfOffset + MONO_STRUCT_OFFSET (MonoLMF, ebp), SLOT_NOREF); mini_gc_set_slot_type_from_fp (cfg, lmfOffset + MONO_STRUCT_OFFSET (MonoLMF, eip), SLOT_NOREF); - + /* * Save general and floating point registers */ - s390_stmg (code, s390_r2, s390_r12, s390_r13, - MONO_STRUCT_OFFSET(MonoLMF, gregs) + 2 * sizeof(gulong)); + s390_stmg (code, s390_r2, s390_r12, s390_r13, + MONO_STRUCT_OFFSET(MonoLMF, gregs) + 2 * sizeof(gulong)); for (i = 0; i < 11; i++) mini_gc_set_slot_type_from_fp (cfg, lmfOffset + MONO_STRUCT_OFFSET (MonoLMF, gregs) + i * sizeof(gulong), SLOT_NOREF); fpOffset = lmfOffset + MONO_STRUCT_OFFSET (MonoLMF, fregs); - for (i = 0; i < 16; i++) { - s390_std (code, i, 0, s390_r13, + for (i = 0; i < 16; i++) { + s390_std (code, i, 0, s390_r13, MONO_STRUCT_OFFSET(MonoLMF, fregs) + i * sizeof(gulong)); mini_gc_set_slot_type_from_fp (cfg, fpOffset, SLOT_NOREF); fpOffset += sizeof(double); - } + } /* * Restore the parameter registers now that we've set up the lmf */ - s390_lmg (code, s390_r2, s390_r6, s390_r13, - MONO_STRUCT_OFFSET(MonoLMF, pregs)); + s390_lmg (code, s390_r2, s390_r6, s390_r13, + MONO_STRUCT_OFFSET(MonoLMF, pregs)); } if (cfg->method->save_lmf) @@ -5965,9 +5965,9 @@ printf("ns: %s k: %s m: %s\n",method->klass->name_space,method->klass->name,meth if (inst->opcode != OP_REGVAR) { switch (ainfo->regtype) { case RegTypeGeneral: { - if (((next->opcode == OP_LOAD_MEMBASE) || - (next->opcode == OP_LOADI4_MEMBASE)) && - next->inst_basereg == inst->inst_basereg && + if (((next->opcode == OP_LOAD_MEMBASE) || + (next->opcode == OP_LOADI4_MEMBASE)) && + next->inst_basereg == inst->inst_basereg && next->inst_offset == inst->inst_offset) { if (next->dreg == ainfo->reg) { NULLIFY_INS (next); @@ -5989,8 +5989,8 @@ printf("ns: %s k: %s m: %s\n",method->klass->name_space,method->klass->name,meth /* Argument allocated to (non-volatile) register */ switch (ainfo->regtype) { case RegTypeGeneral: - if (next->opcode == OP_MOVE && - next->sreg1 == inst->dreg && + if (next->opcode == OP_MOVE && + next->sreg1 == inst->dreg && next->dreg == ainfo->reg) { NULLIFY_INS (next); match = TRUE; @@ -6035,9 +6035,9 @@ printf("ns: %s k: %s m: %s\n",method->klass->name_space,method->klass->name,meth /*========================= End of Function ========================*/ /** - * + * * @brief Architecutre-specific epilog generation - * + * * @param[in] @cfg - Compile control block * * Create the instruction sequence for exit from a method @@ -6050,10 +6050,10 @@ mono_arch_emit_epilog (MonoCompile *cfg) guint8 *code; int max_epilog_size = 96, i; int fpOffset = 0; - + if (cfg->method->save_lmf) max_epilog_size += 128; - + code = realloc_code (cfg, max_epilog_size); cfg->has_unwind_info_for_epilog = TRUE; @@ -6064,7 +6064,7 @@ mono_arch_emit_epilog (MonoCompile *cfg) /* Save the uwind state which is needed by the out-of-line code */ mono_emit_unwind_op_remember_state (cfg, code); - if (method->save_lmf) + if (method->save_lmf) restoreLMF(code, cfg->frame_reg, cfg->stack_usage); code = backUpStackPtr(cfg, code); @@ -6083,7 +6083,7 @@ mono_arch_emit_epilog (MonoCompile *cfg) } s390_lmg (code, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET); - for (i = s390_r6; i < s390_r15; i++) + for (i = s390_r6; i < s390_r15; i++) mono_emit_unwind_op_same_value (cfg, code, i); s390_br (code, s390_r14); @@ -6100,16 +6100,16 @@ mono_arch_emit_epilog (MonoCompile *cfg) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific exception emission - * + * * @param[in] @cfg - Compile control block * * Create the instruction sequence for exception handling */ void -mono_arch_emit_exceptions (MonoCompile *cfg) +mono_arch_emit_exceptions (MonoCompile *cfg) { MonoJumpInfo *patch_info; guint8 *code; @@ -6120,8 +6120,8 @@ mono_arch_emit_exceptions (MonoCompile *cfg) MonoClass *exc_classes [MAX_EXC]; guint8 *exc_throw_start [MAX_EXC]; - for (patch_info = cfg->patch_info; - patch_info; + for (patch_info = cfg->patch_info; + patch_info; patch_info = patch_info->next) { if (patch_info->type == MONO_PATCH_INFO_EXC) exc_count++; @@ -6132,7 +6132,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg) code = realloc_code (cfg, code_size); /* - * Add code to raise exceptions + * Add code to raise exceptions */ for (patch_info = cfg->patch_info; patch_info; patch_info = patch_info->next) { switch (patch_info->type) { @@ -6146,24 +6146,24 @@ mono_arch_emit_exceptions (MonoCompile *cfg) s390_patch_rel (ip + 2, (guint64) S390_RELATIVE(code,ip)); exc_class = mono_class_load_from_name (mono_defaults.corlib, - "System", + "System", patch_info->data.name); for (iExc = 0; iExc < nThrows; ++iExc) if (exc_classes [iExc] == exc_class) break; - + if (iExc < nThrows) { - s390_jcl (code, S390_CC_UN, + s390_jcl (code, S390_CC_UN, (guint64) exc_throw_start [iExc]); patch_info->type = MONO_PATCH_INFO_NONE; } else { - + if (nThrows < MAX_EXC) { exc_classes [nThrows] = exc_class; exc_throw_start [nThrows] = code; } - + /* * Patch the parameter passed to the handler */ @@ -6200,9 +6200,9 @@ mono_arch_emit_exceptions (MonoCompile *cfg) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific finishing of initialization - * + * * Perform any architectural-specific operations at the conclusion of * the initialization phase */ @@ -6215,7 +6215,7 @@ mono_arch_finish_init (void) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific instruction emission for method * * @param[in] @cfg - Compile Control block @@ -6223,7 +6223,7 @@ mono_arch_finish_init (void) * @param[in] @fsig - Method signature * @param[in] @args - Arguments to method * @returns Instruction(s) required for architecture - * + * * Provide any architectural shortcuts for specific methods. */ @@ -6330,20 +6330,20 @@ mono_arch_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMetho /*========================= End of Function ========================*/ /** - * + * * @brief Decompose opcode into a System z operation * * @param[in] @cfg - Compile Control block * @param[in] @ins - Mono Instruction - * + * * Substitute a System z instruction for a Mono operation. */ void mono_arch_decompose_opts (MonoCompile *cfg, MonoInst *ins) { - /* - * Have to rename these to avoid being decomposed normally, since the normal + /* + * Have to rename these to avoid being decomposed normally, since the normal * decomposition does not work on S390. */ switch (ins->opcode) { @@ -6379,15 +6379,15 @@ mono_arch_decompose_opts (MonoCompile *cfg, MonoInst *ins) /*========================= End of Function ========================*/ /** - * + * * @brief Determine the cost of allocation a variable * * @param[in] @cfg - Compile Control block * @param[in] @vmv - Mono Method Variable * @returns Cost (hardcoded on s390x to 2) - * - * Determine the cost, in the number of memory references, of the action - * of allocating the variable VMV into a register during global register + * + * Determine the cost, in the number of memory references, of the action + * of allocating the variable VMV into a register during global register * allocation. * */ @@ -6402,14 +6402,14 @@ mono_arch_regalloc_cost (MonoCompile *cfg, MonoMethodVar *vmv) /*========================= End of Function ========================*/ /** - * + * * @brief Architectural specific register window flushing * * Not applicable for s390x so we just do nothing * */ -void +void mono_arch_flush_register_windows (void) { } @@ -6417,20 +6417,20 @@ mono_arch_flush_register_windows (void) /*========================= End of Function ========================*/ /** - * + * * @brief Architectural specific check if value may be immediate * * @param[in] @opcode - Operation code * @param[in] @imm_opcode - Immediate operation code * @param[in] @imm - Value to be examined * @returns True if it is a valid immediate value - * + * * Determine if operand qualifies as an immediate value. For s390x * this is a value in the range -2**32/2**32-1 * */ -gboolean +gboolean mono_arch_is_inst_imm (int opcode, int imm_opcode, gint64 imm) { return s390_is_imm32 (imm); @@ -6439,12 +6439,12 @@ mono_arch_is_inst_imm (int opcode, int imm_opcode, gint64 imm) /*========================= End of Function ========================*/ /** - * + * * @brief Architectural specific patch offset value for AOT * * @param[in] @code - Location of code to check * @returns Offset - * + * * Dummy entry point if/when s390x supports AOT. */ @@ -6457,13 +6457,13 @@ mono_arch_get_patch_offset (guint8 *code) /*========================= End of Function ========================*/ /** - * + * * @brief Architectural specific returning of register from context * * @param[in] @ctx - Mono context * @param[in] @reg - Register number to be returned * @returns Contents of the register from the context - * + * * Return a register from the context. */ @@ -6482,13 +6482,13 @@ mono_arch_context_get_int_reg_address (MonoContext *ctx, int reg) /*========================= End of Function ========================*/ /** - * + * * @brief Architectural specific setting of a register in the context * * @param[in] @ctx - Mono context * @param[in] @reg - Register number to be returned * @param[in] @val - Value to be set - * + * * Set the specified register in the context with the value passed */ @@ -6501,14 +6501,14 @@ mono_arch_context_set_int_reg (MonoContext *ctx, int reg, host_mgreg_t val) /*========================= End of Function ========================*/ /** - * + * * @brief Architectural specific returning of the "this" value from context * * @param[in] @ctx - Mono context * @param[in] @code - Current location * @returns Pointer to the "this" object - * - * Extract register 2 from the context as for s390x this is where the + * + * Extract register 2 from the context as for s390x this is where the * this parameter is passed */ @@ -6519,9 +6519,9 @@ mono_arch_get_this_arg_from_call (host_mgreg_t *regs, guint8 *code) } /*========================= End of Function ========================*/ - + /** - * + * * @brief Delegation trampoline processing * * @param[in] @info - Trampoline information @@ -6529,7 +6529,7 @@ mono_arch_get_this_arg_from_call (host_mgreg_t *regs, guint8 *code) * @param[in] @param_count - Count of parameters * @param[in] @aot - AOT indicator * @returns Next instruction location - * + * * Process the delegation trampolines */ @@ -6571,7 +6571,7 @@ get_delegate_invoke_impl (MonoTrampInfo **info, gboolean has_target, MonoMethodS iReg++; break; default : - s390_mvc (code, sizeof(uintptr_t), STK_BASE, offset, STK_BASE, offset+sizeof(uintptr_t)); + s390_mvc (code, sizeof(uintptr_t), STK_BASE, offset, STK_BASE, offset+sizeof(uintptr_t)); offset += sizeof(uintptr_t); } } @@ -6599,11 +6599,11 @@ get_delegate_invoke_impl (MonoTrampInfo **info, gboolean has_target, MonoMethodS /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific delegation trampolines processing * * @returns List of trampolines - * + * * Return a list of MonoTrampInfo structures for the delegate invoke impl trampolines. */ @@ -6629,13 +6629,13 @@ mono_arch_get_delegate_invoke_impls (void) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific delegation trampoline processing * * @param[in] @sig - Method signature * @param[in] @has_target - Whether delegation contains a target * @returns Trampoline - * + * * Return a pointer to a delegation trampoline */ @@ -6702,7 +6702,7 @@ mono_arch_get_delegate_invoke_impl (MonoMethodSignature *sig, gboolean has_targe /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific delegation virtual trampoline processing * * @param[in] @sig - Method signature @@ -6710,12 +6710,12 @@ mono_arch_get_delegate_invoke_impl (MonoMethodSignature *sig, gboolean has_targe * @param[in] @offset - Offset into vtable * @param[in] @load_imt_reg - Whether to load the LMT register * @returns Trampoline - * + * * Return a pointer to a delegation virtual trampoline */ gpointer -mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method, +mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod *method, int offset, gboolean load_imt_reg) { guint8 *code, *start; @@ -6727,7 +6727,7 @@ mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod * Replace the "this" argument with the target */ s390_lgr (code, s390_r1, s390_r2); - s390_lg (code, s390_r2, 0, s390_r1, MONO_STRUCT_OFFSET(MonoDelegate, target)); + s390_lg (code, s390_r2, 0, s390_r1, MONO_STRUCT_OFFSET(MonoDelegate, target)); /* * Load the IMT register, if needed @@ -6755,7 +6755,7 @@ mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific build of IMT trampoline * * @param[in] @vtable - Mono VTable @@ -6764,7 +6764,7 @@ mono_arch_get_delegate_virtual_invoke_impl (MonoMethodSignature *sig, MonoMethod * @param[in] @count - Count of items * @param[in] @fail_tramp - Pointer to a failure trampoline * @returns Trampoline - * + * * Return a pointer to an IMT trampoline */ @@ -6787,11 +6787,11 @@ mono_arch_build_imt_trampoline (MonoVTable *vtable, if (item->has_target_code) item->chunk_size += BR_SIZE + JUMP_SIZE + LOADCON_SIZE; else - item->chunk_size += BR_SIZE + JUMP_SIZE + LOADCON_SIZE + + item->chunk_size += BR_SIZE + JUMP_SIZE + LOADCON_SIZE + LOAD_SIZE; } else { if (fail_tramp) { - item->chunk_size += CMP_SIZE + 2 * BR_SIZE + JUMP_SIZE + + item->chunk_size += CMP_SIZE + 2 * BR_SIZE + JUMP_SIZE + 2 * LOADCON_SIZE; if (!item->has_target_code) item->chunk_size += LOAD_SIZE; @@ -6828,7 +6828,7 @@ mono_arch_build_imt_trampoline (MonoVTable *vtable, } item->jmp_code = (guint8*) code; s390_jcl (code, S390_CC_NE, 0); - + if (item->has_target_code) { S390_SET (code, s390_r1, item->value.target_code); } else { @@ -6848,7 +6848,7 @@ mono_arch_build_imt_trampoline (MonoVTable *vtable, S390_SET (code, s390_r1, item->value.target_code); } else { g_assert (vtable); - S390_SET (code, s390_r1, + S390_SET (code, s390_r1, (&(vtable->vtable [item->value.vtable_slot]))); s390_lg (code, s390_r1, 0, s390_r1, 0); } @@ -6875,8 +6875,8 @@ mono_arch_build_imt_trampoline (MonoVTable *vtable, s390_jcl (code, S390_CC_GE, 0); } } - /* - * patch the branches to get to the target items + /* + * patch the branches to get to the target items */ for (i = 0; i < count; ++i) { MonoIMTCheckItem *item = imt_entries [i]; @@ -6893,7 +6893,7 @@ mono_arch_build_imt_trampoline (MonoVTable *vtable, mono_arch_flush_icache ((guint8*)start, (code - start)); MONO_PROFILER_RAISE (jit_code_buffer, (start, code - start, MONO_PROFILER_CODE_BUFFER_IMT_TRAMPOLINE, NULL)); - if (!fail_tramp) + if (!fail_tramp) UnlockedAdd (&mono_stats.imt_trampolines_size, code - start); g_assert (code - start <= size); @@ -6906,13 +6906,13 @@ mono_arch_build_imt_trampoline (MonoVTable *vtable, /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific return of pointer to IMT method * * @param[in] @regs - Context registers * @param[in] @code - Current location * @returns Pointer to IMT method - * + * * Extract the value of the IMT register from the context */ @@ -6925,13 +6925,13 @@ mono_arch_find_imt_method (host_mgreg_t *regs, guint8 *code) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific return of pointer static call vtable. * * @param[in] @regs - Context registers * @param[in] @code - Current location * @returns Pointer to static call vtable - * + * * Extract the value of the RGCTX register from the context which * points to the static call vtable. */ @@ -6945,7 +6945,7 @@ mono_arch_find_static_call_vtable (host_mgreg_t *regs, guint8 *code) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific return of unwind bytecode for DWARF CIE * * @returns Unwind byte code @@ -6968,13 +6968,13 @@ mono_arch_get_cie_program (void) #ifdef MONO_ARCH_SOFT_DEBUG_SUPPORTED /** - * + * * @brief Architecture-specific setting of a breakpoint * * @param[in] @ji - Mono JIT Information * @param[in] @ip - Insruction pointer * - * Set a breakpoint at the native code corresponding to JI at NATIVE_OFFSET. + * Set a breakpoint at the native code corresponding to JI at NATIVE_OFFSET. * The location should contain code emitted by OP_SEQ_POINT. */ @@ -6993,7 +6993,7 @@ mono_arch_set_breakpoint (MonoJitInfo *ji, guint8 *ip) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific clearing of a breakpoint * * @param[in] @ji - Mono JIT Information @@ -7017,7 +7017,7 @@ mono_arch_clear_breakpoint (MonoJitInfo *ji, guint8 *ip) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific check if this is a breakpoint event * * @param[in] @info - Signal information @@ -7037,7 +7037,7 @@ mono_arch_is_breakpoint_event (void *info, void *sigctx) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific skip of a breakpoint * * @param[in] @ctx - Mono Context @@ -7053,9 +7053,9 @@ mono_arch_skip_breakpoint (MonoContext *ctx, MonoJitInfo *ji) } /*========================= End of Function ========================*/ - + /** - * + * * @brief Architecture-specific start of single stepping * * Unprotect the trigger page to enable single stepping @@ -7068,9 +7068,9 @@ mono_arch_start_single_stepping (void) } /*========================= End of Function ========================*/ - + /** - * + * * @brief Architecture-specific stop of single stepping * * Write-protect the trigger page to disable single stepping @@ -7085,7 +7085,7 @@ mono_arch_stop_single_stepping (void) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific check if single stepping event * * @param[in] @info - Signal information @@ -7106,7 +7106,7 @@ mono_arch_is_single_step_event (void *info, void *sigctx) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific skip of a single stepping event * * @param[in] @ctx - Mono Context @@ -7125,14 +7125,14 @@ mono_arch_skip_single_step (MonoContext *ctx) /*========================= End of Function ========================*/ /** - * + * * @brief Architecture-specific creation of sequence point information * * @param[in] @domain - Mono Domain * @param[in] @code - Current location pointer * @returns Sequence Point Information * - * Return a pointer to a data struction which is used by the sequence + * Return a pointer to a data struction which is used by the sequence * point implementation in AOTed code. A no-op on s390x until AOT is * ever supported. */ @@ -7173,7 +7173,7 @@ mono_arch_get_seq_point_info (guint8 *code) #endif /** - * + * * @brief Architecture-specific check of supported operation codes * * @param[in] @opcode - Operation code to be checked @@ -7201,7 +7201,7 @@ mono_arch_opcode_supported (int opcode) #ifndef DISABLE_JIT /** - * + * * @brief Architecture-specific check of tailcall support * * @param[in] @cfg - Mono Compile control block @@ -7225,7 +7225,7 @@ mono_arch_tailcall_supported (MonoCompile *cfg, MonoMethodSignature *caller_sig, gboolean res = IS_SUPPORTED_TAILCALL (callee_info->stack_usage <= caller_info->stack_usage); - // Any call that would result in parameters being placed on the stack cannot be "tailed" as it may + // Any call that would result in parameters being placed on the stack cannot be "tailed" as it may // result in the callers parameter variables being overwritten. ArgInfo const * const ainfo = callee_info->args + callee_sig->hasthis; for (int i = 0; res && i < callee_sig->param_count; ++i) { @@ -7279,7 +7279,7 @@ mono_arch_tailcall_supported (MonoCompile *cfg, MonoMethodSignature *caller_sig, #endif /** - * + * * @brief Architecture-specific load function * * @param[in] @jit_call_id - JIT callee identifier diff --git a/src/mono/mono/mini/mini-s390x.h b/src/mono/mono/mini/mini-s390x.h index 9a1aee5721aca1..e251b8c23b789d 100644 --- a/src/mono/mono/mini/mini-s390x.h +++ b/src/mono/mono/mini/mini-s390x.h @@ -192,7 +192,7 @@ static void inline s390_patch_rel (guchar *code, guint64 target) { guint32 *offset = (guint32 *) code; - + if (target != 0) { *offset = (guint32) target; } @@ -212,7 +212,7 @@ static void inline s390_patch_addr (guchar *code, guint64 target) { guint64 *offset = (guint64 *) code; - + if (target != 0) { *offset = target; } @@ -350,4 +350,4 @@ s390_patch_addr (guchar *code, guint64 target) *(guint32 *) p = lo; \ } while (0) -#endif /* __MONO_MINI_S390X_H__ */ +#endif /* __MONO_MINI_S390X_H__ */ diff --git a/src/mono/mono/mini/mini-sparc.c b/src/mono/mono/mini/mini-sparc.c index 2efe4ba06e74ed..8a51c738ed79ba 100644 --- a/src/mono/mono/mini/mini-sparc.c +++ b/src/mono/mono/mini/mini-sparc.c @@ -44,20 +44,20 @@ * - the instruction set * - the ABI * - * V9 instructions are only usable if the underlying processor is 64 bit. Most Sparc - * processors in use are 64 bit processors. The V9 ABI is only usable if the + * V9 instructions are only usable if the underlying processor is 64 bit. Most Sparc + * processors in use are 64 bit processors. The V9 ABI is only usable if the * mono executable is a 64 bit executable. So it would make sense to use the 64 bit * instructions without using the 64 bit ABI. */ /* * Register usage: - * - %i0..%i hold the incoming arguments, these are never written by JITted + * - %i0..%i hold the incoming arguments, these are never written by JITted * code. Unused input registers are used for global register allocation. * - %o0..%o5 and %l7 is used for local register allocation and passing arguments * - %l0..%l6 is used for global register allocation * - %o7 and %g1 is used as scratch registers in opcodes - * - all floating point registers are used for local register allocation except %f0. + * - all floating point registers are used for local register allocation except %f0. * Only double precision registers are used. * In 64 bit mode: * - fp registers %d0..%d30 are used for parameter passing, and %d32..%d62 are @@ -77,8 +77,8 @@ * This test casts (guint64)-1 to double and then back to guint64 again. * Under x86, it returns 0, while under sparc it returns -1. * - * In addition to this, the runtime requires the trunc function, or its - * solaris counterpart, aintl, to do some double->int conversions. If this + * In addition to this, the runtime requires the trunc function, or its + * solaris counterpart, aintl, to do some double->int conversions. If this * function is not available, it is emulated somewhat, but the results can be * strange. */ @@ -179,11 +179,11 @@ mono_arch_regname (int reg) { const char* mono_arch_fregname (int reg) { static const char *rnames [] = { - "sparc_f0", "sparc_f1", "sparc_f2", "sparc_f3", "sparc_f4", + "sparc_f0", "sparc_f1", "sparc_f2", "sparc_f3", "sparc_f4", "sparc_f5", "sparc_f6", "sparc_f7", "sparc_f8", "sparc_f9", - "sparc_f10", "sparc_f11", "sparc_f12", "sparc_f13", "sparc_f14", + "sparc_f10", "sparc_f11", "sparc_f12", "sparc_f13", "sparc_f14", "sparc_f15", "sparc_f16", "sparc_f17", "sparc_f18", "sparc_f19", - "sparc_f20", "sparc_f21", "sparc_f22", "sparc_f23", "sparc_f24", + "sparc_f20", "sparc_f21", "sparc_f22", "sparc_f23", "sparc_f24", "sparc_f25", "sparc_f26", "sparc_f27", "sparc_f28", "sparc_f29", "sparc_f30", "sparc_f31" }; @@ -331,18 +331,18 @@ mono_arch_flush_register_windows (void) mono_sparc_flushw (); } -gboolean +gboolean mono_arch_is_inst_imm (int opcode, int imm_opcode, gint64 imm) { return sparc_is_imm13 (imm); } -gboolean +gboolean mono_sparc_is_v9 (void) { return mono_hwcap_sparc_is_v9; } -gboolean +gboolean mono_sparc_is_sparc64 (void) { return v64; } @@ -461,7 +461,7 @@ add_float (guint32 *gr, guint32 *stack_size, ArgInfo *ainfo, gboolean single) * get_call_info: * * Obtain information about a call according to the calling convention. - * For V8, see the "System V ABI, Sparc Processor Supplement" Sparc V8 version + * For V8, see the "System V ABI, Sparc Processor Supplement" Sparc V8 version * document for more information. * For V9, see the "Low Level System Information (64-bit psABI)" chapter in * the 'Sparc Compliance Definition 2.4' document. @@ -515,7 +515,7 @@ get_call_info (MonoCompile *cfg, MonoMethodSignature *sig, gboolean is_pinvoke) DEBUG(printf("param %d: ", i)); if (m_type_is_byref (sig->params [i])) { DEBUG(printf("byref\n")); - + add_general (&gr, &stack_size, ainfo, FALSE); continue; } @@ -699,7 +699,7 @@ mono_arch_get_allocatable_int_vars (MonoCompile *cfg) GList *vars = NULL; int i; - /* + /* * FIXME: If an argument is allocated to a register, then load it from the * stack in the prolog. */ @@ -755,7 +755,7 @@ mono_arch_get_global_int_regs (MonoCompile *cfg) /* * mono_arch_regalloc_cost: * - * Return the cost, in number of memory references, of the action of + * Return the cost, in number of memory references, of the action of * allocating the variable VMV into a register during global register * allocation. */ @@ -833,8 +833,8 @@ mono_arch_allocate_vars (MonoCompile *cfg) cfg->frame_reg = sparc_fp; offset = 0; - /* - * Reserve a stack slot for holding information used during exception + /* + * Reserve a stack slot for holding information used during exception * handling. */ if (header->num_clauses) @@ -864,8 +864,8 @@ mono_arch_allocate_vars (MonoCompile *cfg) else size = mini_type_stack_size (inst->inst_vtype, &align); - /* - * This is needed since structures containing doubles must be doubleword + /* + * This is needed since structures containing doubles must be doubleword * aligned. * FIXME: Do this only if needed. */ @@ -905,7 +905,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) arg_type = sig->params [i - sig->hasthis]; #ifndef SPARCV9 - if (!m_type_is_byref (arg_type) && ((arg_type->type == MONO_TYPE_R4) + if (!m_type_is_byref (arg_type) && ((arg_type->type == MONO_TYPE_R4) || (arg_type->type == MONO_TYPE_R8))) /* * Since float arguments are passed in integer registers, we need to @@ -950,7 +950,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) break; case ArgInFloatReg: case ArgInDoubleReg: - /* + /* * Since float regs are volatile, we save the arguments to * the stack in the prolog. * FIXME: Avoid this if the method contains no calls. @@ -965,7 +965,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) inst->inst_offset = ainfo->offset + ARGS_OFFSET; if (!m_type_is_byref (arg_type) && (arg_type->type == MONO_TYPE_R8)) { - /* + /* * It is very hard to load doubles from non-doubleword aligned * memory locations. So if the offset is misaligned, we copy the * argument to a stack location in the prolog. @@ -1000,7 +1000,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) } } - /* + /* * spillvars are stored between the normal locals and the storage reserved * by the ABI. */ @@ -1163,7 +1163,7 @@ emit_pass_vtype (MonoCompile *cfg, MonoCallInst *call, CallInfo *cinfo, ArgInfo else if (pinvoke) size = mono_type_native_stack_size (m_class_get_byval_arg (in->klass), &align); else { - /* + /* * Other backends use mono_type_stack_size (), but that * aligns the size to 8, which is larger than the size of * the source, leading to reads of invalid memory if the @@ -1182,7 +1182,7 @@ emit_pass_vtype (MonoCompile *cfg, MonoCallInst *call, CallInfo *cinfo, ArgInfo cinfo->stack_usage += size; cinfo->stack_usage += pad; - /* + /* * We use OP_OUTARG_VT to copy the valuetype to a stack location, then * use the normal OUTARG opcodes to pass the address of the location to * the callee. @@ -1242,9 +1242,9 @@ emit_sig_cookie (MonoCompile *cfg, MonoCallInst *call, CallInfo *cinfo) MonoMethodSignature *tmp_sig; /* - * mono_ArgIterator_Setup assumes the signature cookie is + * mono_ArgIterator_Setup assumes the signature cookie is * passed first and all the arguments which were before it are - * passed on the stack after the signature. So compensate by + * passed on the stack after the signature. So compensate by * passing a different signature. */ tmp_sig = mono_metadata_signature_dup (call->signature); @@ -1270,7 +1270,7 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call) sig = call->signature; n = sig->param_count + sig->hasthis; - + cinfo = get_call_info (cfg, sig, sig->pinvoke); if (sig->ret && MONO_TYPE_ISSTRUCT (sig->ret)) { @@ -1483,7 +1483,7 @@ else { \ sparc_branch (code, 0, cond, 0); \ } \ if (filldelay) sparc_nop (code); \ - } while (0); + } while (0); #define EMIT_COND_SYSTEM_EXCEPTION(ins,cond,sexc_name) EMIT_COND_SYSTEM_EXCEPTION_GENERAL(ins,cond,sexc_name,TRUE,DEFAULT_ICC) @@ -1577,7 +1577,7 @@ emit_call (MonoCompile *cfg, guint32 *code, guint32 patch_type, gconstpointer da mono_add_patch_info (cfg, (guint8*)code - cfg->native_code, patch_type, data); EMIT_CALL (); } - + return code; } @@ -1594,7 +1594,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) MONO_BB_FOR_EACH_INS_SAFE (bb, n, ins) { switch (ins->opcode) { - case OP_MUL_IMM: + case OP_MUL_IMM: /* remove unnecessary multiplication with 1 */ if (ins->inst_imm == 1) { if (ins->dreg != ins->sreg1) { @@ -1608,11 +1608,11 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) #ifndef SPARCV9 case OP_LOAD_MEMBASE: case OP_LOADI4_MEMBASE: - /* - * OP_STORE_MEMBASE_REG reg, offset(basereg) + /* + * OP_STORE_MEMBASE_REG reg, offset(basereg) * OP_LOAD_MEMBASE offset(basereg), reg */ - if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_REG + if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_REG || last_ins->opcode == OP_STORE_MEMBASE_REG) && ins->inst_basereg == last_ins->inst_destbasereg && ins->inst_offset == last_ins->inst_offset) { @@ -1625,7 +1625,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) ins->sreg1 = last_ins->sreg1; } - /* + /* * Note: reg1 must be different from the basereg in the second load * OP_LOAD_MEMBASE offset(basereg), reg1 * OP_LOAD_MEMBASE offset(basereg), reg2 @@ -1650,11 +1650,11 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) //g_assert_not_reached (); #if 0 - /* - * OP_STORE_MEMBASE_IMM imm, offset(basereg) + /* + * OP_STORE_MEMBASE_IMM imm, offset(basereg) * OP_LOAD_MEMBASE offset(basereg), reg * --> - * OP_STORE_MEMBASE_IMM imm, offset(basereg) + * OP_STORE_MEMBASE_IMM imm, offset(basereg) * OP_ICONST reg, imm */ } else if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_IMM @@ -1702,7 +1702,7 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) /* Used when initializing temporaries */ /* We know sparc_fp is dword aligned */ if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_IMM) && - (ins->inst_destbasereg == last_ins->inst_destbasereg) && + (ins->inst_destbasereg == last_ins->inst_destbasereg) && (ins->inst_destbasereg == sparc_fp) && (ins->inst_offset < 0) && ((ins->inst_offset % 8) == 0) && @@ -1732,13 +1732,13 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) /* * Convert compare with zero+branch to BRcc */ - /* + /* * This only works in 64 bit mode, since it examines all 64 * bits of the register. * Only do this if the method is small since BPr only has a 16bit * displacement. */ - if (v64 && (cfg->header->code_size < 10000) && last_ins && + if (v64 && (cfg->header->code_size < 10000) && last_ins && (last_ins->opcode == OP_COMPARE_IMM) && (last_ins->inst_imm == 0)) { switch (ins->opcode) { @@ -1788,15 +1788,15 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) } break; case OP_MOVE: - /* - * OP_MOVE reg, reg + /* + * OP_MOVE reg, reg */ if (ins->dreg == ins->sreg1) { MONO_DELETE_INS (bb, ins); continue; } - /* - * OP_MOVE sreg, dreg + /* + * OP_MOVE sreg, dreg * OP_MOVE dreg, sreg */ if (last_ins && last_ins->opcode == OP_MOVE && @@ -1877,7 +1877,7 @@ sparc_patch (guint32 *code, const gpointer target) guint32 ins2 = code [1]; if (((ins2 >> 30) == 2) && (((ins2 >> 19) & 0x3f) == 2)) { - /* sethi followed by or */ + /* sethi followed by or */ guint32 *p = code; sparc_set (p, target8, rd); while (p <= (code + 1)) @@ -1900,7 +1900,7 @@ sparc_patch (guint32 *code, const gpointer target) *(code + 1) |= (t & 0x3ff); #endif } - else if (v64 && + else if (v64 && (sparc_inst_rd (ins) == sparc_g1) && (sparc_inst_op (c [1]) == 0) && (sparc_inst_op2 (c [1]) == 4) && (sparc_inst_op (c [2]) == 2) && (sparc_inst_op3 (c [2]) == 2) && @@ -1913,7 +1913,7 @@ sparc_patch (guint32 *code, const gpointer target) while (p < (c + 6)) sparc_nop (p); } - else if ((sparc_inst_op (ins2) == 2) && (sparc_inst_op3 (ins2) == 0x38) && + else if ((sparc_inst_op (ins2) == 2) && (sparc_inst_op3 (ins2) == 0x38) && (sparc_inst_imm (ins2))) { /* sethi followed by jmpl */ #ifndef SPARCV9 @@ -2012,7 +2012,7 @@ emit_vret_token (MonoInst *ins, guint32 *code) MonoCallInst *call = (MonoCallInst*)ins; guint32 size; - /* + /* * The sparc ABI requires that calls to functions which return a structure * contain an additional unimpl instruction which is checked by the callee. */ @@ -2045,7 +2045,7 @@ emit_move_return_value (MonoInst *ins, guint32 *code) case OP_LCALL: case OP_LCALL_REG: case OP_LCALL_MEMBASE: - /* + /* * ins->dreg is the least significant reg due to the lreg: LCALL rule * in inssel-long32.brg. */ @@ -2065,7 +2065,7 @@ emit_move_return_value (MonoInst *ins, guint32 *code) } else sparc_fmovd (code, sparc_f0, ins->dreg); -#else +#else sparc_fmovs (code, sparc_f0, ins->dreg); if (((MonoCallInst*)ins)->signature->ret->type == MONO_TYPE_R4) sparc_fstod (code, ins->dreg, ins->dreg); @@ -2107,7 +2107,7 @@ emit_load_volatile_arguments (MonoCompile *cfg, guint32 *code) sig = mono_method_signature_internal (method); cinfo = get_call_info (cfg, sig, FALSE); - + /* This is the opposite of the code in emit_prolog */ for (i = 0; i < sig->param_count + sig->hasthis; ++i) { @@ -2215,7 +2215,7 @@ emit_load_volatile_arguments (MonoCompile *cfg, guint32 *code) * * Determine whenever the instruction at CODE is a virtual call. */ -gboolean +gboolean mono_sparc_is_virtual_call (guint32 *code) { guint32 buf[1]; @@ -2225,7 +2225,7 @@ mono_sparc_is_virtual_call (guint32 *code) if ((sparc_inst_op (*code) == 0x2) && (sparc_inst_op3 (*code) == 0x38)) { /* - * Register indirect call. If it is a virtual call, then the + * Register indirect call. If it is a virtual call, then the * instruction in the delay slot is a special kind of nop. */ @@ -2540,8 +2540,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_BREAK: /* - * gdb does not like encountering 'ta 1' in the debugged code. So - * instead of emitting a trap, we emit a call a C function and place a + * gdb does not like encountering 'ta 1' in the debugged code. So + * instead of emitting a trap, we emit a call a C function and place a * breakpoint there. */ //sparc_ta (code, 1); @@ -2879,7 +2879,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) code = emit_save_sp_to_lmf (cfg, code); sparc_jmpl (code, ins->sreg1, sparc_g0, sparc_callsite); /* - * We emit a special kind of nop in the delay slot to tell the + * We emit a special kind of nop in the delay slot to tell the * trampoline code that this is a virtual call, thus an unbox * trampoline might need to be called. */ @@ -2989,7 +2989,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_LOCALLOC_IMM: { gint32 offset = ins->inst_imm; gint32 offset2; - + #ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK /* Perform stack touching */ NOT_IMPLEMENTED; @@ -3058,11 +3058,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_START_HANDLER: { /* - * The START_HANDLER instruction marks the beginning of a handler - * block. It is called using a call instruction, so %o7 contains + * The START_HANDLER instruction marks the beginning of a handler + * block. It is called using a call instruction, so %o7 contains * the return address. Since the handler executes in the same stack - * frame as the method itself, we can't use save/restore to save - * the return address. Instead, we save it into a dedicated + * frame as the method itself, we can't use save/restore to save + * the return address. Instead, we save it into a dedicated * variable. */ MonoInst *spvar = mono_find_spvar_for_region (cfg, bb->region); @@ -3099,7 +3099,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) sparc_nop (code); break; } - case OP_CALL_HANDLER: + case OP_CALL_HANDLER: mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_BB, ins->inst_target_bb); /* This is a jump inside the method, so call_simple works even on V9 */ sparc_call_simple (code, 0); @@ -3444,7 +3444,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) sparc_fmovs (code, ins->sreg1 + 1, ins->dreg + 1); #endif break; - case OP_LCONV_TO_R_UN: { + case OP_LCONV_TO_R_UN: { /* Emulated */ g_assert_not_reached (); break; @@ -3453,11 +3453,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_LCONV_TO_OVF_I4_2: { guint32 *br [3], *label [1]; - /* + /* * Valid ints: 0xffffffff:8000000 to 00000000:0x7f000000 */ sparc_cmp_imm (code, ins->sreg1, 0); - br [0] = code; + br [0] = code; sparc_branch (code, 1, sparc_bneg, 0); sparc_nop (code); @@ -3493,13 +3493,13 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_FSUB: sparc_fsubd (code, ins->sreg1, ins->sreg2, ins->dreg); - break; + break; case OP_FMUL: sparc_fmuld (code, ins->sreg1, ins->sreg2, ins->dreg); - break; + break; case OP_FDIV: sparc_fdivd (code, ins->sreg1, ins->sreg2, ins->dreg); - break; + break; case OP_FNEG: #ifdef SPARCV9 sparc_fnegd (code, ins->sreg1, ins->dreg); @@ -3507,7 +3507,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /* FIXME: why don't use fnegd ? */ sparc_fnegs (code, ins->sreg1, ins->dreg); #endif - break; + break; case OP_FREM: sparc_fdivd (code, ins->sreg1, ins->sreg2, FP_SCRATCH_REG); sparc_fmuld (code, ins->sreg2, FP_SCRATCH_REG, FP_SCRATCH_REG); @@ -3536,7 +3536,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) default: sparc_fbranch (code, 1, opcode_to_sparc_cond (ins->opcode), 2); /* delay slot */ - sparc_set (code, 1, ins->dreg); + sparc_set (code, 1, ins->dreg); } break; case OP_FBEQ: @@ -3644,7 +3644,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) mono_inst_name (ins->opcode), max_len, ((guint8*)code) - code_start); g_assert_not_reached (); } - + cpos += max_len; last_ins = ins; @@ -3884,7 +3884,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) offset += 6 * sizeof (target_mgreg_t); else offset += cfg->param_area; - + /* align the stack size */ offset = ALIGN_TO (offset, MONO_ARCH_FRAME_ALIGNMENT); @@ -3950,7 +3950,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) /* Save the argument to a dword aligned stack location */ /* * stack_offset contains the offset of the argument on the stack. - * inst->inst_offset contains the dword aligned offset where the value + * inst->inst_offset contains the dword aligned offset where the value * should be stored. */ if (ainfo->storage == ArgInIRegPair) { @@ -3999,7 +3999,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) sparc_sth_imm (code, sparc_i0 + ainfo->reg, inst->inst_basereg, stack_offset); else if ((stack_offset - ARGS_OFFSET) & 0x4) - sparc_st_imm (code, sparc_i0 + ainfo->reg, inst->inst_basereg, stack_offset); + sparc_st_imm (code, sparc_i0 + ainfo->reg, inst->inst_basereg, stack_offset); else { if (v64) sparc_stx_imm (code, sparc_i0 + ainfo->reg, inst->inst_basereg, stack_offset); @@ -4016,7 +4016,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) if (!sparc_is_imm13 (inst->inst_offset + 4)) NOT_IMPLEMENTED; sparc_st_imm (code, sparc_i0 + ainfo->reg, inst->inst_basereg, inst->inst_offset); - sparc_st_imm (code, sparc_i0 + ainfo->reg + 1, inst->inst_basereg, inst->inst_offset + 4); + sparc_st_imm (code, sparc_i0 + ainfo->reg + 1, inst->inst_basereg, inst->inst_offset + 4); } else if ((ainfo->storage == ArgInFloatReg) && (inst->opcode != OP_REGVAR)) { if (!sparc_is_imm13 (stack_offset)) @@ -4027,7 +4027,7 @@ mono_arch_emit_prolog (MonoCompile *cfg) /* The offset is guaranteed to be aligned by the ABI rules */ sparc_stdf_imm (code, ainfo->reg, inst->inst_basereg, inst->inst_offset); } - + if ((ainfo->storage == ArgInFloatReg) && (inst->opcode == OP_REGVAR)) { /* Need to move into the a double precision register */ sparc_fstod (code, ainfo->reg, ainfo->reg - 1); @@ -4080,10 +4080,10 @@ mono_arch_emit_epilog (MonoCompile *cfg) guint32 *code; int can_fold = 0; int max_epilog_size = 16 + 20 * 4; - + if (cfg->method->save_lmf) max_epilog_size += 128; - + if (mono_jit_trace_calls != NULL) max_epilog_size += 50; @@ -4099,7 +4099,7 @@ mono_arch_emit_epilog (MonoCompile *cfg) code = mono_sparc_emit_restore_lmf (code, lmf_offset); } - /* + /* * The V8 ABI requires that calls to functions which return a structure * return to %i7+12 */ @@ -4113,8 +4113,8 @@ mono_arch_emit_epilog (MonoCompile *cfg) if (cfg->bb_exit->in_count == 1 && cfg->bb_exit->in_bb[0]->native_offset != cfg->bb_exit->native_offset) can_fold = 1; - /* - * FIXME: The last instruction might have a branch pointing into it like in + /* + * FIXME: The last instruction might have a branch pointing into it like in * int_ceq sparc_i0 <- */ can_fold = 0; @@ -4159,8 +4159,8 @@ mono_arch_emit_exceptions (MonoCompile *cfg) if (patch_info->type == MONO_PATCH_INFO_EXC) exc_count++; } - - /* + + /* * make sure we have enough space for exceptions */ #ifdef SPARCV9 @@ -4349,7 +4349,7 @@ mono_arch_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMetho * @arg_info: an array to store the result infos * * Gathers information on parameters such as size, alignment and - * padding. arg_info should be large enought to hold param_count + 1 entries. + * padding. arg_info should be large enought to hold param_count + 1 entries. * * Returns the size of the activation frame. */ diff --git a/src/mono/mono/mini/mini-sparc.h b/src/mono/mono/mini/mini-sparc.h index 63be33284af894..1d96c2f0360ce4 100644 --- a/src/mono/mono/mini/mini-sparc.h +++ b/src/mono/mono/mini/mini-sparc.h @@ -17,7 +17,7 @@ /* Parameters used by the register allocator */ -/* +/* * Use %o0..%o5 as local registers, plus %l7 since we need an extra register for * holding the sreg1 in call instructions. */ @@ -176,4 +176,4 @@ guint32* mono_sparc_emit_save_lmf (guint32* code, guint32 lmf_offset); guint32* mono_sparc_emit_restore_lmf (guint32 *code, guint32 lmf_offset); -#endif /* __MONO_MINI_SPARC_H__ */ +#endif /* __MONO_MINI_SPARC_H__ */ diff --git a/src/mono/mono/mini/mini-trampolines.c b/src/mono/mono/mini/mini-trampolines.c index 84aeee956586fd..2b87e4bce2c557 100644 --- a/src/mono/mono/mini/mini-trampolines.c +++ b/src/mono/mono/mini/mini-trampolines.c @@ -317,7 +317,7 @@ mini_jit_info_is_gsharedvt (MonoJitInfo *ji) /** * mini_add_method_trampoline: - * @m: + * @m: * @compiled_method: * @add_static_rgctx_tramp: adds a static rgctx trampoline * @add_unbox_tramp: adds an unboxing trampoline @@ -658,7 +658,7 @@ common_call_trampoline (host_mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVTa mini_patch_jump_sites (m, mono_get_addr_from_ftnptr (addr)); /* Patch the got entries pointing to this method */ - /* + /* * We do this here instead of in mono_codegen () to cover the case when m * was loaded from an aot image. */ @@ -729,7 +729,7 @@ common_call_trampoline (host_mgreg_t *regs, guint8 *code, MonoMethod *m, MonoVTa ji = mini_jit_info_table_find (code); if (ji && target_ji && generic_shared && ji->has_generic_jit_info && !target_ji->has_generic_jit_info) { - /* + /* * Can't patch the call as the caller is gshared, but the callee is not. Happens when * generic sharing fails. * FIXME: Performance problem. @@ -860,12 +860,12 @@ mono_vcall_trampoline (host_mgreg_t *regs, guint8 *code, int slot, guint8 *tramp /** * mono_aot_trampoline: * - * This trampoline handles calls made from AOT code. We try to bypass the + * This trampoline handles calls made from AOT code. We try to bypass the * normal JIT compilation logic to avoid loading the metadata for the method. */ #ifdef MONO_ARCH_AOT_SUPPORTED gpointer -mono_aot_trampoline (host_mgreg_t *regs, guint8 *code, guint8 *token_info, +mono_aot_trampoline (host_mgreg_t *regs, guint8 *code, guint8 *token_info, guint8* tramp) { MONO_REQ_GC_UNSAFE_MODE; @@ -912,7 +912,7 @@ mono_aot_trampoline (host_mgreg_t *regs, guint8 *code, guint8 *token_info, * This trampoline handles calls made from AOT code through the PLT table. */ gpointer -mono_aot_plt_trampoline (host_mgreg_t *regs, guint8 *code, guint8 *aot_module, +mono_aot_plt_trampoline (host_mgreg_t *regs, guint8 *code, guint8 *aot_module, guint8* tramp) { gpointer res; @@ -1002,8 +1002,8 @@ mono_delegate_trampoline (host_mgreg_t *regs, guint8 *code, gpointer *arg, guint method = delegate->method; /* - * delegate->method_ptr == NULL means the delegate was initialized by - * mini_delegate_ctor, while != NULL means it is initialized by + * delegate->method_ptr == NULL means the delegate was initialized by + * mini_delegate_ctor, while != NULL means it is initialized by * mono_delegate_ctor_with_method (). In both cases, we need to add wrappers * (ctor_with_method () does this, but it doesn't store the wrapper back into * delegate->method). @@ -1082,7 +1082,7 @@ mono_delegate_trampoline (host_mgreg_t *regs, guint8 *code, gpointer *arg, guint method = mono_object_get_virtual_method_internal (delegate->target, method); enable_caching = FALSE; } else if (delegate->target && - method->flags & METHOD_ATTRIBUTE_VIRTUAL && + method->flags & METHOD_ATTRIBUTE_VIRTUAL && method->flags & METHOD_ATTRIBUTE_ABSTRACT && mono_class_is_abstract (method->klass)) { method = mono_object_get_virtual_method_internal (delegate->target, method); @@ -1098,7 +1098,7 @@ mono_delegate_trampoline (host_mgreg_t *regs, guint8 *code, gpointer *arg, guint need_rgctx_tramp = TRUE; } - /* + /* * If the called address is a trampoline, replace it with the compiled method so * further calls don't have to go through the trampoline. */ @@ -1302,7 +1302,7 @@ mono_create_jump_trampoline (MonoMethod *method, gboolean add_sync_wrapper, Mono ji->d.method = method; /* - * mono_delegate_ctor needs to find the method metadata from the + * mono_delegate_ctor needs to find the method metadata from the * trampoline address, so we save it here. */ @@ -1335,7 +1335,7 @@ mono_create_jit_trampoline (MonoMethod *method, MonoError *error) /* Avoid creating trampolines if possible */ gpointer code = mono_jit_find_compiled_method (method); - + if (code) return code; if (mono_llvm_only) { @@ -1363,7 +1363,7 @@ mono_create_jit_trampoline (MonoMethod *method, MonoError *error) jit_mm_unlock (jit_mm); return tramp; -} +} gpointer mono_create_jit_trampoline_from_token (MonoImage *image, guint32 token) @@ -1382,7 +1382,7 @@ mono_create_jit_trampoline_from_token (MonoImage *image, guint32 token) UnlockedIncrement (&jit_trampolines); return tramp; -} +} /* diff --git a/src/mono/mono/mini/mini-unwind.h b/src/mono/mono/mini/mini-unwind.h index ff594c49937f24..3db2f45e9cb2b9 100644 --- a/src/mono/mono/mini/mini-unwind.h +++ b/src/mono/mono/mini/mini-unwind.h @@ -19,7 +19,7 @@ #endif /* - * This is a platform-independent interface for unwinding through stack frames + * This is a platform-independent interface for unwinding through stack frames * based on the Dwarf unwinding interface. * See http://dwarfstd.org/Dwarf3.pdf, section "Call Frame Information". */ @@ -89,7 +89,7 @@ typedef struct { guint32 when; /* The offset _after_ the cpu instruction this unwind op belongs to */ } MonoUnwindOp; -/* +/* * Macros for emitting MonoUnwindOp structures. * These should be called _after_ emitting the cpu instruction the unwind op * belongs to. @@ -178,7 +178,7 @@ guint8* mono_unwind_ops_encode (GSList *unwind_ops, guint32 *out_len); gboolean -mono_unwind_frame (guint8 *unwind_info, guint32 unwind_info_len, +mono_unwind_frame (guint8 *unwind_info, guint32 unwind_info_len, guint8 *start_ip, guint8 *end_ip, guint8 *ip, guint8 **mark_locations, mono_unwind_reg_t *regs, int nregs, host_mgreg_t **save_locations, int save_locations_len, diff --git a/src/mono/mono/mini/mini-wasm.c b/src/mono/mono/mini/mini-wasm.c index 82c8b1fcd6572b..f341690dd7d590 100644 --- a/src/mono/mono/mini/mini-wasm.c +++ b/src/mono/mono/mini/mini-wasm.c @@ -535,7 +535,7 @@ gboolean MONO_SIG_HANDLER_SIGNATURE (mono_chain_signal) { g_error ("mono_chain_signal"); - + return FALSE; } @@ -784,7 +784,7 @@ mono_arch_load_function (MonoJitICallId jit_icall_id) return NULL; } -MONO_API void +MONO_API void mono_wasm_enable_debugging (int log_level) { mono_wasm_debug_level = log_level; diff --git a/src/mono/mono/mini/mini-wasm.h b/src/mono/mono/mini/mini-wasm.h index c98f7603828d5a..d307077de1c337 100644 --- a/src/mono/mono/mini/mini-wasm.h +++ b/src/mono/mono/mini/mini-wasm.h @@ -45,7 +45,7 @@ #define MONO_ARCH_INST_SREG2_MASK(ins) 0 struct MonoLMF { - /* + /* * If the second lowest bit is set to 1, then this is a MonoLMFExt structure, and * the other fields are not valid. */ @@ -108,4 +108,4 @@ void mono_wasm_print_stack_trace (void); gboolean mini_wasm_is_scalar_vtype (MonoType *type); -#endif /* __MONO_MINI_WASM_H__ */ +#endif /* __MONO_MINI_WASM_H__ */ diff --git a/src/mono/mono/mini/mini-x86-gsharedvt.c b/src/mono/mono/mini/mini-x86-gsharedvt.c index d2d4b09d298340..93b86d8cc7afbb 100644 --- a/src/mono/mono/mini/mini-x86-gsharedvt.c +++ b/src/mono/mono/mini/mini-x86-gsharedvt.c @@ -98,7 +98,7 @@ mono_arch_get_gsharedvt_call_info (MonoMemoryManager *mem_manager, gpointer addr * Map ret arg. * This handles the case when the method returns a normal vtype, and when it returns a type arg, and its instantiated * with a vtype. - */ + */ g_ptr_array_add (map, GUINT_TO_POINTER (caller_cinfo->vret_arg_offset / sizeof (target_mgreg_t))); g_ptr_array_add (map, GUINT_TO_POINTER (callee_cinfo->vret_arg_offset / sizeof (target_mgreg_t))); } diff --git a/src/mono/mono/mini/mini-x86.c b/src/mono/mono/mini/mini-x86.c index 53a83263399bc5..e94494327c39ce 100644 --- a/src/mono/mono/mini/mini-x86.c +++ b/src/mono/mono/mini/mini-x86.c @@ -80,7 +80,7 @@ mono_arch_regname (int reg) case X86_EBX: return "%ebx"; case X86_ECX: return "%ecx"; case X86_EDX: return "%edx"; - case X86_ESP: return "%esp"; + case X86_ESP: return "%esp"; case X86_EBP: return "%ebp"; case X86_EDI: return "%edi"; case X86_ESI: return "%esi"; @@ -318,7 +318,7 @@ add_valuetype (MonoMethodSignature *sig, ArgInfo *ainfo, MonoType *type, * get_call_info: * * Obtain information about a call according to the calling convention. - * For x86 ELF, see the "System V Application Binary Interface Intel386 + * For x86 ELF, see the "System V Application Binary Interface Intel386 * Architecture Processor Supplment, Fourth Edition" document for more * information. * For x86 win32, see https://msdn.microsoft.com/en-us/library/984x0h58.aspx. @@ -435,7 +435,7 @@ get_call_info_internal (CallInfo *cinfo, MonoMethodSignature *sig) if (!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG) && (n == 0)) { fr = FLOAT_PARAM_REGS; - + /* Emit the signature cookie just before the implicit arguments */ add_general (&gr, param_regs, &stack_size, &cinfo->sig_cookie); } @@ -446,8 +446,8 @@ get_call_info_internal (CallInfo *cinfo, MonoMethodSignature *sig) if (!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG) && (i == sig->sentinelpos)) { /* We allways pass the sig cookie on the stack for simplicity */ - /* - * Prevent implicit arguments + the sig cookie from being passed + /* + * Prevent implicit arguments + the sig cookie from being passed * in registers. */ fr = FLOAT_PARAM_REGS; @@ -524,7 +524,7 @@ get_call_info_internal (CallInfo *cinfo, MonoMethodSignature *sig) if (!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG) && (n > 0) && (sig->sentinelpos == sig->param_count)) { fr = FLOAT_PARAM_REGS; - + /* Emit the signature cookie just before the implicit arguments */ add_general (&gr, param_regs, &stack_size, &cinfo->sig_cookie); } @@ -681,7 +681,7 @@ mono_arch_get_native_call_context_ret (CallContext *ccontext, gpointer frame, Mo * @arg_info: an array to store the result infos * * Gathers information on parameters such as size, alignment and - * padding. arg_info should be large enought to hold param_count + 1 entries. + * padding. arg_info should be large enought to hold param_count + 1 entries. * * Returns the size of the argument area on the stack. * This should be signal safe, since it is called from @@ -738,7 +738,7 @@ mono_arch_get_argument_info (MonoMethodSignature *csig, int param_count, MonoJit /* ignore alignment for now */ align = 1; - args_size += pad = (align - (args_size & (align - 1))) & (align - 1); + args_size += pad = (align - (args_size & (align - 1))) & (align - 1); arg_info [prev_stackarg].pad = pad; args_size += size; arg_info [k + 1].pad = 0; @@ -962,7 +962,7 @@ mono_arch_is_int_overflow (void *sigctx, void *info) if (reg == -1) return TRUE; } - + return FALSE; } @@ -980,11 +980,11 @@ mono_arch_get_allocatable_int_vars (MonoCompile *cfg) if (vmv->range.first_use.abs_pos >= vmv->range.last_use.abs_pos) continue; - if ((ins->flags & (MONO_INST_IS_DEAD|MONO_INST_VOLATILE|MONO_INST_INDIRECT)) || + if ((ins->flags & (MONO_INST_IS_DEAD|MONO_INST_VOLATILE|MONO_INST_INDIRECT)) || (ins->opcode != OP_LOCAL && ins->opcode != OP_ARG)) continue; - /* we dont allocate I1 to registers because there is no simply way to sign extend + /* we dont allocate I1 to registers because there is no simply way to sign extend * 8bit quantities in caller saved registers on x86 */ if (mono_is_regsize_var (ins->inst_vtype) && (ins->inst_vtype->type != MONO_TYPE_I1)) { g_assert (MONO_VARINFO (cfg, i)->reg == -1); @@ -1014,7 +1014,7 @@ mono_arch_get_global_int_regs (MonoCompile *cfg) /* * mono_arch_regalloc_cost: * - * Return the cost, in number of memory references, of the action of + * Return the cost, in number of memory references, of the action of * allocating the variable VMV into a register during global register * allocation. */ @@ -1219,7 +1219,7 @@ mono_arch_allocate_vars (MonoCompile *cfg) switch (cinfo->ret.storage) { case ArgOnStack: if (cfg->vret_addr) { - /* + /* * In the new IR, the cfg->vret_addr variable represents the * vtype return value. */ @@ -1348,9 +1348,9 @@ emit_sig_cookie (MonoCompile *cfg, MonoCallInst *call, CallInfo *cinfo) int sig_reg; /* - * mono_ArgIterator_Setup assumes the signature cookie is + * mono_ArgIterator_Setup assumes the signature cookie is * passed first and all the arguments which were before it are - * passed on the stack after the signature. So compensate by + * passed on the stack after the signature. So compensate by * passing a different signature. */ tmp_sig = mono_metadata_signature_dup (call->signature); @@ -1387,7 +1387,7 @@ mono_arch_get_llvm_call_info (MonoCompile *cfg, MonoMethodSignature *sig) /* * LLVM always uses the native ABI while we use our own ABI, the * only difference is the handling of vtypes: - * - we only pass/receive them in registers in some cases, and only + * - we only pass/receive them in registers in some cases, and only * in 1 or 2 integer registers. */ if (cinfo->ret.storage == ArgValuetypeInReg) { @@ -1516,7 +1516,7 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call) if (cinfo->ret.storage == ArgValuetypeInReg && cinfo->ret.pair_storage[0] != ArgNone ) { /* * Tell the JIT to use a more efficient calling convention: call using - * OP_CALL, compute the result location after the call, and save the + * OP_CALL, compute the result location after the call, and save the * result there. */ call->vret_in_reg = TRUE; @@ -1529,7 +1529,7 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call) } } - // FIXME: Emit EMIT_NEW_GC_PARAM_SLOT_LIVENESS_DEF everywhere + // FIXME: Emit EMIT_NEW_GC_PARAM_SLOT_LIVENESS_DEF everywhere /* Handle the case where there are no implicit arguments */ if (!sig->pinvoke && (sig->call_convention == MONO_CALL_VARARG) && (n == sentinelpos)) { @@ -1683,7 +1683,7 @@ mono_arch_emit_call (MonoCompile *cfg, MonoCallInst *call) vtarg->sreg1 = call->inst.dreg; vtarg->dreg = mono_alloc_ireg (cfg); MONO_ADD_INS (cfg->cbb, vtarg); - + mono_call_inst_add_outarg_reg (cfg, call, vtarg->dreg, cinfo->ret.reg, FALSE); } else if (cinfo->vtype_retaddr && cinfo->vret_arg_index == 0) { MONO_EMIT_NEW_STORE_MEMBASE (cfg, OP_STORE_MEMBASE_REG, X86_ESP, cinfo->ret.offset, call->vret_var->dreg); @@ -1768,7 +1768,7 @@ mono_arch_emit_setret (MonoCompile *cfg, MonoMethod *method, MonoInst *val) return; } } - + MONO_EMIT_NEW_UNALU (cfg, OP_MOVE, cfg->ret->dreg, val->dreg); } @@ -1784,9 +1784,9 @@ if (ins->inst_true_bb->native_offset) { \ x86_branch32 (code, cond, 0, sign); \ } -/* +/* * Emit an exception if condition is fail and - * if possible do a directly branch to target + * if possible do a directly branch to target */ #define EMIT_COND_SYSTEM_EXCEPTION(cond,signed,exc_name) \ do { \ @@ -1798,12 +1798,12 @@ if (ins->inst_true_bb->native_offset) { \ } else { \ EMIT_COND_BRANCH (tins, cond, signed); \ } \ - } while (0); + } while (0); #define EMIT_FPCOMPARE(code) do { \ x86_fcompp (code); \ x86_fnstsw (code); \ -} while (0); +} while (0); static guint8* x86_align_and_patch (MonoCompile *cfg, guint8 *code, guint32 patch_type, gconstpointer data) @@ -1862,7 +1862,7 @@ mono_arch_peephole_pass_1 (MonoCompile *cfg, MonoBasicBlock *bb) case OP_IADD_IMM: case OP_ADD_IMM: if ((ins->sreg1 < MONO_MAX_IREGS) && (ins->dreg >= MONO_MAX_IREGS)) { - /* + /* * X86_LEA is like ADD, but doesn't have the * sreg1==dreg restriction. */ @@ -1882,15 +1882,15 @@ mono_arch_peephole_pass_1 (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_COMPARE_IMM: case OP_ICOMPARE_IMM: - /* OP_COMPARE_IMM (reg, 0) - * --> - * OP_X86_TEST_NULL (reg) + /* OP_COMPARE_IMM (reg, 0) + * --> + * OP_X86_TEST_NULL (reg) */ if (!ins->inst_imm) ins->opcode = OP_X86_TEST_NULL; break; case OP_X86_COMPARE_MEMBASE_IMM: - /* + /* * OP_STORE_MEMBASE_REG reg, offset(basereg) * OP_X86_COMPARE_MEMBASE_IMM offset(basereg), imm * --> @@ -1910,7 +1910,7 @@ mono_arch_peephole_pass_1 (MonoCompile *cfg, MonoBasicBlock *bb) ins->opcode = OP_X86_TEST_NULL; } - break; + break; case OP_X86_PUSH_MEMBASE: if (last_ins && (last_ins->opcode == OP_STOREI4_MEMBASE_REG || last_ins->opcode == OP_STORE_MEMBASE_REG) && @@ -1943,8 +1943,8 @@ mono_arch_peephole_pass_2 (MonoCompile *cfg, MonoBasicBlock *bb) ins->sreg1 = ins->dreg; ins->sreg2 = ins->dreg; - /* - * Convert succeeding STORE_MEMBASE_IMM 0 ins to STORE_MEMBASE_REG + /* + * Convert succeeding STORE_MEMBASE_IMM 0 ins to STORE_MEMBASE_REG * since it takes 3 bytes instead of 7. */ for (ins2 = mono_inst_next (ins, FILTER_IL_SEQ_POINT); ins2; ins2 = ins2->next) { @@ -1998,7 +1998,7 @@ mono_arch_lowering_pass (MonoCompile *cfg, MonoBasicBlock *bb) MonoInst *ins, *next; /* - * FIXME: Need to add more instructions, but the current machine + * FIXME: Need to add more instructions, but the current machine * description can't model some parts of the composite instructions like * cdq. */ @@ -2008,7 +2008,7 @@ mono_arch_lowering_pass (MonoCompile *cfg, MonoBasicBlock *bb) case OP_IDIV_IMM: case OP_IDIV_UN_IMM: case OP_IREM_UN_IMM: - /* + /* * Keep the cases where we could generated optimized code, otherwise convert * to the non-imm variant. */ @@ -2049,7 +2049,7 @@ mono_arch_lowering_pass (MonoCompile *cfg, MonoBasicBlock *bb) bb->max_vreg = cfg->next_vreg; } -static const int +static const int branch_cc_table [] = { X86_CC_EQ, X86_CC_GE, X86_CC_GT, X86_CC_LE, X86_CC_LT, X86_CC_NE, X86_CC_GE, X86_CC_GT, X86_CC_LE, X86_CC_LT, @@ -2099,7 +2099,7 @@ emit_float_to_int (MonoCompile *cfg, guchar *code, int dreg, int size, gboolean x86_alu_reg_imm (code, X86_SUB, X86_ESP, 8); x86_fist_pop_membase (code, X86_ESP, 0, TRUE); x86_pop_reg (code, dreg); - /* FIXME: need the high register + /* FIXME: need the high register * x86_pop_reg (code, dreg_high); */ } else { @@ -2151,7 +2151,7 @@ mono_emit_stack_alloc (MonoCompile *cfg, guchar *code, MonoInst* tree) x86_alu_reg_imm (code, X86_SUB, X86_ESP, 0x1000); x86_test_membase_reg (code, X86_ESP, 0, X86_ESP); - /* + /* * By the end of the loop, sreg2 is smaller than 0x1000, so the init routine * that follows only initializes the last part of the area. */ @@ -2161,7 +2161,7 @@ mono_emit_stack_alloc (MonoCompile *cfg, guchar *code, MonoInst* tree) x86_push_reg (code, X86_ECX); x86_push_reg (code, X86_EDI); x86_mov_reg_imm (code, X86_ECX, (0x1000 >> 2)); - x86_alu_reg_reg (code, X86_XOR, X86_EAX, X86_EAX); + x86_alu_reg_reg (code, X86_XOR, X86_EAX, X86_EAX); if (cfg->param_area) x86_lea_membase (code, X86_EDI, X86_ESP, 12 + ALIGN_TO (cfg->param_area, MONO_ARCH_FRAME_ALIGNMENT)); else @@ -2206,11 +2206,11 @@ mono_emit_stack_alloc (MonoCompile *cfg, guchar *code, MonoInst* tree) x86_push_reg (code, X86_EDI); offset += 4; } - + x86_shift_reg_imm (code, X86_SHR, sreg, 2); x86_mov_reg_reg (code, X86_ECX, sreg); x86_alu_reg_reg (code, X86_XOR, X86_EAX, X86_EAX); - + if (cfg->param_area) x86_lea_membase (code, X86_EDI, X86_ESP, offset + ALIGN_TO (cfg->param_area, MONO_ARCH_FRAME_ALIGNMENT)); else @@ -2218,7 +2218,7 @@ mono_emit_stack_alloc (MonoCompile *cfg, guchar *code, MonoInst* tree) x86_cld (code); x86_prefix (code, X86_REP_PREFIX); x86_stosl (code); - + if (tree->dreg != X86_EDI && sreg != X86_EDI) x86_pop_reg (code, X86_EDI); if (tree->dreg != X86_ECX && sreg != X86_ECX) @@ -2641,7 +2641,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /* Have to use ecx as a temp reg since this can occur after OP_SETRET */ - /* + /* * We do this _before_ the breakpoint, so single stepping after * a breakpoint is hit will step to the next IL offset. */ @@ -2680,7 +2680,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) int size = start + OP_SEQ_POINT_BP_OFFSET - code; x86_padding (code, size); } - /* + /* * A placeholder for a possible breakpoint inserted by * mono_arch_set_breakpoint (). */ @@ -2738,7 +2738,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_IDIV: case OP_IREM: - /* + /* * The code is the same for div/rem, the allocator will allocate dreg * to RAX/RDX as appropriate. */ @@ -2747,7 +2747,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) x86_push_reg (code, ins->sreg2); x86_cdq (code); x86_div_membase (code, X86_ESP, 0, TRUE); - x86_alu_reg_imm (code, X86_ADD, X86_ESP, 4); + x86_alu_reg_imm (code, X86_ADD, X86_ESP, 4); } else { x86_cdq (code); x86_div_reg (code, ins->sreg2, TRUE); @@ -2759,7 +2759,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) x86_push_reg (code, ins->sreg2); x86_alu_reg_reg (code, X86_XOR, X86_EDX, X86_EDX); x86_div_membase (code, X86_ESP, 0, FALSE); - x86_alu_reg_imm (code, X86_ADD, X86_ESP, 4); + x86_alu_reg_imm (code, X86_ADD, X86_ESP, 4); } else { x86_alu_reg_reg (code, X86_XOR, X86_EDX, X86_EDX); x86_div_reg (code, ins->sreg2, FALSE); @@ -2781,7 +2781,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /* Based on http://compilers.iecc.com/comparch/article/93-04-079 */ x86_cdq (code); x86_alu_reg_imm (code, X86_AND, X86_EAX, 1); - /* + /* * If the divident is >= 0, this does not nothing. If it is positive, it * it transforms %eax=0 into %eax=0, and %eax=1 into %eax=-1. */ @@ -2854,7 +2854,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /* handle shift over 32 bit */ x86_mov_reg_reg (code, ins->backend.reg3, ins->sreg1); x86_clear_reg (code, ins->sreg1); - + x86_patch (jump_to_end, code); } break; @@ -2871,7 +2871,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /* handle shifts over 31 bits */ x86_mov_reg_reg (code, ins->sreg1, ins->backend.reg3); x86_shift_reg_imm (code, X86_SAR, ins->backend.reg3, 31); - + x86_patch (jump_to_end, code); } break; @@ -2888,7 +2888,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /* handle shifts over 31 bits */ x86_mov_reg_reg (code, ins->sreg1, ins->backend.reg3); x86_clear_reg (code, ins->backend.reg3); - + x86_patch (jump_to_end, code); } break; @@ -3128,7 +3128,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) x86_mov_reg_membase (code, X86_EAX, X86_ESP, i, 4); x86_mov_membase_reg (code, X86_EBP, 8 + i, X86_EAX, 4); } - + /* restore ESP/EBP */ x86_leave (code); @@ -3315,13 +3315,13 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_BR: if (ins->inst_target_bb->native_offset) { - x86_jump_code (code, cfg->native_code + ins->inst_target_bb->native_offset); + x86_jump_code (code, cfg->native_code + ins->inst_target_bb->native_offset); } else { mono_add_patch_info (cfg, offset, MONO_PATCH_INFO_BB, ins->inst_target_bb); if ((cfg->opt & MONO_OPT_BRANCH) && x86_is_imm8 (ins->inst_target_bb->max_offset - cpos)) x86_jump8 (code, 0); - else + else x86_jump32 (code, 0); } break; @@ -3545,7 +3545,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) x86_fld_membase (code, X86_ESP, 0, FALSE); x86_alu_reg_imm (code, X86_ADD, X86_ESP, 8); break; - case OP_LCONV_TO_R_UN_2: { + case OP_LCONV_TO_R_UN_2: { static guint8 mn[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x40 }; guint8 *br; @@ -3553,11 +3553,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) x86_push_reg (code, ins->sreg2); x86_push_reg (code, ins->sreg1); x86_fild_membase (code, X86_ESP, 0, TRUE); - + /* test if lreg is negative */ x86_test_reg_reg (code, ins->sreg2, ins->sreg2); br = code; x86_branch8 (code, X86_CC_GEZ, 0, TRUE); - + /* add correction constant mn */ if (cfg->compile_aot) { x86_push_imm (code, (((guint32)mn [9]) << 24) | ((guint32)mn [8] << 16) | ((guint32)mn [7] << 8) | ((guint32)mn [6])); @@ -3585,7 +3585,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) guint8 *br [3], *label [1]; MonoInst *tins; - /* + /* * Valid ints: 0xffffffff:8000000 to 00000000:0x7f000000 */ x86_test_reg_reg (code, ins->sreg1, ins->sreg1); @@ -3609,12 +3609,12 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) mono_add_patch_info (cfg, code - cfg->native_code, MONO_PATCH_INFO_EXC, "OverflowException"); x86_jump32 (code, 0); } - - + + x86_patch (br [0], code); /* our top bit is set, check that top word is 0xfffffff */ x86_alu_reg_imm (code, X86_CMP, ins->sreg2, 0xffffffff); - + x86_patch (br [1], code); /* nope, emit exception */ br [2] = code; x86_branch8 (code, X86_CC_NE, 0, TRUE); @@ -3639,23 +3639,23 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_FSUB: x86_fp_op_reg (code, X86_FSUB, 1, TRUE); - break; + break; case OP_FMUL: x86_fp_op_reg (code, X86_FMUL, 1, TRUE); - break; + break; case OP_FDIV: x86_fp_op_reg (code, X86_FDIV, 1, TRUE); - break; + break; case OP_FNEG: x86_fchs (code); - break; + break; case OP_ABS: x86_fabs (code); - break; + break; case OP_TAN: { - /* + /* * it really doesn't make sense to inline all this code, - * it's here just to show that things may not be as simple + * it's here just to show that things may not be as simple * as they appear. */ guchar *check_pos, *end_tan, *pop_jump; @@ -3692,7 +3692,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) x86_fpatan (code); x86_fldz (code); x86_fp_op_reg (code, X86_FADD, 1, TRUE); - break; + break; case OP_SQRT: x86_fsqrt (code); break; @@ -3736,7 +3736,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /* we need to exchange ST(0) with ST(1) */ x86_fxch (code, 1); - /* this requires a loop, because fprem somtimes + /* this requires a loop, because fprem somtimes * returns a partial remainder */ l1 = code; /* looks like MS is using fprem instead of the IEEE compatible fprem1 */ @@ -3767,7 +3767,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_FCEQ: case OP_FCNEQ: if (cfg->opt & MONO_OPT_FCMOV) { - /* zeroing the register at the start results in + /* zeroing the register at the start results in * shorter and faster code (we can also remove the widening op) */ guchar *unordered_check; @@ -3791,7 +3791,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; } - if (ins->dreg != X86_EAX) + if (ins->dreg != X86_EAX) x86_push_reg (code, X86_EAX); EMIT_FPCOMPARE(code); @@ -3800,13 +3800,13 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) x86_set_reg (code, ins->opcode == OP_FCEQ ? X86_CC_EQ : X86_CC_NE, ins->dreg, TRUE); x86_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE); - if (ins->dreg != X86_EAX) + if (ins->dreg != X86_EAX) x86_pop_reg (code, X86_EAX); break; case OP_FCLT: case OP_FCLT_UN: if (cfg->opt & MONO_OPT_FCMOV) { - /* zeroing the register at the start results in + /* zeroing the register at the start results in * shorter and faster code (we can also remove the widening op) */ x86_alu_reg_reg (code, X86_XOR, ins->dreg, ins->dreg); @@ -3827,7 +3827,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) } break; } - if (ins->dreg != X86_EAX) + if (ins->dreg != X86_EAX) x86_push_reg (code, X86_EAX); EMIT_FPCOMPARE(code); @@ -3846,7 +3846,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) x86_set_reg (code, X86_CC_EQ, ins->dreg, TRUE); x86_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE); - if (ins->dreg != X86_EAX) + if (ins->dreg != X86_EAX) x86_pop_reg (code, X86_EAX); break; case OP_FCLE: { @@ -3890,7 +3890,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_FCGT: case OP_FCGT_UN: if (cfg->opt & MONO_OPT_FCMOV) { - /* zeroing the register at the start results in + /* zeroing the register at the start results in * shorter and faster code (we can also remove the widening op) */ guchar *unordered_check; @@ -3907,7 +3907,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) } break; } - if (ins->dreg != X86_EAX) + if (ins->dreg != X86_EAX) x86_push_reg (code, X86_EAX); EMIT_FPCOMPARE(code); @@ -3921,13 +3921,13 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) x86_jump8 (code, 0); x86_patch (is_not_zero_check, code); x86_alu_reg_imm (code, X86_CMP, X86_EAX, X86_FP_CC_MASK); - + x86_patch (end_jump, code); } x86_set_reg (code, X86_CC_EQ, ins->dreg, TRUE); x86_widen_reg (code, ins->dreg, ins->dreg, FALSE, FALSE); - if (ins->dreg != X86_EAX) + if (ins->dreg != X86_EAX) x86_pop_reg (code, X86_EAX); break; case OP_FCGE: { @@ -4114,7 +4114,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) br1 = code; x86_branch8 (code, X86_CC_NE, 0, FALSE); - x86_fstp (code, 0); + x86_fstp (code, 0); EMIT_COND_SYSTEM_EXCEPTION (X86_CC_EQ, FALSE, "OverflowException"); x86_patch (br1, code); @@ -4172,7 +4172,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) x86_xadd_membase_reg (code, ins->inst_basereg, ins->inst_offset, dreg, 4); /* dreg contains the old value, add with sreg2 value */ x86_alu_reg_reg (code, X86_ADD, dreg, ins->sreg2); - + if (ins->dreg != dreg) { x86_mov_reg_reg (code, ins->dreg, dreg); x86_pop_reg (code, dreg); @@ -4188,11 +4188,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) g_assert (cfg->has_atomic_exchange_i4); /* cmpxchg uses eax as comperand, need to make sure we can use it - * hack to overcome limits in x86 reg allocator - * (req: dreg == eax and sreg2 != eax and breg != eax) + * hack to overcome limits in x86 reg allocator + * (req: dreg == eax and sreg2 != eax and breg != eax) */ g_assert (ins->dreg == X86_EAX); - + /* We need the EAX reg for the cmpxchg */ if (ins->sreg2 == X86_EAX) { sreg2 = (breg == X86_EDX) ? X86_EBX : X86_EDX; @@ -4417,11 +4417,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_SHUFPS: g_assert (ins->inst_c0 >= 0 && ins->inst_c0 <= 0xFF); x86_sse_alu_reg_reg_imm8 (code, X86_SSE_SHUFP, ins->sreg1, ins->sreg2, ins->inst_c0); - break; + break; case OP_SHUFPD: g_assert (ins->inst_c0 >= 0 && ins->inst_c0 <= 0x3); x86_sse_alu_pd_reg_reg_imm8 (code, X86_SSE_SHUFP, ins->sreg1, ins->sreg2, ins->inst_c0); - break; + break; case OP_ADDPD: x86_sse_alu_pd_reg_reg (code, X86_SSE_ADD, ins->sreg1, ins->sreg2); @@ -4472,11 +4472,11 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_DUPPD: x86_sse_alu_sd_reg_reg (code, X86_SSE_MOVDDUP, ins->dreg, ins->sreg1); break; - + case OP_EXTRACT_MASK: x86_sse_alu_pd_reg_reg (code, X86_SSE_PMOVMSKB, ins->dreg, ins->sreg1); break; - + case OP_PAND: x86_sse_alu_pd_reg_reg (code, X86_SSE_PAND, ins->sreg1, ins->sreg2); break; @@ -4522,7 +4522,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_PMAXD_UN: x86_sse_alu_sse41_reg_reg (code, X86_SSE_PMAXUD, ins->sreg1, ins->sreg2); break; - + case OP_PMAXB: x86_sse_alu_sse41_reg_reg (code, X86_SSE_PMAXSB, ins->sreg1, ins->sreg2); break; @@ -4666,7 +4666,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_PSUBW_SAT: x86_sse_alu_pd_reg_reg (code, X86_SSE_PSUBSW, ins->sreg1, ins->sreg2); break; - + case OP_PMULW: x86_sse_alu_pd_reg_reg (code, X86_SSE_PMULLW, ins->sreg1, ins->sreg2); break; @@ -4737,8 +4737,8 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) break; case OP_PSHLQ_REG: x86_sse_shift_reg_reg (code, X86_SSE_PSLLQ_REG, ins->dreg, ins->sreg2); - break; - + break; + case OP_ICONV_TO_X: x86_movd_xreg_reg (code, ins->dreg, ins->sreg1); break; @@ -4831,7 +4831,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) /*FIXME the peephole pass should have killed this*/ if (ins->dreg != ins->sreg1) x86_movaps_reg_reg (code, ins->dreg, ins->sreg1); - break; + break; case OP_XZERO: x86_sse_alu_pd_reg_reg (code, X86_SSE_PXOR, ins->dreg, ins->dreg); break; @@ -4859,7 +4859,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) case OP_FCONV_TO_U2: x86_widen_reg (code, ins->dreg, ins->dreg, FALSE, TRUE); break; - } + } break; case OP_EXPAND_I2: @@ -4965,7 +4965,7 @@ mono_arch_output_basic_block (MonoCompile *cfg, MonoBasicBlock *bb) mono_inst_name (ins->opcode), max_len, code - cfg->native_code - offset); g_assert_not_reached (); } - + cpos += max_len; } @@ -5275,7 +5275,7 @@ mono_arch_emit_epilog (MonoCompile *cfg) /* the code restoring the registers must be kept in sync with OP_TAILCALL */ pos = 0; - + if (method->save_lmf) { gint32 lmf_offset = cfg->lmf_var->inst_offset; @@ -5376,7 +5376,7 @@ mono_arch_emit_exceptions (MonoCompile *cfg) exc_count++; } - /* + /* * make sure we have enough space for exceptions * 16 is the size of two push_imm instructions and a call */ @@ -5470,7 +5470,7 @@ mono_arch_flush_register_windows (void) { } -gboolean +gboolean mono_arch_is_inst_imm (int opcode, int imm_opcode, gint64 imm) { return TRUE; @@ -5689,7 +5689,7 @@ mono_arch_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMetho } else if (strcmp (cmethod->name, "Round") == 0 && fsig->param_count == 1 && fsig->params [0]->type == MONO_TYPE_R8) { opcode = OP_ROUND; } - + if (opcode && fsig->param_count == 1) { MONO_INST_NEW (cfg, ins, opcode); ins->type = STACK_R8; @@ -5707,7 +5707,7 @@ mono_arch_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMetho } else if (strcmp (cmethod->name, "Max") == 0) { if (fsig->params [0]->type == MONO_TYPE_I4) opcode = OP_IMAX; - } + } if (opcode && fsig->param_count == 2) { MONO_INST_NEW (cfg, ins, opcode); @@ -5860,7 +5860,7 @@ get_delegate_invoke_impl (MonoTrampInfo **info, gboolean has_target, guint32 par * and we need: * * - * + * * without unbalancing the stack. * So move each arg up a spot in the stack (overwriting un-needed 'this' arg) * and leaving original spot of first arg as placeholder in stack so @@ -6133,12 +6133,12 @@ get_float_to_x_spill_area (MonoCompile *cfg) if (!cfg->fconv_to_r8_x_var) { cfg->fconv_to_r8_x_var = mono_compile_create_var (cfg, m_class_get_byval_arg (mono_defaults.double_class), OP_LOCAL); cfg->fconv_to_r8_x_var->flags |= MONO_INST_VOLATILE; /*FIXME, use the don't regalloc flag*/ - } + } return cfg->fconv_to_r8_x_var; } /* - * Convert all fconv opts that MONO_OPT_SSE2 would get wrong. + * Convert all fconv opts that MONO_OPT_SSE2 would get wrong. */ void mono_arch_decompose_opts (MonoCompile *cfg, MonoInst *ins) @@ -6203,12 +6203,12 @@ mono_arch_decompose_long_opts (MonoCompile *cfg, MonoInst *long_ins) if (!(cfg->opt & MONO_OPT_SIMD)) return; - - /*TODO move this to simd-intrinsic.c once we support sse 4.1 dword extractors since we need the runtime caps info */ + + /*TODO move this to simd-intrinsic.c once we support sse 4.1 dword extractors since we need the runtime caps info */ switch (long_ins->opcode) { case OP_EXTRACT_I8: vreg = long_ins->sreg1; - + if (long_ins->inst_c0) { MONO_INST_NEW (cfg, ins, OP_PSHUFLED); ins->klass = long_ins->klass; @@ -6218,14 +6218,14 @@ mono_arch_decompose_long_opts (MonoCompile *cfg, MonoInst *long_ins) ins->dreg = vreg = alloc_ireg (cfg); MONO_ADD_INS (cfg->cbb, ins); } - + MONO_INST_NEW (cfg, ins, OP_EXTRACT_I4); ins->klass = mono_defaults.int32_class; ins->sreg1 = vreg; ins->type = STACK_I4; ins->dreg = MONO_LVREG_LS (long_ins->dreg); MONO_ADD_INS (cfg->cbb, ins); - + MONO_INST_NEW (cfg, ins, OP_PSHUFLED); ins->klass = long_ins->klass; ins->sreg1 = long_ins->sreg1; @@ -6233,14 +6233,14 @@ mono_arch_decompose_long_opts (MonoCompile *cfg, MonoInst *long_ins) ins->type = STACK_VTYPE; ins->dreg = vreg = alloc_ireg (cfg); MONO_ADD_INS (cfg->cbb, ins); - + MONO_INST_NEW (cfg, ins, OP_EXTRACT_I4); ins->klass = mono_defaults.int32_class; ins->sreg1 = vreg; ins->type = STACK_I4; ins->dreg = MONO_LVREG_MS (long_ins->dreg); MONO_ADD_INS (cfg->cbb, ins); - + long_ins->opcode = OP_NOP; break; case OP_INSERTX_I8_SLOW: @@ -6301,8 +6301,8 @@ guint8* mono_arch_emit_load_got_addr (guint8 *start, guint8 *code, MonoCompile *cfg, MonoJumpInfo **ji) { x86_call_imm (code, 0); - /* - * The patch needs to point to the pop, since the GOT offset needs + /* + * The patch needs to point to the pop, since the GOT offset needs * to be added to that address. */ if (cfg) @@ -6321,7 +6321,7 @@ mono_arch_emit_load_got_addr (guint8 *start, guint8 *code, MonoCompile *cfg, Mon * * Emit code to load the contents of the GOT slot identified by TRAMP_TYPE and * TARGET from the mscorlib GOT in full-aot code. - * On x86, the GOT address is assumed to be in EBX, and the result is placed into + * On x86, the GOT address is assumed to be in EBX, and the result is placed into * EAX. */ guint8* @@ -6385,7 +6385,7 @@ mono_arch_clear_breakpoint (MonoJitInfo *ji, guint8 *ip) for (i = 0; i < 2; ++i) x86_nop (code); } - + /* * mono_arch_start_single_stepping: * @@ -6396,7 +6396,7 @@ mono_arch_start_single_stepping (void) { ss_trampoline = mini_get_single_step_trampoline (); } - + /* * mono_arch_stop_single_stepping: * diff --git a/src/mono/mono/mini/mini.c b/src/mono/mono/mini/mini.c index 2d6e3a22930f79..bf3a2d32822951 100644 --- a/src/mono/mono/mini/mini.c +++ b/src/mono/mono/mini/mini.c @@ -123,7 +123,7 @@ mono_emit_unwind_op (MonoCompile *cfg, int when, int tag, int reg, int val) op->reg = reg; op->val = val; op->when = when; - + cfg->unwind_ops = g_slist_append_mempool (cfg->mempool, cfg->unwind_ops, op); if (cfg->verbose_level > 1) { switch (tag) { @@ -219,7 +219,7 @@ mono_find_block_region_notry (MonoCompile *cfg, int offset) if ((clause->flags == MONO_EXCEPTION_CLAUSE_FILTER) && (offset >= clause->data.filter_offset) && (offset < (clause->handler_offset))) return ((i + 1) << 8) | MONO_REGION_FILTER | clause->flags; - + if (MONO_OFFSET_IN_HANDLER (clause, offset)) { if (clause->flags == MONO_EXCEPTION_CLAUSE_FINALLY) return ((i + 1) << 8) | MONO_REGION_FINALLY | clause->flags; @@ -244,13 +244,13 @@ mono_get_block_region_notry (MonoCompile *cfg, int region) { if ((region & (0xf << 4)) == MONO_REGION_TRY) { MonoMethodHeader *header = cfg->header; - + /* * This can happen if a try clause is nested inside a finally clause. */ int clause_index = (region >> 8) - 1; g_assert (clause_index >= 0 && clause_index < header->num_clauses); - + region = mono_find_block_region_notry (cfg, header->clauses [clause_index].try_offset); } @@ -302,7 +302,7 @@ mono_reverse_branch_op (guint32 opcode) OP_IBNE_UN, OP_IBLT, OP_IBLE, OP_IBGT, OP_IBGE, OP_IBEQ, OP_IBLT_UN, OP_IBLE_UN, OP_IBGT_UN, OP_IBGE_UN }; - + if (opcode >= CEE_BEQ && opcode <= CEE_BLT_UN) { opcode = reverse_map [opcode - CEE_BEQ]; } else if (opcode >= OP_FBEQ && opcode <= OP_FBLT_UN) { @@ -342,7 +342,7 @@ mono_type_to_store_membase (MonoCompile *cfg, MonoType *type) case MONO_TYPE_STRING: case MONO_TYPE_OBJECT: case MONO_TYPE_SZARRAY: - case MONO_TYPE_ARRAY: + case MONO_TYPE_ARRAY: return OP_STORE_MEMBASE_REG; case MONO_TYPE_I8: case MONO_TYPE_U8: @@ -403,7 +403,7 @@ mono_type_to_load_membase (MonoCompile *cfg, MonoType *type) case MONO_TYPE_STRING: case MONO_TYPE_OBJECT: case MONO_TYPE_SZARRAY: - case MONO_TYPE_ARRAY: + case MONO_TYPE_ARRAY: return OP_LOAD_MEMBASE; case MONO_TYPE_I8: case MONO_TYPE_U8: @@ -674,7 +674,7 @@ mono_compile_create_var_for_vreg (MonoCompile *cfg, MonoType *type, int opcode, if (mini_type_is_reference (type)) mono_mark_vreg_as_ref (cfg, vreg); #endif - + cfg->varinfo [num] = inst; cfg->vars [num].idx = num; @@ -698,12 +698,12 @@ mono_compile_create_var_for_vreg (MonoCompile *cfg, MonoType *type, int opcode, if (regpair) { MonoInst *tree; - /* + /* * These two cannot be allocated using create_var_for_vreg since that would * put it into the cfg->varinfo array, confusing many parts of the JIT. */ - /* + /* * Set flags to VOLATILE so SSA skips it. */ @@ -802,7 +802,7 @@ mono_mark_vreg_as_ref (MonoCompile *cfg, int vreg) memcpy (cfg->vreg_is_ref, tmp, size * sizeof (gboolean)); } cfg->vreg_is_ref [vreg] = TRUE; -} +} void mono_mark_vreg_as_mp (MonoCompile *cfg, int vreg) @@ -818,7 +818,7 @@ mono_mark_vreg_as_mp (MonoCompile *cfg, int vreg) memcpy (cfg->vreg_is_mp, tmp, size * sizeof (gboolean)); } cfg->vreg_is_mp [vreg] = TRUE; -} +} static MonoType* type_from_stack_type (MonoInst *ins) @@ -829,7 +829,7 @@ type_from_stack_type (MonoInst *ins) case STACK_PTR: return mono_get_int_type (); case STACK_R8: return m_class_get_byval_arg (mono_defaults.double_class); case STACK_MP: - /* + /* * this if used to be commented without any specific reason, but * it breaks #80235 when commented */ @@ -915,7 +915,7 @@ mono_add_ins_to_end (MonoBasicBlock *bb, MonoInst *inst) mono_bblock_insert_before_ins (bb, bb->last_ins->prev, inst); } else { mono_bblock_insert_before_ins (bb, bb->last_ins, inst); - } + } } } else @@ -933,7 +933,7 @@ mono_create_jump_table (MonoCompile *cfg, MonoInst *label, MonoBasicBlock **bbs, table = (MonoJumpInfoBBTable *)mono_mempool_alloc (cfg->mempool, sizeof (MonoJumpInfoBBTable)); table->table = bbs; table->table_size = num_blocks; - + ji->ip.label = label; ji->type = MONO_PATCH_INFO_SWITCH; ji->data.table = table; @@ -958,7 +958,7 @@ typedef struct { GSList *slots; } StackSlotInfo; -static gint +static gint compare_by_interval_start_pos_func (gconstpointer a, gconstpointer b) { MonoMethodVar *v1 = (MonoMethodVar*)a; @@ -1199,11 +1199,11 @@ mono_allocate_stack_slots2 (MonoCompile *cfg, gboolean backward, guint32 *stack_ } } - /* + /* * This also handles the case when the variable is used in an * exception region, as liveness info is not computed there. */ - /* + /* * FIXME: All valuetypes are marked as INDIRECT because of LDADDR * opcodes. */ @@ -1438,7 +1438,7 @@ mono_allocate_stack_slots (MonoCompile *cfg, gboolean backward, guint32 *stack_s slot = 0xffffff; if (cfg->comp_done & MONO_COMP_LIVENESS) { //printf ("START %2d %08x %08x\n", vmv->idx, vmv->range.first_use.abs_pos, vmv->range.last_use.abs_pos); - + /* expire old intervals in active */ while (slot_info->active) { MonoMethodVar *amv = (MonoMethodVar *)slot_info->active->data; @@ -1452,11 +1452,11 @@ mono_allocate_stack_slots (MonoCompile *cfg, gboolean backward, guint32 *stack_s slot_info->slots = g_slist_prepend_mempool (cfg->mempool, slot_info->slots, GINT_TO_POINTER (offsets [amv->idx])); } - /* + /* * This also handles the case when the variable is used in an * exception region, as liveness info is not computed there. */ - /* + /* * FIXME: All valuetypes are marked as INDIRECT because of LDADDR * opcodes. */ @@ -1507,7 +1507,7 @@ mono_allocate_stack_slots (MonoCompile *cfg, gboolean backward, guint32 *stack_s if (MONO_TYPE_ISSTRUCT (t)) { align = MAX (align, sizeof (target_mgreg_t)); align = MAX (align, mono_class_min_align (mono_class_from_mono_type_internal (t))); - /* + /* * Align the size too so the code generated for passing vtypes in * registers doesn't overwrite random locals. */ @@ -1746,7 +1746,7 @@ mono_verify_cfg (MonoCompile *cfg) // This will free many fields in cfg to save // memory. Note that this must be safe to call -// multiple times. It must be idempotent. +// multiple times. It must be idempotent. void mono_empty_compile (MonoCompile *cfg) { @@ -1891,7 +1891,7 @@ mono_compile_create_vars (MonoCompile *cfg) header = cfg->header; sig = mono_method_signature_internal (cfg->method); - + if (!MONO_TYPE_IS_VOID (sig->ret)) { cfg->ret = mono_compile_create_var (cfg, sig->ret, OP_ARG); /* Inhibit optimizations */ @@ -1969,7 +1969,7 @@ void mono_print_code (MonoCompile *cfg, const char* msg) { MonoBasicBlock *bb; - + for (bb = cfg->bb_entry; bb; bb = bb->next_bb) mono_print_bb (bb, msg); } @@ -2145,7 +2145,7 @@ mono_codegen (MonoCompile *cfg) g_free (cfg->native_code); cfg->native_code = code; code = cfg->native_code + cfg->code_len; - + /* g_assert (((int)cfg->native_code & (MONO_ARCH_CODE_ALIGNMENT - 1)) == 0); */ mono_postprocess_patches (cfg); @@ -2156,11 +2156,11 @@ mono_codegen (MonoCompile *cfg) g_free (nm); } #endif - + if (cfg->verbose_level > 0) { char* nm = mono_method_get_full_name (cfg->method); g_print ("Method %s emitted at %p to %p (code length %d)\n", - nm, + nm, cfg->native_code, cfg->native_code + cfg->code_len, cfg->code_len); g_free (nm); } @@ -2218,7 +2218,7 @@ mono_codegen (MonoCompile *cfg) mono_codeman_disable_write (); MONO_PROFILER_RAISE (jit_code_buffer, (cfg->native_code, cfg->code_len, MONO_PROFILER_CODE_BUFFER_METHOD, cfg->method)); - + mono_arch_flush_icache (cfg->native_code, cfg->code_len); mono_debug_close_method (cfg); @@ -2263,7 +2263,7 @@ static void mono_bb_ordering (MonoCompile *cfg) cfg->num_bblocks = dfn + 1; - /* remove unreachable code, because the code in them may be + /* remove unreachable code, because the code in them may be * inconsistent (access to dead variables for example) */ for (bb = cfg->bb_entry; bb; bb = bb->next_bb) bb->flags &= ~BB_VISITED; @@ -3313,7 +3313,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts cfg->method_to_register = method_to_register; ERROR_DECL (err); - sig = mono_method_signature_checked (cfg->method, err); + sig = mono_method_signature_checked (cfg->method, err); if (!sig) { cfg->exception_type = MONO_EXCEPTION_TYPE_LOAD; cfg->exception_message = g_strdup (mono_error_get_message (err)); @@ -3344,7 +3344,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts if (!inited) inited = TRUE; - /* + /* * Check for methods which cannot be compiled by LLVM early, to avoid * the extra compilation pass. */ @@ -3382,7 +3382,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts if (mini_debug_options.mdb_optimizations || MONO_CFG_PROFILE_CALL_CONTEXT (cfg)) { cfg->disable_reuse_registers = TRUE; cfg->disable_reuse_stack_slots = TRUE; - /* + /* * This decreases the change the debugger will read registers/stack slots which are * not yet initialized. */ @@ -3426,18 +3426,18 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts char *env = g_getenv ("MONO_VERBOSE_METHOD"); if (env != NULL) verbose_method_names = g_strsplit (env, ";", -1); - + verbose_method_inited = TRUE; } if (verbose_method_names) { int i; - + for (i = 0; verbose_method_names [i] != NULL; i++){ const char *name = verbose_method_names [i]; if ((strchr (name, '.') > name) || strchr (name, ':') || strchr (name, '*')) { MonoMethodDesc *desc; - + desc = mono_method_desc_new (name, TRUE); if (desc) { if (mono_method_desc_full_match (desc, cfg->method)) { @@ -3558,9 +3558,9 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts cfg->after_method_to_ir = TRUE; /* todo: remove code when we have verified that the liveness for try/catch blocks - * works perfectly + * works perfectly */ - /* + /* * Currently, this can't be commented out since exception blocks are not * processed during liveness analysis. * It is also needed, because otherwise the local optimization passes would @@ -3650,9 +3650,9 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts mono_cfg_dump_ir (cfg, "bb_ordering"); if (((cfg->num_varinfo > 2000) || (cfg->num_bblocks > 1000)) && !cfg->compile_aot) { - /* + /* * we disable some optimizations if there are too many variables - * because JIT time may become too expensive. The actual number needs + * because JIT time may become too expensive. The actual number needs * to be tweaked and eventually the non-linear algorithms should be fixed. */ cfg->opt &= ~ (MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP); @@ -3696,7 +3696,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts mono_ssa_compute (cfg); #endif } -#else +#else if (cfg->opt & MONO_OPT_SSA) { if (!(cfg->comp_done & MONO_COMP_SSA) && !cfg->disable_ssa) { #ifndef DISABLE_SSA @@ -3797,11 +3797,11 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts g_assert (cfg->got_var_allocated); - /* + /* * Allways allocate the GOT var to a register, because keeping it * in memory will increase the number of live temporaries in some * code created by inssel.brg, leading to the well known spills+ - * branches problem. Testcase: mcs crash in + * branches problem. Testcase: mcs crash in * System.MonoCustomAttrs:GetCustomAttributes. */ #ifdef MONO_ARCH_GOT_REG @@ -3824,7 +3824,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts if (cfg->opt & MONO_OPT_LINEARS) { GList *vars, *regs, *l; - + /* fixme: maybe we can avoid to compute livenesss here if already computed ? */ cfg->comp_done &= ~MONO_COMP_LIVENESS; if (!(cfg->comp_done & MONO_COMP_LIVENESS)) @@ -3849,7 +3849,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts //mono_print_code (cfg, ""); //print_dfn (cfg); - + /* variables are allocated after decompose, since decompose could create temps */ if (!COMPILE_LLVM (cfg)) { MONO_TIME_TRACK (mono_jit_stats.jit_arch_allocate_vars, mono_arch_allocate_vars (cfg)); @@ -3917,7 +3917,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, JitFlags flags, int parts if (cfg->verbose_level > 0 && !cfg->compile_aot) { nm = mono_method_get_full_name (cfg->method); g_print ("LLVM Method %s emitted at %p to %p (code length %d)\n", - nm, + nm, cfg->native_code, cfg->native_code + cfg->code_len, cfg->code_len); g_free (nm); } @@ -4466,7 +4466,7 @@ mini_get_cpu_features (MonoCompile* cfg) // This is a standard part of ARMv8-A; see A1.5 in "ARM // Architecture Reference Manual ARMv8, for ARMv8-A // architecture profile" - features |= MONO_CPU_ARM64_NEON; + features |= MONO_CPU_ARM64_NEON; #endif // apply parameters passed via -mattr diff --git a/src/mono/mono/mini/mini.h b/src/mono/mono/mini/mini.h index 85f64cd67cc777..baa30d8bdcdb59 100644 --- a/src/mono/mono/mini/mini.h +++ b/src/mono/mono/mini/mini.h @@ -265,7 +265,7 @@ enum { NULLIFY_INS ((ins)); \ } while (0) -/* +/* * this is used to determine when some branch optimizations are possible: we exclude FP compares * because they have weird semantics with NaNs. */ @@ -454,7 +454,7 @@ typedef struct { int pc_offset; /* The basic block containing the call site */ MonoBasicBlock *bb; - /* + /* * The set of variables live at the call site. * Has length cfg->num_varinfo in bits. */ @@ -467,7 +467,7 @@ typedef struct { } GCCallSite; /* - * The IR-level extended basic block. + * The IR-level extended basic block. * * A basic block can have multiple exits just fine, as long as the point of * 'departure' is the last instruction in the basic block. Extended basic @@ -492,7 +492,7 @@ struct MonoBasicBlock { /* unique block number identification */ gint32 block_num; - + gint32 dfn; /* Basic blocks: incoming and outgoing counts and pointers */ @@ -529,13 +529,13 @@ struct MonoBasicBlock { /* fast dominator algorithm */ MonoBasicBlock *df_parent, *ancestor, *child, *label; int size, sdom, idomn; - + /* loop nesting and recognition */ GList *loop_blocks; gint8 nesting; gint8 loop_body_start; - /* + /* * Whenever the bblock is rarely executed so it should be emitted after * the function epilog. */ @@ -564,7 +564,7 @@ struct MonoBasicBlock { * call). */ guint extend_try_block : 1; - + /* use for liveness analysis */ MonoBitSet *gen_set; MonoBitSet *kill_set; @@ -583,7 +583,7 @@ struct MonoBasicBlock { // The MonoInst of the last sequence point for the current basic block. MonoInst *last_seq_point; - + // This will hold a list of last sequence points of incoming basic blocks MonoInst **pred_seq_points; guint num_pred_seq_points; @@ -609,7 +609,7 @@ struct MonoBasicBlock { * * Bits: | 0-3 | 4-7 | 8-31 * | | | - * | clause-flags | MONO_REGION | clause-index + * | clause-flags | MONO_REGION | clause-index * */ guint region; @@ -709,7 +709,7 @@ typedef struct { gboolean imt_arg; /* Whenever there is a dummy extra argument */ gboolean dummy_arg; - /* + /* * The position of the vret arg in the argument list. * Only if ret->storage == ArgVtypeRetAddr. * Should be 0 or 1. @@ -729,7 +729,7 @@ struct MonoInst { guint16 opcode; guint8 type; /* stack type */ guint8 flags; - + /* used by the register allocator */ gint32 dreg, sreg1, sreg2, sreg3; @@ -786,10 +786,10 @@ struct MonoInst { */ int memory_barrier_kind; } backend; - + MonoClass *klass; }; - + struct MonoCallInst { MonoInst inst; MonoMethodSignature *signature; @@ -845,7 +845,7 @@ struct MonoCallArgParm { gint32 offPrm; }; -/* +/* * flags for MonoInst * Note: some of the values overlap, because they can't appear * in the same MonoInst. @@ -869,7 +869,7 @@ enum { MONO_INST_NORANGECHECK = 16, /* On loads, the source address can be null */ MONO_INST_FAULT = 32, - /* + /* * On variables, identifies LMF variables. These variables have a dummy type (int), but * require stack space for a MonoLMF struct. */ @@ -957,7 +957,7 @@ typedef union { guint16 tid; /* tree number */ guint16 bid; /* block number */ } pos ; - guint32 abs_pos; + guint32 abs_pos; } MonoPosition; typedef struct { @@ -993,8 +993,8 @@ struct MonoMethodVar { char cpstate; /* used by SSA conditional constant propagation */ /* The native offsets corresponding to the live range of the variable */ gint32 live_range_start, live_range_end; - /* - * cfg->varinfo [idx]->dreg could be replaced for OP_REGVAR, this contains the + /* + * cfg->varinfo [idx]->dreg could be replaced for OP_REGVAR, this contains the * original vreg. */ gint32 vreg; @@ -1338,7 +1338,7 @@ typedef struct { MonoBackend *backend; - /* + /* * This variable represents the hidden argument holding the vtype * return address. If the method returns something other than a vtype, or * the vtype is returned in registers this is NULL. @@ -1349,7 +1349,7 @@ typedef struct { * This is used to initialize the cil_code field of MonoInst's. */ const unsigned char *ip; - + struct MonoAliasingInformation *aliasing_info; /* A hashtable of region ID-> SP var mappings */ @@ -1369,7 +1369,7 @@ typedef struct { GHashTable *exvars; GList *ldstr_list; /* used by AOT */ - + guint real_offset; GHashTable *cbb_hash; @@ -1542,7 +1542,7 @@ typedef struct { /* Size of above array */ guint32 vreg_is_mp_len; - /* + /* * The original method to compile, differs from 'method' when doing generic * sharing. */ @@ -1610,7 +1610,7 @@ typedef struct { GSList *interp_in_signatures; /* GC Maps */ - + /* The offsets of the locals area relative to the frame pointer */ gint locals_min_stack_offset, locals_max_stack_offset; @@ -1999,12 +1999,12 @@ enum { MONO_EXC_INTRINS_NUM }; - /* + /* * Information about a trampoline function. */ struct MonoTrampInfo { - /* + /* * The native code of the trampoline. Not owned by this structure. */ guint8 *code; @@ -2014,7 +2014,7 @@ struct MonoTrampInfo * structure. */ char *name; - /* + /* * Patches required by the trampoline when aot-ing. Owned by this structure. */ MonoJumpInfo *ji; @@ -2242,7 +2242,7 @@ mini_register_opcode_emulation (int opcode, MonoJitICallInfo *jit_icall_info, co void mono_trampolines_init (void); guint8 * mono_get_trampoline_code (MonoTrampolineType tramp_type); gpointer mono_create_specific_trampoline (MonoMemoryManager *mem_manager, gpointer arg1, MonoTrampolineType tramp_type, guint32 *code_len); -gpointer mono_create_jump_trampoline (MonoMethod *method, +gpointer mono_create_jump_trampoline (MonoMethod *method, gboolean add_sync_wrapper, MonoError *error); gpointer mono_create_jit_trampoline (MonoMethod *method, MonoError *error); @@ -2256,9 +2256,9 @@ gpointer mono_create_ftnptr_arg_trampoline (gpointer arg, gpointer addr guint32 mono_find_rgctx_lazy_fetch_trampoline_by_addr (gconstpointer addr); gpointer mono_magic_trampoline (host_mgreg_t *regs, guint8 *code, gpointer arg, guint8* tramp); gpointer mono_delegate_trampoline (host_mgreg_t *regs, guint8 *code, gpointer *tramp_data, guint8* tramp); -gpointer mono_aot_trampoline (host_mgreg_t *regs, guint8 *code, guint8 *token_info, +gpointer mono_aot_trampoline (host_mgreg_t *regs, guint8 *code, guint8 *token_info, guint8* tramp); -gpointer mono_aot_plt_trampoline (host_mgreg_t *regs, guint8 *code, guint8 *token_info, +gpointer mono_aot_plt_trampoline (host_mgreg_t *regs, guint8 *code, guint8 *token_info, guint8* tramp); gconstpointer mono_get_trampoline_func (MonoTrampolineType tramp_type); gpointer mini_get_vtable_trampoline (MonoVTable *vt, int slot_index); @@ -2341,11 +2341,11 @@ CompRelation mono_negate_cond (CompRelation cond); int mono_op_imm_to_op (int opcode); void mono_decompose_op_imm (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins); void mono_peephole_ins (MonoBasicBlock *bb, MonoInst *ins); -MonoUnwindOp *mono_create_unwind_op (int when, - int tag, int reg, +MonoUnwindOp *mono_create_unwind_op (int when, + int tag, int reg, int val); -void mono_emit_unwind_op (MonoCompile *cfg, int when, - int tag, int reg, +void mono_emit_unwind_op (MonoCompile *cfg, int when, + int tag, int reg, int val); MonoTrampInfo* mono_tramp_info_create (const char *name, guint8 *code, guint32 code_size, MonoJumpInfo *ji, GSList *unwind_ops); void mono_tramp_info_free (MonoTrampInfo *info); @@ -2354,7 +2354,7 @@ void mono_tramp_info_register (MonoTrampInfo *info, MonoMemoryManag int mini_exception_id_by_name (const char *name); gboolean mini_type_is_hfa (MonoType *t, int *out_nfields, int *out_esize); -int mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_bblock, MonoBasicBlock *end_bblock, +int mono_method_to_ir (MonoCompile *cfg, MonoMethod *method, MonoBasicBlock *start_bblock, MonoBasicBlock *end_bblock, MonoInst *return_var, MonoInst **inline_args, guint inline_offset, gboolean is_virtual_call); @@ -2475,7 +2475,7 @@ SeqPointInfo *mono_arch_get_seq_point_info (guint8 *code); gboolean mono_arch_unwind_frame (MonoJitTlsData *jit_tls, - MonoJitInfo *ji, MonoContext *ctx, + MonoJitInfo *ji, MonoContext *ctx, MonoContext *new_ctx, MonoLMF **lmf, host_mgreg_t **save_locations, StackFrameInfo *frame_info); @@ -2610,8 +2610,8 @@ ICALL_EXPORT MonoArray *ves_icall_get_trace (MonoException *exc, gint32 skip, MonoBoolean need_file_info); ICALL_EXPORT -MonoBoolean ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info, - MonoReflectionMethod **method, +MonoBoolean ves_icall_get_frame_info (gint32 skip, MonoBoolean need_file_info, + MonoReflectionMethod **method, gint32 *iloffset, gint32 *native_offset, MonoString **file, gint32 *line, gint32 *column); void mono_set_cast_details (MonoClass *from, MonoClass *to); @@ -2644,7 +2644,7 @@ void mono_debug_free_method (MonoCompile *cfg); void mono_debug_open_block (MonoCompile *cfg, MonoBasicBlock *bb, guint32 address); void mono_debug_record_line_number (MonoCompile *cfg, MonoInst *ins, guint32 address); void mono_debug_serialize_debug_info (MonoCompile *cfg, guint8 **out_buf, guint32 *buf_len); -void mono_debug_add_aot_method (MonoMethod *method, guint8 *code_start, +void mono_debug_add_aot_method (MonoMethod *method, guint8 *code_start, guint8 *debug_info, guint32 debug_info_len); MONO_API void mono_debug_print_vars (gpointer ip, gboolean only_arguments); MONO_API void mono_debugger_run_finally (MonoContext *start_ctx); @@ -2886,7 +2886,7 @@ typedef enum { MONO_CPU_X86_AVX_COMBINED = MONO_CPU_X86_SSE42_COMBINED | MONO_CPU_X86_AVX, MONO_CPU_X86_AVX2_COMBINED = MONO_CPU_X86_AVX_COMBINED | MONO_CPU_X86_AVX2, MONO_CPU_X86_FMA_COMBINED = MONO_CPU_X86_AVX_COMBINED | MONO_CPU_X86_FMA, - MONO_CPU_X86_FULL_SSEAVX_COMBINED = MONO_CPU_X86_FMA_COMBINED | MONO_CPU_X86_AVX2 | MONO_CPU_X86_PCLMUL + MONO_CPU_X86_FULL_SSEAVX_COMBINED = MONO_CPU_X86_FMA_COMBINED | MONO_CPU_X86_AVX2 | MONO_CPU_X86_PCLMUL | MONO_CPU_X86_AES | MONO_CPU_X86_POPCNT | MONO_CPU_X86_FMA, #endif #ifdef TARGET_WASM diff --git a/src/mono/mono/mini/mono-private-unstable.h b/src/mono/mono/mini/mono-private-unstable.h index 03f24a08ec9178..fade778a39857f 100644 --- a/src/mono/mono/mini/mono-private-unstable.h +++ b/src/mono/mono/mini/mono-private-unstable.h @@ -1,6 +1,6 @@ /** * \file - * + * * Private unstable APIs. * * WARNING: The declarations and behavior of functions in this header are NOT STABLE and can be modified or removed at @@ -64,7 +64,7 @@ mono_install_load_aot_data_hook (MonoLoadAotDataFunc load_func, MonoFreeAotDataF MONO_API int monovm_initialize (int propertyCount, const char **propertyKeys, const char **propertyValues); -MONO_API int +MONO_API int monovm_runtimeconfig_initialize (MonovmRuntimeConfigArguments *arg, MonovmRuntimeConfigArgumentsCleanup cleanup_fn, void *user_data); // The wrapper MonoCoreRuntimeProperties struct can be stack-allocated or freed, but the structs inside it _must_ be heap-allocated and never freed, as they are not copied to avoid extra allocations diff --git a/src/mono/mono/mini/monovm.c b/src/mono/mono/mini/monovm.c index e1485962165992..a90b36ec3e3bea 100644 --- a/src/mono/mono/mini/monovm.c +++ b/src/mono/mono/mini/monovm.c @@ -250,7 +250,7 @@ monovm_execute_assembly (int argc, const char **argv, const char *managedAssembl char **mono_argv = (char **) malloc (sizeof (char *) * (mono_argc + 1 /* null terminated */)); const char **ptr = (const char **) mono_argv; - + *ptr++ = NULL; // executable assembly @@ -280,7 +280,7 @@ monovm_shutdown (int *latchedExitCode) static int monovm_create_delegate_impl (const char* assemblyName, const char* typeName, const char *methodName, void **delegate); - + int monovm_create_delegate (const char *assemblyName, const char *typeName, const char *methodName, void **delegate) @@ -337,7 +337,7 @@ monovm_create_delegate_impl (const char* assemblyName, const char* typeName, con g_assert (t); MonoClass *klass = mono_class_from_mono_type_internal (t); - + MonoMethod *method = mono_class_get_method_from_name_checked (klass, methodName, -1, 0, error); goto_if_nok (error, fail); @@ -346,7 +346,7 @@ monovm_create_delegate_impl (const char* assemblyName, const char* typeName, con mono_error_set_not_supported (error, "MonoVM only supports UnmanagedCallersOnly implementations of hostfxr_get_runtime_delegate delegate types"); goto fail; } - + MonoClass *delegate_klass = NULL; MonoGCHandle target_handle = 0; MonoMethod *wrapper = mono_marshal_get_managed_wrapper (method, delegate_klass, target_handle, error); diff --git a/src/mono/mono/mini/regalloc.h b/src/mono/mono/mini/regalloc.h index c0aa5fdf64a8a3..5ba2ee4bd0b027 100644 --- a/src/mono/mono/mini/regalloc.h +++ b/src/mono/mono/mini/regalloc.h @@ -14,7 +14,7 @@ enum { MONO_REG_SIMD }; - + #ifdef MONO_ARCH_NEED_SIMD_BANK #define MONO_NUM_REGBANKS 5 #else @@ -29,7 +29,7 @@ typedef struct { regmask_t free_mask [MONO_NUM_REGBANKS]; /* symbolic -> hard register assignment */ - /* + /* * If the register is spilled, then this contains -spill - 1, where 'spill' * is the index of the spill variable. */ diff --git a/src/mono/mono/mini/seq-points.c b/src/mono/mono/mini/seq-points.c index 257b408f192da4..4a6c2dbb3710e0 100644 --- a/src/mono/mono/mini/seq-points.c +++ b/src/mono/mono/mini/seq-points.c @@ -41,7 +41,7 @@ recursively_make_pred_seq_points (MonoCompile *cfg, MonoBasicBlock *bb) for (int i = 0; i < bb->in_count; ++i) { MonoBasicBlock *in_bb = bb->in_bb [i]; - + // This bb has the last seq point, append it and continue if (in_bb->last_seq_point != NULL) { predecessors = g_array_append_val (predecessors, in_bb->last_seq_point); @@ -54,7 +54,7 @@ recursively_make_pred_seq_points (MonoCompile *cfg, MonoBasicBlock *bb) continue; // Take sequence points from incoming basic blocks - + if (in_bb == cfg->bb_entry) continue; @@ -80,7 +80,7 @@ recursively_make_pred_seq_points (MonoCompile *cfg, MonoBasicBlock *bb) for (int newer = 0; newer < bb->num_pred_seq_points; newer++) { bb->pred_seq_points [newer] = g_array_index(predecessors, MonoInst*, newer); } - } + } g_array_free (predecessors, TRUE); } diff --git a/src/mono/mono/mini/seq-points.h b/src/mono/mono/mini/seq-points.h index a35584971c6c43..639b9ed60f09bb 100644 --- a/src/mono/mono/mini/seq-points.h +++ b/src/mono/mono/mini/seq-points.h @@ -3,7 +3,7 @@ * Copyright 2014 Xamarin Inc * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ - + #ifndef __MONO_SEQ_POINTS_H__ #define __MONO_SEQ_POINTS_H__ diff --git a/src/mono/mono/mini/ssa.c b/src/mono/mono/mini/ssa.c index 47579c57e12855..df1ac7fb78ccfc 100644 --- a/src/mono/mono/mini/ssa.c +++ b/src/mono/mono/mini/ssa.c @@ -38,7 +38,7 @@ typedef struct { MonoInst *inst; } MonoVarUsageInfo; -static void +static void unlink_target (MonoBasicBlock *bb, MonoBasicBlock *target) { int i; @@ -53,13 +53,13 @@ unlink_target (MonoBasicBlock *bb, MonoBasicBlock *target) if (target->in_bb [i] == bb) { target->in_bb [i] = target->in_bb [--target->in_count]; break; - + } } } static void -unlink_unused_bblocks (MonoCompile *cfg) +unlink_unused_bblocks (MonoCompile *cfg) { int i, j; MonoBasicBlock *bb; @@ -72,24 +72,24 @@ unlink_unused_bblocks (MonoCompile *cfg) for (bb = cfg->bb_entry; bb && bb->next_bb;) { if (!(bb->next_bb->flags & BB_REACHABLE)) { bb->next_bb = bb->next_bb->next_bb; - } else + } else bb = bb->next_bb; } for (i = 1; i < cfg->num_bblocks; i++) { bb = cfg->bblocks [i]; - + if (!(bb->flags & BB_REACHABLE)) { for (j = 0; j < bb->in_count; j++) { - unlink_target (bb->in_bb [j], bb); + unlink_target (bb->in_bb [j], bb); } for (j = 0; j < bb->out_count; j++) { - unlink_target (bb, bb->out_bb [j]); + unlink_target (bb, bb->out_bb [j]); } if (G_UNLIKELY (cfg->verbose_level > 1)) printf ("\tUnlinked BB%d\n", bb->block_num); } - + } } @@ -148,11 +148,11 @@ record_use (MonoCompile *cfg, MonoInst *var, MonoBasicBlock *bb, MonoInst *ins) MonoVarUsageInfo *ui = (MonoVarUsageInfo *)mono_mempool_alloc (cfg->mempool, sizeof (MonoVarUsageInfo)); info = MONO_VARINFO (cfg, var->inst_c0); - + ui->bb = bb; ui->inst = ins; info->uses = g_list_prepend_mempool (cfg->mempool, info->uses, ui); -} +} typedef struct { MonoInst *var; @@ -331,7 +331,7 @@ typedef struct { /** * mono_ssa_rename_vars: * Implement renaming of SSA variables. Also compute def-use information in parallel. - * \p stack_history points to an area of memory which can be used for storing changes + * \p stack_history points to an area of memory which can be used for storing changes * made to the stack, so they can be reverted later. */ static void @@ -476,7 +476,7 @@ mono_ssa_compute (MonoCompile *cfg) mono_blockset_print (cfg, set, "", -1); } } - + mono_bitset_foreach_bit (set, idx, cfg->num_bblocks) { MonoBasicBlock *bb = cfg->bblocks [idx]; @@ -675,7 +675,7 @@ mono_ssa_remove (MonoCompile *cfg) } /* - * Removal of SSA form introduces many copies. To avoid this, we tyry to coalesce + * Removal of SSA form introduces many copies. To avoid this, we tyry to coalesce * the variables if possible. Since the newly introduced SSA variables don't * have overlapping live ranges (because we don't do agressive optimization), we * can coalesce them into the original variable. @@ -697,14 +697,14 @@ mono_ssa_remove (MonoCompile *cfg) if (var) { MonoMethodVar *vmv = MONO_VARINFO (cfg, var->inst_c0); - - /* + + /* * The third condition avoids coalescing with variables eliminated * during deadce. */ if ((vmv->reg != -1) && (vmv->idx != vmv->reg) && (MONO_VARINFO (cfg, vmv->reg)->reg != -1)) { printf ("COALESCE: R%d -> R%d\n", ins->dreg, cfg->varinfo [vmv->reg]->dreg); - ins->dreg = cfg->varinfo [vmv->reg]->dreg; + ins->dreg = cfg->varinfo [vmv->reg]->dreg; } } } @@ -739,7 +739,7 @@ mono_ssa_remove (MonoCompile *cfg) } static void -mono_ssa_create_def_use (MonoCompile *cfg) +mono_ssa_create_def_use (MonoCompile *cfg) { MonoBasicBlock *bb; MonoInst *ins; @@ -999,7 +999,7 @@ visit_inst (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, GList **cvars, change_varstate (cfg, cvars, info, 2, NULL, carray); break; } - + if (mv->cpstate == 0) continue; @@ -1007,7 +1007,7 @@ visit_inst (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, GList **cvars, if (!c0) c0 = carray [var->dreg]; - + /* FIXME: */ if (c0->opcode != OP_ICONST) { change_varstate (cfg, cvars, info, 2, NULL, carray); @@ -1019,7 +1019,7 @@ visit_inst (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, GList **cvars, break; } } - + if (c0 && info->cpstate < 1) { change_varstate (cfg, cvars, info, 1, c0, carray); @@ -1050,7 +1050,7 @@ visit_inst (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, GList **cvars, } else if (!var && (ins->dreg != -1)) { /* - * We don't record def-use information for local vregs since it would be + * We don't record def-use information for local vregs since it would be * expensive. Instead, we depend on the fact that all uses of the vreg are in * the same bblock, so they will be examined after the definition. * FIXME: This isn't true if the ins is visited through an SSA edge. @@ -1059,7 +1059,7 @@ visit_inst (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, GList **cvars, carray [ins->dreg] = c0; } else { if (carray [ins->dreg]) { - /* + /* * The state of the vreg changed from constant to non-constant * -> need to rescan the whole bblock. */ @@ -1255,7 +1255,7 @@ fold_ins (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, MonoInst **carray NULLIFY_INS (ins->next->next); } } - } + } else if (MONO_IS_COND_BRANCH_OP (ins)) { if (ins->flags & MONO_INST_CFOLD_TAKEN) { remove_bb_from_phis (cfg, bb, ins->inst_false_bb); @@ -1272,7 +1272,7 @@ fold_ins (MonoCompile *cfg, MonoBasicBlock *bb, MonoInst *ins, MonoInst **carray } void -mono_ssa_cprop (MonoCompile *cfg) +mono_ssa_cprop (MonoCompile *cfg) { MonoInst **carray; MonoBasicBlock *bb; @@ -1317,7 +1317,7 @@ mono_ssa_cprop (MonoCompile *cfg) g_assert (bb->flags & BB_REACHABLE); - /* + /* * Some bblocks are linked to 2 others even through they fall through to the * next bblock. */ @@ -1334,7 +1334,7 @@ mono_ssa_cprop (MonoCompile *cfg) } while (cvars) { - MonoMethodVar *info = (MonoMethodVar *)cvars->data; + MonoMethodVar *info = (MonoMethodVar *)cvars->data; cvars = g_list_delete_link (cvars, cvars); for (tmp = info->uses; tmp; tmp = tmp->next) { @@ -1380,11 +1380,11 @@ add_to_dce_worklist (MonoCompile *cfg, MonoMethodVar *var, MonoMethodVar *use, G use->uses = g_list_remove_link (use->uses, tmp); break; } - } + } } void -mono_ssa_deadce (MonoCompile *cfg) +mono_ssa_deadce (MonoCompile *cfg) { int i; GList *work_list; @@ -1408,7 +1408,7 @@ mono_ssa_deadce (MonoCompile *cfg) MonoMethodVar *info = (MonoMethodVar *)work_list->data; work_list = g_list_remove_link (work_list, work_list); - /* + /* * The second part of the condition happens often when PHI nodes have their dreg * as one of their arguments due to the fact that we use the original vars. */ @@ -1466,7 +1466,7 @@ mono_ssa_strength_reduction (MonoCompile *cfg) for (i = 0; i < cfg->num_varinfo; i++) { MonoMethodVar *info = MONO_VARINFO (cfg, i); - + if (info->def && info->def->ssa_op == MONO_SSA_STORE && info->def->inst_i0->opcode == OP_LOCAL && g_list_find (lp, info->def_bb)) { MonoInst *v = info->def->inst_i1; diff --git a/src/mono/mono/mini/trace.h b/src/mono/mono/mini/trace.h index f973d10fbd1faa..a286e574e1f4b4 100644 --- a/src/mono/mono/mini/trace.h +++ b/src/mono/mono/mini/trace.h @@ -13,11 +13,11 @@ void mono_trace_enter_method (MonoMethod *method, MonoJitInfo *ji, MonoProfilerCallContext *ctx); ICALL_EXPORT -void +void mono_trace_leave_method (MonoMethod *method, MonoJitInfo *ji, MonoProfilerCallContext *ctx); ICALL_EXPORT -void +void mono_trace_tail_method (MonoMethod *method, MonoJitInfo *ji, MonoMethod *target); void mono_trace_enable (gboolean enable); diff --git a/src/mono/mono/mini/tramp-amd64-gsharedvt.c b/src/mono/mono/mini/tramp-amd64-gsharedvt.c index 0d564fbeefe45d..b8f45e7afe907d 100644 --- a/src/mono/mono/mini/tramp-amd64-gsharedvt.c +++ b/src/mono/mono/mini/tramp-amd64-gsharedvt.c @@ -252,7 +252,7 @@ mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot) /* setup the frame */ amd64_alu_reg_imm (code, X86_SUB, AMD64_RSP, framesize); - + /* save stuff */ /* save info */ @@ -294,7 +294,7 @@ mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot) /* arg1 == info */ amd64_mov_reg_reg (code, MONO_AMD64_ARG_REG1, AMD64_RAX, sizeof (target_mgreg_t)); /* arg2 = caller stack area */ - amd64_lea_membase (code, MONO_AMD64_ARG_REG2, AMD64_RBP, -(framesize - caller_reg_area_offset)); + amd64_lea_membase (code, MONO_AMD64_ARG_REG2, AMD64_RBP, -(framesize - caller_reg_area_offset)); /* arg3 == callee stack area */ amd64_lea_membase (code, MONO_AMD64_ARG_REG3, AMD64_RSP, callee_reg_area_offset); diff --git a/src/mono/mono/mini/tramp-amd64.c b/src/mono/mono/mini/tramp-amd64.c index ad749405c15112..6c4557a4da9713 100644 --- a/src/mono/mono/mini/tramp-amd64.c +++ b/src/mono/mono/mini/tramp-amd64.c @@ -159,7 +159,7 @@ mono_arch_patch_callsite (guint8 *method_start, guint8 *orig_code, guint8 *addr) gboolean disp_32bit = ((((gint64)addr - (gint64)orig_code)) < (1 << 30)) && ((((gint64)addr - (gint64)orig_code)) > -(1 << 30)); if ((((guint64)(addr)) >> 32) != 0 && !disp_32bit) { - /* + /* * This might happen with LLVM or when calling AOTed code. Create a thunk. */ guint8 *thunk_start, *thunk_code; @@ -290,7 +290,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf cfa_offset -= sizeof (target_mgreg_t); mono_add_unwind_op_def_cfa_offset (unwind_ops, code, buf, cfa_offset); - /* + /* * Allocate a new stack frame */ amd64_push_reg (code, AMD64_RBP); @@ -473,7 +473,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf amd64_mov_reg_membase (code, AMD64_R11, AMD64_RBP, lmf_offset + MONO_STRUCT_OFFSET (MonoLMFTramp, lmf_addr), sizeof (target_mgreg_t)); amd64_mov_membase_reg (code, AMD64_R11, 0, AMD64_RCX, sizeof (target_mgreg_t)); - /* + /* * Save rax to the stack, after the leave instruction, this will become part of * the red zone. */ @@ -482,7 +482,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf /* Check for thread interruption */ /* This is not perf critical code so no need to check the interrupt flag */ - /* + /* * Have to call the _force_ variant, since there could be a protected wrapper on the top of the stack. */ if (aot) { @@ -626,7 +626,7 @@ mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_ty MONO_PROFILER_RAISE (jit_code_buffer, (buf, code - buf, MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE, mono_get_generic_trampoline_simple_name (tramp_type))); return buf; -} +} gpointer mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info, gboolean aot) @@ -966,7 +966,7 @@ mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gbo amd64_mov_reg_imm (code, AMD64_R11, mono_component_debugger ()->single_step_from_context); else amd64_mov_reg_imm (code, AMD64_R11, mono_component_debugger ()->breakpoint_from_context); - } + } amd64_call_reg (code, AMD64_R11); /* Restore registers from ctx */ diff --git a/src/mono/mono/mini/tramp-arm.c b/src/mono/mono/mini/tramp-arm.c index 0834f106505e3d..4b12b2aab0bda7 100644 --- a/src/mono/mono/mini/tramp-arm.c +++ b/src/mono/mono/mini/tramp-arm.c @@ -40,7 +40,7 @@ mono_arch_patch_callsite (guint8 *method_start, guint8 *code_ptr, guint8 *addr) /* This is the 'bl' or the 'mov pc' instruction */ --code; - + /* * Note that methods are called also with the bl opcode. */ @@ -70,10 +70,10 @@ mono_arch_patch_plt_entry (guint8 *code, gpointer *got, host_mgreg_t *regs, guin if (*(guint32*)code == 0xe59fc000) { /* ARM_LDR_IMM (code, ARMREG_IP, ARMREG_PC, 0); */ guint32 offset = ((guint32*)code)[2]; - + jump_entry = code + offset + 12; } else if (*(guint16*)(code - 4) == 0xf8df) { - /* + /* * Thumb PLT entry, begins with ldr.w ip, [pc, #8], code points to entry + 4, see * mono_arm_get_thumb_plt_entry (). */ @@ -178,9 +178,9 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf mono_add_unwind_op_offset (unwind_ops, code, buf, ARMREG_R4 + i, -regsave_size + ((4 + i) * 4)); if (aot) { - /* + /* * For page trampolines the data is in r1, so just move it, otherwise use the got slot as below. - * The trampoline contains a pc-relative offset to the got slot + * The trampoline contains a pc-relative offset to the got slot * preceeding the got slot where the value is stored. The offset can be * found at [lr + 0]. */ @@ -209,7 +209,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf code = mono_arm_emit_load_imm (code, ARMREG_R2, STACK - MONO_ABI_SIZEOF (MonoLMF)); ARM_ADD_REG_REG (code, ARMREG_V1, ARMREG_SP, ARMREG_R2); - /* ok, now we can continue with the MonoLMF setup, mostly untouched + /* ok, now we can continue with the MonoLMF setup, mostly untouched * from emit_prolog in mini-arm.c * This is a synthetized call to mono_get_lmf_addr () */ @@ -286,7 +286,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf } else { ARM_MOV_REG_REG (code, ARMREG_R1, ARMREG_V3); } - + /* Arg 3: the specific argument, stored in v2 */ ARM_MOV_REG_REG (code, ARMREG_R2, ARMREG_V2); @@ -1146,7 +1146,7 @@ mono_arm_get_thumb_plt_entry (guint8 *code) g_assert (((guint16*)target) [0] == 0xf8df); g_assert (((guint16*)target) [1] == 0xc008); - /* + /* * The PLT info offset is at offset 16, but mono_arch_get_plt_entry_offset () returns * the 3rd word, so compensate by returning a different value. */ diff --git a/src/mono/mono/mini/tramp-arm64.c b/src/mono/mono/mini/tramp-arm64.c index e0ea4f11e787ee..e437bc2480333b 100644 --- a/src/mono/mono/mini/tramp-arm64.c +++ b/src/mono/mono/mini/tramp-arm64.c @@ -5,7 +5,7 @@ * Copyright 2013 Xamarin Inc * * Based on tramp-arm.c: - * + * * Authors: * Paolo Molaro (lupus@ximian.com) * @@ -43,7 +43,7 @@ mono_arch_patch_plt_entry (guint8 *code, gpointer *got, host_mgreg_t *regs, guin guint64 slot_addr; int disp; - /* + /* * Decode the address loaded by the PLT entry emitted by arch_emit_plt_entry () in * aot-compiler.c */ diff --git a/src/mono/mono/mini/tramp-mips.c b/src/mono/mono/mini/tramp-mips.c index fdd9e546bebd8c..edfdbe2b405bd3 100644 --- a/src/mono/mono/mini/tramp-mips.c +++ b/src/mono/mono/mini/tramp-mips.c @@ -41,7 +41,7 @@ mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr) { guint8 *code, *start; MonoMemoryManager *mem_manager = m_method_get_mem_manager (m); - + start = code = mono_mem_manager_code_reserve (mem_manager, 20); mips_load (code, mips_t9, addr); @@ -81,7 +81,7 @@ mono_arch_patch_callsite (guint8 *method_start, guint8 *orig_code, guint8 *addr) On entry, 'code' points just after one of the above sequences. */ - + /* The jal case */ if ((code[-2] >> 26) == 0x03) { //g_print ("direct patching\n"); @@ -107,7 +107,7 @@ mono_arch_patch_plt_entry (guint8 *code, gpointer *got, host_mgreg_t *regs, guin g_assert_not_reached (); } -/* Stack size for trampoline function +/* Stack size for trampoline function * MIPS_MINIMAL_STACK_SIZE + 16 (args + alignment to mips_magic_trampoline) * + MonoLMF + 14 fp regs + 13 gregs + alignment * #define STACK (MIPS_MINIMAL_STACK_SIZE + 4 * sizeof (gulong) + sizeof (MonoLMF) + 14 * sizeof (double) + 13 * (sizeof (gulong))) @@ -219,13 +219,13 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf /* Arg 4: Trampoline */ mips_move (code, mips_a3, mips_zero); - + /* Now go to the trampoline */ tramp = (guint8*)mono_get_trampoline_func (tramp_type); mips_load (code, mips_t9, (guint32)tramp); mips_jalr (code, mips_t9, mips_ra); mips_nop (code); - + /* Code address is now in v0, move it to at */ mips_move (code, mips_at, mips_v0); @@ -290,7 +290,7 @@ mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_ty * mono_arch_create_trampoline_code() knows we're putting this in t8 */ mips_load (code, mips_t8, arg1); - + /* Now jump to the generic trampoline code */ mips_load (code, mips_at, tramp); mips_jr (code, mips_at); diff --git a/src/mono/mono/mini/tramp-ppc.c b/src/mono/mono/mini/tramp-ppc.c index 67eb7c24db3bab..7d3c286a95af75 100644 --- a/src/mono/mono/mini/tramp-ppc.c +++ b/src/mono/mono/mini/tramp-ppc.c @@ -166,7 +166,7 @@ mono_arch_patch_callsite (guint8 *method_start, guint8 *code_ptr, guint8 *addr) /* This is the 'blrl' instruction */ --code; - + /* * Note that methods are called also with the bl opcode. */ @@ -176,7 +176,7 @@ mono_arch_patch_callsite (guint8 *method_start, guint8 *code_ptr, guint8 *addr) mono_arch_flush_icache ((guint8*)code, 4); return; } - + /* Sanity check */ g_assert (mono_ppc_is_direct_call_sequence (code)); @@ -203,7 +203,7 @@ mono_arch_patch_plt_entry (guint8 *code, gpointer *got, host_mgreg_t *regs, guin *(guint8**)((guint8*)got + offset) = addr; } -/* Stack size for trampoline function +/* Stack size for trampoline function * PPC_MINIMAL_STACK_SIZE + 16 (args + alignment to ppc_magic_trampoline) * + MonoLMF + 14 fp regs + 13 gregs + alignment */ @@ -260,7 +260,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf ppc_stfd (code, i, offset, ppc_r1); offset += sizeof (double); } - /* + /* * now the integer registers. */ offset = STACK - sizeof (MonoLMF) + G_STRUCT_OFFSET (MonoLMF, iregs); @@ -291,7 +291,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf ppc_mflr (code, ppc_r0); ppc_str (code, ppc_r0, STACK + PPC_RET_ADDR_OFFSET, ppc_r1); - /* ok, now we can continue with the MonoLMF setup, mostly untouched + /* ok, now we can continue with the MonoLMF setup, mostly untouched * from emit_prolog in mini-ppc.c */ if (aot) { @@ -342,7 +342,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf */ /* Arg 1: a pointer to the registers */ ppc_addi (code, ppc_r3, ppc_r1, GREGS_OFFSET); - + /* Arg 2: code (next address to the instruction that called us) */ if (tramp_type == MONO_TRAMPOLINE_JUMP) ppc_li (code, ppc_r4, 0); @@ -366,7 +366,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf ppc_mtlr (code, PPC_CALL_REG); ppc_blrl (code); } - + /* OK, code address is now on r3, move it to r14 for now. */ if (!MONO_TRAMPOLINE_TYPE_MUST_RETURN (tramp_type)) { #ifdef PPC_USES_FUNCTION_DESCRIPTOR @@ -510,12 +510,12 @@ mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_ty /* Prepare the jump to the generic trampoline code.*/ ppc_load_ptr (code, ppc_r0, tramp); ppc_mtctr (code, ppc_r0); - + /* And finally put 'arg1' in r0 and fly! */ ppc_load_ptr (code, ppc_r0, arg1); ppc_bcctr (code, 20, 0); } - + /* Flush instruction cache, since we've generated code */ mono_arch_flush_icache (buf, code - buf); MONO_PROFILER_RAISE (jit_code_buffer, (buf, code - buf, MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE, mono_get_generic_trampoline_simple_name (tramp_type))); diff --git a/src/mono/mono/mini/tramp-s390x.c b/src/mono/mono/mini/tramp-s390x.c index d301a3777eacf0..64497d163baae6 100644 --- a/src/mono/mono/mini/tramp-s390x.c +++ b/src/mono/mono/mini/tramp-s390x.c @@ -25,7 +25,7 @@ #define LMFReg s390_r13 /* - * Method-specific trampoline code fragment sizes + * Method-specific trampoline code fragment sizes */ #define SPECIFIC_TRAMPOLINE_SIZE 96 @@ -83,17 +83,17 @@ typedef struct { /*====================== End of Global Variables ===================*/ /** - * + * * @brief Build the unbox trampoline * * @param[in] Method pointer * @param[in] Pointer to native code for method * - * Return a pointer to a trampoline which does the unboxing before + * Return a pointer to a trampoline which does the unboxing before * calling the method. * - * When value type methods are called through the - * vtable we need to unbox the 'this' argument. + * When value type methods are called through the + * vtable we need to unbox the 'this' argument. */ gpointer @@ -125,7 +125,7 @@ mono_arch_get_unbox_trampoline (MonoMethod *m, gpointer addr) /*========================= End of Function ========================*/ /** - * + * * @brief Build the SDB trampoline * * @param[in] Type of trampoline (ss or bp) @@ -141,7 +141,7 @@ guint8 * mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gboolean aot) { int tramp_size = 512; - int i, framesize, ctx_offset, + int i, framesize, ctx_offset, gr_offset, fp_offset, ip_offset, sp_offset; guint8 *code, *buf; @@ -158,7 +158,7 @@ mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gbo framesize = ALIGN_TO (framesize, MONO_ARCH_FRAME_ALIGNMENT); - /** + /** * Create unwind information - On entry s390_r1 has value of method's frame reg */ s390_stmg (code, s390_r6, s390_r15, STK_BASE, S390_REG_SAVE_OFFSET); @@ -168,7 +168,7 @@ mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gbo mono_add_unwind_op_offset (unwind_ops, code, buf, i, gr_offset); gr_offset += sizeof(uintptr_t); } - + s390_lgr (code, s390_r0, STK_BASE); s390_aghi (code, STK_BASE, -framesize); mono_add_unwind_op_def_cfa_offset (unwind_ops, code, buf, framesize + S390_CFA_OFFSET); @@ -182,20 +182,20 @@ mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gbo s390_stmg (code, s390_r0, s390_r14, STK_BASE, gr_offset); s390_stg (code, s390_r1, 0, STK_BASE, sp_offset); s390_stg (code, s390_r14, 0, STK_BASE, ip_offset); - + fp_offset = ctx_offset + G_STRUCT_OFFSET(MonoContext, uc_mcontext.fpregs.fprs); for (i = s390_f0; i < s390_f15; ++i) { s390_std (code, i, 0, STK_BASE, fp_offset); fp_offset += sizeof(double); } - /* + /* * Call the single step/breakpoint function in sdb using * the context address as the parameter */ s390_la (code, s390_r2, 0, STK_BASE, ctx_offset); - if (single_step) + if (single_step) ep = (mono_component_debugger ())->single_step_from_context; else ep = (mono_component_debugger ())->breakpoint_from_context; @@ -205,12 +205,12 @@ mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gbo /* * Restore volatiles - */ + */ s390_lmg (code, s390_r0, s390_r5, STK_BASE, gr_offset); /* * Restore FP registers - */ + */ fp_offset = ctx_offset + G_STRUCT_OFFSET(MonoContext, uc_mcontext.fpregs.fprs); for (i = s390_f0; i < s390_f15; ++i) { s390_ld (code, i, 0, STK_BASE, fp_offset); @@ -219,12 +219,12 @@ mono_arch_create_sdb_trampoline (gboolean single_step, MonoTrampInfo **info, gbo /* * Load the IP from the context to pick up any SET_IP command results - */ + */ s390_lg (code, s390_r14, 0, STK_BASE, ip_offset); /* * Restore everything else from the on-entry values - */ + */ s390_aghi (code, STK_BASE, framesize); mono_add_unwind_op_def_cfa_offset (unwind_ops, code, buf, S390_CFA_OFFSET); mono_add_unwind_op_same_value (unwind_ops, code, buf, STK_BASE); @@ -349,10 +349,10 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf /* Now we'll create in 'buf' the S/390 trampoline code. This is the trampoline code common to all methods */ - + code = buf = (guint8 *) mono_global_codeman_reserve(512); - - if (tramp_type == MONO_TRAMPOLINE_JUMP) + + if (tramp_type == MONO_TRAMPOLINE_JUMP) has_caller = 0; else has_caller = 1; @@ -361,7 +361,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf STEP 0: First create a non-standard function prologue with a stack size big enough to save our registers. -----------------------------------------------------------*/ - + mono_add_unwind_op_def_cfa (unwind_ops, buf, code, STK_BASE, S390_CFA_OFFSET); s390_stmg (buf, s390_r6, s390_r15, STK_BASE, S390_REG_SAVE_OFFSET); offset = S390_REG_SAVE_OFFSET - S390_CFA_OFFSET; @@ -369,7 +369,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf mono_add_unwind_op_offset (unwind_ops, buf, code, i, offset); offset += sizeof(uintptr_t); } - + s390_lgr (buf, s390_r11, s390_r15); s390_aghi (buf, STK_BASE, -sizeof(trampStack_t)); mono_add_unwind_op_def_cfa_offset (unwind_ops, buf, code, sizeof(trampStack_t) + S390_CFA_OFFSET); @@ -379,13 +379,13 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf /* we build the MonoLMF structure on the stack - see mini-s390.h */ /* Keep in sync with the code in mono_arch_emit_prolog */ /*---------------------------------------------------------------*/ - + s390_lgr (buf, LMFReg, STK_BASE); s390_aghi (buf, LMFReg, G_STRUCT_OFFSET(trampStack_t, LMF)); - - /*---------------------------------------------------------------*/ - /* Save general and floating point registers in LMF */ - /*---------------------------------------------------------------*/ + + /*---------------------------------------------------------------*/ + /* Save general and floating point registers in LMF */ + /*---------------------------------------------------------------*/ s390_stmg (buf, s390_r0, s390_r1, LMFReg, G_STRUCT_OFFSET(MonoLMF, gregs[0])); s390_stmg (buf, s390_r2, s390_r5, LMFReg, G_STRUCT_OFFSET(MonoLMF, gregs[2])); s390_mvc (buf, 10*sizeof(gulong), LMFReg, G_STRUCT_OFFSET(MonoLMF, gregs[6]), @@ -403,63 +403,63 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf 's390_magic_trampoline' and before the call to the native method. ----------------------------------------------------------*/ - + S390_SET (buf, s390_r1, mono_get_lmf_addr); s390_basr (buf, s390_r14, s390_r1); - - /*---------------------------------------------------------------*/ - /* Set lmf.lmf_addr = jit_tls->lmf */ - /*---------------------------------------------------------------*/ - s390_stg (buf, s390_r2, 0, LMFReg, - G_STRUCT_OFFSET(MonoLMF, lmf_addr)); - - /*---------------------------------------------------------------*/ - /* Get current lmf */ - /*---------------------------------------------------------------*/ - s390_lg (buf, s390_r0, 0, s390_r2, 0); - - /*---------------------------------------------------------------*/ - /* Set our lmf as the current lmf */ - /*---------------------------------------------------------------*/ - s390_stg (buf, LMFReg, 0, s390_r2, 0); - - /*---------------------------------------------------------------*/ - /* Have our lmf.previous_lmf point to the last lmf */ - /*---------------------------------------------------------------*/ - s390_stg (buf, s390_r0, 0, LMFReg, - G_STRUCT_OFFSET(MonoLMF, previous_lmf)); - - /*---------------------------------------------------------------*/ - /* save method info */ - /*---------------------------------------------------------------*/ + + /*---------------------------------------------------------------*/ + /* Set lmf.lmf_addr = jit_tls->lmf */ + /*---------------------------------------------------------------*/ + s390_stg (buf, s390_r2, 0, LMFReg, + G_STRUCT_OFFSET(MonoLMF, lmf_addr)); + + /*---------------------------------------------------------------*/ + /* Get current lmf */ + /*---------------------------------------------------------------*/ + s390_lg (buf, s390_r0, 0, s390_r2, 0); + + /*---------------------------------------------------------------*/ + /* Set our lmf as the current lmf */ + /*---------------------------------------------------------------*/ + s390_stg (buf, LMFReg, 0, s390_r2, 0); + + /*---------------------------------------------------------------*/ + /* Have our lmf.previous_lmf point to the last lmf */ + /*---------------------------------------------------------------*/ + s390_stg (buf, s390_r0, 0, LMFReg, + G_STRUCT_OFFSET(MonoLMF, previous_lmf)); + + /*---------------------------------------------------------------*/ + /* save method info */ + /*---------------------------------------------------------------*/ s390_lg (buf, s390_r1, 0, LMFReg, G_STRUCT_OFFSET(MonoLMF, gregs[0])); - s390_stg (buf, s390_r1, 0, LMFReg, G_STRUCT_OFFSET(MonoLMF, method)); - - /*---------------------------------------------------------------*/ - /* save the current SP */ - /*---------------------------------------------------------------*/ + s390_stg (buf, s390_r1, 0, LMFReg, G_STRUCT_OFFSET(MonoLMF, method)); + + /*---------------------------------------------------------------*/ + /* save the current SP */ + /*---------------------------------------------------------------*/ s390_lg (buf, s390_r1, 0, STK_BASE, 0); - s390_stg (buf, s390_r1, 0, LMFReg, G_STRUCT_OFFSET(MonoLMF, ebp)); - - /*---------------------------------------------------------------*/ - /* save the current IP */ - /*---------------------------------------------------------------*/ + s390_stg (buf, s390_r1, 0, LMFReg, G_STRUCT_OFFSET(MonoLMF, ebp)); + + /*---------------------------------------------------------------*/ + /* save the current IP */ + /*---------------------------------------------------------------*/ if (has_caller) { s390_lg (buf, s390_r1, 0, s390_r1, S390_RET_ADDR_OFFSET); } else { s390_lghi (buf, s390_r1, 0); } - s390_stg (buf, s390_r1, 0, LMFReg, G_STRUCT_OFFSET(MonoLMF, eip)); - + s390_stg (buf, s390_r1, 0, LMFReg, G_STRUCT_OFFSET(MonoLMF, eip)); + /*---------------------------------------------------------------*/ /* STEP 2: call the C trampoline function */ /*---------------------------------------------------------------*/ - + /* Set arguments */ /* Arg 1: host_mgreg_t *regs */ s390_la (buf, s390_r2, 0, LMFReg, G_STRUCT_OFFSET(MonoLMF, gregs[0])); - + /* Arg 2: code (next address to the instruction that called us) */ if (has_caller) { s390_lg (buf, s390_r3, 0, s390_r11, S390_RET_ADDR_OFFSET); @@ -472,12 +472,12 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf /* Arg 4: trampoline address. */ S390_SET (buf, s390_r5, buf); - + /* Calculate call address and call the C trampoline. Return value will be in r2 */ tramp = (guint8*)mono_get_trampoline_func (tramp_type); S390_SET (buf, s390_r1, tramp); s390_basr (buf, s390_r14, s390_r1); - + /* OK, code address is now on r2. Save it, so that we can restore r2 and use it later */ s390_stg (buf, s390_r2, 0, STK_BASE, G_STRUCT_OFFSET(trampStack_t, saveFn)); @@ -486,7 +486,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf STEP 3: Restore the LMF ----------------------------------------------------------*/ restoreLMF(buf, STK_BASE, sizeof(trampStack_t)); - + /* Check for thread interruption */ S390_SET (buf, s390_r1, (guint8 *)mono_thread_force_interruption_checkpoint_noraise); s390_basr (buf, s390_r14, s390_r1); @@ -496,11 +496,11 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf /* * Exception case: * We have an exception we want to throw in the caller's frame, so pop - * the trampoline frame and throw from the caller. + * the trampoline frame and throw from the caller. */ S390_SET (buf, s390_r1, (guint *)mono_get_rethrow_preserve_exception_addr ()); s390_aghi (buf, STK_BASE, sizeof(trampStack_t)); - s390_lg (buf, s390_r1, 0, s390_r1, 0); + s390_lg (buf, s390_r1, 0, s390_r1, 0); s390_lmg (buf, s390_r6, s390_r14, STK_BASE, S390_REG_SAVE_OFFSET); s390_br (buf, s390_r1); PTRSLOT (buf, o[0]); @@ -511,10 +511,10 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf /*---------------------------------------------------------- STEP 4: call the compiled method ----------------------------------------------------------*/ - + /* Restore parameter registers */ s390_lmg (buf, s390_r2, s390_r5, LMFReg, G_STRUCT_OFFSET(MonoLMF, gregs[2])); - + /* Restore the FP registers */ offset = G_STRUCT_OFFSET(MonoLMF, fregs[0]); for (i = s390_f0; i <= s390_f15; ++i) { @@ -523,7 +523,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf } /* Restore stack pointer and jump to the code - - * R14 contains the return address to our caller + * R14 contains the return address to our caller */ s390_lgr (buf, STK_BASE, s390_r11); mono_add_unwind_op_def_cfa_offset (unwind_ops, buf, code, S390_CFA_OFFSET); @@ -542,7 +542,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf /* Flush instruction cache, since we've generated code */ mono_arch_flush_icache (code, buf - code); MONO_PROFILER_RAISE (jit_code_buffer, (buf, code - buf, MONO_PROFILER_CODE_BUFFER_HELPER, NULL)); - + g_assert (info); tramp_name = mono_get_generic_trampoline_name (tramp_type); *info = mono_tramp_info_create (tramp_name, code, buf - code, ji, unwind_ops); @@ -628,9 +628,9 @@ mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_ty if (code_len) *code_len = buf - code; - + return code; -} +} /*========================= End of Function ========================*/ @@ -654,8 +654,8 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info guint8 **rgctx_null_jumps; gint64 displace; int tramp_size, - depth, - index, + depth, + index, iPatch = 0, i; gboolean mrgctx; @@ -757,7 +757,7 @@ mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info g_free (name); return(buf); -} +} /*========================= End of Function ========================*/ @@ -799,6 +799,6 @@ mono_arch_get_static_rgctx_trampoline (MonoMemoryManager *mem_manager, gpointer mono_tramp_info_register (mono_tramp_info_create (NULL, start, code - start, NULL, NULL), mem_manager); return(start); -} +} /*========================= End of Function ========================*/ diff --git a/src/mono/mono/mini/tramp-sparc.c b/src/mono/mono/mini/tramp-sparc.c index 47b8010ce7d15e..230198cb5b0b02 100644 --- a/src/mono/mono/mini/tramp-sparc.c +++ b/src/mono/mono/mini/tramp-sparc.c @@ -104,7 +104,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf /* Save r1 needed by the IMT code */ sparc_sti_imm (code, sparc_g1, sparc_sp, regs_offset + (sparc_g1 * sizeof (target_mgreg_t))); - /* + /* * sparc_g5 contains the return address, the trampoline argument is stored in the * instruction stream after the call. */ @@ -114,7 +114,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf /* Save fp regs since they are not preserved by calls */ for (i = 0; i < 16; i ++) sparc_stdf_imm (code, sparc_f0 + (i * 2), sparc_sp, MONO_SPARC_STACK_BIAS + 320 + (i * 8)); -#endif +#endif /* We receive the method address in %r1, so save it here */ sparc_sti_imm (code, method_reg, sparc_sp, MONO_SPARC_STACK_BIAS + 200); @@ -186,7 +186,7 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf /* Reload fp regs */ for (i = 0; i < 16; i ++) sparc_lddf_imm (code, sparc_sp, MONO_SPARC_STACK_BIAS + 320 + (i * 8), sparc_f0 + (i * 2)); -#endif +#endif sparc_jmpl (code, sparc_o0, sparc_g0, sparc_g0); @@ -253,7 +253,7 @@ mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_ty MONO_PROFILER_RAISE (jit_code_buffer, (buf, code - buf, MONO_PROFILER_CODE_BUFFER_SPECIFIC_TRAMPOLINE, mono_get_generic_trampoline_simple_name (tramp_type))); return buf; -} +} gpointer mono_arch_create_rgctx_lazy_fetch_trampoline (guint32 slot, MonoTrampInfo **info, gboolean aot) diff --git a/src/mono/mono/mini/tramp-x86-gsharedvt.c b/src/mono/mono/mini/tramp-x86-gsharedvt.c index 83f55eb11586c2..58eb280388ae1a 100644 --- a/src/mono/mono/mini/tramp-x86-gsharedvt.c +++ b/src/mono/mono/mini/tramp-x86-gsharedvt.c @@ -177,7 +177,7 @@ mono_arch_get_gsharedvt_trampoline (MonoTrampInfo **info, gboolean aot) x86_mov_reg_membase (code, X86_ECX, X86_EBP, info_offset, 4); /* Branch to the in/out handling code */ - x86_alu_membase_imm (code, X86_CMP, X86_ECX, MONO_STRUCT_OFFSET (GSharedVtCallInfo, gsharedvt_in), 1); + x86_alu_membase_imm (code, X86_CMP, X86_ECX, MONO_STRUCT_OFFSET (GSharedVtCallInfo, gsharedvt_in), 1); br_out = code; x86_branch32 (code, X86_CC_NE, 0, TRUE); diff --git a/src/mono/mono/mini/tramp-x86.c b/src/mono/mono/mini/tramp-x86.c index 582628105b1d51..b109c4f09bbf1b 100644 --- a/src/mono/mono/mini/tramp-x86.c +++ b/src/mono/mono/mini/tramp-x86.c @@ -397,7 +397,7 @@ gpointer mono_arch_create_specific_trampoline (gpointer arg1, MonoTrampolineType tramp_type, MonoMemoryManager *mem_manager, guint32 *code_len) { guint8 *code, *buf, *tramp; - + tramp = mono_get_trampoline_code (tramp_type); const int size = TRAMPOLINE_SIZE; @@ -538,7 +538,7 @@ mono_arch_create_general_rgctx_lazy_fetch_trampoline (MonoTrampInfo **info, gboo code = buf = mono_global_codeman_reserve (tramp_size); // FIXME: Currently, we always go to the slow path. - + /* Load trampoline addr */ x86_mov_reg_membase (code, X86_EAX, MONO_ARCH_RGCTX_REG, 4, 4); /* Load mrgctx/vtable */ diff --git a/src/mono/mono/mini/type-checking.c b/src/mono/mono/mini/type-checking.c index b623c603741af5..1d279e86b8d228 100644 --- a/src/mono/mono/mini/type-checking.c +++ b/src/mono/mono/mini/type-checking.c @@ -169,7 +169,7 @@ mini_emit_interface_bitmap_check (MonoCompile *cfg, int intf_bit_reg, int base_r #endif } -/* +/* * Emit code which loads into "intf_bit_reg" a nonzero value if the MonoClass * stored in "klass_reg" implements the interface "klass". */ @@ -179,7 +179,7 @@ mini_emit_load_intf_bit_reg_class (MonoCompile *cfg, int intf_bit_reg, int klass mini_emit_interface_bitmap_check (cfg, intf_bit_reg, klass_reg, m_class_offsetof_interface_bitmap (), klass); } -/* +/* * Emit code which loads into "intf_bit_reg" a nonzero value if the MonoVTable * stored in "vtable_reg" implements the interface "klass". */ @@ -189,7 +189,7 @@ mini_emit_load_intf_bit_reg_vtable (MonoCompile *cfg, int intf_bit_reg, int vtab mini_emit_interface_bitmap_check (cfg, intf_bit_reg, vtable_reg, MONO_STRUCT_OFFSET (MonoVTable, interface_bitmap), klass); } -/* +/* * Emit code which checks whenever the interface id of @klass is smaller than * than the value given by max_iid_reg. */ @@ -216,7 +216,7 @@ mini_emit_max_iid_check_vtable (MonoCompile *cfg, int vtable_reg, MonoClass *kla MonoBasicBlock *false_target) { int max_iid_reg = alloc_preg (cfg); - + MONO_EMIT_NEW_LOAD_MEMBASE_OP (cfg, OP_LOADU4_MEMBASE, max_iid_reg, vtable_reg, MONO_STRUCT_OFFSET (MonoVTable, max_interface_id)); mini_emit_max_iid_check (cfg, max_iid_reg, klass, false_target); } @@ -263,7 +263,7 @@ mini_emit_iface_cast (MonoCompile *cfg, int vtable_reg, MonoClass *klass, MonoBa if (true_target) MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_PBNE_UN, true_target); else - MONO_EMIT_NEW_COND_EXC (cfg, EQ, "InvalidCastException"); + MONO_EMIT_NEW_COND_EXC (cfg, EQ, "InvalidCastException"); } /* @@ -286,7 +286,7 @@ mini_emit_iface_class_cast (MonoCompile *cfg, int klass_reg, MonoClass *klass, M static void mini_emit_castclass (MonoCompile *cfg, int obj_reg, int klass_reg, MonoClass *klass, MonoBasicBlock *object_is_null); - + static void mini_emit_castclass_inst (MonoCompile *cfg, int obj_reg, int klass_reg, MonoClass *klass, MonoInst *klass_inst, MonoBasicBlock *object_is_null) { @@ -564,7 +564,7 @@ handle_isinst (MonoCompile *cfg, MonoClass *klass, MonoInst *src, int context_us MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_BR, is_null_bb); } else if (m_class_get_cast_class (klass) == m_class_get_parent (mono_defaults.enum_class)) { mini_emit_class_check_branch (cfg, eclass_reg, m_class_get_parent (mono_defaults.enum_class), OP_PBEQ, is_null_bb); - mini_emit_class_check_branch (cfg, eclass_reg, mono_defaults.enum_class, OP_PBEQ, is_null_bb); + mini_emit_class_check_branch (cfg, eclass_reg, mono_defaults.enum_class, OP_PBEQ, is_null_bb); MONO_EMIT_NEW_BRANCH_BLOCK (cfg, OP_BR, false_bb); } else if (m_class_get_cast_class (klass) == mono_defaults.enum_class) { mini_emit_class_check_branch (cfg, eclass_reg, mono_defaults.enum_class, OP_PBEQ, is_null_bb); @@ -665,7 +665,7 @@ mono_decompose_typechecks (MonoCompile *cfg) } if ((cfg->verbose_level > 2) && found_typetest) mono_print_code (cfg, "AFTER DECOMPOSE TYPE_CHECKS"); - + } diff --git a/src/mono/mono/mini/unwind.c b/src/mono/mono/mini/unwind.c index bdcfe78604b7cb..5b78f6ea25a54a 100644 --- a/src/mono/mono/mini/unwind.c +++ b/src/mono/mono/mini/unwind.c @@ -97,7 +97,7 @@ static int map_hw_reg_to_dwarf_reg [ppc_lr + 1] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, * 0-15 = GR0-15 * 16-31 = FP0-15 (f0, f2, f4, f6, f1, f3, f5, f7, f8, f10, f12, f14, f9, f11, f13, f15) */ -static int map_hw_reg_to_dwarf_reg [] = { 0, 1, 2, 3, 4, 5, 6, 7, +static int map_hw_reg_to_dwarf_reg [] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 17, 21, 18, 22, 19, 23, 24, 28, 25, 29, 26, 30, 27, 31}; @@ -449,7 +449,7 @@ mono_unwind_ops_encode_full (GSList *unwind_ops, guint32 *out_len, gboolean enab *p ++ = DW_CFA_advance_loc | (30); loc += 30; } - } + } switch (op->op) { case DW_CFA_def_cfa: @@ -502,7 +502,7 @@ mono_unwind_ops_encode_full (GSList *unwind_ops, guint32 *out_len, gboolean enab break; } } - + g_assert (p - buf < 4096); *out_len = p - buf; res = (guint8 *)g_malloc (p - buf); @@ -540,8 +540,8 @@ typedef struct { } UnwindState; /* - * Given the state of the current frame as stored in REGS, execute the unwind - * operations in unwind_info until the location counter reaches POS. The result is + * Given the state of the current frame as stored in REGS, execute the unwind + * operations in unwind_info until the location counter reaches POS. The result is * stored back into REGS. OUT_CFA will receive the value of the CFA. * If SAVE_LOCATIONS is non-NULL, it should point to an array of size SAVE_LOCATIONS_LEN. * On return, the nth entry will point to the address of the stack slot where register @@ -552,7 +552,7 @@ typedef struct { * It returns FALSE on failure */ gboolean -mono_unwind_frame (guint8 *unwind_info, guint32 unwind_info_len, +mono_unwind_frame (guint8 *unwind_info, guint32 unwind_info_len, guint8 *start_ip, guint8 *end_ip, guint8 *ip, guint8 **mark_locations, mono_unwind_reg_t *regs, int nregs, host_mgreg_t **save_locations, int save_locations_len, @@ -1037,7 +1037,7 @@ mono_unwind_decode_fde (guint8 *fde, guint32 *out_len, guint32 *code_len, MonoJi guint8 *buf; gboolean has_fde_augmentation = FALSE; - /* + /* * http://refspecs.freestandards.org/LSB_3.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html */ @@ -1105,7 +1105,7 @@ mono_unwind_decode_fde (guint8 *fde, guint32 *out_len, guint32 *code_len, MonoJi break; } } - + p = cie_aug; p += cie_aug_len; } diff --git a/src/mono/mono/sgen/sgen-alloc.c b/src/mono/mono/sgen/sgen-alloc.c index 3e7959b85c563e..6638a943341a67 100644 --- a/src/mono/mono/sgen/sgen-alloc.c +++ b/src/mono/mono/sgen/sgen-alloc.c @@ -52,7 +52,7 @@ static guint64 stat_bytes_alloced_los = 0; * This is not constantly syncrhonized, but only updated on each GC. */ static guint64 bytes_allocated_attached = 0; -/* Total bytes allocated so far in program execution by detached threads */ +/* Total bytes allocated so far in program execution by detached threads */ static guint64 bytes_allocated_detached = 0; /* @@ -532,7 +532,7 @@ sgen_clear_tlabs (void) } FOREACH_THREAD_END sgen_set_bytes_allocated_attached (total_bytes_allocated_globally); -} +} void sgen_update_allocation_count (void) { @@ -553,7 +553,7 @@ sgen_set_bytes_allocated_attached (guint64 bytes) } void -sgen_increment_bytes_allocated_detached (guint64 bytes) +sgen_increment_bytes_allocated_detached (guint64 bytes) { bytes_allocated_detached += bytes; } @@ -561,16 +561,16 @@ sgen_increment_bytes_allocated_detached (guint64 bytes) guint64 sgen_get_total_allocated_bytes (MonoBoolean precise) { - if (precise) { + if (precise) { LOCK_GC; sgen_stop_world (0, FALSE); sgen_update_allocation_count (); - + sgen_restart_world (0, FALSE); UNLOCK_GC; } - + return bytes_allocated_attached + bytes_allocated_detached; } diff --git a/src/mono/mono/sgen/sgen-cardtable.c b/src/mono/mono/sgen/sgen-cardtable.c index 31a25f47fd8fdc..a79924fa8eecae 100644 --- a/src/mono/mono/sgen/sgen-cardtable.c +++ b/src/mono/mono/sgen/sgen-cardtable.c @@ -95,7 +95,7 @@ sgen_card_table_wbarrier_arrayref_copy (gpointer dest_ptr, gconstpointer src_ptr sgen_card_table_mark_address ((mword)dest); sgen_dummy_use (value); } - } + } } static void @@ -130,7 +130,7 @@ sgen_card_table_wbarrier_object_copy (GCObject* obj, GCObject *src) static void sgen_card_table_wbarrier_generic_nostore (gpointer ptr) { - sgen_card_table_mark_address ((mword)ptr); + sgen_card_table_mark_address ((mword)ptr); } static void diff --git a/src/mono/mono/sgen/sgen-conf.h b/src/mono/mono/sgen/sgen-conf.h index fc6ee088dbf5ed..9962dffb34c93d 100644 --- a/src/mono/mono/sgen/sgen-conf.h +++ b/src/mono/mono/sgen/sgen-conf.h @@ -175,7 +175,7 @@ typedef target_mword SgenDescriptor; * * Increasing this value speeds up allocation but will cause more frequent nursery collections as less space will be used. * Descreasing this value will cause allocation to be slower since we'll have to cycle thru more fragments. - * 512 annedoctally keeps wastage under control and doesn't impact allocation performance too much. + * 512 annedoctally keeps wastage under control and doesn't impact allocation performance too much. */ #define SGEN_MAX_NURSERY_WASTE 512 diff --git a/src/mono/mono/sgen/sgen-descriptor.c b/src/mono/mono/sgen/sgen-descriptor.c index df72b4e692ed2c..195b13349bf52d 100644 --- a/src/mono/mono/sgen/sgen-descriptor.c +++ b/src/mono/mono/sgen/sgen-descriptor.c @@ -213,7 +213,7 @@ mono_gc_get_bitmap_for_descr (SgenDescriptor descr, int *numbits) gsize *bitmap; switch (d & DESC_TYPE_MASK) { - case DESC_TYPE_RUN_LENGTH: { + case DESC_TYPE_RUN_LENGTH: { int first_set = (d >> 16) & 0xff; int num_set = (d >> 24) & 0xff; int i; @@ -295,7 +295,7 @@ mono_gc_make_root_descr_all_refs (int numbits) gc_bitmap = (gsize *)g_malloc0 (ALIGN_TO (ALIGN_TO (numbits, 8) + 1, sizeof (gsize))); memset (gc_bitmap, 0xff, num_bytes); - if (numbits < ((sizeof (*gc_bitmap) * 8) - ROOT_DESC_TYPE_SHIFT)) + if (numbits < ((sizeof (*gc_bitmap) * 8) - ROOT_DESC_TYPE_SHIFT)) gc_bitmap[0] = GUINT64_TO_LE(gc_bitmap[0]); else if (numbits && num_bytes % (sizeof (*gc_bitmap))) gc_bitmap[num_bytes / 8] = GUINT64_TO_LE(gc_bitmap [num_bytes / 8]); diff --git a/src/mono/mono/sgen/sgen-descriptor.h b/src/mono/mono/sgen/sgen-descriptor.h index f10ebf6a5104a9..faa9abb8a1dd17 100644 --- a/src/mono/mono/sgen/sgen-descriptor.h +++ b/src/mono/mono/sgen/sgen-descriptor.h @@ -113,7 +113,7 @@ enum { enum { ROOT_DESC_CONSERVATIVE, /* 0, so matches NULL value */ ROOT_DESC_BITMAP, - ROOT_DESC_RUN_LEN, + ROOT_DESC_RUN_LEN, ROOT_DESC_COMPLEX, ROOT_DESC_VECTOR, ROOT_DESC_USER, diff --git a/src/mono/mono/sgen/sgen-fin-weak-hash.c b/src/mono/mono/sgen/sgen-fin-weak-hash.c index 055963affe70d0..e1a85926950c10 100644 --- a/src/mono/mono/sgen/sgen-fin-weak-hash.c +++ b/src/mono/mono/sgen/sgen-fin-weak-hash.c @@ -34,7 +34,7 @@ typedef SgenGrayQueue GrayQueue; static int no_finalize = 0; /* - * The finalizable hash has the object as the key, the + * The finalizable hash has the object as the key, the * disappearing_link hash, has the link address as key. * * Copyright 2011 Xamarin Inc. @@ -136,7 +136,7 @@ sgen_collect_bridge_objects (int generation, ScanCopyContext ctx) copy_func (©, queue); sgen_client_bridge_register_finalized_object (copy); - + if (hash_table == &minor_finalizable_hash && !ptr_in_nursery (copy)) { /* remove from the list */ SGEN_HASH_TABLE_FOREACH_REMOVE (TRUE); @@ -623,7 +623,7 @@ sgen_remove_finalizers_if (SgenObjectPredicateFunc predicate, void *user_data, i SGEN_HASH_TABLE_FOREACH_REMOVE (TRUE); continue; } - } SGEN_HASH_TABLE_FOREACH_END; + } SGEN_HASH_TABLE_FOREACH_END; } void diff --git a/src/mono/mono/sgen/sgen-gc.c b/src/mono/mono/sgen/sgen-gc.c index b91cef311aeb15..8ae0ded31a0800 100644 --- a/src/mono/mono/sgen/sgen-gc.c +++ b/src/mono/mono/sgen/sgen-gc.c @@ -397,7 +397,7 @@ static SgenPointerQueue fin_ready_queue = SGEN_POINTER_QUEUE_INIT (INTERNAL_MEM_ static SgenPointerQueue critical_fin_queue = SGEN_POINTER_QUEUE_INIT (INTERNAL_MEM_FINALIZE_READY); /* registered roots: the key to the hash is the root start address */ -/* +/* * Different kinds of roots are kept separate to speed up pin_from_roots () for example. */ SgenHashTable sgen_roots_hash [ROOT_TYPE_NUM] = { @@ -408,7 +408,7 @@ SgenHashTable sgen_roots_hash [ROOT_TYPE_NUM] = { static mword roots_size = 0; /* amount of memory in the root set */ /* The size of a TLAB */ -/* The bigger the value, the less often we have to go to the slow path to allocate a new +/* The bigger the value, the less often we have to go to the slow path to allocate a new * one, but the more space is wasted by threads not allocating much memory. * FIXME: Tune this. * FIXME: Make this self-tuning for each thread. @@ -829,7 +829,7 @@ sgen_sort_addresses (void **array, size_t size) } } -/* +/* * Scan the memory between start and end and queue values which could be pointers * to the area between start_nursery and end_nursery for later consideration. * Typically used for thread stacks. @@ -1134,7 +1134,7 @@ finish_gray_stack (int generation, ScanCopyContext ctx) * We need to walk the LO list as well in search of marked big objects * (use a flag since this is needed only on major collections). We need to loop * here as well, so keep a counter of marked LO (increasing it in copy_object). - * To achieve better cache locality and cache usage, we drain the gray stack + * To achieve better cache locality and cache usage, we drain the gray stack * frequently, after each object is copied, and just finish the work here. */ sgen_drain_gray_stack (ctx); @@ -1231,7 +1231,7 @@ finish_gray_stack (int generation, ScanCopyContext ctx) sgen_client_clear_unreachable_ephemerons (ctx); /* - * We clear togglerefs only after all possible chances of revival are done. + * We clear togglerefs only after all possible chances of revival are done. * This is semantically more inline with what users expect and it allows for * user finalizers to correctly interact with TR objects. */ @@ -2606,7 +2606,7 @@ sgen_ensure_free_space (size_t size, int generation) generation_to_collect = GENERATION_OLD; } else { generation_to_collect = GENERATION_NURSERY; - reason = "Nursery full"; + reason = "Nursery full"; } } @@ -2643,7 +2643,7 @@ sgen_perform_collection_inner (size_t requested_size, int generation_to_collect, sgen_stop_world (generation_to_collect, forced_serial || !sgen_major_collector.is_concurrent); else SGEN_ASSERT (0, sgen_is_world_stopped (), "We can only collect if the world is stopped"); - + TV_GETTIME (gc_total_start); diff --git a/src/mono/mono/sgen/sgen-gc.h b/src/mono/mono/sgen/sgen-gc.h index b5b91c9a2eec77..ef7569f4fe980d 100644 --- a/src/mono/mono/sgen/sgen-gc.h +++ b/src/mono/mono/sgen/sgen-gc.h @@ -293,7 +293,7 @@ sgen_get_nursery_end (void) #define SGEN_LOAD_VTABLE(obj) ((GCVTable)(SGEN_POINTER_UNTAG_ALL (SGEN_LOAD_VTABLE_UNCHECKED ((GCObject *)(obj))))) /* -List of what each bit on of the vtable gc bits means. +List of what each bit on of the vtable gc bits means. */ enum { // When the Java bridge has determined an object is "bridged", it uses these two bits to cache that information. @@ -1038,7 +1038,7 @@ sgen_major_is_object_alive (GCObject *object) /* - * If the object has been forwarded it means it's still referenced from a root. + * If the object has been forwarded it means it's still referenced from a root. * If it is pinned it's still alive as well. * A LOS object is only alive if we have pinned it. * Return TRUE if @obj is ready to be finalized. @@ -1190,7 +1190,7 @@ gint64 sgen_timestamp (void); * - CANARY_SIZE must be multiple of word size in bytes * - Canary space is not included on checks against SGEN_MAX_SMALL_OBJ_SIZE */ - + gboolean sgen_nursery_canaries_enabled (void); #define CANARY_SIZE 8 diff --git a/src/mono/mono/sgen/sgen-gray.h b/src/mono/mono/sgen/sgen-gray.h index 7da84ba07359a4..19e9b90f3bf4b9 100644 --- a/src/mono/mono/sgen/sgen-gray.h +++ b/src/mono/mono/sgen/sgen-gray.h @@ -16,24 +16,24 @@ * This gray queue has to be as optimized as possible, because it is in the core of * the mark/copy phase of the garbage collector. The memory access has then to be as * cache friendly as possible. That's why we use a cursor based implementation. - * + * * This simply consist in maintaining a pointer to the current element in the * queue. In addition to using this cursor, we use a simple linked list of arrays, * called sections, so that we have the cache friendliness of arrays without having * the cost of memory reallocation of a dynaic array, not the cost of memory * indirection of a linked list. - * + * * This implementation also allows the dequeuing of a whole section at a time. This is - * for example used in the parallel GC because it would be too costly to take one element + * for example used in the parallel GC because it would be too costly to take one element * at a time. This imply the main constraint that, because we don't carry the cursor - * with the section, we still have to store the index of the last element. This is done + * with the section, we still have to store the index of the last element. This is done * through the 'size' field on the section, which default value is it's maximum value * SGEN_GRAY_QUEUE_SECTION_SIZE. This field is updated in multiple cases : * - section allocation : default value * - object push : default value if we fill the current queue first * - section dequeue : position of the cursor in the dequeued section * - section enqueue : position of the cursor in the previously first section in the queue - * + * * The previous implementation was an index based access where we would store the index * of the last element in the section. This was less efficient because we would have * to make 1 memory access for the index value, 1 for the base address of the objects diff --git a/src/mono/mono/sgen/sgen-hash-table.c b/src/mono/mono/sgen/sgen-hash-table.c index e9c921588a4d51..01a45ed3d81547 100644 --- a/src/mono/mono/sgen/sgen-hash-table.c +++ b/src/mono/mono/sgen/sgen-hash-table.c @@ -8,10 +8,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND diff --git a/src/mono/mono/sgen/sgen-marksweep-drain-gray-stack.h b/src/mono/mono/sgen/sgen-marksweep-drain-gray-stack.h index 889fa6077f1411..6bf3dc0a9ae3ca 100644 --- a/src/mono/mono/sgen/sgen-marksweep-drain-gray-stack.h +++ b/src/mono/mono/sgen/sgen-marksweep-drain-gray-stack.h @@ -285,7 +285,7 @@ SCAN_OBJECT_FUNCTION_NAME (GCObject *full_object, SgenDescriptor desc, SgenGrayQ #include "sgen-scan-object.h" } -#ifdef SCAN_VTYPE_FUNCTION_NAME +#ifdef SCAN_VTYPE_FUNCTION_NAME static void SCAN_VTYPE_FUNCTION_NAME (GCObject *full_object, char *start, SgenDescriptor desc, SgenGrayQueue *queue BINARY_PROTOCOL_ARG (size_t size)) { diff --git a/src/mono/mono/sgen/sgen-marksweep.c b/src/mono/mono/sgen/sgen-marksweep.c index f767431c1699ee..24eaf1fd9ad9ba 100644 --- a/src/mono/mono/sgen/sgen-marksweep.c +++ b/src/mono/mono/sgen/sgen-marksweep.c @@ -712,7 +712,7 @@ alloc_obj (GCVTable vtable, size_t size, gboolean pinned, gboolean has_reference /* FIXME: assumes object layout */ *(GCVTable*)obj = vtable; - sgen_total_allocated_major += block_obj_sizes [size_index]; + sgen_total_allocated_major += block_obj_sizes [size_index]; return (GCObject *)obj; } @@ -767,7 +767,7 @@ major_alloc_object_par (GCVTable vtable, size_t size, gboolean has_references) *(GCVTable*)obj = vtable; /* FIXME is it worth CAS-ing here */ - sgen_total_allocated_major += block_obj_sizes [size_index]; + sgen_total_allocated_major += block_obj_sizes [size_index]; return (GCObject *)obj; } diff --git a/src/mono/mono/sgen/sgen-memory-governor.c b/src/mono/mono/sgen/sgen-memory-governor.c index ac801a24a92f02..a2eb08ae7f288e 100644 --- a/src/mono/mono/sgen/sgen-memory-governor.c +++ b/src/mono/mono/sgen/sgen-memory-governor.c @@ -165,7 +165,7 @@ sgen_need_major_collection (mword space_needed, gboolean *forced) heap_size = get_heap_size (); if (heap_size <= major_collection_trigger_size) - return FALSE; + return FALSE; /* * The more the heap grows, the more we need to decrease the allowance above, diff --git a/src/mono/mono/sgen/sgen-minor-copy-object.h b/src/mono/mono/sgen/sgen-minor-copy-object.h index 5597ab41bb06c5..7e498482f50b85 100644 --- a/src/mono/mono/sgen/sgen-minor-copy-object.h +++ b/src/mono/mono/sgen/sgen-minor-copy-object.h @@ -74,7 +74,7 @@ extern guint64 stat_nursery_copy_object_failed_to_space; /* from sgen-gc.c */ */ static MONO_ALWAYS_INLINE void -SERIAL_COPY_OBJECT (GCObject **obj_slot, SgenGrayQueue *queue) +SERIAL_COPY_OBJECT (GCObject **obj_slot, SgenGrayQueue *queue) { GCObject *forwarded; GCObject *copy; @@ -115,7 +115,7 @@ SERIAL_COPY_OBJECT (GCObject **obj_slot, SgenGrayQueue *queue) if (sgen_nursery_is_to_space (obj)) { SGEN_ASSERT (9, sgen_vtable_get_descriptor (SGEN_LOAD_VTABLE(obj)), "to space object %p has no gc descriptor", obj); SGEN_LOG (9, " (tospace, no change)"); - HEAVY_STAT (++stat_nursery_copy_object_failed_to_space); + HEAVY_STAT (++stat_nursery_copy_object_failed_to_space); return; } #endif @@ -188,7 +188,7 @@ SERIAL_COPY_OBJECT_FROM_OBJ (GCObject **obj_slot, SgenGrayQueue *queue) /* FIXME: all of these could just use `sgen_obj_get_descriptor_safe()` */ SGEN_ASSERT (9, sgen_vtable_get_descriptor (SGEN_LOAD_VTABLE(obj)), "to space object %p has no gc descriptor", obj); SGEN_LOG (9, " (tospace, no change)"); - HEAVY_STAT (++stat_nursery_copy_object_failed_to_space); + HEAVY_STAT (++stat_nursery_copy_object_failed_to_space); /* * FIXME: diff --git a/src/mono/mono/sgen/sgen-nursery-allocator.c b/src/mono/mono/sgen/sgen-nursery-allocator.c index c4ac6b2c67381b..731dfcccbd1d4b 100644 --- a/src/mono/mono/sgen/sgen-nursery-allocator.c +++ b/src/mono/mono/sgen/sgen-nursery-allocator.c @@ -4,7 +4,7 @@ * * Copyright 2009-2010 Novell, Inc. * 2011 Rodrigo Kumpera - * + * * Copyright 2011 Xamarin Inc (http://www.xamarin.com) * Copyright (C) 2012 Xamarin Inc * @@ -23,7 +23,7 @@ * We should start assigning threads very small fragments: if there are many * threads the nursery will be full of reserved space that the threads may not * use at all, slowing down allocation speed. - * Thread local allocation is done from areas of memory Hotspot calls Thread Local + * Thread local allocation is done from areas of memory Hotspot calls Thread Local * Allocation Buffers (TLABs). */ #include "config.h" @@ -360,7 +360,7 @@ par_alloc_from_fragment (SgenFragmentAllocator *allocator, SgenFragment *frag, s if (frag->fragment_end - end < SGEN_MAX_NURSERY_WASTE) { SgenFragment *next, **prev_ptr; - + /* * Before we clean the remaining nursery, we must claim the remaining space * as it could end up been used by the range allocator since it can end up @@ -422,7 +422,7 @@ serial_alloc_from_fragment (SgenFragment **previous, SgenFragment *frag, size_t if (frag->fragment_end - end < SGEN_MAX_NURSERY_WASTE) { *previous = frag->next; - + /* Clear the remaining space, pinning depends on this. FIXME move this to use phony arrays */ memset (end, 0, frag->fragment_end - end); @@ -598,7 +598,7 @@ sgen_clear_allocator_fragments (SgenFragmentAllocator *allocator) #ifdef NALLOC_DEBUG add_alloc_record (frag->fragment_next, frag->fragment_end - frag->fragment_next, CLEAR_NURSERY_FRAGS); #endif - } + } } /* Clear all remaining nursery fragments */ diff --git a/src/mono/mono/sgen/sgen-pinning-stats.c b/src/mono/mono/sgen/sgen-pinning-stats.c index c8f0e0e22c29da..34fea4f836e22d 100644 --- a/src/mono/mono/sgen/sgen-pinning-stats.c +++ b/src/mono/mono/sgen/sgen-pinning-stats.c @@ -3,7 +3,7 @@ * Copyright 2001-2003 Ximian, Inc * Copyright 2003-2010 Novell, Inc. * Copyright 2011 Xamarin Inc (http://www.xamarin.com) - * + * * Licensed under the MIT license. See LICENSE file in the project root for full license information. */ diff --git a/src/mono/mono/sgen/sgen-pinning.c b/src/mono/mono/sgen/sgen-pinning.c index 6776c576372e15..9c53416e824986 100644 --- a/src/mono/mono/sgen/sgen-pinning.c +++ b/src/mono/mono/sgen/sgen-pinning.c @@ -89,7 +89,7 @@ sgen_scan_pin_queue_objects (ScanCopyContext ctx) void sgen_pin_stage_ptr (void *ptr) { - /*very simple multiplicative hash function, tons better than simple and'ng */ + /*very simple multiplicative hash function, tons better than simple and'ng */ int hash_idx = ((mword)ptr * 1737350767) & (PIN_HASH_SIZE - 1); if (pin_hash_filter [hash_idx] == ptr) return; diff --git a/src/mono/mono/sgen/sgen-simple-nursery.c b/src/mono/mono/sgen/sgen-simple-nursery.c index 1db3b081f1952f..18a771d0abafce 100644 --- a/src/mono/mono/sgen/sgen-simple-nursery.c +++ b/src/mono/mono/sgen/sgen-simple-nursery.c @@ -66,7 +66,7 @@ prepare_to_space (char *to_space_bitmap, size_t space_bitmap_size) static void clear_fragments (void) -{ +{ } static void @@ -154,7 +154,7 @@ sgen_simple_nursery_init (SgenMinorCollector *collector, gboolean parallel) #ifdef DISABLE_SGEN_MAJOR_MARKSWEEP_CONC g_assert (parallel == FALSE); #endif - + collector->is_split = FALSE; collector->is_parallel = parallel; diff --git a/src/mono/mono/sgen/sgen-split-nursery.c b/src/mono/mono/sgen/sgen-split-nursery.c index 4afd1ff8d246ce..5c73a1ced752ef 100644 --- a/src/mono/mono/sgen/sgen-split-nursery.c +++ b/src/mono/mono/sgen/sgen-split-nursery.c @@ -46,7 +46,7 @@ The Allocator Space takes the botton part of the nursery. The Survivor spaces are intermingled in the top part of the nursery. It's done this way since the required size for the To Space depends on the survivor rate -of objects from the Allocator Space. +of objects from the Allocator Space. During a collection when the object scan function see a nursery object it must determine if the object needs to be evacuated or left in place. Originally, this diff --git a/src/mono/mono/tests/metadata-verifier/gen-md-tests.c b/src/mono/mono/tests/metadata-verifier/gen-md-tests.c index 869ac8b60ea8ff..0f1efd15849b55 100644 --- a/src/mono/mono/tests/metadata-verifier/gen-md-tests.c +++ b/src/mono/mono/tests/metadata-verifier/gen-md-tests.c @@ -29,7 +29,7 @@ tokens: comment ::= '#.* - identifier ::= ([a-z] | [A-Z]) ([a-z] | [A-Z] | [0-9] | [_-.])* + identifier ::= ([a-z] | [A-Z]) ([a-z] | [A-Z] | [0-9] | [_-.])* hexa_digit = [0-9] | [a-f] | [A-F] number ::= hexadecimal | decimal hexadecimal ::= (+-)?('0' [xX])? hexa_digit+ @@ -44,7 +44,7 @@ identifier '{' assembly_directive test_entry* '}' assembly_directive: - 'assembly' identifier + 'assembly' identifier test_entry: validity patch (',' patch)* @@ -277,7 +277,7 @@ init_test_set (test_set_t *test_set) printf ("Could not parse image %s\n", test_set->assembly); exit (INVALID_BAD_FILE); } - + test_set->init = 1; } @@ -293,7 +293,7 @@ make_test_name (test_entry_t *entry, test_set_t *test_set) #define READ_BIT(PTR,OFF) ((((guint8*)(PTR))[(OFF / 8)] & (1 << ((OFF) % 8))) != 0) #define SET_BIT(PTR,OFF) do { ((guint8*)(PTR))[(OFF / 8)] |= (1 << ((OFF) % 8)); } while (0) -static guint32 +static guint32 get_pe_header (test_entry_t *entry) { return READ_VAR (guint32, entry->data + 0x3c) + 4; @@ -363,7 +363,7 @@ get_metadata_stream_header (test_entry_t *entry, guint32 idx) } offset = pad4 (offset); } - return offset; + return offset; } static guint32 @@ -374,14 +374,14 @@ lookup_var (test_entry_t *entry, const char *name) if (!strcmp ("pe-signature", name)) return get_pe_header (entry) - 4; if (!strcmp ("pe-header", name)) - return get_pe_header (entry); + return get_pe_header (entry); if (!strcmp ("pe-optional-header", name)) - return get_pe_header (entry) + 20; + return get_pe_header (entry) + 20; if (!strcmp ("section-table", name)) - return get_pe_header (entry) + 244; + return get_pe_header (entry) + 244; if (!strcmp ("cli-header", name)) return get_cli_header (entry); - if (!strcmp ("cli-metadata", name)) + if (!strcmp ("cli-metadata", name)) return get_cli_metadata_root (entry); if (!strcmp ("tables-header", name)) { guint32 metadata_root = get_cli_metadata_root (entry); @@ -597,7 +597,7 @@ process_test_entry (test_set_t *test_set, test_entry_t *entry) fclose (f); g_free (file_name); -} +} /*******************************************************************************************************/ @@ -685,7 +685,7 @@ static char* token_text_dup (scanner_t *scanner, token_t *token) { int len = token->end - token->start; - + char *str = g_memdup (scanner->input + token->start, len + 1); str [len] = 0; return str; @@ -696,7 +696,7 @@ static void dump_token (scanner_t *scanner, token_t *token) { char *str = token_text_dup (scanner, token); - + printf ("token '%s' of type '%s' at line %d\n", str, token_type_name (token->type), token->line); free (str); } @@ -965,13 +965,13 @@ parse_effect (scanner_t *scanner) CONSUME_IDENTIFIER(name); if (!strcmp ("set-byte", name)) - type = EFFECT_SET_BYTE; + type = EFFECT_SET_BYTE; else if (!strcmp ("set-ushort", name)) - type = EFFECT_SET_USHORT; + type = EFFECT_SET_USHORT; else if (!strcmp ("set-uint", name)) - type = EFFECT_SET_UINT; + type = EFFECT_SET_UINT; else if (!strcmp ("set-bit", name)) - type = EFFECT_SET_BIT; + type = EFFECT_SET_BIT; else if (!strcmp ("truncate", name)) type = EFFECT_SET_TRUNC; else if (!strcmp ("or-byte", name)) @@ -980,7 +980,7 @@ parse_effect (scanner_t *scanner) type = EFFECT_OR_USHORT; else if (!strcmp ("or-uint", name)) type = EFFECT_OR_UINT; - else + else FAIL(g_strdup_printf ("Invalid effect kind, expected one of: (set-byte set-ushort set-uint set-bit or-byte or-ushort or-uint truncate) but got %s",name), INVALID_ID_TEXT); effect = g_new0 (patch_effect_t, 1); @@ -1027,7 +1027,7 @@ static void parse_test_entry (scanner_t *scanner, test_set_t *test_set) { test_entry_t entry = { 0 }; - + entry.validity = parse_validity (scanner); do { @@ -1073,7 +1073,7 @@ parse_program (scanner_t *scanner) static void digest_file (const char *file) { - scanner_t *scanner = scanner_new (file); + scanner_t *scanner = scanner_new (file); parse_program (scanner); scanner_free (scanner); } diff --git a/src/mono/mono/utils/atomic.c b/src/mono/mono/utils/atomic.c index eac6be32557ecd..215fe6ccce73f9 100644 --- a/src/mono/mono/utils/atomic.c +++ b/src/mono/mono/utils/atomic.c @@ -34,20 +34,20 @@ gint32 mono_atomic_cas_i32(volatile gint32 *dest, gint32 exch, { gint32 old; int ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); ret = pthread_mutex_lock(&spin); g_assert (ret == 0); - + old= *dest; if(old==comp) { *dest=exch; } - + ret = pthread_mutex_unlock(&spin); g_assert (ret == 0); - + pthread_cleanup_pop (0); return(old); @@ -58,20 +58,20 @@ gpointer mono_atomic_cas_ptr(volatile gpointer *dest, { gpointer old; int ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); ret = pthread_mutex_lock(&spin); g_assert (ret == 0); - + old= *dest; if(old==comp) { *dest=exch; } - + ret = pthread_mutex_unlock(&spin); g_assert (ret == 0); - + pthread_cleanup_pop (0); return(old); @@ -123,7 +123,7 @@ gint32 mono_atomic_inc_i32(volatile gint32 *dest) { gint32 ret; int thr_ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); thr_ret = pthread_mutex_lock(&spin); @@ -131,12 +131,12 @@ gint32 mono_atomic_inc_i32(volatile gint32 *dest) (*dest)++; ret= *dest; - + thr_ret = pthread_mutex_unlock(&spin); g_assert (thr_ret == 0); - + pthread_cleanup_pop (0); - + return(ret); } @@ -165,20 +165,20 @@ gint32 mono_atomic_dec_i32(volatile gint32 *dest) { gint32 ret; int thr_ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); thr_ret = pthread_mutex_lock(&spin); g_assert (thr_ret == 0); - + (*dest)--; ret= *dest; - + thr_ret = pthread_mutex_unlock(&spin); g_assert (thr_ret == 0); - + pthread_cleanup_pop (0); - + return(ret); } @@ -207,7 +207,7 @@ gint32 mono_atomic_xchg_i32(volatile gint32 *dest, gint32 exch) { gint32 ret; int thr_ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); thr_ret = pthread_mutex_lock(&spin); @@ -215,12 +215,12 @@ gint32 mono_atomic_xchg_i32(volatile gint32 *dest, gint32 exch) ret=*dest; *dest=exch; - + thr_ret = pthread_mutex_unlock(&spin); g_assert (thr_ret == 0); - + pthread_cleanup_pop (0); - + return(ret); } @@ -249,20 +249,20 @@ gpointer mono_atomic_xchg_ptr(volatile gpointer *dest, gpointer exch) { gpointer ret; int thr_ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); thr_ret = pthread_mutex_lock(&spin); g_assert (thr_ret == 0); - + ret=*dest; *dest=exch; - + thr_ret = pthread_mutex_unlock(&spin); g_assert (thr_ret == 0); - + pthread_cleanup_pop (0); - + return(ret); } @@ -270,7 +270,7 @@ gint32 mono_atomic_fetch_add_i32(volatile gint32 *dest, gint32 add) { gint32 ret; int thr_ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); thr_ret = pthread_mutex_lock(&spin); @@ -278,7 +278,7 @@ gint32 mono_atomic_fetch_add_i32(volatile gint32 *dest, gint32 add) ret= *dest; *dest+=add; - + thr_ret = pthread_mutex_unlock(&spin); g_assert (thr_ret == 0); @@ -291,7 +291,7 @@ gint64 mono_atomic_fetch_add_i64(volatile gint64 *dest, gint64 add) { gint64 ret; int thr_ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); thr_ret = pthread_mutex_lock(&spin); @@ -299,7 +299,7 @@ gint64 mono_atomic_fetch_add_i64(volatile gint64 *dest, gint64 add) ret= *dest; *dest+=add; - + thr_ret = pthread_mutex_unlock(&spin); g_assert (thr_ret == 0); @@ -312,14 +312,14 @@ gint8 mono_atomic_load_i8(volatile gint8 *src) { gint8 ret; int thr_ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); thr_ret = pthread_mutex_lock(&spin); g_assert (thr_ret == 0); ret= *src; - + thr_ret = pthread_mutex_unlock(&spin); g_assert (thr_ret == 0); @@ -332,14 +332,14 @@ gint16 mono_atomic_load_i16(volatile gint16 *src) { gint16 ret; int thr_ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); thr_ret = pthread_mutex_lock(&spin); g_assert (thr_ret == 0); ret= *src; - + thr_ret = pthread_mutex_unlock(&spin); g_assert (thr_ret == 0); @@ -352,14 +352,14 @@ gint32 mono_atomic_load_i32(volatile gint32 *src) { gint32 ret; int thr_ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); thr_ret = pthread_mutex_lock(&spin); g_assert (thr_ret == 0); ret= *src; - + thr_ret = pthread_mutex_unlock(&spin); g_assert (thr_ret == 0); @@ -372,14 +372,14 @@ gint64 mono_atomic_load_i64(volatile gint64 *src) { gint64 ret; int thr_ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); thr_ret = pthread_mutex_lock(&spin); g_assert (thr_ret == 0); ret= *src; - + thr_ret = pthread_mutex_unlock(&spin); g_assert (thr_ret == 0); @@ -392,14 +392,14 @@ gpointer mono_atomic_load_ptr(volatile gpointer *src) { gpointer ret; int thr_ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); thr_ret = pthread_mutex_lock(&spin); g_assert (thr_ret == 0); ret= *src; - + thr_ret = pthread_mutex_unlock(&spin); g_assert (thr_ret == 0); @@ -411,85 +411,85 @@ gpointer mono_atomic_load_ptr(volatile gpointer *src) void mono_atomic_store_i8(volatile gint8 *dst, gint8 val) { int thr_ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); thr_ret = pthread_mutex_lock(&spin); g_assert (thr_ret == 0); *dst=val; - + thr_ret = pthread_mutex_unlock(&spin); g_assert (thr_ret == 0); - + pthread_cleanup_pop (0); } void mono_atomic_store_i16(volatile gint16 *dst, gint16 val) { int thr_ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); thr_ret = pthread_mutex_lock(&spin); g_assert (thr_ret == 0); *dst=val; - + thr_ret = pthread_mutex_unlock(&spin); g_assert (thr_ret == 0); - + pthread_cleanup_pop (0); } void mono_atomic_store_i32(volatile gint32 *dst, gint32 val) { int thr_ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); thr_ret = pthread_mutex_lock(&spin); g_assert (thr_ret == 0); *dst=val; - + thr_ret = pthread_mutex_unlock(&spin); g_assert (thr_ret == 0); - + pthread_cleanup_pop (0); } void mono_atomic_store_i64(volatile gint64 *dst, gint64 val) { int thr_ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); thr_ret = pthread_mutex_lock(&spin); g_assert (thr_ret == 0); *dst=val; - + thr_ret = pthread_mutex_unlock(&spin); g_assert (thr_ret == 0); - + pthread_cleanup_pop (0); } void mono_atomic_store_ptr(volatile gpointer *dst, gpointer val) { int thr_ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); thr_ret = pthread_mutex_lock(&spin); g_assert (thr_ret == 0); *dst=val; - + thr_ret = pthread_mutex_unlock(&spin); g_assert (thr_ret == 0); - + pthread_cleanup_pop (0); } @@ -578,20 +578,20 @@ mono_atomic_cas_i64(volatile gint64 *dest, gint64 exch, gint64 comp) { gint64 old; int ret; - + pthread_cleanup_push ((void(*)(void *))pthread_mutex_unlock, (void *)&spin); ret = pthread_mutex_lock(&spin); g_assert (ret == 0); - + old= *dest; if(old==comp) { *dest=exch; } - + ret = pthread_mutex_unlock(&spin); g_assert (ret == 0); - + pthread_cleanup_pop (0); return(old); diff --git a/src/mono/mono/utils/dlmalloc.c b/src/mono/mono/utils/dlmalloc.c index ed68e4103be5c3..48ed19153e748c 100644 --- a/src/mono/mono/utils/dlmalloc.c +++ b/src/mono/mono/utils/dlmalloc.c @@ -382,9 +382,9 @@ MALLINFO_FIELD_TYPE default: size_t size_t. The value is used only if HAVE_USR_INCLUDE_MALLOC_H is not set REALLOC_ZERO_BYTES_FREES default: not defined - This should be set if a call to realloc with zero bytes should - be the same as a call to free. Some people think it should. Otherwise, - since this malloc returns a unique pointer for malloc(0), so does + This should be set if a call to realloc with zero bytes should + be the same as a call to free. Some people think it should. Otherwise, + since this malloc returns a unique pointer for malloc(0), so does realloc(p, 0). LACKS_UNISTD_H, LACKS_FCNTL_H, LACKS_SYS_PARAM_H, LACKS_SYS_MMAN_H @@ -3485,7 +3485,7 @@ static void* sys_alloc(mstate m, size_t nb) { m->seg.sflags = mmap_flag; m->magic = mparams.magic; init_bins(m); - if (is_global(m)) + if (is_global(m)) init_top(m, (mchunkptr)tbase, tsize - TOP_FOOT_SIZE); else { /* Offset top by embedded malloc_state */ @@ -3636,7 +3636,7 @@ static int sys_trim(mstate m, size_t pad) { } /* Unmap any unused mmapped segments */ - if (HAVE_MMAP) + if (HAVE_MMAP) released += release_unused_segments(m); /* On failure, disable autotrim to avoid repeated failed future calls */ @@ -3848,7 +3848,7 @@ static void* internal_memalign(mstate m, size_t alignment, size_t bytes) { while (a < alignment) a <<= 1; alignment = a; } - + if (bytes >= MAX_REQUEST - alignment) { if (m != 0) { /* Test isn't needed but avoids compiler warning */ MALLOC_FAILURE_ACTION; @@ -5103,5 +5103,5 @@ int mspace_mallopt(int param_number, int value) { Trial version Fri Aug 28 13:14:29 1992 Doug Lea (dl at g.oswego.edu) * Based loosely on libg++-1.2X malloc. (It retains some of the overall structure of old version, but most details differ.) - + */ diff --git a/src/mono/mono/utils/dlmalloc.h b/src/mono/mono/utils/dlmalloc.h index 327cc4c0c14d03..e382b994af1e7e 100644 --- a/src/mono/mono/utils/dlmalloc.h +++ b/src/mono/mono/utils/dlmalloc.h @@ -1,14 +1,14 @@ /* Default header file for malloc-2.8.x, written by Doug Lea and released to the public domain, as explained at - http://creativecommons.org/licenses/publicdomain. - + http://creativecommons.org/licenses/publicdomain. + last update: Mon Aug 15 08:55:52 2005 Doug Lea (dl at gee) This header is for ANSI C/C++ only. You can set any of the following #defines before including: - * If USE_DL_PREFIX is defined, it is assumed that malloc.c + * If USE_DL_PREFIX is defined, it is assumed that malloc.c was also compiled with this option, so all routines have names starting with "dl". diff --git a/src/mono/mono/utils/dtrace.h b/src/mono/mono/utils/dtrace.h index 883d1affa61885..c1f1e01121173a 100644 --- a/src/mono/mono/utils/dtrace.h +++ b/src/mono/mono/utils/dtrace.h @@ -1,10 +1,10 @@ /* * * \file * DTrace probes - * + * * Authors: * Andreas Faerber - * + * */ #ifndef __UTILS_DTRACE_H__ diff --git a/src/mono/mono/utils/freebsd-elf_common.h b/src/mono/mono/utils/freebsd-elf_common.h index 658119fdbc51f2..b3520edda1f983 100644 --- a/src/mono/mono/utils/freebsd-elf_common.h +++ b/src/mono/mono/utils/freebsd-elf_common.h @@ -196,12 +196,12 @@ typedef struct { #define SHT_STRTAB 3 /* string table section */ #define SHT_RELA 4 /* relocation section with addends */ #define SHT_HASH 5 /* symbol hash table section */ -#define SHT_DYNAMIC 6 /* dynamic section */ +#define SHT_DYNAMIC 6 /* dynamic section */ #define SHT_NOTE 7 /* note section */ #define SHT_NOBITS 8 /* no space section */ #define SHT_REL 9 /* relocation section - no addends */ #define SHT_SHLIB 10 /* reserved - purpose unknown */ -#define SHT_DYNSYM 11 /* dynamic symbol table section */ +#define SHT_DYNSYM 11 /* dynamic symbol table section */ #define SHT_INIT_ARRAY 14 /* Initialization function pointers. */ #define SHT_FINI_ARRAY 15 /* Termination function pointers. */ #define SHT_PREINIT_ARRAY 16 /* Pre-initialization function ptrs. */ diff --git a/src/mono/mono/utils/gc_wrapper.h b/src/mono/mono/utils/gc_wrapper.h index 00ab7fb6c55016..3881d88ef71411 100644 --- a/src/mono/mono/utils/gc_wrapper.h +++ b/src/mono/mono/utils/gc_wrapper.h @@ -28,10 +28,10 @@ */ #ifndef HOST_WIN32 // FIXME? # if defined(MONO_KEYWORD_THREAD) && !defined(__powerpc__) - + /* The local alloc stuff is in pthread_support.c, but solaris uses solaris_threads.c */ /* It is also disabled on solaris/x86 by libgc/configure.ac */ - /* + /* * ARM has no definition for some atomic functions in gc_locks.h and * support is also disabled in libgc/configure.ac. */ diff --git a/src/mono/mono/utils/lock-free-alloc.h b/src/mono/mono/utils/lock-free-alloc.h index c05610fabc1542..cca1d83eb66142 100644 --- a/src/mono/mono/utils/lock-free-alloc.h +++ b/src/mono/mono/utils/lock-free-alloc.h @@ -11,10 +11,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND diff --git a/src/mono/mono/utils/lock-free-queue.c b/src/mono/mono/utils/lock-free-queue.c index b1e1725cbe26b7..02ce5b1745a77b 100644 --- a/src/mono/mono/utils/lock-free-queue.c +++ b/src/mono/mono/utils/lock-free-queue.c @@ -11,10 +11,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND diff --git a/src/mono/mono/utils/lock-free-queue.h b/src/mono/mono/utils/lock-free-queue.h index abb16d287b896c..76a8e98decc2d0 100644 --- a/src/mono/mono/utils/lock-free-queue.h +++ b/src/mono/mono/utils/lock-free-queue.h @@ -12,10 +12,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND diff --git a/src/mono/mono/utils/mach-support-arm.c b/src/mono/mono/utils/mach-support-arm.c index 004b03cfd7c933..f877fa70500202 100644 --- a/src/mono/mono/utils/mach-support-arm.c +++ b/src/mono/mono/utils/mach-support-arm.c @@ -80,7 +80,7 @@ mono_mach_arch_get_thread_states (thread_port_t thread, thread_state_t state, ma { #if defined(HOST_WATCHOS) g_error ("thread_get_state() is not supported by this platform"); -#else +#else arm_thread_state_t *arch_state = (arm_thread_state_t *) state; kern_return_t ret; diff --git a/src/mono/mono/utils/mach-support-x86.c b/src/mono/mono/utils/mach-support-x86.c index e28ee66f9e0fea..6dd775d2c08608 100644 --- a/src/mono/mono/utils/mach-support-x86.c +++ b/src/mono/mono/utils/mach-support-x86.c @@ -116,7 +116,7 @@ mono_mach_arch_set_thread_states (thread_port_t thread, thread_state_t state, ma return ret; ret = thread_set_state (thread, x86_FLOAT_STATE32, fpstate, fpcount); return ret; -#endif +#endif } #endif diff --git a/src/mono/mono/utils/memcheck.h b/src/mono/mono/utils/memcheck.h index 2740578f1dc53c..960bed5f7abcbb 100644 --- a/src/mono/mono/utils/memcheck.h +++ b/src/mono/mono/utils/memcheck.h @@ -22,16 +22,16 @@ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. The origin of this software must not be misrepresented; you must - not claim that you wrote the original software. If you use this - software in a product, an acknowledgment in the product + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. - 4. The name of the author may not be used to endorse or promote - products derived from this software without specific prior written + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS @@ -53,7 +53,7 @@ the terms of the GNU General Public License, version 2. See the COPYING file in the source distribution for details. - ---------------------------------------------------------------- + ---------------------------------------------------------------- */ @@ -71,12 +71,12 @@ #include "valgrind.h" -/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !! +/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !! This enum comprises an ABI exported by Valgrind to programs which use client requests. DO NOT CHANGE THE ORDER OF THESE ENTRIES, NOR DELETE ANY -- add new ones at the end. */ typedef - enum { + enum { VG_USERREQ__MAKE_MEM_NOACCESS = VG_USERREQ_TOOL_BASE('M','C'), VG_USERREQ__MAKE_MEM_UNDEFINED, VG_USERREQ__MAKE_MEM_DEFINED, @@ -100,7 +100,7 @@ typedef VG_USERREQ__DISABLE_ADDR_ERROR_REPORTING_IN_RANGE, /* This is just for memcheck's internal use - don't use it */ - _VG_USERREQ__MEMCHECK_RECORD_OVERLAP_ERROR + _VG_USERREQ__MEMCHECK_RECORD_OVERLAP_ERROR = VG_USERREQ_TOOL_BASE('M','C') + 256 } Vg_MemCheckClientRequest; @@ -113,7 +113,7 @@ typedef VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */, \ VG_USERREQ__MAKE_MEM_NOACCESS, \ (_qzz_addr), (_qzz_len), 0, 0, 0) - + /* Similarly, mark memory at _qzz_addr as addressable but undefined for _qzz_len bytes. */ #define VALGRIND_MAKE_MEM_UNDEFINED(_qzz_addr,_qzz_len) \ diff --git a/src/mono/mono/utils/memfuncs.c b/src/mono/mono/utils/memfuncs.c index 5ffb16b25912ec..4fc78079626abc 100644 --- a/src/mono/mono/utils/memfuncs.c +++ b/src/mono/mono/utils/memfuncs.c @@ -44,7 +44,7 @@ #if defined(TARGET_WIN32) #include -#endif +#endif #include "memfuncs.h" diff --git a/src/mono/mono/utils/mono-codeman.c b/src/mono/mono/utils/mono-codeman.c index c7ff9326ed710c..3d1fa4ac82325a 100644 --- a/src/mono/mono/utils/mono-codeman.c +++ b/src/mono/mono/utils/mono-codeman.c @@ -36,9 +36,9 @@ static size_t dynamic_code_frees_count; static const MonoCodeManagerCallbacks *code_manager_callbacks; /* - * AMD64 processors maintain icache coherency only for pages which are + * AMD64 processors maintain icache coherency only for pages which are * marked executable. Also, windows DEP requires us to obtain executable memory from - * malloc when using dynamic code managers. The system malloc can't do this so we use a + * malloc when using dynamic code managers. The system malloc can't do this so we use a * slighly modified version of Doug Lea's Malloc package for this purpose: * http://g.oswego.edu/dl/html/malloc.html * @@ -51,7 +51,7 @@ static const MonoCodeManagerCallbacks *code_manager_callbacks; #define MIN_ALIGN MEMORY_ALLOCATION_ALIGNMENT #elif defined(__x86_64__) /* - * We require 16 byte alignment on amd64 so the fp literals embedded in the code are + * We require 16 byte alignment on amd64 so the fp literals embedded in the code are * properly aligned for SSE2. */ #define MIN_ALIGN 16 @@ -157,7 +157,7 @@ codechunk_vfree (void *ptr, guint32 size) mono_vfree (ptr, size, MONO_MEM_ACCOUNT_CODE); } mono_os_mutex_unlock (&valloc_mutex); -} +} static void codechunk_cleanup (void) @@ -303,7 +303,7 @@ mono_code_manager_new_internal (int codeman_type) * * Returns: the new code manager */ -MonoCodeManager* +MonoCodeManager* mono_code_manager_new (void) { return mono_code_manager_new_internal (MONO_CODEMAN_TYPE_JIT); @@ -318,7 +318,7 @@ mono_code_manager_new (void) * * Returns: the new code manager */ -MonoCodeManager* +MonoCodeManager* mono_code_manager_new_dynamic (void) { return mono_code_manager_new_internal (MONO_CODEMAN_TYPE_DYNAMIC); @@ -373,12 +373,12 @@ static void free_chunklist (MonoCodeManager *cman, CodeChunk *chunk) { CodeChunk *dead; - + #if defined(HAVE_VALGRIND_MEMCHECK_H) && defined (VALGRIND_JIT_UNREGISTER_MAP) int valgrind_unregister = 0; if (RUNNING_ON_VALGRIND) valgrind_unregister = 1; -#define valgrind_unregister(x) do { if (valgrind_unregister) { VALGRIND_JIT_UNREGISTER_MAP(NULL,x); } } while (0) +#define valgrind_unregister(x) do { if (valgrind_unregister) { VALGRIND_JIT_UNREGISTER_MAP(NULL,x); } } while (0) #else #define valgrind_unregister(x) #endif @@ -631,8 +631,8 @@ mono_code_manager_reserve_align (MonoCodeManager *cman, int size, int alignment) return ptr; } } - /* - * no room found, move one filled chunk to cman->full + /* + * no room found, move one filled chunk to cman->full * to keep cman->current from growing too much */ prev = NULL; diff --git a/src/mono/mono/utils/mono-conc-hashtable.c b/src/mono/mono/utils/mono-conc-hashtable.c index c7050a2a5a327f..0b4bd7bb0a0c80 100644 --- a/src/mono/mono/utils/mono-conc-hashtable.c +++ b/src/mono/mono/utils/mono-conc-hashtable.c @@ -356,7 +356,7 @@ mono_conc_hashtable_insert (MonoConcurrentHashTable *hash_table, gpointer key, g if (kvs [i].key == TOMBSTONE) --hash_table->tombstone_count; else - ++hash_table->element_count; + ++hash_table->element_count; kvs [i].key = key; return NULL; } diff --git a/src/mono/mono/utils/mono-context.h b/src/mono/mono/utils/mono-context.h index bd1a3cd0104c2a..57d98ee52b4303 100644 --- a/src/mono/mono/utils/mono-context.h +++ b/src/mono/mono/utils/mono-context.h @@ -596,7 +596,7 @@ typedef struct { #ifdef __mono_ppc64__ typedef struct { - gulong sc_ir; // pc + gulong sc_ir; // pc gulong sc_sp; // r1 host_mgreg_t regs [32]; double fregs [32]; @@ -787,9 +787,9 @@ typedef struct MonoContext { gpointer *fp; } MonoContext; -#define MONO_CONTEXT_SET_IP(ctx,eip) do { (ctx)->ip = (gpointer)(eip); } while (0); -#define MONO_CONTEXT_SET_BP(ctx,ebp) do { (ctx)->fp = (gpointer*)(ebp); } while (0); -#define MONO_CONTEXT_SET_SP(ctx,esp) do { (ctx)->sp = (gpointer*)(esp); } while (0); +#define MONO_CONTEXT_SET_IP(ctx,eip) do { (ctx)->ip = (gpointer)(eip); } while (0); +#define MONO_CONTEXT_SET_BP(ctx,ebp) do { (ctx)->fp = (gpointer*)(ebp); } while (0); +#define MONO_CONTEXT_SET_SP(ctx,esp) do { (ctx)->sp = (gpointer*)(esp); } while (0); #define MONO_CONTEXT_GET_IP(ctx) ((gpointer)((ctx)->ip)) #define MONO_CONTEXT_GET_BP(ctx) ((gpointer)((ctx)->fp)) @@ -917,13 +917,13 @@ typedef struct ucontext MonoContext; do { \ (ctx)->uc_mcontext.gregs[14] = (unsigned long)ip; \ (ctx)->uc_mcontext.psw.addr = (unsigned long)ip; \ - } while (0); + } while (0); #define MONO_CONTEXT_SET_SP(ctx,bp) MONO_CONTEXT_SET_BP((ctx),(bp)) #define MONO_CONTEXT_SET_BP(ctx,bp) \ do { \ (ctx)->uc_mcontext.gregs[15] = (unsigned long)bp; \ - } while (0) + } while (0) #define MONO_CONTEXT_GET_IP(ctx) (gpointer) (ctx)->uc_mcontext.psw.addr #define MONO_CONTEXT_GET_SP(ctx) ((gpointer)((ctx)->uc_mcontext.gregs[15])) diff --git a/src/mono/mono/utils/mono-counters.c b/src/mono/mono/utils/mono-counters.c index 5acf772cca9c61..9e93493dec2821 100644 --- a/src/mono/mono/utils/mono-counters.c +++ b/src/mono/mono/utils/mono-counters.c @@ -211,7 +211,7 @@ register_internal (const char *name, int type, void *addr, int size) * It may be a function pointer if \c MONO_COUNTER_CALLBACK is specified: * the function should return the value and take no arguments. */ -void +void mono_counters_register (const char* name, int type, void *addr) { int size; @@ -620,7 +620,7 @@ mono_counters_dump_section (int section, int variance, FILE *outfile) * mono_counters_dump: * \param section_mask The sections to dump counters for * \param outfile a FILE to dump the results to; NULL will default to g_print - * Displays the counts of all the enabled counters registered. + * Displays the counts of all the enabled counters registered. * To filter by variance, you can OR one or more variance with the specific section you want. * Use \c MONO_COUNTER_SECTION_MASK to dump all categories of a specific variance. */ @@ -799,7 +799,7 @@ mono_counters_init (void) { } -void +void mono_counters_register (const char* name, int type, void *addr) { } diff --git a/src/mono/mono/utils/mono-counters.h b/src/mono/mono/utils/mono-counters.h index 77175b35f49a8e..c5da782c7faacc 100644 --- a/src/mono/mono/utils/mono-counters.h +++ b/src/mono/mono/utils/mono-counters.h @@ -57,7 +57,7 @@ typedef struct _MonoCounter MonoCounter; MONO_API void mono_counters_enable (int section_mask); MONO_API void mono_counters_init (void); -/* +/* * register addr as the address of a counter of type type. * It may be a function pointer if MONO_COUNTER_CALLBACK is specified: * the function should return the value and take no arguments. @@ -68,7 +68,7 @@ MONO_API void mono_counters_register_with_size (const char *name, int type, void typedef void (*MonoCounterRegisterCallback) (MonoCounter*); MONO_API void mono_counters_on_register (MonoCounterRegisterCallback callback); -/* +/* * Create a readable dump of the counters for section_mask sections (ORed section values) */ MONO_API void mono_counters_dump (int section_mask, FILE *outfile); diff --git a/src/mono/mono/utils/mono-embed.c b/src/mono/mono/utils/mono-embed.c index 1e535cca26fd6a..fa89d37166e6a9 100644 --- a/src/mono/mono/utils/mono-embed.c +++ b/src/mono/mono/utils/mono-embed.c @@ -29,12 +29,12 @@ static void * dl_mapping_open (const char *file, int flags, char **err, void *user_data) { MonoDlMapping *mappings; - + if (mono_dls == NULL){ *err = g_strdup ("Library not registered"); return NULL; } - + mappings = (MonoDlMapping *) g_hash_table_lookup (mono_dls, file); *err = g_strdup (mappings == NULL ? "File not registered" : ""); return mappings; @@ -44,7 +44,7 @@ static void * dl_mapping_symbol (void *handle, const char *symbol, char **err, void *user_data) { MonoDlMapping *mappings = (MonoDlMapping *) handle; - + for (;mappings->name; mappings++){ if (strcmp (symbol, mappings->name) == 0){ *err = g_strdup (""); @@ -60,11 +60,11 @@ dl_mapping_symbol (void *handle, const char *symbol, char **err, void *user_data * \param name Library name, this is the name used by the DllImport as the external library name * \param mappings the mappings to register for P/Invoke. * - * The mappings registered using this function are used as fallbacks if the dynamic linker + * The mappings registered using this function are used as fallbacks if the dynamic linker * fails, or if the platform doesn't have a dynamic linker. * * \p mappings is a pointer to the first element of an array of - * \c MonoDlMapping values. The list must be terminated with both + * \c MonoDlMapping values. The list must be terminated with both * the \c name and \c addr fields set to NULL. * * This is typically used like this: @@ -93,7 +93,7 @@ mono_dl_register_library (const char *name, MonoDlMapping *mappings) mono_dls = g_hash_table_new (g_str_hash, g_str_equal); mono_dl_fallback_register (dl_mapping_open, dl_mapping_symbol, NULL, NULL); } - + g_hash_table_insert (mono_dls, g_strdup (name), mappings); } diff --git a/src/mono/mono/utils/mono-embed.h b/src/mono/mono/utils/mono-embed.h index 9a81e788c5982f..f4934a47a2de7c 100644 --- a/src/mono/mono/utils/mono-embed.h +++ b/src/mono/mono/utils/mono-embed.h @@ -7,11 +7,11 @@ #include -/* +/* * This is a fallback for platform symbol loading functionality. */ typedef struct { - const char *name; + const char *name; void *addr; } MonoDlMapping; diff --git a/src/mono/mono/utils/mono-error-internals.h b/src/mono/mono/utils/mono-error-internals.h index f43727dde76bf3..6d55b5a7f81a1f 100644 --- a/src/mono/mono/utils/mono-error-internals.h +++ b/src/mono/mono/utils/mono-error-internals.h @@ -164,7 +164,7 @@ void mono_error_dup_strings (MonoError *error, gboolean dup_strings); /* This function is not very useful as you can't provide any details beyond the message.*/ -MONO_COMPONENT_API +MONO_COMPONENT_API void mono_error_set_error (MonoError *error, int error_code, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(3,4); @@ -210,7 +210,7 @@ MONO_COMPONENT_API void mono_error_set_not_supported (MonoError *error, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(2,3); -void +void mono_error_set_ambiguous_implementation (MonoError *error, const char *msg_format, ...) MONO_ATTR_FORMAT_PRINTF(2,3); MONO_COMPONENT_API diff --git a/src/mono/mono/utils/mono-error.c b/src/mono/mono/utils/mono-error.c index 6d02df6968dc26..0f422502de118a 100644 --- a/src/mono/mono/utils/mono-error.c +++ b/src/mono/mono/utils/mono-error.c @@ -311,7 +311,7 @@ mono_error_set_class (MonoError *oerror, MonoClass *klass) if (is_managed_exception (error)) return; - error->exn.klass = klass; + error->exn.klass = klass; } static void @@ -716,9 +716,9 @@ mono_error_prepare_exception (MonoError *oerror, MonoError *error_out) case MONO_ERROR_ARGUMENT_NULL: exception = mono_exception_new_argument_null (error->first_argument, error_out); break; - - case MONO_ERROR_ARGUMENT_OUT_OF_RANGE: - exception = mono_exception_new_argument_out_of_range(error->first_argument, error->full_message, error_out); + + case MONO_ERROR_ARGUMENT_OUT_OF_RANGE: + exception = mono_exception_new_argument_out_of_range(error->first_argument, error->full_message, error_out); break; case MONO_ERROR_NOT_VERIFIABLE: @@ -852,7 +852,7 @@ mono_error_box (const MonoError *ierror, MonoImage *image) to->exn.klass = from->exn.klass; #undef DUP_STR - + return box; } @@ -896,7 +896,7 @@ mono_error_set_from_boxed (MonoError *oerror, const MonoErrorBoxed *box) DUP_STR (full_message_with_fields); DUP_STR (first_argument); to->exn.klass = from->exn.klass; - + #undef DUP_STR return (to->flags & MONO_ERROR_INCOMPLETE) == 0 ; } diff --git a/src/mono/mono/utils/mono-error.h b/src/mono/mono/utils/mono-error.h index 69bfb8a47346f4..297412b3d5a151 100644 --- a/src/mono/mono/utils/mono-error.h +++ b/src/mono/mono/utils/mono-error.h @@ -40,7 +40,7 @@ enum { /* * This is a generic error mechanism is you need to raise an arbitrary corlib exception. - * You must pass the exception name otherwise prepare_exception will fail with internal execution. + * You must pass the exception name otherwise prepare_exception will fail with internal execution. */ MONO_ERROR_GENERIC = 9, /* This one encapsulates a managed exception instance */ diff --git a/src/mono/mono/utils/mono-filemap.c b/src/mono/mono/utils/mono-filemap.c index 3fe31d7776f768..0c4ac46a5b4970 100644 --- a/src/mono/mono/utils/mono-filemap.c +++ b/src/mono/mono/utils/mono-filemap.c @@ -44,7 +44,7 @@ mono_file_map_open (const char* name) #endif } -guint64 +guint64 mono_file_map_size (MonoFileMap *fmap) { struct stat stat_buf; @@ -63,7 +63,7 @@ mono_file_map_fd (MonoFileMap *fmap) #endif } -int +int mono_file_map_close (MonoFileMap *fmap) { #ifdef WIN32 diff --git a/src/mono/mono/utils/mono-flight-recorder.c b/src/mono/mono/utils/mono-flight-recorder.c index 7ff4b59d737da9..ab14f4fe578483 100644 --- a/src/mono/mono/utils/mono-flight-recorder.c +++ b/src/mono/mono/utils/mono-flight-recorder.c @@ -26,14 +26,14 @@ // Mutex has to be held when called void -mono_flight_recorder_iter_init (MonoFlightRecorder *recorder, MonoFlightRecorderIter *iter) +mono_flight_recorder_iter_init (MonoFlightRecorder *recorder, MonoFlightRecorderIter *iter) { // Make sure we are initialized g_assert (recorder->max_count > 0); iter->recorder = recorder; if (recorder->cursor == MONO_FLIGHT_RECORDER_SENTINEL) { - iter->lowest_index = MONO_FLIGHT_RECORDER_SENTINEL; + iter->lowest_index = MONO_FLIGHT_RECORDER_SENTINEL; iter->highest_index = MONO_FLIGHT_RECORDER_SENTINEL; } else if (recorder->cursor >= recorder->max_count) { // Ring buffer has wrapped around diff --git a/src/mono/mono/utils/mono-hwcap-arm.c b/src/mono/mono/utils/mono-hwcap-arm.c index b4de27ee1de987..c6a30854a39189 100644 --- a/src/mono/mono/utils/mono-hwcap-arm.c +++ b/src/mono/mono/utils/mono-hwcap-arm.c @@ -95,21 +95,21 @@ mono_hwcap_arch_init (void) /* TODO: Find a way to detect features like Thumb and VFP. */ #elif defined (_WIN32) - /* From MSDN: - * Windows on ARM presumes that it is running on an ARMv7 architecture at all times. + /* From MSDN: + * Windows on ARM presumes that it is running on an ARMv7 architecture at all times. * Floating-point support in the form of VFPv3-D32 or later must be present in hardware. - * The VFP must support both single-precision and double-precision floating-point in hardware. + * The VFP must support both single-precision and double-precision floating-point in hardware. * * The Windows runtime does not support emulation of floating-point to enable running on non-VFP hardware. - * Advanced SIMD Extensions (NEON) support—this includes both integer and floating-point operations—must also be present in hardware. + * Advanced SIMD Extensions (NEON) support—this includes both integer and floating-point operations—must also be present in hardware. * No run-time support for emulation is provided. * * Integer divide support (UDIV/SDIV) is strongly recommended but not required. * Platforms that lack integer divide support may incur a performance penalty because * these operations have to be trapped and possibly patched. * - * The instruction set for Windows on ARM is strictly limited to Thumb-2. - * All code executed on this platform is expected to start and remain in Thumb mode at all times. + * The instruction set for Windows on ARM is strictly limited to Thumb-2. + * All code executed on this platform is expected to start and remain in Thumb mode at all times. */ mono_hwcap_arm_is_v5 = TRUE; mono_hwcap_arm_is_v6 = TRUE; diff --git a/src/mono/mono/utils/mono-jemalloc.c b/src/mono/mono/utils/mono-jemalloc.c index 4b0f5baa05c6dd..16b4c1d7c6207a 100644 --- a/src/mono/mono/utils/mono-jemalloc.c +++ b/src/mono/mono/utils/mono-jemalloc.c @@ -9,7 +9,7 @@ #ifdef MONO_JEMALLOC_ENABLED -void +void mono_init_jemalloc (void) { GMemVTable g_mem_vtable = { MONO_JEMALLOC_MALLOC, MONO_JEMALLOC_REALLOC, MONO_JEMALLOC_FREE, MONO_JEMALLOC_CALLOC}; diff --git a/src/mono/mono/utils/mono-jemalloc.h b/src/mono/mono/utils/mono-jemalloc.h index 6721877f514285..73d869bbb36d07 100644 --- a/src/mono/mono/utils/mono-jemalloc.h +++ b/src/mono/mono/utils/mono-jemalloc.h @@ -16,11 +16,11 @@ * 2. You can use it as a global malloc replacement * 3. You can use it with a prefix. If you use it with a prefix, you have to explicitly name the malloc function. * - * In order to make this feature able to be toggled at run-time, I chose to use a prefix of mono_je. + * In order to make this feature able to be toggled at run-time, I chose to use a prefix of mono_je. * This mapping is captured below in the header, in the spirit of "no magic constants". * * The place that configures jemalloc and sets this prefix is in the Makefile in - * mono/jemalloc/Makefile.am + * mono/jemalloc/Makefile.am * */ #define MONO_JEMALLOC_MALLOC mono_jemalloc diff --git a/src/mono/mono/utils/mono-linked-list-set.c b/src/mono/mono/utils/mono-linked-list-set.c index ee43dfdf7a3af9..a3a2b7f548cad9 100644 --- a/src/mono/mono/utils/mono-linked-list-set.c +++ b/src/mono/mono/utils/mono-linked-list-set.c @@ -139,7 +139,7 @@ gboolean mono_lls_insert (MonoLinkedListSet *list, MonoThreadHazardPointers *hp, MonoLinkedListSetNode *value) { MonoLinkedListSetNode *cur, **prev; - /*We must do a store barrier before inserting + /*We must do a store barrier before inserting to make sure all values in @node are globally visible.*/ mono_memory_barrier (); diff --git a/src/mono/mono/utils/mono-log-android.c b/src/mono/mono/utils/mono-log-android.c index 6a86ce1c8fba6b..4a4c4b1932fd53 100644 --- a/src/mono/mono/utils/mono-log-android.c +++ b/src/mono/mono/utils/mono-log-android.c @@ -20,7 +20,7 @@ * \param path Unused * \param userData Unused * Open access to Android logcat (no-op) - */ + */ void mono_log_open_logcat (const char *path, void *userData) { diff --git a/src/mono/mono/utils/mono-log-common.c b/src/mono/mono/utils/mono-log-common.c index 74cfd6adba2e66..6ad11e378cca2f 100644 --- a/src/mono/mono/utils/mono-log-common.c +++ b/src/mono/mono/utils/mono-log-common.c @@ -35,7 +35,7 @@ static void *logUserData = NULL; /** * mapSyslogLevel: - * + * * @level - GLogLevelFlags value * @returns The equivalent character identifier */ @@ -80,7 +80,7 @@ mono_log_open_logfile(const char *path, void *userData) } #endif if (logFile == NULL) { - g_warning("opening of log file %s failed with %s - defaulting to stdout", + g_warning("opening of log file %s failed with %s - defaulting to stdout", path, strerror(errno)); logFile = stdout; } diff --git a/src/mono/mono/utils/mono-log-flight-recorder.c b/src/mono/mono/utils/mono-log-flight-recorder.c index ff76d6d43346ea..c083391038f1bb 100644 --- a/src/mono/mono/utils/mono-log-flight-recorder.c +++ b/src/mono/mono/utils/mono-log-flight-recorder.c @@ -63,7 +63,7 @@ handle_command (gpointer state, gpointer payload, gboolean at_shutdown) #if 0 // Dump all messages on each append. This is an aggressive, slow - // debugging method. + // debugging method. LogMessage messages [MAX_RECORDER_LOG_LEN]; LogQueueDumpRequest dump; @@ -100,8 +100,8 @@ static MonoUtilityThread *logger_thread; * mono_log_open_recorder: * \param path Unused * \param userData Unused - * Open access to recorder - */ + * Open access to recorder + */ void mono_log_open_recorder (const char *path, void *userData) { @@ -150,7 +150,7 @@ mono_log_write_recorder (const char *log_domain, GLogLevelFlags level, mono_bool /** * mono_log_close_recorder * - * Close access to recorder + * Close access to recorder */ void mono_log_close_recorder (void) diff --git a/src/mono/mono/utils/mono-log-posix.c b/src/mono/mono/utils/mono-log-posix.c index 454bf021356e1a..094a9f1a5bd254 100644 --- a/src/mono/mono/utils/mono-log-posix.c +++ b/src/mono/mono/utils/mono-log-posix.c @@ -32,12 +32,12 @@ static void *logUserData = NULL; /** * mapSyslogLevel: - * + * * @level - GLogLevelFlags value * @returns The equivalent syslog priority value */ static __inline__ int -mapSyslogLevel(GLogLevelFlags level) +mapSyslogLevel(GLogLevelFlags level) { if (level & G_LOG_LEVEL_ERROR) return (LOG_ERR); @@ -58,7 +58,7 @@ mapSyslogLevel(GLogLevelFlags level) * mono_log_open_syslog: * \param ident Identifier: ignored * \param userData Not used - * Open the syslog interface specifying that we want our PID recorded + * Open the syslog interface specifying that we want our PID recorded * and that we're using the \c LOG_USER facility. */ void diff --git a/src/mono/mono/utils/mono-log-windows.c b/src/mono/mono/utils/mono-log-windows.c index b7d328cf33e027..cd6e8922d76d5a 100644 --- a/src/mono/mono/utils/mono-log-windows.c +++ b/src/mono/mono/utils/mono-log-windows.c @@ -34,7 +34,7 @@ static const wchar_t *logFileName = L".//mono.log"; // FIXME double slash /** * mapSyslogLevel: - * + * * @level - GLogLevelFlags value * @returns The equivalent character identifier */ @@ -60,7 +60,7 @@ mapLogFileLevel (GLogLevelFlags level) * mono_log_open_syslog: * \param ident Identifier: ignored * \param userData Not used - * Open the syslog file. If the open fails issue a warning and + * Open the syslog file. If the open fails issue a warning and * use stdout as the log file destination. */ void diff --git a/src/mono/mono/utils/mono-logger-internals.h b/src/mono/mono/utils/mono-logger-internals.h index bff13285fb6d9a..4100ddaa105f2c 100644 --- a/src/mono/mono/utils/mono-logger-internals.h +++ b/src/mono/mono/utils/mono-logger-internals.h @@ -45,16 +45,16 @@ mono_trace_init (void); MONO_API void mono_tracev_inner (GLogLevelFlags level, MonoTraceMask mask, const char *format, va_list args); -void +void mono_trace_set_level (GLogLevelFlags level); -void +void mono_trace_set_mask (MonoTraceMask mask); -void +void mono_trace_push (GLogLevelFlags level, MonoTraceMask mask); -void +void mono_trace_pop (void); MONO_COMPONENT_API diff --git a/src/mono/mono/utils/mono-logger.c b/src/mono/mono/utils/mono-logger.c index b5870ac3b25155..83a97b326ea146 100644 --- a/src/mono/mono/utils/mono-logger.c +++ b/src/mono/mono/utils/mono-logger.c @@ -37,7 +37,7 @@ typedef struct { * * Initializes the mono tracer. */ -void +void mono_trace_init (void) { if(level_stack == NULL) { @@ -68,7 +68,7 @@ mono_trace_init (void) * Traces a new message, depending on the current logging level * and trace mask. */ -void +void mono_tracev_inner (GLogLevelFlags level, MonoTraceMask mask, const char *format, va_list args) { char *log_message; @@ -93,7 +93,7 @@ mono_tracev_inner (GLogLevelFlags level, MonoTraceMask mask, const char *format, * \c mono_trace will check the visibility of a message against this * value. */ -void +void mono_trace_set_level (GLogLevelFlags level) { if(level_stack == NULL) @@ -109,7 +109,7 @@ mono_trace_set_level (GLogLevelFlags level) * \c mono_trace will check the visibility of a message against this * value. */ -void +void mono_trace_set_mask (MonoTraceMask mask) { if(level_stack == NULL) @@ -124,7 +124,7 @@ mono_trace_set_mask (MonoTraceMask mask) * Sets the current logging destination. This can be a file or, if supported, * syslog. */ -void +void mono_trace_set_logdest_string (const char *dest) { MonoLogCallParm logger; @@ -179,7 +179,7 @@ mono_trace_set_logdest_string (const char *dest) * \param head Whether we want pid/date/time header on log messages * Sets the current logging header option. */ -void +void mono_trace_set_logheader_string(const char *head) { if (head == NULL) { @@ -196,7 +196,7 @@ mono_trace_set_logheader_string(const char *head) * Saves the current values of level and mask then calls \c mono_trace_set * with the specified new values. */ -void +void mono_trace_push (GLogLevelFlags level, MonoTraceMask mask) { if(level_stack == NULL) @@ -220,7 +220,7 @@ mono_trace_push (GLogLevelFlags level, MonoTraceMask mask) * * Restores level and mask values saved from a previous call to mono_trace_push. */ -void +void mono_trace_pop (void) { if(level_stack == NULL) @@ -240,7 +240,7 @@ mono_trace_pop (void) } -void +void mono_trace_set_level_string (const char *value) { int i = 0; @@ -263,7 +263,7 @@ mono_trace_set_level_string (const char *value) g_print("Unknown trace loglevel: %s\n", value); } -void +void mono_trace_set_mask_string (const char *value) { int i; @@ -368,7 +368,7 @@ log_level_get_name (GLogLevelFlags log_level) /** * callback_adapter - * + * * @log_domain Message prefix * @log_level Severity * @message Message to be written @@ -415,7 +415,7 @@ legacy_closer(void) { if (logCallback.user_data != NULL) { g_free (logCallback.user_data); /* This is a UserSuppliedLoggerUserData struct */ - logCallback.opener = NULL; + logCallback.opener = NULL; logCallback.writer = NULL; logCallback.closer = NULL; logCallback.user_data = NULL; @@ -425,10 +425,10 @@ legacy_closer(void) /** * mono_trace_set_log_handler: - * + * * @callback The callback that will replace the default logging handler * @user_data Argument passed to @callback - * + * * The log handler replaces the default runtime logger. All logging requests with be routed to it. * If the fatal argument in the callback is true, the callback must abort the current process. The runtime expects that * execution will not resume after a fatal error. diff --git a/src/mono/mono/utils/mono-logger.h b/src/mono/mono/utils/mono-logger.h index a90e6c54cf365c..e3ef20475485c3 100644 --- a/src/mono/mono/utils/mono-logger.h +++ b/src/mono/mono/utils/mono-logger.h @@ -8,10 +8,10 @@ #include MONO_BEGIN_DECLS -MONO_API void +MONO_API void mono_trace_set_level_string (const char *value); -MONO_API void +MONO_API void mono_trace_set_mask_string (const char *value); typedef void (*MonoPrintCallback) (const char *string, mono_bool is_stdout); diff --git a/src/mono/mono/utils/mono-md5.c b/src/mono/mono/utils/mono-md5.c index 165e42a564f925..b239cd1782cefd 100644 --- a/src/mono/mono/utils/mono-md5.c +++ b/src/mono/mono/utils/mono-md5.c @@ -86,7 +86,7 @@ static union _endian { gint i; gchar b[4]; } *_endian = (union _endian *)&_ie; /* * Note: this code is harmless on little-endian machines. */ -static void +static void _byte_reverse (guchar *buf, guint32 longs) { guint32 t; @@ -100,26 +100,26 @@ _byte_reverse (guchar *buf, guint32 longs) /** * mono_md5_init: Initialise an md5 context object - * @ctx: md5 context - * - * Initialise an md5 buffer. + * @ctx: md5 context + * + * Initialise an md5 buffer. * **/ -void +void mono_md5_init (MonoMD5Context *ctx) { ctx->buf[0] = 0x67452301; ctx->buf[1] = 0xefcdab89; ctx->buf[2] = 0x98badcfe; ctx->buf[3] = 0x10325476; - + ctx->bits[0] = 0; ctx->bits[1] = 0; - - if (IS_BIG_ENDIAN()) - ctx->doByteReverse = 1; - else - ctx->doByteReverse = 0; + + if (IS_BIG_ENDIAN()) + ctx->doByteReverse = 1; + else + ctx->doByteReverse = 0; } @@ -129,29 +129,29 @@ mono_md5_init (MonoMD5Context *ctx) * @ctx: conetxt object used for md5 computaion * @buf: buffer to add * @len: buffer length - * + * * Update context to reflect the concatenation of another buffer full * of bytes. Use this to progressively construct an md5 hash. **/ -void +void mono_md5_update (MonoMD5Context *ctx, const guchar *buf, guint32 len) { guint32 t; - + /* Update bitcount */ - + t = ctx->bits[0]; if ((ctx->bits[0] = t + ((guint32) len << 3)) < t) ctx->bits[1]++; /* Carry from low to high */ ctx->bits[1] += len >> 29; - + t = (t >> 3) & 0x3f; /* Bytes already in shsInfo->data */ - + /* Handle any leading odd-sized chunks */ - + if (t) { guchar *p = (guchar *) ctx->in + t; - + t = 64 - t; if (len < t) { memcpy (p, buf, len); @@ -165,7 +165,7 @@ mono_md5_update (MonoMD5Context *ctx, const guchar *buf, guint32 len) len -= t; } /* Process data in 64-byte chunks */ - + while (len >= 64) { memcpy (ctx->in, buf, 64); if (ctx->doByteReverse) @@ -174,9 +174,9 @@ mono_md5_update (MonoMD5Context *ctx, const guchar *buf, guint32 len) buf += 64; len -= 64; } - + /* Handle any remaining bytes of data. */ - + memcpy (ctx->in, buf, len); } @@ -185,33 +185,33 @@ mono_md5_update (MonoMD5Context *ctx, const guchar *buf, guint32 len) /* - * Final wrapup - pad to 64-byte boundary with the bit pattern + * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */ /** * mono_md5_final: copy the final md5 hash to a bufer * @digest: 16 bytes buffer * @ctx: context containing the calculated md5 - * + * * copy the final md5 hash to a bufer **/ -void +void mono_md5_final (MonoMD5Context *ctx, guchar digest[16]) { guint32 count; guchar *p; - + /* Compute number of bytes mod 64 */ count = (ctx->bits[0] >> 3) & 0x3F; - + /* Set the first char of padding to 0x80. This is safe since there is always at least one byte free */ p = ctx->in + count; *p++ = 0x80; - + /* Bytes of padding needed to make 64 bytes */ count = 64 - 1 - count; - + /* Pad out to 56 mod 64 */ if (count < 8) { /* Two lots of padding: Pad the first block to 64 bytes */ @@ -219,7 +219,7 @@ mono_md5_final (MonoMD5Context *ctx, guchar digest[16]) if (ctx->doByteReverse) _byte_reverse (ctx->in, 16); md5_transform (ctx->buf, (guint32 *) ctx->in); - + /* Now fill the next block with 56 bytes */ memset (ctx->in, 0, 56); } else { @@ -228,11 +228,11 @@ mono_md5_final (MonoMD5Context *ctx, guchar digest[16]) } if (ctx->doByteReverse) _byte_reverse (ctx->in, 14); - + /* Append length in bits and transform */ ((guint32 *) ctx->in)[14] = ctx->bits[0]; ((guint32 *) ctx->in)[15] = ctx->bits[1]; - + md5_transform (ctx->buf, (guint32 *) ctx->in); if (ctx->doByteReverse) _byte_reverse ((guchar *) ctx->buf, 4); @@ -265,16 +265,16 @@ mono_md5_ctx_byte_length (MonoMD5Context *ctx) * reflect the addition of 16 longwords of new data. md5_Update blocks * the data and converts bytes into longwords for this routine. */ -static void +static void md5_transform (guint32 buf[4], const guint32 in[16]) { guint32 a, b, c, d; - + a = buf[0]; b = buf[1]; c = buf[2]; d = buf[3]; - + MD5STEP (F1, a, b, c, d, in[0] + 0xd76aa478, 7); MD5STEP (F1, d, a, b, c, in[1] + 0xe8c7b756, 12); MD5STEP (F1, c, d, a, b, in[2] + 0x242070db, 17); @@ -291,7 +291,7 @@ md5_transform (guint32 buf[4], const guint32 in[16]) MD5STEP (F1, d, a, b, c, in[13] + 0xfd987193, 12); MD5STEP (F1, c, d, a, b, in[14] + 0xa679438e, 17); MD5STEP (F1, b, c, d, a, in[15] + 0x49b40821, 22); - + MD5STEP (F2, a, b, c, d, in[1] + 0xf61e2562, 5); MD5STEP (F2, d, a, b, c, in[6] + 0xc040b340, 9); MD5STEP (F2, c, d, a, b, in[11] + 0x265e5a51, 14); @@ -308,7 +308,7 @@ md5_transform (guint32 buf[4], const guint32 in[16]) MD5STEP (F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); MD5STEP (F2, c, d, a, b, in[7] + 0x676f02d9, 14); MD5STEP (F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); - + MD5STEP (F3, a, b, c, d, in[5] + 0xfffa3942, 4); MD5STEP (F3, d, a, b, c, in[8] + 0x8771f681, 11); MD5STEP (F3, c, d, a, b, in[11] + 0x6d9d6122, 16); @@ -325,7 +325,7 @@ md5_transform (guint32 buf[4], const guint32 in[16]) MD5STEP (F3, d, a, b, c, in[12] + 0xe6db99e5, 11); MD5STEP (F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); MD5STEP (F3, b, c, d, a, in[2] + 0xc4ac5665, 23); - + MD5STEP (F4, a, b, c, d, in[0] + 0xf4292244, 6); MD5STEP (F4, d, a, b, c, in[7] + 0x432aff97, 10); MD5STEP (F4, c, d, a, b, in[14] + 0xab9423a7, 15); @@ -342,7 +342,7 @@ md5_transform (guint32 buf[4], const guint32 in[16]) MD5STEP (F4, d, a, b, c, in[11] + 0xbd3af235, 10); MD5STEP (F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); MD5STEP (F4, b, c, d, a, in[9] + 0xeb86d391, 21); - + buf[0] += a; buf[1] += b; buf[2] += c; @@ -357,19 +357,19 @@ md5_transform (guint32 buf[4], const guint32 in[16]) * \param buffer byte buffer * \param buffer_size buffer size (in bytes) * \param digest 16-byte buffer receiving the hash code. - * - * Get the MD5 hash of a buffer. The result is put in + * + * Get the MD5 hash of a buffer. The result is put in * the 16-byte buffer \p digest. */ void mono_md5_get_digest (const guchar *buffer, gint buffer_size, guchar digest[16]) -{ +{ MonoMD5Context ctx; mono_md5_init (&ctx); mono_md5_update (&ctx, buffer, buffer_size); mono_md5_final (&ctx, digest); - + } @@ -377,15 +377,15 @@ mono_md5_get_digest (const guchar *buffer, gint buffer_size, guchar digest[16]) * mono_md5_get_digest_from_file: * \param filename file name * \param digest 16-byte buffer receiving the hash code. - * - * Get the MD5 hash of a file. The result is put in + * + * Get the MD5 hash of a file. The result is put in * the 16-byte buffer \p digest. - * + * * If an IO error happens the value in \p digest is not updated. */ void mono_md5_get_digest_from_file (const gchar *filename, guchar digest[16]) -{ +{ MonoMD5Context ctx; guchar tmp_buf[1024]; gint nb_bytes_read; @@ -396,10 +396,10 @@ mono_md5_get_digest_from_file (const gchar *filename, guchar digest[16]) if (!fp) { return; } - + while ((nb_bytes_read = fread (tmp_buf, sizeof (guchar), 1024, fp)) > 0) mono_md5_update (&ctx, tmp_buf, nb_bytes_read); - + if (ferror(fp)) { fclose(fp); return; diff --git a/src/mono/mono/utils/mono-memory-model.h b/src/mono/mono/utils/mono-memory-model.h index a35433fd023dd7..863ee77d615635 100644 --- a/src/mono/mono/utils/mono-memory-model.h +++ b/src/mono/mono/utils/mono-memory-model.h @@ -22,7 +22,7 @@ On the other hand, we can't use arm's weak model on targets such as x86 that hav a stronger model that requires much much less fencing. The idea of exposing each arch memory model is to avoid fencing whenever possible -but at the same time make all required ordering explicit. +but at the same time make all required ordering explicit. There are four kinds of barriers, LoadLoad, LoadStore, StoreLoad and StoreStore. Each arch must define which ones needs fencing. @@ -109,19 +109,19 @@ LDR R3, [R4, R0] #ifndef STORE_STORE_FENCE #define STORE_STORE_FENCE mono_compiler_barrier () -#endif +#endif #ifndef LOAD_LOAD_FENCE #define LOAD_LOAD_FENCE mono_compiler_barrier () -#endif +#endif #ifndef STORE_LOAD_FENCE #define STORE_LOAD_FENCE mono_compiler_barrier () -#endif +#endif #ifndef LOAD_STORE_FENCE #define LOAD_STORE_FENCE mono_compiler_barrier () -#endif +#endif #ifndef STORE_RELEASE_FENCE #define STORE_RELEASE_FENCE mono_compiler_barrier () diff --git a/src/mono/mono/utils/mono-mmap-wasm.c b/src/mono/mono/utils/mono-mmap-wasm.c index 82f117b728c798..3364ec4fed939e 100644 --- a/src/mono/mono/utils/mono-mmap-wasm.c +++ b/src/mono/mono/utils/mono-mmap-wasm.c @@ -63,7 +63,7 @@ mono_valloc_granule (void) static int prot_from_flags (int flags) -{ +{ #if HOST_WASI // The mmap in wasi-sdk rejects PROT_NONE, but otherwise disregards the flags // We just need to pass an acceptable value diff --git a/src/mono/mono/utils/mono-networkinterfaces.c b/src/mono/mono/utils/mono-networkinterfaces.c index f86bd651ee74be..c93ce63db77cd2 100644 --- a/src/mono/mono/utils/mono-networkinterfaces.c +++ b/src/mono/mono/utils/mono-networkinterfaces.c @@ -27,7 +27,7 @@ mono_networkinterface_list (int *size) char name [256]; f = fopen ("/proc/net/dev", "r"); - if (!f) + if (!f) return NULL; if (!fgets (buf, sizeof (buf) / sizeof (char), f)) @@ -86,7 +86,7 @@ mono_network_get_data (char* name, MonoNetworkData data, MonoNetworkError *error *error = MONO_NETWORK_ERROR_OTHER; f = fopen ("/proc/net/dev", "r"); - if (!f) + if (!f) return -1; if (!fgets (buf, sizeof (buf) / sizeof (char), f)) @@ -109,7 +109,7 @@ mono_network_get_data (char* name, MonoNetworkData data, MonoNetworkError *error &rx_bytes, &rx_packets, &rx_errs, &rx_drops, &rx_fifo, &rx_frame, &rx_multi, &tx_bytes, &tx_packets, &tx_errs, &tx_drops, - &tx_fifo, &tx_colls, &tx_carrier) != 14) + &tx_fifo, &tx_colls, &tx_carrier) != 14) goto out; switch (data) { diff --git a/src/mono/mono/utils/mono-path.c b/src/mono/mono/utils/mono-path.c index 2f4790666a4280..5e4f117272206a 100644 --- a/src/mono/mono/utils/mono-path.c +++ b/src/mono/mono/utils/mono-path.c @@ -1,7 +1,7 @@ /** * \file * Routines for handling path names. - * + * * Authors: * Gonzalo Paniagua Javier (gonzalo@novell.com) * Miguel de Icaza (miguel@novell.com) @@ -69,7 +69,7 @@ mono_path_canonicalize (const char *path) if (backc > 0) { backc--; } else { - if (dest != lastpos) + if (dest != lastpos) /* The two strings can overlap */ memmove (dest, lastpos, len + 1); dest += len + 1; @@ -86,9 +86,9 @@ mono_path_canonicalize (const char *path) if (*(lastpos-1) == G_DIR_SEPARATOR && *(lastpos-2) == G_DIR_SEPARATOR && *lastpos == 0) lastpos = lastpos-1; #endif - + if (dest != lastpos) strcpy (dest, lastpos); - + g_strreverse (abspath); /* We strip away all trailing dir separators. This is not correct for the root directory, @@ -126,7 +126,7 @@ resolve_symlink (const char *path) g_free (copy); return p; } - + buffer [n] = 0; if (!g_path_is_absolute (buffer)) { dir = g_path_get_dirname (p); diff --git a/src/mono/mono/utils/mono-poll.c b/src/mono/mono/utils/mono-poll.c index 022cabc24b4be3..20091c34e6dc96 100644 --- a/src/mono/mono/utils/mono-poll.c +++ b/src/mono/mono/utils/mono-poll.c @@ -108,7 +108,7 @@ mono_poll (mono_pollfd *ufds, unsigned int nfds, int timeout) nexc++; if (fd > maxfd) maxfd = fd; - + } affected = select (maxfd + 1, &rfds, &wfds, &efds, tvptr); diff --git a/src/mono/mono/utils/mono-private-unstable.h b/src/mono/mono/utils/mono-private-unstable.h index 241a7234479579..489c3451b49b06 100644 --- a/src/mono/mono/utils/mono-private-unstable.h +++ b/src/mono/mono/utils/mono-private-unstable.h @@ -1,6 +1,6 @@ /** * \file - * + * * Private unstable APIs. * * WARNING: The declarations and behavior of functions in this header are NOT STABLE and can be modified or removed at diff --git a/src/mono/mono/utils/mono-property-hash.c b/src/mono/mono/utils/mono-property-hash.c index 0703b8b977778a..65b257d2e16f72 100644 --- a/src/mono/mono/utils/mono-property-hash.c +++ b/src/mono/mono/utils/mono-property-hash.c @@ -56,7 +56,7 @@ mono_property_hash_insert (MonoPropertyHash *hash, gpointer object, guint32 prop } g_hash_table_insert (prop_hash, object, value); -} +} static void remove_object (gpointer key, gpointer value, gpointer user_data) @@ -82,4 +82,4 @@ mono_property_hash_lookup (MonoPropertyHash *hash, gpointer object, guint32 prop return NULL; return g_hash_table_lookup (prop_hash, object); } - + diff --git a/src/mono/mono/utils/mono-publib.h b/src/mono/mono/utils/mono-publib.h index b01438e52cf1cb..24346ccf1c578c 100644 --- a/src/mono/mono/utils/mono-publib.h +++ b/src/mono/mono/utils/mono-publib.h @@ -5,7 +5,7 @@ #ifndef __MONO_PUBLIB_H__ #define __MONO_PUBLIB_H__ -/* +/* * Minimal general purpose header for use in public mono header files. * We can't include config.h, so we use compiler-specific preprocessor * directives where needed. diff --git a/src/mono/mono/utils/mono-rand.c b/src/mono/mono/utils/mono-rand.c index ae6e7951695620..52b1e2807fdb8f 100644 --- a/src/mono/mono/utils/mono-rand.c +++ b/src/mono/mono/utils/mono-rand.c @@ -131,7 +131,7 @@ get_entropy_from_egd (const char *path, guchar *buffer, gssize buffer_size, Mono gint ret; guint offset = 0; int err = 0; - + socket_fd = socket (PF_UNIX, SOCK_STREAM, 0); if (socket_fd < 0) { ret = -1; @@ -325,7 +325,7 @@ mono_rand_try_get_bytes (gpointer *handle, guchar *buffer, gssize buffer_size, M error_init (error); g_static_assert (RAND_MAX >= 0xFF); - + while (buffer_size > 0) { int const i = rand (); int j; diff --git a/src/mono/mono/utils/mono-sha1.c b/src/mono/mono/utils/mono-sha1.c index bfcf6cf4031b57..7b6d6dd4d273e0 100644 --- a/src/mono/mono/utils/mono-sha1.c +++ b/src/mono/mono/utils/mono-sha1.c @@ -5,7 +5,7 @@ By Steve Reid 100% Public Domain ----------------- -Modified 7/98 +Modified 7/98 By James H. Brown Still 100% Public Domain @@ -27,7 +27,7 @@ Since the file IO in main() reads 16K at a time, any file 8K or larger would be guaranteed to generate the wrong hash (e.g. Test Vector #3, a million "a"s). -I also changed the declaration of variables i & j in mono_sha1_update to +I also changed the declaration of variables i & j in mono_sha1_update to unsigned long from unsigned int for the same reason. These changes should make no difference to any 32 bit implementations since @@ -54,7 +54,7 @@ Still 100% public domain Modified 4/01 By Saul Kravitz Still 100% PD -Modified to run on Compaq Alpha hardware. +Modified to run on Compaq Alpha hardware. */ @@ -137,7 +137,7 @@ static void SHA1Transform(guint32 state[5], const guchar buffer[64]); static void SHAPrintContext(MonoSHA1Context *context, char *msg){ printf("%s (%d,%d) %x %x %x %x %x\n", msg, - context->count[0], context->count[1], + context->count[0], context->count[1], context->state[0], context->state[1], context->state[2], @@ -287,28 +287,28 @@ unsigned char finalcount[8]; */ void mono_sha1_get_digest (const guchar *buffer, gint buffer_size, guchar digest [20]) -{ +{ MonoSHA1Context ctx; mono_sha1_init (&ctx); mono_sha1_update (&ctx, buffer, buffer_size); mono_sha1_final (&ctx, digest); - + } /** * mono_sha1_get_digest_from_file: * \param filename file name * \param digest 20-byte buffer receiving the hash code. - * - * Get the SHA-1 hash of a file. The result is put in + * + * Get the SHA-1 hash of a file. The result is put in * the 20-byte buffer \p digest. - * + * * If an IO error happens the value in \p digest is not updated. */ void mono_sha1_get_digest_from_file (const gchar *filename, guchar digest [20]) -{ +{ MonoSHA1Context ctx; guchar tmp_buf[1024]; gint nb_bytes_read; @@ -319,10 +319,10 @@ mono_sha1_get_digest_from_file (const gchar *filename, guchar digest [20]) if (!fp) { return; } - + while ((nb_bytes_read = fread (tmp_buf, sizeof (guchar), 1024, fp)) > 0) mono_sha1_update (&ctx, tmp_buf, nb_bytes_read); - + if (ferror(fp)) { fclose(fp); return; @@ -339,7 +339,7 @@ mono_sha1_get_digest_from_file (const gchar *filename, guchar digest [20]) * Get the public token from public key data. * \p token must point to at least 8 bytes of storage. */ -void +void mono_digest_get_public_token (guchar* token, const guchar *pubkey, guint32 len) { guchar digest [20]; diff --git a/src/mono/mono/utils/mono-stack-unwinding.h b/src/mono/mono/utils/mono-stack-unwinding.h index b3109a9b0e61f3..66931c6defc040 100644 --- a/src/mono/mono/utils/mono-stack-unwinding.h +++ b/src/mono/mono/utils/mono-stack-unwinding.h @@ -55,7 +55,7 @@ typedef enum { typedef struct { MonoStackFrameType type; - /* + /* * For FRAME_TYPE_MANAGED, otherwise NULL. */ MonoJitInfo *ji; @@ -79,7 +79,7 @@ typedef struct { int native_offset; /* * IL offset of this frame. - * Only available if the runtime have debugging enabled (--debug switch) and + * Only available if the runtime have debugging enabled (--debug switch) and * il offset resultion was requested (MONO_UNWIND_LOOKUP_IL_OFFSET) */ int il_offset; @@ -114,7 +114,7 @@ typedef struct { enum { MONO_UNWIND_DATA_DOMAIN, MONO_UNWIND_DATA_LMF, - MONO_UNWIND_DATA_JIT_TLS, + MONO_UNWIND_DATA_JIT_TLS, }; /* diff --git a/src/mono/mono/utils/mono-stdlib.c b/src/mono/mono/utils/mono-stdlib.c index 5f679b15fafdf1..3c94f06aa1d48e 100644 --- a/src/mono/mono/utils/mono-stdlib.c +++ b/src/mono/mono/utils/mono-stdlib.c @@ -1,7 +1,7 @@ /** * \file * stdlib replacement functions. - * + * * Authors: * Gonzalo Paniagua Javier (gonzalo@novell.com) * diff --git a/src/mono/mono/utils/mono-threads-aix.c b/src/mono/mono/utils/mono-threads-aix.c index 28cae9b44abec0..5ce0e25561930d 100644 --- a/src/mono/mono/utils/mono-threads-aix.c +++ b/src/mono/mono/utils/mono-threads-aix.c @@ -12,7 +12,7 @@ void mono_threads_platform_get_stack_bounds (guint8 **staddr, size_t *stsize) { - /* see GC_push_all_stacks in libgc/aix_irix_threads.c + /* see GC_push_all_stacks in libgc/aix_irix_threads.c for why we do this; pthread_getattr_np exists only on some versions of AIX and not on PASE, so use a legacy way to get the stack information */ diff --git a/src/mono/mono/utils/mono-threads-coop.c b/src/mono/mono/utils/mono-threads-coop.c index 970a7099e9ecfa..602a607439c0f5 100644 --- a/src/mono/mono/utils/mono-threads-coop.c +++ b/src/mono/mono/utils/mono-threads-coop.c @@ -41,7 +41,7 @@ #elif defined (HOST_WASM) //TODO: figure out wasm stack scanning #define SAVE_REGS_ON_STACK do {} while (0) -#else +#else #define SAVE_REGS_ON_STACK __builtin_unwind_init (); #endif diff --git a/src/mono/mono/utils/mono-threads-mach-helper.c b/src/mono/mono/utils/mono-threads-mach-helper.c index 7b4f140b619ef9..498d9ff069d65d 100644 --- a/src/mono/mono/utils/mono-threads-mach-helper.c +++ b/src/mono/mono/utils/mono-threads-mach-helper.c @@ -49,7 +49,7 @@ static id mono_dead_letter_key; * due to duplicate entries. * * So what do we do here? - * + * * Experimentation showns that threadDictionary is destroied after the * problematic keys, so we add our dead letter object as an aditional * way to be notified of thread death. @@ -115,7 +115,7 @@ mono_threads_init_dead_letter (void) alloc = sel_registerName ("alloc"); release = sel_registerName ("release"); dealloc = sel_registerName ("dealloc"); - + currentThread = sel_registerName ("currentThread"); threadDictionary = sel_registerName ("threadDictionary"); diff --git a/src/mono/mono/utils/mono-threads-state-machine.c b/src/mono/mono/utils/mono-threads-state-machine.c index 927d86d619f23a..8b863f8371349a 100644 --- a/src/mono/mono/utils/mono-threads-state-machine.c +++ b/src/mono/mono/utils/mono-threads-state-machine.c @@ -315,7 +315,7 @@ mono_threads_transition_request_suspension (MonoThreadInfo *info) goto retry_state_change; trace_state_change ("SUSPEND_INIT_REQUESTED", info, raw_state, cur_state, no_safepoints, 1); return ReqSuspendAlreadySuspendedBlocking; - + /* [1] It's questionable on what to do if we hit the beginning of a self suspend. @@ -435,7 +435,7 @@ Try to resume a suspended thread. Returns one of the following values: - Sucess: The thread was resumed. - Error: The thread was not suspended in the first place. [2] -- InitSelfResume: The thread is blocked on self suspend and should be resumed +- InitSelfResume: The thread is blocked on self suspend and should be resumed - InitAsyncResume: The thread is blocked on async suspend and should be resumed - ResumeInitBlockingResume: The thread was suspended on the exit path of blocking state and should be resumed FIXME: ResumeInitBlockingResume is just InitSelfResume by a different name. diff --git a/src/mono/mono/utils/mono-threads.h b/src/mono/mono/utils/mono-threads.h index 4a29ab561e7f6e..d0efd7d77c1c69 100644 --- a/src/mono/mono/utils/mono-threads.h +++ b/src/mono/mono/utils/mono-threads.h @@ -407,7 +407,7 @@ mono_thread_info_set_tid (THREAD_INFO_TYPE *info, MonoNativeThreadId tid) /* * @thread_info_size is sizeof (GcThreadInfo), a struct the GC defines to make it possible to have - * a single block with info from both camps. + * a single block with info from both camps. */ void mono_thread_info_init (size_t thread_info_size); @@ -647,8 +647,8 @@ mono_native_thread_id_main_thread_known (MonoNativeThreadId *main_thread_tid); /* * This does _not_ return the same value as mono_native_thread_id_get, except on Windows. * On POSIX, mono_native_thread_id_get returns the value from pthread_self, which is then - * passed around as an identifier to other pthread functions. However this function, where - * possible, returns the OS-unique thread id value, fetched in a platform-specific manner. + * passed around as an identifier to other pthread functions. However this function, where + * possible, returns the OS-unique thread id value, fetched in a platform-specific manner. * It will not work with the various pthread functions, should never be used as a * MonoNativeThreadId, and is intended solely to match the output of various diagonistic tools. */ diff --git a/src/mono/mono/utils/mono-uri.c b/src/mono/mono/utils/mono-uri.c index a39f6be3f0819d..ed49c4c96bdb47 100644 --- a/src/mono/mono/utils/mono-uri.c +++ b/src/mono/mono/utils/mono-uri.c @@ -39,7 +39,7 @@ int main () { char *s = g_malloc (256); int i = 0; - + s [255] = 0; for (i = 1; i < 256; i++) diff --git a/src/mono/mono/utils/mono-utility-thread.c b/src/mono/mono/utils/mono-utility-thread.c index ce248018d11719..1c88040df35d37 100644 --- a/src/mono/mono/utils/mono-utility-thread.c +++ b/src/mono/mono/utils/mono-utility-thread.c @@ -22,7 +22,7 @@ typedef struct { MonoSemType *response_sem; // Variably-sized, size is thread->payload_size - gpointer payload [MONO_ZERO_LEN_ARRAY]; + gpointer payload [MONO_ZERO_LEN_ARRAY]; } UtilityThreadQueueEntry; static void @@ -38,7 +38,7 @@ utility_thread_handle_inbox (MonoUtilityThread *thread, gboolean at_shutdown) UtilityThreadQueueEntry *entry = (UtilityThreadQueueEntry *) mono_lock_free_queue_dequeue (&thread->work_queue); if (!entry) return FALSE; - + thread->callbacks.command (thread->state_ptr, &entry->payload, at_shutdown); if (entry->response_sem) { *entry->finished = TRUE; diff --git a/src/mono/mono/utils/mono-value-hash.c b/src/mono/mono/utils/mono-value-hash.c index 351df65443a695..42e2a9b6b36473 100644 --- a/src/mono/mono/utils/mono-value-hash.c +++ b/src/mono/mono/utils/mono-value-hash.c @@ -133,7 +133,7 @@ mono_value_hash_table_new (GHashFunc hash_func, GEqualFunc key_equal_func, MonoV mono_value_hash_table_set_shift (hash, HASH_TABLE_MIN_SHIFT); hash->table = g_new0 (Slot, hash->table_size); - + return hash; } @@ -146,10 +146,10 @@ mono_value_hash_table_new_full (GHashFunc hash_func, GEqualFunc key_equal_func, MonoValueHashTable *hash = mono_value_hash_table_new (hash_func, key_equal_func); if (hash == NULL) return NULL; - + hash->key_destroy_func = key_destroy_func; hash->value_destroy_func = value_destroy_func; - + return hash; } @@ -169,7 +169,7 @@ do_rehash (MonoValueHashTable *hash) /* printf ("New size: %d\n", hash->table_size); */ hash->table = g_new0 (Slot, hash->table_size); - + for (i = 0; i < old_size; i++){ Slot *s = &old_table [i]; Slot *new_s; @@ -222,7 +222,7 @@ mono_value_hash_table_insert_replace (MonoValueHashTable *hash, gpointer key, gp g_assert (value); g_assert (hash->key_extract_func (value) == key); - + g_return_if_fail (hash != NULL); hashcode = HASH (hash, key); @@ -282,7 +282,7 @@ lookup_internal (MonoValueHashTable *hash, gconstpointer key) guint hashcode; guint s_index; guint step = 0; - + hashcode = HASH (hash, key); s_index = hashcode & hash->table_mask; @@ -321,7 +321,7 @@ void mono_value_hash_table_destroy (MonoValueHashTable *hash) { int i; - + g_return_if_fail (hash != NULL); for (i = 0; i < hash->table_size; i++){ @@ -335,6 +335,6 @@ mono_value_hash_table_destroy (MonoValueHashTable *hash) } } g_free (hash->table); - + g_free (hash); } diff --git a/src/mono/mono/utils/mono-value-hash.h b/src/mono/mono/utils/mono-value-hash.h index 7702844ad9eea4..27b9d95d4c262c 100644 --- a/src/mono/mono/utils/mono-value-hash.h +++ b/src/mono/mono/utils/mono-value-hash.h @@ -17,7 +17,7 @@ /* * This is a hash table with the following features/restrictions: - * - Keys are not stored in the table, instead a function must be supplied which + * - Keys are not stored in the table, instead a function must be supplied which * computes them from the value. * - Values are assumed to be normal pointers, i.e. their lowest 2-3 bits should be * zero. @@ -27,7 +27,7 @@ * hash tables which store the key (or even the key hash) in the hash nodes. But * it also means that each hash node has a size of one machine word, instead of * 4 in GHashTable. - * - Removal of entries is not supported, as it is not needed by the runtime right + * - Removal of entries is not supported, as it is not needed by the runtime right * now. */ diff --git a/src/mono/mono/utils/monobitset.c b/src/mono/mono/utils/monobitset.c index ecbe76cd54f9cd..db163b6a820bfc 100644 --- a/src/mono/mono/utils/monobitset.c +++ b/src/mono/mono/utils/monobitset.c @@ -115,7 +115,7 @@ mono_bitset_test (const MonoBitSet *set, guint32 pos) { * mono_bitset_test_bulk: * \param set bitset ptr * \param pos test bit at this pos - * \returns 32/64 bits from the bitset, starting from \p pos, which must be + * \returns 32/64 bits from the bitset, starting from \p pos, which must be * divisible with 32/64. */ gsize @@ -190,7 +190,7 @@ mono_bitset_size (const MonoBitSet *set) { return set->size; } -/* +/* * should test wich version is faster. */ #if 1 @@ -251,7 +251,7 @@ mono_bitset_count (const MonoBitSet *set) { #endif #if 0 -const static int +const static int bitstart_mask [] = { 0xffffffff, 0xfffffffe, 0xfffffffc, 0xfffffff8, 0xfffffff0, 0xffffffe0, 0xffffffc0, 0xffffff80, @@ -283,7 +283,7 @@ my_g_bit_nth_lsf (gsize mask, gint nth_bit) int r; /* This depends on mask != 0 */ __asm__("bsfl %1,%0\n\t" - : "=r" (r) : "g" (mask)); + : "=r" (r) : "g" (mask)); return nth_bit + r; } #elif defined(__x86_64) && defined(__GNUC__) @@ -445,7 +445,7 @@ mono_bitset_find_last (const MonoBitSet *set, gint pos) { if (pos < 0) pos = set->size - 1; - + j = pos / BITS_PER_CHUNK; bit = pos % BITS_PER_CHUNK; @@ -656,10 +656,10 @@ mono_bitset_test_safe (const MonoBitSet *set, guint32 pos) #ifdef TEST_BITSET /* - * Compile with: + * Compile with: * gcc -g -Wall -DTEST_BITSET -o monobitset monobitset.c `pkg-config --cflags --libs glib-2.0` */ -int +int main() { MonoBitSet *set1, *set2, *set3, *set4; int error = 1; @@ -671,14 +671,14 @@ main() { if (mono_bitset_count (set1) != 0) return error; error++; - + mono_bitset_set (set1, 33); if (mono_bitset_count (set1) != 1) return error; error++; /* g_print("should be 33: %d\n", mono_bitset_find_first (set1, 0)); */ - + if (mono_bitset_find_first (set1, 0) != 33) return error; error++; @@ -804,7 +804,7 @@ main() { mono_bitset_free (set4); g_print ("total tests passed: %d\n", error - 1); - + return 0; } diff --git a/src/mono/mono/utils/monobitset.h b/src/mono/mono/utils/monobitset.h index 3e89eac3bc535b..5a71dcb4a146b5 100644 --- a/src/mono/mono/utils/monobitset.h +++ b/src/mono/mono/utils/monobitset.h @@ -75,7 +75,7 @@ MONO_API MonoBitSet* mono_bitset_new (guint32 max_size, guint32 flags); MONO_API MonoBitSet* mono_bitset_mem_new (gpointer mem, guint32 max_size, guint32 flags); -MONO_API void mono_bitset_free (MonoBitSet *set); +MONO_API void mono_bitset_free (MonoBitSet *set); MONO_API void mono_bitset_set (MonoBitSet *set, guint32 pos); diff --git a/src/mono/mono/utils/networking-fallback.c b/src/mono/mono/utils/networking-fallback.c index 1b31ae503c695d..0c3b47adaf340c 100644 --- a/src/mono/mono/utils/networking-fallback.c +++ b/src/mono/mono/utils/networking-fallback.c @@ -16,7 +16,7 @@ #include #endif -#if !defined (HAVE_GETADDRINFO) +#if !defined (HAVE_GETADDRINFO) #if defined (HAVE_GETHOSTBYNAME) || defined (HAVE_GETHOSTBYNAME2) @@ -71,7 +71,7 @@ mono_get_address_info (const char *hostname, int port, int flags, MonoAddressInf if (!addr_info->entries) { *result = NULL; mono_free_address_info (addr_info); - return 1; + return 1; } *result = addr_info; diff --git a/src/mono/mono/utils/networking-missing.c b/src/mono/mono/utils/networking-missing.c index 45ccf518a7db16..1f16b4121d7fec 100644 --- a/src/mono/mono/utils/networking-missing.c +++ b/src/mono/mono/utils/networking-missing.c @@ -25,17 +25,17 @@ inet_pton (int family, const char *address, void *inaddrp) if (family == AF_INET) { #ifdef HAVE_INET_ATON struct in_addr inaddr; - + if (!inet_aton (address, &inaddr)) return 0; - + memcpy (inaddrp, &inaddr, sizeof (struct in_addr)); return 1; #else /* assume the system has inet_addr(), if it doesn't have that we're pretty much screwed... */ guint32 inaddr; - + if (!strcmp (address, "255.255.255.255")) { /* special-case hack */ inaddr = 0xffffffff; @@ -47,12 +47,12 @@ inet_pton (int family, const char *address, void *inaddrp) if (inaddr == INADDR_NONE) return 0; } - + memcpy (inaddrp, &inaddr, sizeof (guint32)); return 1; #endif /* HAVE_INET_ATON */ } - + return -1; } diff --git a/src/mono/mono/utils/networking-posix.c b/src/mono/mono/utils/networking-posix.c index 8d79cc637f7bcd..64d7a5d8a8d674 100644 --- a/src/mono/mono/utils/networking-posix.c +++ b/src/mono/mono/utils/networking-posix.c @@ -112,7 +112,7 @@ mono_get_address_info (const char *hostname, int port, int flags, MonoAddressInf if (cur->family == PF_INET) { cur->address_len = sizeof (struct in_addr); cur->address.v4 = ((struct sockaddr_in*)res->ai_addr)->sin_addr; -#ifdef HAVE_STRUCT_SOCKADDR_IN6 +#ifdef HAVE_STRUCT_SOCKADDR_IN6 } else if (cur->family == PF_INET6) { cur->address_len = sizeof (struct in6_addr); cur->address.v6 = ((struct sockaddr_in6*)res->ai_addr)->sin6_addr; @@ -131,7 +131,7 @@ mono_get_address_info (const char *hostname, int port, int flags, MonoAddressInf prev->next = cur; else addr_info->entries = cur; - + prev = cur; res = res->ai_next; } diff --git a/src/mono/mono/utils/strenc.c b/src/mono/mono/utils/strenc.c index bb383e10eca2f2..f6eb0f4b898c8d 100644 --- a/src/mono/mono/utils/strenc.c +++ b/src/mono/mono/utils/strenc.c @@ -50,16 +50,16 @@ gunichar2 *mono_unicode_from_external (const gchar *in, gsize *bytes) gchar *encoding_list; int i; glong lbytes; - + if(in==NULL) { return(NULL); } - + encoding_list=g_getenv ("MONO_EXTERNAL_ENCODINGS"); if(encoding_list==NULL) { encoding_list = g_strdup(""); } - + encodings=g_strsplit (encoding_list, ":", 0); g_free (encoding_list); for(i=0;encodings[i]!=NULL; i++) { @@ -88,9 +88,9 @@ gunichar2 *mono_unicode_from_external (const gchar *in, gsize *bytes) return((gunichar2 *)res); } } - + g_strfreev (encodings); - + if(g_utf8_validate (in, -1, NULL)) { glong items_written; gunichar2 *unires=g_utf8_to_utf16 (in, -1, NULL, &items_written, NULL); @@ -125,20 +125,20 @@ gchar *mono_utf8_from_external (const gchar *in) gchar **encodings; gchar *encoding_list; int i; - + if(in==NULL) { return(NULL); } - + encoding_list=g_getenv ("MONO_EXTERNAL_ENCODINGS"); if(encoding_list==NULL) { encoding_list = g_strdup(""); } - + encodings=g_strsplit (encoding_list, ":", 0); g_free (encoding_list); for(i=0;encodings[i]!=NULL; i++) { - + /* "default_locale" is a special case encoding */ if(!strcmp (encodings[i], "default_locale")) { res=g_locale_to_utf8 (in, -1, NULL, NULL, NULL); @@ -156,9 +156,9 @@ gchar *mono_utf8_from_external (const gchar *in) return(res); } } - + g_strfreev (encodings); - + if(g_utf8_validate (in, -1, NULL)) { return(g_strdup (in)); } @@ -184,7 +184,7 @@ gchar *mono_unicode_to_external_checked (const gunichar2 *uni, MonoError *err) gchar *utf8; gchar *encoding_list; GError *gerr = NULL; - + /* Turn the unicode into utf8 to start with, because its * easier to work with gchar * than gunichar2 * */ @@ -194,7 +194,7 @@ gchar *mono_unicode_to_external_checked (const gunichar2 *uni, MonoError *err) g_error_free (gerr); return utf8; } - + encoding_list=g_getenv ("MONO_EXTERNAL_ENCODINGS"); if(encoding_list==NULL) { /* Do UTF8 */ @@ -202,7 +202,7 @@ gchar *mono_unicode_to_external_checked (const gunichar2 *uni, MonoError *err) } else { gchar *res, **encodings; int i; - + encodings=g_strsplit (encoding_list, ":", 0); g_free (encoding_list); for(i=0; encodings[i]!=NULL; i++) { @@ -217,14 +217,14 @@ gchar *mono_unicode_to_external_checked (const gunichar2 *uni, MonoError *err) if(res!=NULL) { g_free (utf8); g_strfreev (encodings); - + return(res); } } - + g_strfreev (encodings); } - + /* Nothing else worked, so just return the utf8 */ return(utf8); } @@ -333,7 +333,7 @@ mono_utf8_validate_and_len_with_bounds (const gchar *source, glong max_bytes, gl while (*ptr != 0) { length = trailingBytesForUTF8 [*ptr] + 1; srcPtr = (guchar*) ptr + length; - + /* since *ptr is not zero we must ensure that we can decode the current char + the byte after srcPtr points to the first byte after the current char.*/ if (srcPtr >= end) { diff --git a/src/mono/mono/utils/valgrind.h b/src/mono/mono/utils/valgrind.h index 0829ac748b7c60..070617915864c8 100644 --- a/src/mono/mono/utils/valgrind.h +++ b/src/mono/mono/utils/valgrind.h @@ -21,16 +21,16 @@ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. The origin of this software must not be misrepresented; you must - not claim that you wrote the original software. If you use this - software in a product, an acknowledgment in the product + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. - 4. The name of the author may not be used to endorse or promote - products derived from this software without specific prior written + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS @@ -52,13 +52,13 @@ the terms of the GNU General Public License, version 2. See the COPYING file in the source distribution for details. - ---------------------------------------------------------------- + ---------------------------------------------------------------- */ /* This file is for inclusion into client (your!) code. - You can use these macros to manipulate and query Valgrind's + You can use these macros to manipulate and query Valgrind's execution inside your own programs. The resulting executables will still run without Valgrind, just a @@ -222,8 +222,8 @@ this is executed not under Valgrind. Args are passed in a memory block, and so there's no intrinsic limit to the number that could be passed, but it's currently five. - - The macro args are: + + The macro args are: _zzq_rlval result lvalue _zzq_default default value (result returned when running on real CPU) _zzq_request request code @@ -250,7 +250,7 @@ || (defined(PLAT_x86_win32) && defined(__GNUC__)) typedef - struct { + struct { unsigned int nraddr; /* where's the code? */ } OrigFn; @@ -314,7 +314,7 @@ typedef #if defined(PLAT_x86_win32) && !defined(__GNUC__) typedef - struct { + struct { unsigned int nraddr; /* where's the code? */ } OrigFn; @@ -388,7 +388,7 @@ valgrind_do_client_request_expr(uintptr_t _zzq_default, uintptr_t _zzq_request, || (defined(PLAT_amd64_win64) && defined(__GNUC__)) typedef - struct { + struct { unsigned long long int nraddr; /* where's the code? */ } OrigFn; @@ -460,7 +460,7 @@ typedef #if defined(PLAT_ppc32_linux) typedef - struct { + struct { unsigned int nraddr; /* where's the code? */ } OrigFn; @@ -529,7 +529,7 @@ typedef #if defined(PLAT_ppc64be_linux) typedef - struct { + struct { unsigned long long int nraddr; /* where's the code? */ unsigned long long int r2; /* what tocptr do we need? */ } @@ -685,7 +685,7 @@ typedef #if defined(PLAT_arm_linux) typedef - struct { + struct { unsigned int nraddr; /* where's the code? */ } OrigFn; @@ -753,7 +753,7 @@ typedef #if defined(PLAT_arm64_linux) typedef - struct { + struct { unsigned long long int nraddr; /* where's the code? */ } OrigFn; @@ -898,7 +898,7 @@ typedef #if defined(PLAT_mips32_linux) typedef - struct { + struct { unsigned int nraddr; /* where's the code? */ } OrigFn; @@ -912,7 +912,7 @@ typedef "srl $0, $0, 29\n\t" \ "srl $0, $0, 3\n\t" \ "srl $0, $0, 19\n\t" - + #define VALGRIND_DO_CLIENT_REQUEST_EXPR( \ _zzq_default, _zzq_request, \ _zzq_arg1, _zzq_arg2, _zzq_arg3, _zzq_arg4, _zzq_arg5) \ @@ -2161,7 +2161,7 @@ typedef #define VALGRIND_RESTORE_STACK \ "mr 1,28\n\t" -/* These CALL_FN_ macros assume that on ppc32-linux, +/* These CALL_FN_ macros assume that on ppc32-linux, sizeof(unsigned long) == 4. */ #define CALL_FN_W_v(lval, orig) \ @@ -4678,7 +4678,7 @@ typedef #define __CALLER_SAVED_REGS "0","1","2","3","4","5","14", \ "f0","f1","f2","f3","f4","f5","f6","f7" -/* Nb: Although r11 is modified in the asm snippets below (inside +/* Nb: Although r11 is modified in the asm snippets below (inside VALGRIND_CFI_PROLOGUE) it is not listed in the clobber section, for two reasons: (1) r11 is restored in VALGRIND_CFI_EPILOGUE, so effectively it is not @@ -5128,7 +5128,7 @@ typedef #endif /* PLAT_s390x_linux */ /* ------------------------- mips32-linux ----------------------- */ - + #if defined(PLAT_mips32_linux) /* These regs are trashed by the hidden call. */ @@ -6104,7 +6104,7 @@ typedef #define VG_IS_TOOL_USERREQ(a, b, v) \ (VG_USERREQ_TOOL_BASE(a,b) == ((v) & 0xffff0000)) -/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !! +/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !! This enum comprises an ABI exported by Valgrind to programs which use client requests. DO NOT CHANGE THE ORDER OF THESE ENTRIES, NOR DELETE ANY -- add new ones at the end. */ @@ -6242,7 +6242,7 @@ VALGRIND_PRINTF(const char *format, ...) _qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__PRINTF_VALIST_BY_REF, (unsigned long)format, - (unsigned long)&vargs, + (unsigned long)&vargs, 0, 0, 0); #endif va_end(vargs); @@ -6280,7 +6280,7 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...) _qzz_res = VALGRIND_DO_CLIENT_REQUEST_EXPR(0, VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF, (unsigned long)format, - (unsigned long)&vargs, + (unsigned long)&vargs, 0, 0, 0); #endif va_end(vargs); @@ -6291,7 +6291,7 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...) /* These requests allow control to move from the simulated CPU to the real CPU, calling an arbitary function. - + Note that the current ThreadId is inserted as the first argument. So this call: @@ -6377,7 +6377,7 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...) - It marks the block as being addressable and undefined (if 'is_zeroed' is not set), or addressable and defined (if 'is_zeroed' is set). This controls how accesses to the block by the program are handled. - + 'addr' is the start of the usable block (ie. after any redzone), 'sizeB' is its size. 'rzB' is the redzone size if the allocator can apply redzones -- these are blocks of padding at the start and end of @@ -6385,7 +6385,7 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...) Valgrind will spot block overruns. `is_zeroed' indicates if the memory is zeroed (or filled with another predictable value), as is the case for calloc(). - + VALGRIND_MALLOCLIKE_BLOCK should be put immediately after the point where a heap block -- that will be used by the client program -- is allocated. It's best to put it at the outermost level of the allocator if possible;