Skip to content

Commit 5acd3c1

Browse files
committed
Squashed 'ocaml/' changes from fe8a98b..ce88833
ce88833 Merge flambda-backend changes b7506bb Revert "Cherry-pick of ocaml/ocaml 1eeb0e7fe595f5f9e1ea1edbdf785ff3b49feeeb (#12)" 183f688 Add config option to enable/disable stack allocation (#22) ee7c849 If both the type and mode of an ident are wrong, complain about the type. (#19) 44bade0 Allow submoding during module inclusion checks (#21) de3bec9 Add subtyping between arrows of related modes (#20) 93d8615 Enable the local keywords even when the local extension is off (#18) 81dd85e Documentation for local allocations b05519f Fix a GC bug in local stack scanning (#17) 9f879de Fix __FUNCTION__ (#15) a78975e Optimise "include struct ... end" in more cases (ocaml/ocaml#11134) b819c66 Cherry-pick of ocaml/ocaml 1eeb0e7fe595f5f9e1ea1edbdf785ff3b49feeeb (#12) bb363d4 Optimise the allocation of optional arguments (#11) git-subtree-dir: ocaml git-subtree-split: ce88833
1 parent 076ba4d commit 5acd3c1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+2090
-523
lines changed

Makefile.config.in

+1
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ AWK=@AWK@
246246
STDLIB_MANPAGES=@stdlib_manpages@
247247
NAKED_POINTERS=@naked_pointers@
248248
INTEL_JCC_BUG_CFLAGS=@intel_jcc_bug_cflags@
249+
STACK_ALLOCATION=@stack_allocation@
249250

250251
### Native command to build ocamlrun.exe
251252

asmcomp/afl_instrument.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ let rec with_afl_logging b dbg =
4646
Clet(VP.create cur_pos, op Cxor [op (Cload (Word_int, Asttypes.Mutable))
4747
[afl_prev_loc dbg]; Cconst_int (cur_location, dbg)],
4848
Csequence(
49-
op (Cstore(Byte_unsigned, Assignment))
49+
op (Cstore(Byte_unsigned, Assignment alloc_heap))
5050
[op Cadda [Cvar afl_area; Cvar cur_pos];
5151
op Cadda [op (Cload (Byte_unsigned, Asttypes.Mutable))
5252
[op Cadda [Cvar afl_area; Cvar cur_pos]];
5353
Cconst_int (1, dbg)]],
54-
op (Cstore(Word_int, Assignment))
54+
op (Cstore(Word_int, Assignment alloc_heap))
5555
[afl_prev_loc dbg; Cconst_int (cur_location lsr 1, dbg)]))) in
5656
Csequence(instrumentation, instrument b)
5757

asmcomp/cmm_helpers.ml

+48-40
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,8 @@ let unbox_float dbg =
606606
(* Complex *)
607607

608608
let box_complex dbg c_re c_im =
609-
Cop(Calloc Alloc_heap, [alloc_floatarray_header 2 dbg; c_re; c_im], dbg)
609+
Cop(Calloc Lambda.alloc_heap,
610+
[alloc_floatarray_header 2 dbg; c_re; c_im], dbg)
610611

