@@ -646,6 +646,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr
646646 // Normal moves between vars
647647 case INTOP_MOV_4: MOV (int32_t , int32_t ); break ;
648648 case INTOP_MOV_8: MOV (int64_t , int64_t ); break ;
649+ #undef MOV
649650
650651 case INTOP_MOV_VT:
651652 memmove (stack + ip[1 ], stack + ip[2 ], ip[3 ]);
@@ -1016,6 +1017,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr
10161017 case INTOP_BRTRUE_I8:
10171018 BR_UNOP (int64_t , != 0 );
10181019 break ;
1020+ #undef BR_UNOP
10191021
10201022#define BR_BINOP_COND (cond ) \
10211023 if (cond) \
@@ -1226,6 +1228,8 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr
12261228 BR_BINOP_COND (isunordered (d1, d2) || d1 < d2);
12271229 break ;
12281230 }
1231+ #undef BR_BINOP_COND
1232+ #undef BR_BINOP
12291233
12301234 case INTOP_ADD_I4:
12311235 LOCAL_VAR (ip[1 ], int32_t ) = LOCAL_VAR (ip[2 ], int32_t ) + LOCAL_VAR (ip[3 ], int32_t );
@@ -1682,6 +1686,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr
16821686 case INTOP_CLT_UN_R8:
16831687 CMP_BINOP_FP (double , <, 1 );
16841688 break ;
1689+ #undef CMP_BINOP_FP
16851690
16861691#define LDIND (dtype, ftype ) \
16871692 do { \
@@ -1715,6 +1720,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr
17151720 case INTOP_LDIND_R8:
17161721 LDIND (double , double );
17171722 break ;
1723+ #undef LDIND
17181724 case INTOP_LDIND_VT:
17191725 {
17201726 char *src = LOCAL_VAR (ip[2 ], char *);
@@ -1757,6 +1763,7 @@ void InterpExecMethod(InterpreterFrame *pInterpreterFrame, InterpMethodContextFr
17571763 case INTOP_STIND_R8:
17581764 STIND (double , double );
17591765 break ;
1766+ #undef STIND
17601767 case INTOP_STIND_O:
17611768 {
17621769 char *dst = LOCAL_VAR (ip[1 ], char *);
@@ -2361,6 +2368,7 @@ do { \
23612368 LDELEM (double , double );
23622369 break ;
23632370 }
2371+ #undef LDELEM
23642372 case INTOP_LDELEM_REF:
23652373 {
23662374 BASEARRAYREF arrayRef = LOCAL_VAR (ip[2 ], BASEARRAYREF);
@@ -2457,6 +2465,7 @@ do { \
24572465 STELEM (double , double );
24582466 break ;
24592467 }
2468+ #undef STELEM
24602469 case INTOP_STELEM_REF:
24612470 {
24622471 BASEARRAYREF arrayRef = LOCAL_VAR (ip[1 ], BASEARRAYREF);
@@ -2635,6 +2644,31 @@ do \
26352644 COMPARE_EXCHANGE (int64_t );
26362645 break ;
26372646 }
2647+ #undef COMPARE_EXCHANGE
2648+
2649+ #define EXCHANGE (type ) \
2650+ do \
2651+ { \
2652+ type* dst = LOCAL_VAR (ip[2 ], type*); \
2653+ NULL_CHECK (dst); \
2654+ type newValue = LOCAL_VAR (ip[3 ], type); \
2655+ type old = InterlockedExchangeT (dst, newValue); \
2656+ LOCAL_VAR (ip[1 ], type) = old; \
2657+ ip += 4 ; \
2658+ } while (0 )
2659+
2660+ case INTOP_EXCHANGE_I4:
2661+ {
2662+ EXCHANGE (int32_t );
2663+ break ;
2664+ }
2665+
2666+ case INTOP_EXCHANGE_I8:
2667+ {
2668+ EXCHANGE (int64_t );
2669+ break ;
2670+ }
2671+ #undef EXCHANGE
26382672
26392673 case INTOP_CALL_FINALLY:
26402674 {
0 commit comments