Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: asmcomp/cmmgen.ml
- ===================================================================
- --- asmcomp/cmmgen.ml (revision 16106)
- +++ asmcomp/cmmgen.ml (working copy)
- @@ -1387,19 +1387,7 @@
- | _ ->
- bind "met" (lookup_tag obj (transl met)) (call_met obj args))
- | Ulet(id, exp, body) ->
- - begin match is_unboxed_number exp with
- - No_unboxing ->
- - Clet(id, transl exp, transl body)
- - | Boxed_float ->
- - transl_unbox_let box_float unbox_float transl_unbox_float
- - Double_u 0
- - id exp body
- - | Boxed_integer bi ->
- - transl_unbox_let (box_int bi) (unbox_int bi) (transl_unbox_int bi)
- - (if bi = Pint32 then Thirtytwo_signed else Word)
- - size_addr
- - id exp body
- - end
- + transl_let id exp (transl body)
- | Uletrec(bindings, body) ->
- transl_letrec bindings (transl body)
- @@ -2056,6 +2044,7 @@
- and transl_unbox_float = function
- Uconst(Uconst_ref(_, Uconst_float f)) -> Cconst_float f
- + | Ulet(id, exp, body) -> transl_let id exp (transl_unbox_float body)
- | exp -> unbox_float(transl exp)
- and transl_unbox_int bi = function
- @@ -2067,12 +2056,26 @@
- assert (size_int = 8); Cconst_natint (Int64.to_nativeint n)
- | Uprim(Pbintofint bi',[Uconst(Uconst_int i)],_) when bi = bi' ->
- Cconst_int i
- + | Ulet(id, exp, body) -> transl_let id exp (transl_unbox_int bi body)
- | exp -> unbox_int bi (transl exp)
- +and transl_let id exp tr_body =
- + match is_unboxed_number exp with
- + No_unboxing ->
- + Clet(id, transl exp, tr_body)
- + | Boxed_float ->
- + transl_unbox_let box_float unbox_float transl_unbox_float
- + Double_u 0
- + id exp tr_body
- + | Boxed_integer bi ->
- + transl_unbox_let (box_int bi) (unbox_int bi) (transl_unbox_int bi)
- + (if bi = Pint32 then Thirtytwo_signed else Word)
- + size_addr
- + id exp tr_body
- +
- and transl_unbox_let box_fn unbox_fn transl_unbox_fn box_chunk box_offset
- - id exp body =
- + id exp trbody1 =
- let unboxed_id = Ident.create (Ident.name id) in
- - let trbody1 = transl body in
- let (trbody2, need_boxed, is_assigned) =
- subst_boxed_number unbox_fn id unboxed_id box_chunk box_offset trbody1 in
- if need_boxed && is_assigned then
Add Comment
Please, Sign In to add comment