611612
let complex_re c dbg = Cop(Cload (Double, Immutable), [c], dbg)
612613
let complex_im c dbg = Cop(Cload (Double, Immutable),
@@ -760,16 +761,16 @@ let unboxed_float_array_ref arr ofs dbg =
760761
Cop(Cload (Double, Mutable),
761762
[array_indexing log2_size_float arr ofs dbg], dbg)
762763
let float_array_ref arr ofs dbg =
763-
box_float dbg Alloc_heap (unboxed_float_array_ref arr ofs dbg)
764+
box_float dbg Lambda.alloc_heap (unboxed_float_array_ref arr ofs dbg)
764765

765766
let addr_array_set arr ofs newval dbg =
766767
Cop(Cextcall("caml_modify", typ_void, [], false),
767768
[array_indexing log2_size_addr arr ofs dbg; newval], dbg)
768769
let int_array_set arr ofs newval dbg =
769-
Cop(Cstore (Word_int, Lambda.Assignment),
770+
Cop(Cstore (Word_int, Lambda.Assignment Lambda.alloc_heap),
770771
[array_indexing log2_size_addr arr ofs dbg; newval], dbg)
771772
let float_array_set arr ofs newval dbg =
772-
Cop(Cstore (Double, Lambda.Assignment),
773+
Cop(Cstore (Double, Lambda.Assignment Lambda.alloc_heap),
773774
[array_indexing log2_size_float arr ofs dbg; newval], dbg)
774775

775776
let addr_array_set_local arr ofs newval dbg =
@@ -828,7 +829,7 @@ let call_cached_method obj tag cache pos args (apos,mode) dbg =
828829
(* Allocation *)
829830

830831
let make_alloc_generic ~mode set_fn dbg tag wordsize args =
831-
if mode = Lambda.Alloc_local || wordsize <= Config.max_young_wosize then
832+
if Lambda.is_local_mode mode || wordsize <= Config.max_young_wosize then
832833
let hdr =
833834
match mode with
834835
| Lambda.Alloc_local -> local_block_header tag wordsize
@@ -1003,13 +1004,14 @@ let bigarray_set unsafe elt_kind layout b args newval dbg =
10031004
bind "addr" (bigarray_indexing unsafe elt_kind layout b args dbg)
10041005
(fun addr ->
10051006
Csequence(
1006-
Cop(Cstore (kind, Assignment), [addr; complex_re newv dbg], dbg),
1007-
Cop(Cstore (kind, Assignment),
1007+
Cop(Cstore (kind, Assignment Lambda.alloc_heap),
1008+
[addr; complex_re newv dbg], dbg),
1009+
Cop(Cstore (kind, Assignment Lambda.alloc_heap),
10081010
[Cop(Cadda, [addr; Cconst_int (sz, dbg)], dbg);
10091011
complex_im newv dbg],
10101012
dbg))))
10111013
| _ ->
1012-
Cop(Cstore (bigarray_word_kind elt_kind, Assignment),
1014+
Cop(Cstore (bigarray_word_kind elt_kind, Assignment Lambda.alloc_heap),
10131015
[bigarray_indexing unsafe elt_kind layout b args dbg; newval],
10141016
dbg))
10151017

@@ -1162,7 +1164,7 @@ let unaligned_load_16 ptr idx dbg =
11621164
let unaligned_set_16 ptr idx newval dbg =
11631165
if Arch.allow_unaligned_access
11641166
then
1165-
Cop(Cstore (Sixteen_unsigned, Assignment),
1167+
Cop(Cstore (Sixteen_unsigned, Assignment Lambda.alloc_heap),
11661168
[add_int ptr idx dbg; newval], dbg)
11671169
else
11681170
let cconst_int i = Cconst_int (i, dbg) in
@@ -1173,8 +1175,8 @@ let unaligned_set_16 ptr idx newval dbg =
11731175
let v2 = Cop(Cand, [newval; cconst_int 0xFF], dbg) in
11741176
let b1, b2 = if Arch.big_endian then v1, v2 else v2, v1 in
11751177
Csequence(
1176-
Cop(Cstore (Byte_unsigned, Assignment), [add_int ptr idx dbg; b1], dbg),
1177-
Cop(Cstore (Byte_unsigned, Assignment),
1178+
Cop(Cstore (Byte_unsigned, Assignment Lambda.alloc_heap), [add_int ptr idx dbg; b1], dbg),
1179+
Cop(Cstore (Byte_unsigned, Assignment Lambda.alloc_heap),
11781180
[add_int (add_int ptr idx dbg) (cconst_int 1) dbg; b2], dbg))
11791181

11801182
let unaligned_load_32 ptr idx dbg =
@@ -1205,7 +1207,7 @@ let unaligned_load_32 ptr idx dbg =
12051207
let unaligned_set_32 ptr idx newval dbg =
12061208
if Arch.allow_unaligned_access
12071209
then
1208-
Cop(Cstore (Thirtytwo_unsigned, Assignment), [add_int ptr idx dbg; newval],
1210+
Cop(Cstore (Thirtytwo_unsigned, Assignment Lambda.alloc_heap), [add_int ptr idx dbg; newval],
12091211
dbg)
12101212
else
12111213
let cconst_int i = Cconst_int (i, dbg) in
@@ -1225,16 +1227,16 @@ let unaligned_set_32 ptr idx newval dbg =
12251227
else v4, v3, v2, v1 in
12261228
Csequence(
12271229
Csequence(
1228-
Cop(Cstore (Byte_unsigned, Assignment),
1230+
Cop(Cstore (Byte_unsigned, Assignment Lambda.alloc_heap),
12291231
[add_int ptr idx dbg; b1], dbg),
1230-
Cop(Cstore (Byte_unsigned, Assignment),
1232+
Cop(Cstore (Byte_unsigned, Assignment Lambda.alloc_heap),
12311233
[add_int (add_int ptr idx dbg) (cconst_int 1) dbg; b2],
12321234
dbg)),
12331235
Csequence(
1234-
Cop(Cstore (Byte_unsigned, Assignment),
1236+
Cop(Cstore (Byte_unsigned, Assignment Lambda.alloc_heap),
12351237
[add_int (add_int ptr idx dbg) (cconst_int 2) dbg; b3],
12361238
dbg),
1237-
Cop(Cstore (Byte_unsigned, Assignment),
1239+
Cop(Cstore (Byte_unsigned, Assignment Lambda.alloc_heap),
12381240
[add_int (add_int ptr idx dbg) (cconst_int 3) dbg; b4],
12391241
dbg)))
12401242

@@ -1280,7 +1282,7 @@ let unaligned_load_64 ptr idx dbg =
12801282
let unaligned_set_64 ptr idx newval dbg =
12811283
assert(size_int = 8);
12821284
if Arch.allow_unaligned_access
1283-
then Cop(Cstore (Word_int, Assignment), [add_int ptr idx dbg; newval], dbg)
1285+
then Cop(Cstore (Word_int, Assignment Lambda.alloc_heap), [add_int ptr idx dbg; newval], dbg)
12841286
else
12851287
let cconst_int i = Cconst_int (i, dbg) in
12861288
let v1 =
@@ -1319,32 +1321,32 @@ let unaligned_set_64 ptr idx newval dbg =
13191321
Csequence(
13201322
Csequence(
13211323
Csequence(
1322-
Cop(Cstore (Byte_unsigned, Assignment),
1324+
Cop(Cstore (Byte_unsigned, Assignment Lambda.alloc_heap),
13231325
[add_int ptr idx dbg; b1],
13241326
dbg),
1325-
Cop(Cstore (Byte_unsigned, Assignment),
1327+
Cop(Cstore (Byte_unsigned, Assignment Lambda.alloc_heap),
13261328
[add_int (add_int ptr idx dbg) (cconst_int 1) dbg; b2],
13271329
dbg)),
13281330
Csequence(
1329-
Cop(Cstore (Byte_unsigned, Assignment),
1331+
Cop(Cstore (Byte_unsigned, Assignment Lambda.alloc_heap),
13301332
[add_int (add_int ptr idx dbg) (cconst_int 2) dbg; b3],
13311333
dbg),
1332-
Cop(Cstore (Byte_unsigned, Assignment),
1334+
Cop(Cstore (Byte_unsigned, Assignment Lambda.alloc_heap),
13331335
[add_int (add_int ptr idx dbg) (cconst_int 3) dbg; b4],
13341336
dbg))),
13351337
Csequence(
13361338
Csequence(
1337-
Cop(Cstore (Byte_unsigned, Assignment),
1339+
Cop(Cstore (Byte_unsigned, Assignment Lambda.alloc_heap),
13381340
[add_int (add_int ptr idx dbg) (cconst_int 4) dbg; b5],
13391341
dbg),
1340-
Cop(Cstore (Byte_unsigned, Assignment),
1342+
Cop(Cstore (Byte_unsigned, Assignment Lambda.alloc_heap),
13411343
[add_int (add_int ptr idx dbg) (cconst_int 5) dbg; b6],
13421344
dbg)),
13431345
Csequence(
1344-
Cop(Cstore (Byte_unsigned, Assignment),
1346+
Cop(Cstore (Byte_unsigned, Assignment Lambda.alloc_heap),
13451347
[add_int (add_int ptr idx dbg) (cconst_int 6) dbg; b7],
13461348
dbg),
1347-
Cop(Cstore (Byte_unsigned, Assignment),
1349+
Cop(Cstore (Byte_unsigned, Assignment Lambda.alloc_heap),
13481350
[add_int (add_int ptr idx dbg) (cconst_int 7) dbg; b8],
13491351
dbg))))
13501352

@@ -1824,7 +1826,7 @@ let cache_public_method meths tag cache dbg =
18241826
VP.create tagged,
18251827
Cop(Caddi, [lsl_const (Cvar li) log2_size_addr dbg;
18261828
cconst_int(1 - 3 * size_addr)], dbg),
1827-
Csequence(Cop (Cstore (Word_int, Assignment), [cache; Cvar tagged], dbg),
1829+
Csequence(Cop (Cstore (Word_int, Assignment Lambda.alloc_heap), [cache; Cvar tagged], dbg),
18281830
Cvar tagged)))))
18291831

18301832
let has_local_allocs e =
@@ -1896,9 +1898,12 @@ let apply_function_body (arity, (mode : Lambda.alloc_mode)) =
18961898
(* In the slowpath, a region is necessary in case
18971899
the initial applications do local allocations *)
18981900
let region =
1899-
match mode with
1900-
| Alloc_heap -> Some (V.create_local "region")
1901-
| Alloc_local -> None
1901+
if not Config.stack_allocation then None
1902+
else begin
1903+
match mode with
1904+
| Alloc_heap -> Some (V.create_local "region")
1905+
| Alloc_local -> None
1906+
end
19021907
in
19031908
let rec app_fun clos n =
19041909
if n = arity-1 then begin
@@ -2130,8 +2135,9 @@ let rec intermediate_curry_functions ~nlocal ~arity num =
21302135
let name2 = if num = 0 then name1 else name1 ^ "_" ^ Int.to_string num in
21312136
let arg = V.create_local "arg" and clos = V.create_local "clos" in
21322137
let fun_dbg = placeholder_fun_dbg ~human_name:name2 in
2133-
let mode : Lambda.alloc_mode =
2134-
if num >= arity - nlocal then Alloc_local else Alloc_heap in
2138+
let mode =
2139+
if num >= arity - nlocal then Lambda.alloc_local else Lambda.alloc_heap
2140+
in
21352141
let curried n : Clambda.arity = (Curried {nlocal=min nlocal n}, n) in
21362142
Cfunction
21372143
{fun_name = name2;
@@ -2214,7 +2220,7 @@ module ApplyFnSet =
22142220
module AritySet =
22152221
Set.Make (struct type t = Clambda.arity let compare = compare end)
22162222

2217-
let default_apply = ApplyFnSet.of_list [2,Alloc_heap; 3,Alloc_heap]
2223+
let default_apply = ApplyFnSet.of_list [2,Lambda.alloc_heap; 3,Lambda.alloc_heap]
22182224
(* These apply funs are always present in the main program because
22192225
the run-time system needs them (cf. runtime/<arch>.S) . *)
22202226

@@ -2260,7 +2266,7 @@ let negint arg dbg =
22602266
let offsetref n arg dbg =
22612267
return_unit dbg
22622268
(bind "ref" arg (fun arg ->
2263-
Cop(Cstore (Word_int, Assignment),
2269+
Cop(Cstore (Word_int, Assignment Lambda.alloc_heap),
22642270
[arg;
22652271
add_const (Cop(Cload (Word_int, Mutable), [arg], dbg))
22662272
(n lsl 1) dbg],
@@ -2318,11 +2324,13 @@ let assignment_kind
23182324
(ptr: Lambda.immediate_or_pointer)
23192325
(init: Lambda.initialization_or_assignment) =
23202326
match init, ptr with
2321-
| Assignment, Pointer -> Caml_modify
2322-
| Local_assignment, Pointer -> Caml_modify_local
2327+
| Assignment Alloc_heap, Pointer -> Caml_modify
2328+
| Assignment Alloc_local, Pointer ->
2329+
assert Config.stack_allocation;
2330+
Caml_modify_local
23232331
| Heap_initialization, _ ->
23242332
Misc.fatal_error "Cmm_helpers: Lambda.Heap_initialization unsupported"
2325-
| (Assignment | Local_assignment), Immediate
2333+
| (Assignment _), Immediate
23262334
| Root_initialization, (Immediate | Pointer) -> Simple
23272335

23282336
let setfield n ptr init arg1 arg2 dbg =
@@ -2505,7 +2513,7 @@ let arrayref_safe kind arg1 arg2 dbg =
25052513
(get_header_without_profinfo arr dbg) dbg; idx],
25062514
int_array_ref arr idx dbg)))
25072515
| Pfloatarray ->
2508-
box_float dbg Alloc_heap (
2516+
box_float dbg Lambda.alloc_heap (
25092517
bind "index" arg2 (fun idx ->
25102518
bind "arr" arg1 (fun arr ->
25112519
Csequence(
@@ -2528,7 +2536,7 @@ let setfield_computed ptr init arg1 arg2 arg3 dbg =
25282536
return_unit dbg (int_array_set arg1 arg2 arg3 dbg)
25292537

25302538
let bytesset_unsafe arg1 arg2 arg3 dbg =
2531-
return_unit dbg (Cop(Cstore (Byte_unsigned, Assignment),
2539+
return_unit dbg (Cop(Cstore (Byte_unsigned, Assignment Lambda.alloc_heap),
25322540
[add_int arg1 (untag_int arg2 dbg) dbg;
25332541
ignore_high_bit_int (untag_int arg3 dbg)], dbg))
25342542

@@ -2539,7 +2547,7 @@ let bytesset_safe arg1 arg2 arg3 dbg =
25392547
bind "str" arg1 (fun str ->
25402548
Csequence(
25412549
make_checkbound dbg [string_length str dbg; idx],
2542-
Cop(Cstore (Byte_unsigned, Assignment),
2550+
Cop(Cstore (Byte_unsigned, Assignment Lambda.alloc_heap),
25432551
[add_int str idx dbg;
25442552
ignore_high_bit_int newval],
25452553
dbg))))))
@@ -2716,7 +2724,7 @@ let entry_point namelist =
27162724
let cconst_int i = Cconst_int (i, dbg ()) in
27172725
let cconst_symbol sym = Cconst_symbol (sym, dbg ()) in
27182726
let incr_global_inited () =
2719-
Cop(Cstore (Word_int, Assignment),
2727+
Cop(Cstore (Word_int, Assignment Lambda.alloc_heap),
27202728
[cconst_symbol "caml_globals_inited";
27212729
Cop(Caddi, [Cop(Cload (Word_int, Mutable),
27222730
[cconst_symbol "caml_globals_inited"], dbg ());

asmcomp/cmmgen.ml

+17-15
Original file line numberDiff line numberDiff line change
@@ -341,13 +341,13 @@ let is_unboxed_number_cmm ~strict cmm =
341341
| Cconst_symbol (s, _) ->
342342
begin match Cmmgen_state.structured_constant_of_sym s with
343343
| Some (Uconst_float _) ->
344-
notify (Boxed (Boxed_float (Alloc_heap, Debuginfo.none), true))
344+
notify (Boxed (Boxed_float (alloc_heap, Debuginfo.none), true))
345345
| Some (Uconst_nativeint _) ->
346-
notify (Boxed (Boxed_integer (Pnativeint, Alloc_heap, Debuginfo.none), true))
346+
notify (Boxed (Boxed_integer (Pnativeint, alloc_heap, Debuginfo.none), true))
347347
| Some (Uconst_int32 _) ->
348-
notify (Boxed (Boxed_integer (Pint32, Alloc_heap, Debuginfo.none), true))
348+
notify (Boxed (Boxed_integer (Pint32, alloc_heap, Debuginfo.none), true))
349349
| Some (Uconst_int64 _) ->
350-
notify (Boxed (Boxed_integer (Pint64, Alloc_heap, Debuginfo.none), true))
350+
notify (Boxed (Boxed_integer (Pint64, alloc_heap, Debuginfo.none), true))
351351
| _ ->
352352
notify No_unboxing
353353
end
@@ -494,7 +494,7 @@ let rec transl env e =
494494
state of [Translcore], we will in fact only get here with
495495
[Pfloatarray]s. *)
496496
assert (kind = kind');
497-
transl_make_array dbg env kind Alloc_heap args
497+
transl_make_array dbg env kind alloc_heap args
498498
| (Pduparray _, [arg]) ->
499499
let prim_obj_dup =
500500
Primitive.simple ~name:"caml_obj_dup" ~arity:1 ~alloc:true
@@ -510,11 +510,11 @@ let rec transl env e =
510510
(transl env arg1) (List.map (transl env) argl) dbg in
511511
begin match elt_kind with
512512
(* TODO: local allocation of bigarray elements *)
513-
Pbigarray_float32 | Pbigarray_float64 -> box_float dbg Alloc_heap elt
513+
Pbigarray_float32 | Pbigarray_float64 -> box_float dbg alloc_heap elt
514514
| Pbigarray_complex32 | Pbigarray_complex64 -> elt
515-
| Pbigarray_int32 -> box_int dbg Pint32 Alloc_heap elt
516-
| Pbigarray_int64 -> box_int dbg Pint64 Alloc_heap elt
517-
| Pbigarray_native_int -> box_int dbg Pnativeint Alloc_heap elt
515+
| Pbigarray_int32 -> box_int dbg Pint32 alloc_heap elt
516+
| Pbigarray_int64 -> box_int dbg Pint64 alloc_heap elt
517+
| Pbigarray_native_int -> box_int dbg Pnativeint alloc_heap elt
518518
| Pbigarray_caml_int -> tag_int elt dbg
519519
| Pbigarray_sint8 | Pbigarray_uint8
520520
| Pbigarray_sint16 | Pbigarray_uint16 -> tag_int elt dbg
@@ -760,7 +760,9 @@ and transl_make_array dbg env kind mode args =
760760
let prim =
761761
match (mode : Lambda.alloc_mode) with
762762
| Alloc_heap -> "caml_make_array"
763-
| Alloc_local -> "caml_make_array_local"
763+
| Alloc_local ->
764+
assert Config.stack_allocation;
765+
"caml_make_array_local"
764766
in
765767
Cop(Cextcall(prim, typ_val, [], true),
766768
[make_alloc ~mode dbg 0 (List.map (transl env) args)], dbg)
@@ -804,10 +806,10 @@ and transl_ccall env prim args dbg =
804806
match prim.prim_native_repr_res with
805807
| _, Same_as_ocaml_repr -> (typ_val, fun x -> x)
806808
(* TODO: Allow Alloc_local on suitably typed C stubs *)
807-
| _, Unboxed_float -> (typ_float, box_float dbg Alloc_heap)
809+
| _, Unboxed_float -> (typ_float, box_float dbg alloc_heap)
808810
| _, Unboxed_integer Pint64 when size_int = 4 ->
809-
([|Int; Int|], box_int dbg Pint64 Alloc_heap)
810-
| _, Unboxed_integer bi -> (typ_int, box_int dbg bi Alloc_heap)
811+
([|Int; Int|], box_int dbg Pint64 alloc_heap)
812+
| _, Unboxed_integer bi -> (typ_int, box_int dbg bi alloc_heap)
811813
| _, Untagged_int -> (typ_int, (fun i -> tag_int i dbg))
812814
in
813815
let typ_args, args = transl_args prim.prim_native_repr_args args in
@@ -1169,9 +1171,9 @@ and transl_let env str kind id exp transl_body =
11691171
of allocation mode it may be possible to mark some Alloc_local *)
11701172
match str, kind with
11711173
| Mutable, Pfloatval ->
1172-
Boxed (Boxed_float (Alloc_heap, dbg), false)
1174+
Boxed (Boxed_float (alloc_heap, dbg), false)
11731175
| Mutable, Pboxedintval bi ->
1174-
Boxed (Boxed_integer (bi, Alloc_heap, dbg), false)
1176+
Boxed (Boxed_integer (bi, alloc_heap, dbg), false)
11751177
| _, (Pfloatval | Pboxedintval _) ->
11761178
(* It would be safe to always unbox in this case, but
11771179
we do it only if this indeed allows us to get rid of

asmcomp/comballoc.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ let rec combine i allocstate =
3737
| Pending_alloc {reg; dbginfos; totalsz; mode = prev_mode}
3838
when (mode = prev_mode) &&
3939
((totalsz + sz <= (Config.max_young_wosize + 1) * Arch.size_addr)
40-
|| mode = Lambda.Alloc_local) ->
40+
|| Lambda.is_local_mode mode) ->
4141
let (next, state) =
4242
combine i.next
4343
(Pending_alloc { reg = i.res.(0);

asmcomp/printcmm.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ let operation d = function
126126
match init with
127127
| Lambda.Heap_initialization -> "(heap-init)"
128128
| Lambda.Root_initialization -> "(root-init)"
129-
| Lambda.Assignment -> ""
130-
| Local_assignment -> "(local)"
129+
| Lambda.Assignment Alloc_heap -> ""
130+
| Lambda.Assignment Alloc_local -> "(local)"
131131
in
132132
Printf.sprintf "store %s%s" (chunk c) init
133133
| Caddi -> "+"

0 commit comments

Comments
 (0)