Skip to content

Commit

Permalink
Remove #if __cplusplus from MagicTypeInfo. (dotnet#32461)
Browse files Browse the repository at this point in the history
This wastes about 24 static const bytes which I think is ok.
6 bytes per struct plus 2 padding, and there are 3 of them, total, ever, passed by pointer.

I was looking into mono/mono#18827
and wanting to rule out #if __cplusplus.

Co-authored-by: Jay Krell <[email protected]>
  • Loading branch information
monojenkins and jaykrell authored Feb 18, 2020
1 parent a0ae661 commit 8bc99f3
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions src/mono/mono/mini/mini-native-types.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,9 @@ typedef struct {

typedef struct {
short op_index;
#ifdef __cplusplus
MonoStackType big_stack_type : 16;
MonoStackType small_stack_type : 16;
MonoStackType stack_type : 16;
#else
short big_stack_type;
short small_stack_type;
short stack_type;
#endif
MonoStackType big_stack_type;
MonoStackType small_stack_type;
MonoStackType stack_type;
short conv_4_to_8;
short conv_8_to_4;
short move;
Expand All @@ -42,7 +36,6 @@ typedef struct {
short compare_op;
} MagicTypeInfo;


#if TARGET_SIZEOF_VOID_P == 8
#define OP_PT_ADD OP_LADD
#define OP_PT_SUB OP_LSUB
Expand Down Expand Up @@ -175,7 +168,7 @@ emit_widen (MonoCompile *cfg, const MagicTypeInfo *info, int sreg)
MONO_INST_NEW (cfg, ins, info->conv_4_to_8);
ins->sreg1 = sreg;
ins->type = info->big_stack_type;
ins->dreg = alloc_dreg (cfg, info->big_stack_type);
ins->dreg = alloc_dreg (cfg, info->big_stack_type);
MONO_ADD_INS (cfg->cbb, ins);
return mono_decompose_opcode (cfg, ins);
}
Expand Down

0 comments on commit 8bc99f3

Please sign in to comment.