The logic stays the same, but to be correct with the comments EXPR_BINOP
should be put together with expressions which are always assumed to have
side effects. That's beacuse many arithmetic operations store the
result in the left child expression thus preventing expression reuse.

Signed-off-by: Tomek Grabiec <tgrab...@gmail.com>
---
 jit/expression.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/jit/expression.c b/jit/expression.c
index 8c413b7..a660f05 100644
--- a/jit/expression.c
+++ b/jit/expression.c
@@ -72,7 +72,6 @@ int expr_is_pure(struct expression *expr)
                 * general these expressions should not be connected
                 * to more than one node.
                 */
-       case EXPR_BINOP:
        case EXPR_ARGS_LIST:
        case EXPR_UNARY_OP:
        case EXPR_CONVERSION:
@@ -91,6 +90,7 @@ int expr_is_pure(struct expression *expr)
        case EXPR_ANEWARRAY:
        case EXPR_MULTIANEWARRAY:
        case EXPR_NEW:
+       case EXPR_BINOP:
                return false;
 
                /* These expression types do not have any side-effects */
-- 
1.6.0.6


------------------------------------------------------------------------------
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to