Skip to content
Merged
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
21 changes: 4 additions & 17 deletions src/codegen/compile.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4173,31 +4173,18 @@ module Serialization = struct
G.i (Store {ty = I64Type; align = 0; offset = 0l; sz = None}) ^^
compile_unboxed_const 8l ^^ advance_data_buf
| Prim (Int32|Nat32) ->
get_data_buf ^^
get_x ^^ BoxedSmallWord.unbox env ^^
G.i (Store {ty = I32Type; align = 0; offset = 0l; sz = None}) ^^
compile_unboxed_const 4l ^^ advance_data_buf
write_word32 (get_x ^^ BoxedSmallWord.unbox env)
| Prim Char ->
get_data_buf ^^
get_x ^^ TaggedSmallWord.untag_codepoint ^^
G.i (Store {ty = I32Type; align = 0; offset = 0l; sz = None}) ^^
compile_unboxed_const 4l ^^ advance_data_buf
write_word32 (get_x ^^ TaggedSmallWord.untag_codepoint)
| Prim (Int16|Nat16) ->
get_data_buf ^^
get_x ^^ TaggedSmallWord.lsb_adjust Nat16 ^^
G.i (Store {ty = I32Type; align = 0; offset = 0l; sz = Some Wasm.Types.Pack16}) ^^
compile_unboxed_const 2l ^^ advance_data_buf
| Prim (Int8|Nat8) ->
get_data_buf ^^
get_x ^^ TaggedSmallWord.lsb_adjust Nat8 ^^
G.i (Store {ty = I32Type; align = 0; offset = 0l; sz = Some Wasm.Types.Pack8}) ^^
compile_unboxed_const 1l ^^ advance_data_buf
write_byte (get_x ^^ TaggedSmallWord.lsb_adjust Nat8)
| Prim Bool ->
get_data_buf ^^
get_x ^^
BoxedSmallWord.unbox env (* essentially SR.adjust SR.Vanilla SR.bool *) ^^
G.i (Store {ty = I32Type; align = 0; offset = 0l; sz = Some Wasm.Types.Pack8}) ^^
compile_unboxed_const 1l ^^ advance_data_buf
write_byte (get_x ^^ BoxedSmallWord.unbox env) (* essentially SR.adjust SR.Vanilla SR.bool *)
| Tup [] -> (* e(()) = null *)
G.nop
| Tup ts ->
Expand Down