Skip to content
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

Unboxed records inside boxed records: Lambda changes #3274

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
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
22 changes: 18 additions & 4 deletions lambda/lambda.mli
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ type primitive =
| Pmakefloatblock of mutable_flag * locality_mode
| Pmakeufloatblock of mutable_flag * locality_mode
| Pmakemixedblock of int * mutable_flag * mixed_block_shape * locality_mode
| Pfield of int * immediate_or_pointer * field_read_semantics
| Pfield of int * immediate_or_pointer * block_shape * field_read_semantics
| Pfield_computed of field_read_semantics
| Psetfield of int * immediate_or_pointer * initialization_or_assignment
| Psetfield of int * immediate_or_pointer * block_shape * initialization_or_assignment
| Psetfield_computed of immediate_or_pointer * initialization_or_assignment
| Pfloatfield of int * field_read_semantics * locality_mode
| Pufloatfield of int * field_read_semantics
Expand Down Expand Up @@ -424,8 +424,20 @@ and layout =
| Punboxed_product of layout list
| Pbottom

and known_layout =
| Pvalue of value_kind
| Punboxed_float of boxed_float
| Punboxed_int of boxed_integer
| Punboxed_vector of boxed_vector
| Punboxed_product of layout list

and block_shape =
value_kind list option
| Unknown_all_values
| Shape of block_shape_item list

and block_shape_item =
| Value of value_kind
| Unboxed_product of known_layout list

and flat_element = Types.flat_element =
| Imm
Expand All @@ -448,7 +460,8 @@ and mixed_block_write =
| Mwrite_flat_suffix of flat_element

and mixed_block_shape =
{ value_prefix_len : int;
{ (* CR xclerc: try to find a better name, as this might contain unboxed products *)
value_prefix : block_shape;
(* We use an array just so we can index into the middle. *)
flat_suffix : flat_element array;
}
Expand Down Expand Up @@ -528,6 +541,7 @@ val layout_of_extern_repr : extern_repr -> layout
type structured_constant =
Const_base of constant
| Const_block of int * structured_constant list
(* CR xclerc: double check whether `mixed_block_shape` should be changed. *)
| Const_mixed_block of int * mixed_block_shape * structured_constant list
| Const_float_array of string list
| Const_immstring of string
Expand Down
Loading