File tree Expand file tree Collapse file tree 2 files changed +3
-36
lines changed Expand file tree Collapse file tree 2 files changed +3
-36
lines changed Original file line number Diff line number Diff line change @@ -47,13 +47,9 @@ module Info = struct
4747 }
4848
4949 let def t x =
50- let idx = Code.Var. idx x in
51- if Array. length t.info_defs < = idx
52- then None
53- else
54- match t.info_defs.(idx) with
55- | Phi _ | Param -> None
56- | Expr x -> Some x
50+ match t.info_defs.(Code.Var. idx x) with
51+ | Phi _ | Param -> None
52+ | Expr x -> Some x
5753
5854 let possibly_mutable t x = Code.Var.ISet. mem t.info_possibly_mutable x
5955
Original file line number Diff line number Diff line change @@ -293,35 +293,6 @@ let specialize_instrs ~target opt_count info l =
293293 match l with
294294 | [] -> List. rev acc
295295 | i :: r -> (
296- let i =
297- match i with
298- | Let (x , Apply { f; args; exact = false } ) -> (
299- match Info. def info f with
300- | None -> i
301- | Some (Prim (Extern "caml_jsoo_runtime" , [ name ])) -> (
302- let name =
303- match name with
304- | Pc (String name ) -> Some name
305- | Pc _ -> None
306- | Pv x -> (
307- match Info. def info x with
308- | Some (Constant (String name )) -> Some name
309- | Some _ | None -> None )
310- in
311- match name with
312- | None -> i
313- | Some name -> (
314- let name = Primitive. resolve name in
315- match Primitive. arity name with
316- | exception Not_found -> i
317- | n ->
318- if List. compare_length_with args ~len: n = 0
319- then
320- Let (x, Prim (Extern name, List. map args ~f: (fun x -> Pv x)))
321- else i))
322- | Some _ -> i)
323- | _ -> i
324- in
325296 (* We make bound checking explicit. Then, we can remove duplicated
326297 bound checks. Also, it appears to be more efficient to inline
327298 the array access. The bound checking function returns the array,
You can’t perform that action at this time.
0 commit comments