Skip to content

Layouts prototype #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 122 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
122 commits
Select commit Hold shift + click to select a range
1a354ff
Move type_unboxed.unboxed into type_kind (backport PR #10252)
stedolan Feb 24, 2021
2265bdd
Bootstrap
ccasin Aug 8, 2022
c9c7e9e
Make immediacy part of type_kind (backport PR #10041)
stedolan Nov 18, 2020
0a73808
Bootstrap
ccasin Aug 9, 2022
cd21d95
layouts prototype
ccasin Aug 12, 2022
96e1cb1
After typechecking, correct_levels before calling Ctype stuff
ccasin Oct 4, 2022
00d8b7a
Correct list order in value_kind
ccasin Oct 4, 2022
2b5d074
We're ok with requiring [@@value] on stupid types for now
ccasin Oct 4, 2022
ddb8113
More allowing ourselves to add [@@value] for dumb types
ccasin Oct 4, 2022
16241b8
Better layouts for rec module approximation + tests of that
ccasin Oct 5, 2022
81c1254
Check debug printer types in the initial environment
ccasin Oct 5, 2022
ad9874c
More accurate layouts in type kinds, reworked printing of layouts
ccasin Oct 5, 2022
e276373
bootstrap
ccasin Oct 5, 2022
38680f1
Estimate type layouts earlier to avoid unnecessary expansion
ccasin Oct 6, 2022
9374820
bootstrap
ccasin Oct 6, 2022
0f11aa1
Skip layout checking in parts of subst that unify in empty env
ccasin Oct 6, 2022
3614bf7
Fix levels for type params in recursive module approximations
ccasin Oct 6, 2022
48e0f67
accept bad error message in case of missing cmi file, for now
ccasin Oct 6, 2022
e230810
Fix constraining tuple types to value
ccasin Oct 7, 2022
2635c5e
bootstrap
ccasin Oct 7, 2022
a7e75e3
accept bad error message for now
ccasin Oct 7, 2022
12627f2
More reversed lists in typeopt
ccasin Oct 9, 2022
608e0ca
First, hacky, stab at delaying layout checks to after update_type
ccasin Oct 10, 2022
7cd37da
bootstrap
ccasin Oct 10, 2022
41acfc0
beginnings of a test for layouts on missing cmis
ccasin Oct 10, 2022
7df1348
cleanup of delayed layout checks
ccasin Oct 10, 2022
c44b207
Undo changes to get_unboxed_type_representation
ccasin Oct 11, 2022
89bd211
Better errors for missing cmis; fix a test and disable a test
ccasin Oct 11, 2022
f0ee7ab
remove accidentally committed files
ccasin Oct 11, 2022
76031c9
Fix some missing cmi cases
ccasin Oct 11, 2022
5b658ff
Squash some XXXs
ccasin Oct 12, 2022
a3b77bf
Add checks that constructor args / record fields are representable
ccasin Oct 12, 2022
2cd6d81
Make get_unboxed_type_representation fail more gracefully
ccasin Oct 12, 2022
4b9ec68
move all typedecl layout checks to check_constraints
ccasin Oct 16, 2022
6aa14b4
bootstrap
ccasin Oct 16, 2022
453ee14
module constraints and tests for modules
ccasin Oct 17, 2022
1dbad6d
Clean XXXs
ccasin Oct 17, 2022
7f0e408
Syntax for layouts on type parameters, and a test (to be expanded)
ccasin Oct 18, 2022
5c739ae
squash a couple XXXs; layout checks for explicitly polymorphic types
ccasin Oct 18, 2022
cb5c0b8
bootstrap
ccasin Oct 18, 2022
6c0772b
Add tests for bad layouts on explicit polymorphism
ccasin Oct 18, 2022
061c087
more XXX squashing
ccasin Oct 20, 2022
e82fed0
Test for `Nondep_cannot_erase` case in `nondep_type_decl`
ccasin Oct 20, 2022
5620948
Remove Tvar layout ref; mutate desc instead. Also, tuple -> record.
ccasin Oct 20, 2022
63d332c
bootstrap
ccasin Oct 20, 2022
ede3b65
Default layout variables at module boundaries (and elsewhere)
ccasin Oct 21, 2022
19eb1bc
restore "norm" optimization in subst
ccasin Oct 21, 2022
be29eb7
bootstrap
ccasin Oct 21, 2022
b215631
clean up XXXs
ccasin Oct 21, 2022
046b6fa
More XXXs and some corresponding test cases
ccasin Oct 21, 2022
d6dd1df
Add missing layout check
ccasin Nov 3, 2022
22a626e
More missing checks / hacky defaulting stuff
ccasin Nov 3, 2022
54adac7
Update variant/record repr types, redo void transl and value_kind
ccasin Nov 3, 2022
5b1df5d
bootstrap
ccasin Nov 3, 2022
0996526
cleanup
ccasin Nov 4, 2022
f95d753
cleanup
ccasin Nov 4, 2022
ec47479
Fix XXX
ccasin Nov 4, 2022
ecaf0fa
cleanup
ccasin Nov 4, 2022
701a8e7
Handle more voids in records, and a corresponding test
ccasin Nov 6, 2022
e01a63c
Fix tests
ccasin Nov 6, 2022
04446ec
Support for void args to variants in the pattern match compiler
ccasin Nov 7, 2022
6f75ffc
minor XXX cleanup
ccasin Nov 7, 2022
a286c4f
Fix a few things pointed out by Richard
ccasin Nov 8, 2022
adc7915
Another comment
ccasin Nov 8, 2022
0834f8b
Adjusting filtering of void patterns. Still a bit more to do.
ccasin Nov 10, 2022
a3e37a5
Handle most cases of voids with lets. Ban module-level voids.
ccasin Nov 11, 2022
719b9b9
matching on voids working now. more test cases to be written
ccasin Nov 11, 2022
b9cdf02
clean some XXXs. Make polymorphic variant declarations take void args
ccasin Nov 11, 2022
113245a
Add / fix up some tests
ccasin Nov 11, 2022
1d7a615
Progress on module boundary stuff
ccasin Nov 11, 2022
4ffbeac
moregen: test cases and another layout check
ccasin Nov 12, 2022
22e484f
Test cases
ccasin Nov 13, 2022
3cccb9f
Another test
ccasin Nov 13, 2022
bf20806
cleanup and test case
ccasin Nov 14, 2022
e528728
Missing layout check and test
ccasin Nov 14, 2022
a122d3f
Add missing layout check and test case
ccasin Nov 14, 2022
44a1386
Test cleanup
ccasin Nov 14, 2022
5e59f14
More layout checks and test cases for classes
ccasin Nov 14, 2022
8f64c37
tests
ccasin Nov 15, 2022
816434f
module tests
ccasin Nov 15, 2022
20a3f6f
XXX and test case cleanup
ccasin Nov 15, 2022
27ef098
XXX cleanup
ccasin Nov 15, 2022
af709c6
Some fixes for unboxed inlined void records
ccasin Nov 15, 2022
ac8890d
temp fix for voids in or pats that mix normal and exception parts.
ccasin Nov 15, 2022
3029f06
XXXs
ccasin Nov 15, 2022
5a0d254
More XXXs and some cleanup
ccasin Nov 15, 2022
fcb9add
XXXs in typedecl
ccasin Nov 16, 2022
c620426
test case
ccasin Nov 16, 2022
c8a6ee1
Fix an XXX and add a corresponding test
ccasin Nov 16, 2022
b2a73da
More XXX cleanup, and add a comment explaining policy
ccasin Nov 16, 2022
2ad2108
Add missing checks for tuples
ccasin Nov 16, 2022
982b15f
bootstrap
ccasin Nov 16, 2022
c9850d2
add a question
ccasin Nov 16, 2022
b440a55
Add missing check on polymorphic variants, and corresponding test.
ccasin Nov 16, 2022
1b4502a
This adds layouts to extension tags and fixes cstr_arg_layouts
ccasin Nov 16, 2022
45143a1
Add lbl_layout. Change ld_void to ld_layout.
ccasin Nov 17, 2022
34d0093
bootstrap
ccasin Nov 17, 2022
b539959
Improve layout checking in package with constraints.
ccasin Nov 17, 2022
b7403f2
A temporary hack to deal with unsoundness in package with types
ccasin Nov 17, 2022
7bb5d9c
Fix a lingering minor bug from the cstr_arg_layouts rework
ccasin Nov 17, 2022
a33cfd1
Fix extensible variants and add corresponding tests
ccasin Nov 17, 2022
f652841
bootstrap
ccasin Nov 17, 2022
71fe6ba
Note about an example Stephen and I discussed.
ccasin Nov 17, 2022
4055fe5
Clean up seperability stuff and add a test case
ccasin Nov 17, 2022
212ef79
Delay typedecl layout checks rather than layouts in check_constraints
ccasin Nov 17, 2022
6a242b6
bootstrap
ccasin Nov 17, 2022
46a2ac4
minor cleanup of last commit
ccasin Nov 18, 2022
df770f8
fix and refactor value kind
ccasin Nov 18, 2022
8c3d746
Clean up remaining places in matching where sort info is needed
ccasin Nov 18, 2022
a56d872
More OO test cases and a missing value check
ccasin Nov 18, 2022
0b6ca79
Yet another value check and corresponding tests
ccasin Nov 18, 2022
2713b55
Add a missing layout check and a note to test it when we can
ccasin Nov 18, 2022
82bcb1a
cleanup
ccasin Nov 20, 2022
f0381f3
cleanup
ccasin Nov 20, 2022
48a95a3
cleanup
ccasin Nov 20, 2022
1426d49
Cleanup
ccasin Nov 21, 2022
1baf921
Delete unused record field
ccasin Nov 21, 2022
4827ba6
cleanup
ccasin Nov 21, 2022
3776f64
cleanup
ccasin Nov 21, 2022
1901776
cleanup
ccasin Nov 21, 2022
88be8c4
cleanup
ccasin Nov 21, 2022
30ae4af
Cleanup
ccasin Nov 22, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 37 additions & 68 deletions .depend
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,7 @@ typing/btype.cmx : \
typing/btype.cmi
typing/btype.cmi : \
typing/types.cmi \
typing/type_layout.cmi \
typing/path.cmi \
parsing/asttypes.cmi
typing/cmt2annot.cmo : \
Expand Down Expand Up @@ -522,7 +523,7 @@ typing/cmt2annot.cmx : \
typing/annot.cmi
typing/ctype.cmo : \
typing/types.cmi \
typing/type_immediacy.cmi \
typing/type_layout.cmi \
typing/subst.cmi \
typing/primitive.cmi \
typing/predef.cmi \
Expand All @@ -539,7 +540,7 @@ typing/ctype.cmo : \
typing/ctype.cmi
typing/ctype.cmx : \
typing/types.cmx \
typing/type_immediacy.cmx \
typing/type_layout.cmx \
typing/subst.cmx \
typing/primitive.cmx \
typing/predef.cmx \
Expand All @@ -556,7 +557,7 @@ typing/ctype.cmx : \
typing/ctype.cmi
typing/ctype.cmi : \
typing/types.cmi \
typing/type_immediacy.cmi \
typing/type_layout.cmi \
typing/primitive.cmi \
typing/path.cmi \
parsing/longident.cmi \
Expand Down Expand Up @@ -693,7 +694,7 @@ typing/includeclass.cmi : \
typing/includecore.cmo : \
typing/types.cmi \
typing/typedtree.cmi \
typing/type_immediacy.cmi \
typing/type_layout.cmi \
typing/printtyp.cmi \
typing/primitive.cmi \
typing/path.cmi \
Expand All @@ -707,7 +708,7 @@ typing/includecore.cmo : \
typing/includecore.cmx : \
typing/types.cmx \
typing/typedtree.cmx \
typing/type_immediacy.cmx \
typing/type_layout.cmx \
typing/printtyp.cmx \
typing/primitive.cmx \
typing/path.cmx \
Expand All @@ -721,7 +722,7 @@ typing/includecore.cmx : \
typing/includecore.cmi : \
typing/types.cmi \
typing/typedtree.cmi \
typing/type_immediacy.cmi \
typing/type_layout.cmi \
typing/path.cmi \
parsing/location.cmi \
typing/ident.cmi \
Expand Down Expand Up @@ -824,7 +825,6 @@ typing/oprint.cmx : \
typing/oprint.cmi : \
typing/outcometree.cmi
typing/outcometree.cmi : \
typing/type_immediacy.cmi \
parsing/asttypes.cmi
typing/parmatch.cmo : \
utils/warnings.cmi \
Expand Down Expand Up @@ -943,7 +943,7 @@ typing/persistent_env.cmi : \
file_formats/cmi_format.cmi
typing/predef.cmo : \
typing/types.cmi \
typing/type_immediacy.cmi \
typing/type_layout.cmi \
typing/path.cmi \
parsing/parsetree.cmi \
parsing/location.cmi \
Expand All @@ -954,7 +954,7 @@ typing/predef.cmo : \
typing/predef.cmi
typing/predef.cmx : \
typing/types.cmx \
typing/type_immediacy.cmx \
typing/type_layout.cmx \
typing/path.cmx \
parsing/parsetree.cmi \
parsing/location.cmx \
Expand Down Expand Up @@ -1003,7 +1003,6 @@ typing/printpat.cmi : \
typing/printtyp.cmo : \
utils/warnings.cmi \
typing/types.cmi \
typing/type_immediacy.cmi \
typing/primitive.cmi \
typing/predef.cmi \
typing/path.cmi \
Expand All @@ -1023,7 +1022,6 @@ typing/printtyp.cmo : \
typing/printtyp.cmx : \
utils/warnings.cmx \
typing/types.cmx \
typing/type_immediacy.cmx \
typing/primitive.cmx \
typing/predef.cmx \
typing/path.cmx \
Expand Down Expand Up @@ -1123,6 +1121,7 @@ typing/stypes.cmi : \
typing/annot.cmi
typing/subst.cmo : \
typing/types.cmi \
typing/type_layout.cmi \
typing/path.cmi \
parsing/parsetree.cmi \
utils/misc.cmi \
Expand All @@ -1135,6 +1134,7 @@ typing/subst.cmo : \
typing/subst.cmi
typing/subst.cmx : \
typing/types.cmx \
typing/type_layout.cmx \
typing/path.cmx \
parsing/parsetree.cmi \
utils/misc.cmx \
Expand Down Expand Up @@ -1179,14 +1179,17 @@ typing/tast_mapper.cmi : \
typing/typedtree.cmi \
typing/env.cmi \
parsing/asttypes.cmi
typing/type_immediacy.cmo : \
typing/type_layout.cmo : \
typing/types.cmi \
parsing/builtin_attributes.cmi \
typing/type_immediacy.cmi
typing/type_immediacy.cmx : \
typing/type_layout.cmi
typing/type_layout.cmx : \
typing/types.cmx \
parsing/builtin_attributes.cmx \
typing/type_immediacy.cmi
typing/type_immediacy.cmi : \
parsing/parsetree.cmi
typing/type_layout.cmi
typing/type_layout.cmi : \
typing/types.cmi \
parsing/builtin_attributes.cmi
typing/typeclass.cmo : \
utils/warnings.cmi \
typing/typetexp.cmi \
Expand Down Expand Up @@ -1334,10 +1337,8 @@ typing/typedecl.cmo : \
typing/types.cmi \
typing/typedtree.cmi \
typing/typedecl_variance.cmi \
typing/typedecl_unboxed.cmi \
typing/typedecl_separability.cmi \
typing/typedecl_immediacy.cmi \
typing/type_immediacy.cmi \
typing/type_layout.cmi \
typing/subst.cmi \
typing/printtyp.cmi \
typing/primitive.cmi \
Expand Down Expand Up @@ -1368,10 +1369,8 @@ typing/typedecl.cmx : \
typing/types.cmx \
typing/typedtree.cmx \
typing/typedecl_variance.cmx \
typing/typedecl_unboxed.cmx \
typing/typedecl_separability.cmx \
typing/typedecl_immediacy.cmx \
typing/type_immediacy.cmx \
typing/type_layout.cmx \
typing/subst.cmx \
typing/printtyp.cmx \
typing/primitive.cmx \
Expand Down Expand Up @@ -1401,7 +1400,7 @@ typing/typedecl.cmi : \
typing/typedtree.cmi \
typing/typedecl_variance.cmi \
typing/typedecl_separability.cmi \
typing/typedecl_immediacy.cmi \
typing/type_layout.cmi \
typing/path.cmi \
parsing/parsetree.cmi \
parsing/longident.cmi \
Expand All @@ -1411,29 +1410,6 @@ typing/typedecl.cmi : \
typing/env.cmi \
typing/ctype.cmi \
parsing/asttypes.cmi
typing/typedecl_immediacy.cmo : \
typing/types.cmi \
typing/typedecl_unboxed.cmi \
typing/typedecl_properties.cmi \
typing/type_immediacy.cmi \
parsing/location.cmi \
typing/ctype.cmi \
typing/typedecl_immediacy.cmi
typing/typedecl_immediacy.cmx : \
typing/types.cmx \
typing/typedecl_unboxed.cmx \
typing/typedecl_properties.cmx \
typing/type_immediacy.cmx \
parsing/location.cmx \
typing/ctype.cmx \
typing/typedecl_immediacy.cmi
typing/typedecl_immediacy.cmi : \
typing/types.cmi \
typing/typedecl_properties.cmi \
typing/type_immediacy.cmi \
parsing/location.cmi \
typing/ident.cmi \
typing/env.cmi
typing/typedecl_properties.cmo : \
typing/types.cmi \
typing/ident.cmi \
Expand All @@ -1453,6 +1429,7 @@ typing/typedecl_properties.cmi : \
typing/typedecl_separability.cmo : \
typing/types.cmi \
typing/typedecl_properties.cmi \
typing/type_layout.cmi \
parsing/location.cmi \
typing/env.cmi \
typing/ctype.cmi \
Expand All @@ -1463,6 +1440,7 @@ typing/typedecl_separability.cmo : \
typing/typedecl_separability.cmx : \
typing/types.cmx \
typing/typedecl_properties.cmx \
typing/type_layout.cmx \
parsing/location.cmx \
typing/env.cmx \
typing/ctype.cmx \
Expand All @@ -1476,21 +1454,6 @@ typing/typedecl_separability.cmi : \
parsing/location.cmi \
typing/ident.cmi \
typing/env.cmi
typing/typedecl_unboxed.cmo : \
typing/types.cmi \
typing/predef.cmi \
typing/env.cmi \
typing/ctype.cmi \
typing/typedecl_unboxed.cmi
typing/typedecl_unboxed.cmx : \
typing/types.cmx \
typing/predef.cmx \
typing/env.cmx \
typing/ctype.cmx \
typing/typedecl_unboxed.cmi
typing/typedecl_unboxed.cmi : \
typing/types.cmi \
typing/env.cmi
typing/typedecl_variance.cmo : \
typing/types.cmi \
typing/typedtree.cmi \
Expand Down Expand Up @@ -1525,6 +1488,7 @@ typing/typedecl_variance.cmi : \
typing/env.cmi \
parsing/asttypes.cmi
typing/typedtree.cmo : \
utils/warnings.cmi \
typing/types.cmi \
typing/primitive.cmi \
typing/path.cmi \
Expand All @@ -1533,9 +1497,11 @@ typing/typedtree.cmo : \
parsing/location.cmi \
typing/ident.cmi \
typing/env.cmi \
parsing/builtin_attributes.cmi \
parsing/asttypes.cmi \
typing/typedtree.cmi
typing/typedtree.cmx : \
utils/warnings.cmx \
typing/types.cmx \
typing/primitive.cmx \
typing/path.cmx \
Expand All @@ -1544,9 +1510,11 @@ typing/typedtree.cmx : \
parsing/location.cmx \
typing/ident.cmx \
typing/env.cmx \
parsing/builtin_attributes.cmx \
parsing/asttypes.cmi \
typing/typedtree.cmi
typing/typedtree.cmi : \
utils/warnings.cmi \
typing/types.cmi \
typing/primitive.cmi \
typing/path.cmi \
Expand All @@ -1555,6 +1523,7 @@ typing/typedtree.cmi : \
parsing/location.cmi \
typing/ident.cmi \
typing/env.cmi \
parsing/builtin_attributes.cmi \
parsing/asttypes.cmi
typing/typemod.cmo : \
utils/warnings.cmi \
Expand Down Expand Up @@ -1633,11 +1602,12 @@ typing/typemod.cmi : \
typing/includemod.cmi \
typing/ident.cmi \
typing/env.cmi \
file_formats/cmi_format.cmi
file_formats/cmi_format.cmi \
utils/clflags.cmi
typing/typeopt.cmo : \
typing/types.cmi \
typing/typedtree.cmi \
typing/typedecl.cmi \
typing/type_layout.cmi \
typing/predef.cmi \
typing/path.cmi \
utils/numbers.cmi \
Expand All @@ -1652,7 +1622,7 @@ typing/typeopt.cmo : \
typing/typeopt.cmx : \
typing/types.cmx \
typing/typedtree.cmx \
typing/typedecl.cmx \
typing/type_layout.cmx \
typing/predef.cmx \
typing/path.cmx \
utils/numbers.cmx \
Expand All @@ -1671,7 +1641,6 @@ typing/typeopt.cmi : \
lambda/lambda.cmi \
typing/env.cmi
typing/types.cmo : \
typing/type_immediacy.cmi \
typing/primitive.cmi \
typing/path.cmi \
parsing/parsetree.cmi \
Expand All @@ -1684,7 +1653,6 @@ typing/types.cmo : \
parsing/asttypes.cmi \
typing/types.cmi
typing/types.cmx : \
typing/type_immediacy.cmx \
typing/primitive.cmx \
typing/path.cmx \
parsing/parsetree.cmi \
Expand All @@ -1697,7 +1665,6 @@ typing/types.cmx : \
parsing/asttypes.cmi \
typing/types.cmi
typing/types.cmi : \
typing/type_immediacy.cmi \
typing/primitive.cmi \
typing/path.cmi \
parsing/parsetree.cmi \
Expand Down Expand Up @@ -3564,6 +3531,7 @@ lambda/translcomprehension.cmi : \
lambda/lambda.cmi \
lambda/debuginfo.cmi
lambda/translcore.cmo : \
utils/warnings.cmi \
typing/types.cmi \
typing/typeopt.cmi \
typing/typedtree.cmi \
Expand Down Expand Up @@ -3593,6 +3561,7 @@ lambda/translcore.cmo : \
parsing/asttypes.cmi \
lambda/translcore.cmi
lambda/translcore.cmx : \
utils/warnings.cmx \
typing/types.cmx \
typing/typeopt.cmx \
typing/typedtree.cmx \
Expand Down
9 changes: 6 additions & 3 deletions asmcomp/cmmgen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,14 @@ let rec expr_size env = function
(* Pgenarray is excluded from recursive bindings by the
check in Translcore.check_recursive_lambda *)
RHS_nonrec
| Uprim (Pduprecord ((Record_regular | Record_inlined _), sz), _, _) ->
| Uprim (Pduprecord ((Record_boxed _ | Record_inlined (_, Variant_boxed _)),
sz), _, _) ->
RHS_block sz
| Uprim (Pduprecord (Record_unboxed _, _), _, _) ->
| Uprim (Pduprecord ((Record_unboxed _
| Record_inlined (_, Variant_unboxed _)),
_), _, _) ->
assert false
| Uprim (Pduprecord (Record_extension _, sz), _, _) ->
| Uprim (Pduprecord (Record_inlined (_, Variant_extensible), sz), _, _) ->
RHS_block (sz + 1)
| Uprim (Pduprecord (Record_float, sz), _, _) ->
RHS_floatblock sz
Expand Down
Loading