harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pavel Afremov (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-5335) [drlvm][jit][jet] Switch improvement
Date Fri, 21 Dec 2007 14:32:43 GMT
[drlvm][jit][jet] Switch improvement
------------------------------------

                 Key: HARMONY-5335
                 URL: https://issues.apache.org/jira/browse/HARMONY-5335
             Project: Harmony
          Issue Type: Improvement
          Components: DRLVM
            Reporter: Pavel Afremov
         Attachments: switch_improvement.patch

During fixing HARMONY-5309 wrong / non optimal check was found in the JET. More correct /
optimal patch was provided. To avoid missing of the correction this JIRA was created.

In file vm/jitrino/src/jet/cg_br.cpp(line 237) Check 
    int tmp = -jinst.low();
    const int LO_BOUND = INT_MIN/(int)sizeof(void*);
    const int UP_BOUND = INT_MAX/(int)sizeof(void*);
    if (!(LO_BOUND<=tmp && tmp<=UP_BOUND))

has no sense on x86-32, because operation 
    ld(jobj, gr_tabl, gr_tabl, -jinst.low()*sizeof(void*), 
    val.reg(), sizeof(void*));

always is correct because of 32 bit overflow.

Also sx(Opnd(i64, val.reg()), Opnd(i32, val.reg())); has sense on x86-64 for small negative
values of  jinst.low (INT_MIN/8,0) only. In other case this operation is useless.

So from my point of view optimal patch should looks like switch_improvement.patch.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message