Commit 98265f29 by Keith Seitz Committed by Keith Seitz

interpret.cc (STOREA): Rewrite using temporary variable to avoid double-macro…

interpret.cc (STOREA): Rewrite using temporary variable to avoid double-macro expansion side-effects.

        * interpret.cc (STOREA): Rewrite using temporary variable to
        avoid double-macro expansion side-effects.
        (STOREI): Likewise.
        (STOREF): Likewise.
        (STOREL)[SIZEOF_VOID_P == 8]: Likewise.
        (STORED)[SIZEOF_VOID_P == 8]: Likewise.
        (STOREL)[SIZEOF_VOID_P != 8]: Likewise.
        (STORED)[SIZEOF_VOID_P != 8]: Likewise.
        (POKEI): Likewise.

From-SVN: r124746
parent 11c004e7
2007-05-15 Keith Seitz <keiths@redhat.com>
* interpret.cc (STOREA): Rewrite using temporary variable to
avoid double-macro expansion side-effects.
(STOREI): Likewise.
(STOREF): Likewise.
(STOREL)[SIZEOF_VOID_P == 8]: Likewise.
(STORED)[SIZEOF_VOID_P == 8]: Likewise.
(STOREL)[SIZEOF_VOID_P != 8]: Likewise.
(STORED)[SIZEOF_VOID_P != 8]: Likewise.
(POKEI): Likewise.
2007-05-12 David Daney <ddaney@avtrex.com> 2007-05-12 David Daney <ddaney@avtrex.com>
PR libgcj/29324 PR libgcj/29324
......
...@@ -180,60 +180,81 @@ convert (FROM val, TO min, TO max) ...@@ -180,60 +180,81 @@ convert (FROM val, TO min, TO max)
# define LOADD(I) LOADL(I) # define LOADD(I) LOADL(I)
#endif #endif
#define STOREA(I) \ #define STOREA(I) \
do { \ do \
DEBUG_LOCALS_INSN (I, 'o'); \ { \
locals[I].o = (--sp)->o; \ jint __idx = (I); \
} while (0) DEBUG_LOCALS_INSN (__idx, 'o'); \
#define STOREI(I) \ locals[__idx].o = (--sp)->o; \
do { \ } \
DEBUG_LOCALS_INSN (I, 'i'); \ while (0)
locals[I].i = (--sp)->i; \ #define STOREI(I) \
} while (0) do \
#define STOREF(I) \ { \
do { \ jint __idx = (I); \
DEBUG_LOCALS_INSN (I, 'f'); \ DEBUG_LOCALS_INSN (__idx, 'i'); \
locals[I].f = (--sp)->f; \ locals[__idx].i = (--sp)->i; \
} while (0) } while (0)
#define STOREF(I) \
do \
{ \
jint __idx = (I); \
DEBUG_LOCALS_INSN (__idx, 'f'); \
locals[__idx].f = (--sp)->f; \
} \
while (0)
#if SIZEOF_VOID_P == 8 #if SIZEOF_VOID_P == 8
# define STOREL(I) \ # define STOREL(I) \
do { \ do \
DEBUG_LOCALS_INSN (I, 'l'); \ { \
DEBUG_LOCALS_INSN (I + 1, 'x'); \ jint __idx = (I); \
(sp -= 2, locals[I].l = sp->l); \ DEBUG_LOCALS_INSN (__idx, 'l'); \
} while (0) DEBUG_LOCALS_INSN (__idx + 1, 'x'); \
# define STORED(I) \ (sp -= 2, locals[__idx].l = sp->l); \
do { \ } \
DEBUG_LOCALS_INSN (I, 'd'); \ while (0)
DEBUG_LOCALS_INSN (I + 1, 'x'); \ # define STORED(I) \
(sp -= 2, locals[I].d = sp->d); \ do \
} while (0) { \
jint __idx = (I); \
DEBUG_LOCALS_INSN (__idx, 'd'); \
DEBUG_LOCALS_INSN (__idx + 1, 'x'); \
(sp -= 2, locals[__idx].d = sp->d); \
} \
while (0)
#else #else
# define STOREL(I) \ # define STOREL(I) \
do { \ do \
DEBUG_LOCALS_INSN (I, 'l'); \ { \
DEBUG_LOCALS_INSN (I + 1, 'x'); \ jint __idx = (I); \
jint __idx = (I); \ DEBUG_LOCALS_INSN (__idx, 'l'); \
locals[__idx+1].ia[0] = (--sp)->ia[0]; \ DEBUG_LOCALS_INSN (__idx + 1, 'x'); \
locals[__idx].ia[0] = (--sp)->ia[0]; \ locals[__idx + 1].ia[0] = (--sp)->ia[0]; \
} while (0) locals[__idx].ia[0] = (--sp)->ia[0]; \
# define STORED(I) \ } \
do { \ while (0)
DEBUG_LOCALS_INSN (I, 'd'); \ # define STORED(I) \
DEBUG_LOCALS_INSN (I + 1, 'x'); \ do { \
jint __idx = (I); \ jint __idx = (I); \
locals[__idx+1].ia[0] = (--sp)->ia[0]; \ DEBUG_LOCALS_INSN (__idx, 'd'); \
locals[__idx].ia[0] = (--sp)->ia[0]; \ DEBUG_LOCALS_INSN (__idx + 1, 'x'); \
locals[__idx + 1].ia[0] = (--sp)->ia[0]; \
locals[__idx].ia[0] = (--sp)->ia[0]; \
} while (0) } while (0)
#endif #endif
#define PEEKI(I) (locals+(I))->i #define PEEKI(I) (locals+(I))->i
#define PEEKA(I) (locals+(I))->o #define PEEKA(I) (locals+(I))->o
#define POKEI(I,V) \ #define POKEI(I,V) \
DEBUG_LOCALS_INSN(I,'i'); \ do \
((locals+(I))->i = (V)) { \
jint __idx = (I); \
DEBUG_LOCALS_INSN (__idx, 'i'); \
((locals + __idx)->i = (V)); \
} \
while (0)
#define BINOPI(OP) { \ #define BINOPI(OP) { \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment