Various fixes for bottom-up run.
authorKim Nguyễn <kn@lri.fr>
Wed, 2 May 2012 12:34:18 +0000 (14:34 +0200)
committerKim Nguyễn <kn@lri.fr>
Wed, 2 May 2012 12:34:18 +0000 (14:34 +0200)
src/runtime.ml

index fa92977..52583c0 100644 (file)
@@ -135,6 +135,7 @@ module Make (U : ResJIT.S) : S with type result_set = U.NS.t =
              end
            end else (* todo_code *) begin fun empty_slot sl1 sl2 tree node ->
              let sl = choose_slot empty_slot sl1 sl2 in
+             LOG( __ "bottom-up" 3 "Has todo code\n");
               U.exec sl sl1 sl2 node code;
               List.fold_left
                 (fun ares (p, q, code) ->
@@ -217,7 +218,7 @@ DEFINE LOOP_TAG (t, states, tag, ctx) = (
 
       and l2jit_dispatch t tag states ctx opcode =
         match opcode with
-          | L2JIT.RETURN _ -> nil_res
+          | L2JIT.RETURN () -> nil_res
           | L2JIT.LEFT (tr_list, instr) ->
               let res1, slot1 =
                 l2jit_dispatch_instr t (Tree.closing tree t) instr
@@ -238,7 +239,7 @@ DEFINE LOOP_TAG (t, states, tag, ctx) = (
                 l2jit_dispatch_instr t ctx instr2
               in
                 l3jit_dispatch tr_list res1 res2 t slot1 slot2
-          | L2JIT.CACHE _ ->
+          | L2JIT.CACHE () ->
             LOG(__ "top-down-run" 3
                   "Top-down cache miss for configuration %s %a"
                   (Tag.to_string tag) StateSet.print states);
@@ -325,6 +326,8 @@ DEFINE BOTTOM_UP_NEXT(node, rest, stop) =
       let nil_res = auto.bottom_states, empty_slot in
       let cache = Cache.Lvl3.create 0 L3JIT.dummy in
       let rec move_up node res is_left rest stop =
+       LOG(__ "bottom-up" 2 "move_up: node %i is_left %b stop %i\n"
+             (Node.to_int node) is_left (Node.to_int stop));
         if node == stop then res, rest
         else
           (*let prev_sibling = Tree.prev_sibling tree node in *)
@@ -366,6 +369,12 @@ DEFINE BOTTOM_UP_NEXT(node, rest, stop) =
                   states
                   Translist.nil
               in
+             LOG( __ "bottom-up" 3 "Transition list for %s, %a, %a is %a\n"
+                    (Tag.to_string tag)
+                    StateSet.print s1
+                    StateSet.print s2
+                    Translist.print trl
+             );
               let code = L3JIT.gen_code auto trl s1 s2 in
               Cache.Lvl3.add cache id2 id1 tag code; code
             else code