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) ->
let f = gen_code auto tlist s1 s2 in
LOG(__ "grammar" 2 "Inserting: %i, %a, %a\n%!"
(Uid.to_int tlist.Translist.Node.id) StateSet.print s1 StateSet.print s2);
- add cache tlist s1 s2 f; f
+ if not !Options.no_cache then add cache tlist s1 s2 f;
+ f
end
DEFINE LOOP (t, states, 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
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);
let top_down_run auto tree root =
Ata.init ();
+ L2JIT.init();
let res, slot = full_top_down_run auto auto.init tree root in
slot.(StateSet.min_elt auto.topdown_marking_states)
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 *)
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