Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: Upgrade Binaryen to v101 (#99)
feat!: Move expressions into namespaces feat: Add operations on expressions feat: Add operations on functions feat: Add operations on globals feat: Add operations on imports feat: Add operations on exports feat!: Move element segment into own module feat: Add operations on element segments feat: Add `Type.expandType` feat: Add `Module.get_features` feat!: Move `Features` into `Module.Feature` feat!: Create Settings modules & move global functions feat!: Convert some Settings from ints to bools chore!: Remove SIMD methods that Binaryen replaced feat: Build vendored Binaryen with GCC 7 instead of 9 Co-authored-by: Oscar Spencer <oscar@grain-lang.org> Co-authored-by: Blaine Bublitz <blaine.bublitz@gmail.com> Co-authored-by: Josiah Savary <hello@jsavary.com>
- Loading branch information
1 parent
61cf08f
commit 3de1b28
Showing
66 changed files
with
4,864 additions
and
1,323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
open Js_of_ocaml.Js | ||
open Js_of_ocaml.Js.Unsafe | ||
|
||
type t = int | ||
|
||
let get_name elem = | ||
let element_segment_info = | ||
meth_call global##.binaryen "getElementSegmentInfo" [| inject elem |] | ||
in | ||
to_string (get element_segment_info "name") | ||
|
||
let get_table elem = | ||
let element_segment_info = | ||
meth_call global##.binaryen "getElementSegmentInfo" [| inject elem |] | ||
in | ||
to_string (get element_segment_info "table") | ||
|
||
let get_offset elem = | ||
let element_segment_info = | ||
meth_call global##.binaryen "getElementSegmentInfo" [| inject elem |] | ||
in | ||
get element_segment_info "offset" | ||
|
||
let get_length elem = | ||
meth_call global##.binaryen "_BinaryenElementSegmentGetLength" | ||
[| inject elem |] | ||
|
||
let get_data elem index = | ||
let element_segment_info = | ||
meth_call global##.binaryen "getElementSegmentInfo" [| inject elem |] | ||
in | ||
let data_js_array = get element_segment_info "data" in | ||
to_string (get data_js_array index) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.