X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=src%2FresJIT.ml;h=8f6f92e19ccfb4f711edaf4e7780f60b08d51363;hb=refs%2Fheads%2Fmaster;hp=215938b417f177b209ace049e322fb066cd941c9;hpb=7c4c61cec6fe1ae3a1b83a59b17ce90adcfe9b0b;p=SXSI%2Fxpathcomp.git diff --git a/src/resJIT.ml b/src/resJIT.ml index 215938b..8f6f92e 100644 --- a/src/resJIT.ml +++ b/src/resJIT.ml @@ -238,30 +238,41 @@ DEFINE EXEC_CODE_TEMPLATE(ns) = fun slot slot1 slot2 t dst code -> SET (slot.(dst) , ns.concat4 slot1.(src1) slot1.(src2) slot2.(src3) slot2.(src4)) | OP_SELF _ -> - slot.(dst) <- ns.singleton t + LOG(__ "res-jit" 1 "Putting Node %i in the result set@\n" (Node.to_int t)); + slot.(dst) <- ns.singleton t - | OP_SELF_LEFT1 src -> slot.(dst) <- ns.cons t slot1.(src) + | OP_SELF_LEFT1 src -> + LOG(__ "res-jit" 1 "Putting Node %i in the result set@\n" (Node.to_int t)); + slot.(dst) <- ns.cons t slot1.(src) | OP_SELF_LEFT2 (src1, src2) -> - slot.(dst) <- ns.conscat t slot1.(src1) slot1.(src2) + LOG(__ "res-jit" 1 "Putting Node %i in the result set@\n" (Node.to_int t)); + slot.(dst) <- ns.conscat t slot1.(src1) slot1.(src2) - | OP_SELF_RIGHT1 src -> slot.(dst) <- ns.cons t slot2.(src) + | OP_SELF_RIGHT1 src -> + LOG(__ "res-jit" 1 "Putting Node %i in the result set@\n" (Node.to_int t)); + slot.(dst) <- ns.cons t slot2.(src) | OP_SELF_RIGHT2 (src1, src2) -> - slot.(dst) <- ns.conscat t slot2.(src1) slot2.(src2) + LOG(__ "res-jit" 1 "Putting Node %i in the result set@\n" (Node.to_int t)); + slot.(dst) <- ns.conscat t slot2.(src1) slot2.(src2) | OP_SELF_LEFT1_RIGHT1 (src1, src2) -> - slot.(dst) <- ns.conscat t slot1.(src1) slot2.(src2) + LOG(__ "res-jit" 1 "Putting Node %i in the result set@\n" (Node.to_int t)); + slot.(dst) <- ns.conscat t slot1.(src1) slot2.(src2) | OP_SELF_LEFT2_RIGHT1 (src1, src2, src3) -> - slot.(dst) <- ns.conscat3 t slot1.(src1) slot1.(src2) slot2.(src3) + LOG(__ "res-jit" 1 "Putting Node %i in the result set@\n" (Node.to_int t)); + slot.(dst) <- ns.conscat3 t slot1.(src1) slot1.(src2) slot2.(src3) | OP_SELF_LEFT1_RIGHT2 (src1, src2, src3) -> - slot.(dst) <- ns.conscat3 t slot1.(src1) slot2.(src2) slot2.(src3) + LOG(__ "res-jit" 1 "Putting Node %i in the result set@\n" (Node.to_int t)); + slot.(dst) <- ns.conscat3 t slot1.(src1) slot2.(src2) slot2.(src3) | OP_SELF_LEFT2_RIGHT2 (src1, src2, src3, src4) -> - slot.(dst) <- - ns.conscat4 t slot1.(src1) slot1.(src2) slot2.(src3) slot2.(src4) + LOG(__ "res-jit" 1 "Putting Node %i in the result set@\n" (Node.to_int t)); + slot.(dst) <- + ns.conscat4 t slot1.(src1) slot1.(src2) slot2.(src3) slot2.(src4) | OP_OTHER line -> let acc = ref ns.empty in let len = Array.length line - 1 in @@ -275,7 +286,7 @@ DEFINE EXEC_REC_TEMPLATE = (match code with | Nil -> () | Cons(dst, opcode, code1) -> - LOG("res-jit", 3, __ " %a := %a\n%!" + LOG(__ "res-jit" 3 " %a := %a" State.print dst print_opcode opcode; ); exec_code slot slot1 slot2 t dst opcode; @@ -283,7 +294,7 @@ DEFINE EXEC_REC_TEMPLATE = match code1 with | Nil -> () | Cons(dst, opcode, code1) -> - LOG("res-jit", 3, __ " %a := %a\n%!" + LOG(__ "res-jit" 3 " %a := %a" State.print dst print_opcode opcode; ); exec_code slot slot1 slot2 t dst opcode; @@ -292,11 +303,11 @@ DEFINE EXEC_REC_TEMPLATE = end) DEFINE EXEC_TEMPLATE = - (LOG("res-jit", 3, __ "Node %i:\n" (Node.to_int t)); - LOG("res-jit", 3, __ " LEFT : %a\n" print slot1); - LOG("res-jit", 3, __ " RIGHT : %a\n" print slot2); + (LOG(__ "res-jit" 3 "Node %i:@\nLEFT : %a@\nRIGHT : %a" + (Node.to_int t) print slot1 print slot2 + ); exec slot slot1 slot2 t code; - LOG("res-jit", 3, __ " RES : %a\n\n%!" print slot)) + LOG(__ "res-jit" 3 "RES : %a" print slot)) module type S = @@ -318,7 +329,6 @@ module Count = let exec_instr = EXEC_INSTR_TEMPLATE(NodeSet.Count) let exec_code = EXEC_CODE_TEMPLATE(NodeSet.Count) let rec exec slot slot1 slot2 t code = EXEC_REC_TEMPLATE - let exec slot slot1 slot2 t code = EXEC_TEMPLATE let var _ x = x let close _ x = x let is_open _ = false @@ -332,7 +342,6 @@ module Mat = let exec_instr = EXEC_INSTR_TEMPLATE(NodeSet.Mat) let exec_code = EXEC_CODE_TEMPLATE(NodeSet.Mat) let rec exec slot slot1 slot2 t code = EXEC_REC_TEMPLATE - let exec slot slot1 slot2 t code = EXEC_TEMPLATE let var _ x = x let close _ x = x let is_open _ = false