DEFINE LOOP (t, states, ctx) = (
let _t = t in
LOG(__ "top-down-run" 3
- "Entering node %i with loop (tag %s, context %i) with states %a"
- (Node.to_int _t)
- (Tag.to_string (Tree.tag tree _t))
- (Node.to_int (ctx))
- (StateSet.print) (states));
+ "Entering node %i with loop (tag %s, context %i) with states %a"
+ (Node.to_int _t)
+ (Tag.to_string (Tree.tag tree _t))
+ (Node.to_int (ctx))
+ (StateSet.print) (states));
if _t == Tree.nil then nil_res
else
let tag = Tree.tag tree _t in
l3jit_dispatch tr_list res1 res2 t slot1 slot2
and l2jit_dispatch_instr t ctx instr =
+ let () = LOG(__ "top-down-run" 3 "Dispatching instr: %a on node %i (context=%i)"
+ L2JIT.print_jump instr (Node.to_int t) (Node.to_int ctx))
+ in
match instr with
| L2JIT.NOP () -> nil_res
| L2JIT.FIRST_CHILD s -> LOOP ((Tree.first_child tree t), s, ctx)
| L2JIT.TAGGED_CHILD (s, tag) ->
LOOP_TAG((Tree.tagged_child tree t tag), s, tag, ctx)
- | L2JIT.TAGGED_FOLLOWING_SIBLING (s, tag) ->
- LOOP_TAG((Tree.tagged_following_sibling tree t tag), s, tag, ctx)
+ | L2JIT.TAGGED_SIBLING (s, tag) ->
+ LOOP_TAG((Tree.tagged_sibling tree t tag), s, tag, ctx)
| L2JIT.SELECT_CHILD (s, _, us) ->
LOOP ((Tree.select_child tree t us), s, ctx)
- | L2JIT.SELECT_FOLLOWING_SIBLING (s, _, us) ->
- LOOP ((Tree.select_following_sibling tree t us), s, ctx)
+ | L2JIT.SELECT_SIBLING (s, _, us) ->
+ LOOP ((Tree.select_sibling tree t us), s, ctx)
| L2JIT.TAGGED_SUBTREE(s, tag) ->
mark_subtree s (U.NS.subtree_tags tree t tag)