File tree Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change @@ -816,22 +816,25 @@ let eval_branch blocks update_branch info l =
816816 incr update_branch;
817817 Branch cont
818818 | None ->
819- let t = SBT. create 0 in
820- let seen_pc = Addr.Hashtbl. create 0 in
819+ let t = lazy ( SBT. create 0 ) in
820+ let seen_pc = ref IntSet. empty in
821821 Switch
822822 ( x
823823 , Array. map a ~f: (function
824- | pc , [] when not (Addr.Hashtbl. mem seen_pc pc ) -> (
824+ | ( pc , [] ) as cont when not (IntSet. mem pc ! seen_pc ) ->
825825 let block = Code.Addr.Map. find pc blocks in
826- let sb = Simple_block. make block in
827- match SBT. find_opt t sb with
828- | Some pc' when pc' <> pc ->
829- incr update_branch;
830- pc', []
831- | Some _ | None ->
832- SBT. add t sb pc;
833- Addr.Hashtbl. add seen_pc pc () ;
834- pc, [] )
826+ if List. compare_length_with block.body ~len: 7 < = 0
827+ then (
828+ let sb = Simple_block. make block in
829+ match SBT. find_opt (Lazy. force t) sb with
830+ | Some pc' when pc' <> pc ->
831+ incr update_branch;
832+ pc', []
833+ | Some _ | None ->
834+ SBT. add (Lazy. force t) sb pc;
835+ seen_pc := IntSet. add pc ! seen_pc;
836+ pc, [] )
837+ else cont
835838 | cont -> cont) ))
836839 | cont -> cont
837840
You can’t perform that action at this time.
0 commit comments