cherry pick from local- branch
[SXSI/xpathcomp.git] / tree.ml
diff --git a/tree.ml b/tree.ml
index 7ea6f03..5327aa0 100644 (file)
--- a/tree.ml
+++ b/tree.ml
@@ -133,9 +133,15 @@ external benchmark_jump : tree -> Tag.t -> unit = "caml_benchmark_jump" "noalloc
 let benchmark_jump t s = benchmark_jump t.doc s
 
 external benchmark_fcns : tree -> int = "caml_benchmark_fcns" "noalloc"
+external benchmark_fene : tree -> int = "caml_benchmark_fene" "noalloc"
+external benchmark_iter : tree -> int = "caml_benchmark_iter" "noalloc"
 
 let benchmark_fcns t = benchmark_fcns t.doc
 
+let benchmark_fene t = benchmark_fene t.doc
+
+let benchmark_iter t = benchmark_iter t.doc
+
 external benchmark_lcps : tree -> unit = "caml_benchmark_lcps" "noalloc"
 
 let benchmark_lcps t = benchmark_lcps t.doc
@@ -491,7 +497,7 @@ let parent t n = tree_parent t.doc n
 
 let first_child t = let doc = t.doc in ();fun n -> tree_first_child doc n
 let first_element t = let doc = t.doc in (); fun n -> tree_first_element doc n
-
+let first_element t n = tree_first_element t.doc n
 (* these function will be called in two times: first partial application
    on the tag, then application of the tag and the tree, then application of
    the other arguments. We use the trick to let the compiler optimize application
@@ -505,6 +511,7 @@ let select_child t = fun ts ->
 
 let next_sibling t = let doc = t.doc in (); fun n ->  tree_next_sibling doc n
 let next_element t = let doc = t.doc in (); fun n ->  tree_next_element doc n
+let next_element t n = tree_next_element t.doc n
 
 let tagged_following_sibling t tag = (); fun n -> tree_tagged_following_sibling t.doc n tag