Skip to content

Commit 44bdd2a

Browse files
authored
feat!: Upgrade to Binaryen v116 (#202)
1 parent 6af9f7d commit 44bdd2a

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

binaryen.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ depends: [
1616
"dune" {>= "3.0.0"}
1717
"dune-configurator" {>= "3.0.0"}
1818
"js_of_ocaml-compiler" {>= "4.1.0" < "6.0.0"}
19-
"libbinaryen" {>= "115.0.0" < "116.0.0"}
19+
"libbinaryen" {>= "116.0.0" < "117.0.0"}
2020
]

esy.lock/index.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": "Apache-2.0",
77
"dependencies": {
88
"ocaml": ">= 4.13.0 < 5.0.0",
9-
"@grain/libbinaryen": ">= 115.0.0 < 116.0.0",
9+
"@grain/libbinaryen": ">= 116.0.0 < 117.0.0",
1010
"@opam/dune": ">= 3.0.0",
1111
"@opam/dune-configurator": ">= 3.0.0"
1212
},

src/expression.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,11 +442,11 @@ caml_binaryen_pop(value _module, value _ty) {
442442
}
443443

444444
CAMLprim value
445-
caml_binaryen_i31_new(value _module, value _val) {
445+
caml_binaryen_ref_i31(value _module, value _val) {
446446
CAMLparam2(_module, _val);
447447
BinaryenModuleRef module = BinaryenModuleRef_val(_module);
448448
BinaryenExpressionRef val = BinaryenExpressionRef_val(_val);
449-
BinaryenExpressionRef exp = BinaryenI31New(module, val);
449+
BinaryenExpressionRef exp = BinaryenRefI31(module, val);
450450
CAMLreturn(alloc_BinaryenExpressionRef(exp));
451451
}
452452

@@ -717,9 +717,9 @@ caml_binaryen_expression_id_tuple_extract(value unit) {
717717
CAMLreturn(Val_int(BinaryenTupleExtractId()));
718718
}
719719
CAMLprim value
720-
caml_binaryen_expression_id_i31_new(value unit) {
720+
caml_binaryen_expression_id_ref_i31(value unit) {
721721
CAMLparam1(unit);
722-
CAMLreturn(Val_int(BinaryenI31NewId()));
722+
CAMLreturn(Val_int(BinaryenRefI31Id()));
723723
}
724724
CAMLprim value
725725
caml_binaryen_expression_id_i31_get(value unit) {

src/expression.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,9 @@ function caml_binaryen_pop(wasm_mod, typ) {
542542
return Binaryen._BinaryenPop(wasm_mod, typ);
543543
}
544544

545-
//Provides: caml_binaryen_i31_new
546-
function caml_binaryen_i31_new(wasm_mod, typ) {
547-
return wasm_mod.i31.new(typ);
545+
//Provides: caml_binaryen_ref_i31
546+
function caml_binaryen_ref_i31(wasm_mod, typ) {
547+
return wasm_mod.ref.i31(typ);
548548
}
549549

550550
//Provides: caml_binaryen_i31_get
@@ -812,10 +812,10 @@ function caml_binaryen_expression_id_tuple_make() {
812812
function caml_binaryen_expression_id_tuple_extract() {
813813
return Binaryen.TupleExtractId;
814814
}
815-
//Provides: caml_binaryen_expression_id_i31_new
815+
//Provides: caml_binaryen_expression_id_ref_i31
816816
//Requires: Binaryen
817-
function caml_binaryen_expression_id_i31_new() {
818-
return Binaryen.I31NewId;
817+
function caml_binaryen_expression_id_ref_i31() {
818+
return Binaryen.RefI31Id;
819819
}
820820
//Provides: caml_binaryen_expression_id_i31_get
821821
//Requires: Binaryen

src/expression.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,9 @@ external id_tuple_extract : unit -> int
285285

286286
let id_tuple_extract = id_tuple_extract ()
287287

288-
external id_i31_new : unit -> int = "caml_binaryen_expression_id_i31_new"
288+
external id_ref_i31 : unit -> int = "caml_binaryen_expression_id_ref_i31"
289289

290-
let id_i31_new = id_i31_new ()
290+
let id_ref_i31 = id_ref_i31 ()
291291

292292
external id_i31_get : unit -> int = "caml_binaryen_expression_id_i31_get"
293293

@@ -394,7 +394,7 @@ let get_kind expr =
394394
| n when n = id_rethrow -> Rethrow
395395
| n when n = id_tuple_make -> TupleMake
396396
| n when n = id_tuple_extract -> TupleExtract
397-
| n when n = id_i31_new -> I31New
397+
| n when n = id_ref_i31 -> I31New
398398
| n when n = id_i31_get -> I31Get
399399
| n when n = id_call_ref -> CallRef
400400
| n when n = id_ref_test -> RefTest
@@ -820,7 +820,7 @@ module Pop = struct
820820
end
821821

822822
module I31 = struct
823-
external make : Module.t -> t -> t = "caml_binaryen_i31_new"
823+
external make : Module.t -> t -> t = "caml_binaryen_ref_i31"
824824
(** Module, value *)
825825

826826
external get : Module.t -> t -> bool -> t = "caml_binaryen_i31_get"

0 commit comments

Comments
 (0)