The values of .start_insn and .end_insn can be computed in 
compute_insn_positions().

Signed-off-by: Tomek Grabiec <tgrab...@gmail.com>
---
 jit/compilation-unit.c |    4 ++++
 jit/liveness.c         |   17 -----------------
 2 files changed, 4 insertions(+), 17 deletions(-)

diff --git a/jit/compilation-unit.c b/jit/compilation-unit.c
index d9dc523..cf349b8 100644
--- a/jit/compilation-unit.c
+++ b/jit/compilation-unit.c
@@ -252,6 +252,8 @@ void compute_insn_positions(struct compilation_unit *cu)
        for_each_basic_block(bb, &cu->bb_list) {
                struct insn *insn;
 
+               bb->start_insn = pos;
+
                for_each_insn(insn, &bb->insn_list) {
                        insn->lir_pos = pos;
 
@@ -259,5 +261,7 @@ void compute_insn_positions(struct compilation_unit *cu)
 
                        ++pos;
                }
+
+               bb->end_insn = pos;
        }
 }
diff --git a/jit/liveness.c b/jit/liveness.c
index 619a988..cc82933 100644
--- a/jit/liveness.c
+++ b/jit/liveness.c
@@ -200,27 +200,10 @@ static int init_sets(struct compilation_unit *cu)
        return err;
 }
 
-static void compute_boundaries(struct compilation_unit *cu)
-{
-       unsigned long insn_idx = 0;
-       struct basic_block *bb;
-       struct insn *insn;
-
-       for_each_basic_block(bb, &cu->bb_list) {
-               bb->start_insn = insn_idx;
-               for_each_insn(insn, &bb->insn_list) {
-                       insn_idx++;
-               }
-               bb->end_insn = insn_idx;
-       }
-}
-
 int analyze_liveness(struct compilation_unit *cu)
 {
        int err = 0;
 
-       compute_boundaries(cu);
-
        err = init_sets(cu);
        if (err)
                goto out;
-- 
1.6.3.3


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel

Reply via email to