Changeset 2904


Ignore:
Timestamp:
Mar 19, 2013, 1:27:24 AM (4 years ago)
Author:
sacerdot
Message:
  1. Algorithm modified by hand to make it run faster. The trusted code needs to be changed once and for all.
  2. pretty-printing code to understand slowness added
Location:
extracted
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extracted/compiler.ml

    r2875 r2904  
    578578    Errors.res **)
    579579let assembler observe p =
     580prerr_endline "ASSEMBLY0";
    580581  Obj.magic
    581582    (Monad.m_bind0 (Monad.max_def Errors.res0)
     
    583584        (Errors.opt_to_res (Errors.msg ErrorMessages.Jump_expansion_failed)
    584585          (Policy.jump_expansion' p))) (fun sigma_pol ->
     586prerr_endline "ASSEMBLY1";
    585587      let sigma = fun ppc -> (Types.pi1 sigma_pol).Types.fst ppc in
    586588      let pol = fun ppc -> (Types.pi1 sigma_pol).Types.snd ppc in
    587589      let p0 = Assembly.assembly p sigma pol in
    588590      let i = Obj.magic observe Object_code_pass (Types.pi1 p0) in
     591prerr_endline "ASSEMBLY2";
    589592      Obj.magic (Errors.OK (Types.pi1 p0))))
    590593
     
    774777        Monad.m_bind0 (Monad.max_def Errors.res0)
    775778          (Obj.magic (assembler observe p1)) (fun p2 ->
     779prerr_endline "COMPUTE_COST_MAP";
    776780          let k = ASMCostsSplit.aSM_cost_map p2 in
     781prerr_endline "LIFT_COST_MAP";
    777782          let k' =
    778783            lift_cost_map_back_to_front p' (Fetch.load_code_memory p2.ASM.oc)
    779784              p2.ASM.costlabels k
    780785          in
     786prerr_endline "END";
    781787          Monad.m_return0 (Monad.max_def Errors.res0)
    782788            { c_labelled_object_code = p2; c_stack_cost = stack_cost;
  • extracted/policy.ml

    r2773 r2904  
    9494let rec jump_expansion_internal program n =
    9595  let labels = PolicyFront.create_label_map (Types.pi1 program) in
     96  let rec aux res =
     97prerr_endline "JEI_start";
     98   let { Types.fst = no_ch; Types.snd = z } = res in
     99    match z with
     100     | Types.None ->
     101       { Types.fst = Bool.False; Types.snd = Types.None }
     102     | Types.Some op ->
     103         match no_ch with
     104         | Bool.True -> res
     105         | Bool.False ->
     106           aux
     107            (Types.pi1
     108             (PolicyStep.jump_expansion_step program (Types.pi1 labels)
     109               op))
     110  in
     111   aux
     112    { Types.fst = Bool.False; Types.snd =
     113       (Types.pi1
     114         (PolicyFront.jump_expansion_start program (Types.pi1 labels))) }
     115(*
    96116  (match n with
    97117   | Nat.O ->
     
    114134              Types.pi1
    115135                (PolicyStep.jump_expansion_step program (Types.pi1 labels)
    116                   op))) __)) __)) __
     136                  op))) __)) __)) __*)
    117137
    118138(** val measure_int :
Note: See TracChangeset for help on using the changeset viewer.