@grain/binaryen.ml 0.14.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- binaryen-archive/CHANGELOG.md +26 -0
- binaryen-archive/README.md +16 -0
- binaryen-archive/binaryen.opam +2 -4
- binaryen-archive/dune +1 -1
- binaryen-archive/esy.lock/index.json +6 -94
- binaryen-archive/package.json +3 -5
- binaryen-archive/src/binaryen_stubs_exports.js +110 -0
- binaryen-archive/src/binaryen_stubs_expressions.js +1613 -0
- binaryen-archive/src/binaryen_stubs_features.js +105 -0
- binaryen-archive/src/binaryen_stubs_functions.js +92 -0
- binaryen-archive/src/binaryen_stubs_globals.js +62 -0
- binaryen-archive/src/binaryen_stubs_imports.js +86 -0
- binaryen-archive/src/binaryen_stubs_literals.js +29 -0
- binaryen-archive/src/binaryen_stubs_memory.js +25 -0
- binaryen-archive/src/binaryen_stubs_modules.js +121 -0
- binaryen-archive/src/binaryen_stubs_ops.js +1895 -0
- binaryen-archive/src/binaryen_stubs_settings.js +120 -0
- binaryen-archive/src/binaryen_stubs_tables.c +2 -0
- binaryen-archive/src/binaryen_stubs_tables.js +84 -0
- binaryen-archive/src/binaryen_stubs_types.js +73 -0
- binaryen-archive/src/dune +11 -4
- binaryen-archive/{virtual → src}/element_segment.mli +0 -0
- binaryen-archive/{virtual → src}/export.mli +0 -0
- binaryen-archive/{virtual → src}/expression.mli +0 -0
- binaryen-archive/{virtual → src}/function.mli +0 -0
- binaryen-archive/{virtual → src}/global.mli +0 -0
- binaryen-archive/{virtual → src}/import.mli +0 -0
- binaryen-archive/src/literal.ml +0 -13
- binaryen-archive/src/literal.mli +8 -0
- binaryen-archive/src/memory.ml +6 -6
- binaryen-archive/{virtual → src}/memory.mli +1 -1
- binaryen-archive/src/module.ml +1 -1
- binaryen-archive/{virtual → src}/module.mli +1 -1
- binaryen-archive/{virtual → src}/op.mli +0 -0
- binaryen-archive/src/passes.ml +345 -0
- binaryen-archive/src/passes.mli +343 -0
- binaryen-archive/{virtual → src}/settings.mli +0 -0
- binaryen-archive/{virtual → src}/table.mli +0 -0
- binaryen-archive/{virtual → src}/type.mli +0 -0
- binaryen-archive/test/dune +2 -22
- binaryen-archive/test/test.expected +8 -4
- binaryen-archive/test/test.ml +33 -10
- binaryen-archive/esy.lock/opam/js_of_ocaml-ppx.3.11.0/opam +0 -44
- binaryen-archive/esy.lock/opam/js_of_ocaml.3.11.0/opam +0 -45
- binaryen-archive/esy.lock/opam/uchar.0.0.2/opam +0 -36
- binaryen-archive/esy.lock/overrides/opam__s__uchar_opam__c__0.0.2_opam_override/files/winpatch.patch +0 -11
- binaryen-archive/esy.lock/overrides/opam__s__uchar_opam__c__0.0.2_opam_override/package.json +0 -11
- binaryen-archive/js/binaryen.es5.js +0 -363
- binaryen-archive/js/dune +0 -13
- binaryen-archive/js/element_segment.ml +0 -33
- binaryen-archive/js/export.ml +0 -57
- binaryen-archive/js/expression.ml +0 -1105
- binaryen-archive/js/function.ml +0 -60
- binaryen-archive/js/global.ml +0 -48
- binaryen-archive/js/import.ml +0 -69
- binaryen-archive/js/literal.ml +0 -28
- binaryen-archive/js/memory.ml +0 -39
- binaryen-archive/js/module.ml +0 -116
- binaryen-archive/js/op.ml +0 -482
- binaryen-archive/js/prelude.js +0 -2
- binaryen-archive/js/settings.ml +0 -60
- binaryen-archive/js/stubs.c +0 -15
- binaryen-archive/js/table.ml +0 -29
- binaryen-archive/js/type.ml +0 -21
- binaryen-archive/virtual/dune +0 -6
- binaryen-archive/virtual/literal.mli +0 -19
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
//Provides: caml_binaryen_get_optimize_level
|
|
2
|
+
//Requires: binaryen
|
|
3
|
+
function caml_binaryen_get_optimize_level() {
|
|
4
|
+
return binaryen.getOptimizeLevel();
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
//Provides: caml_binaryen_set_optimize_level
|
|
8
|
+
//Requires: binaryen
|
|
9
|
+
function caml_binaryen_set_optimize_level(level) {
|
|
10
|
+
return binaryen.setOptimizeLevel(level);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//Provides: caml_binaryen_get_shrink_level
|
|
14
|
+
//Requires: binaryen
|
|
15
|
+
function caml_binaryen_get_shrink_level() {
|
|
16
|
+
return binaryen.getShrinkLevel();
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//Provides: caml_binaryen_set_shrink_level
|
|
20
|
+
//Requires: binaryen
|
|
21
|
+
function caml_binaryen_set_shrink_level(level) {
|
|
22
|
+
return binaryen.setShrinkLevel(level);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//Provides: caml_binaryen_get_debug_info
|
|
26
|
+
//Requires: binaryen
|
|
27
|
+
function caml_binaryen_get_debug_info() {
|
|
28
|
+
// Uses the `_Binaryen` function because then we are working with ints which are also booleans to JSOO
|
|
29
|
+
return binaryen._BinaryenGetDebugInfo();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//Provides: caml_binaryen_set_debug_info
|
|
33
|
+
//Requires: binaryen
|
|
34
|
+
function caml_binaryen_set_debug_info(on) {
|
|
35
|
+
// Uses the `_Binaryen` function because then we are working with ints which are also booleans to JSOO
|
|
36
|
+
return binaryen._BinaryenSetDebugInfo(on);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
//Provides: caml_binaryen_get_low_memory_unused
|
|
40
|
+
//Requires: binaryen
|
|
41
|
+
function caml_binaryen_get_low_memory_unused() {
|
|
42
|
+
// Uses the `_Binaryen` function because then we are working with ints which are also booleans to JSOO
|
|
43
|
+
return binaryen._BinaryenGetLowMemoryUnused();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
//Provides: caml_binaryen_set_low_memory_unused
|
|
47
|
+
//Requires: binaryen
|
|
48
|
+
function caml_binaryen_set_low_memory_unused(on) {
|
|
49
|
+
// Uses the `_Binaryen` function because then we are working with ints which are also booleans to JSOO
|
|
50
|
+
return binaryen._BinaryenSetLowMemoryUnused(on);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
//Provides: caml_binaryen_get_pass_argument
|
|
54
|
+
//Requires: binaryen
|
|
55
|
+
//Requires: caml_jsstring_of_string
|
|
56
|
+
function caml_binaryen_get_pass_argument(name) {
|
|
57
|
+
return binaryen.getPassArgument(
|
|
58
|
+
caml_jsstring_of_string(name)
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
//Provides: caml_binaryen_set_pass_argument
|
|
63
|
+
//Requires: binaryen
|
|
64
|
+
//Requires: caml_jsstring_of_string
|
|
65
|
+
function caml_binaryen_set_pass_argument(name, value) {
|
|
66
|
+
return binaryen.setPassArgument(
|
|
67
|
+
caml_jsstring_of_string(name),
|
|
68
|
+
caml_jsstring_of_string(value)
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
//Provides: caml_binaryen_get_always_inline_max_size
|
|
73
|
+
//Requires: binaryen
|
|
74
|
+
function caml_binaryen_get_always_inline_max_size() {
|
|
75
|
+
return binaryen.getAlwaysInlineMaxSize();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
//Provides: caml_binaryen_set_always_inline_max_size
|
|
79
|
+
//Requires: binaryen
|
|
80
|
+
function caml_binaryen_set_always_inline_max_size(size) {
|
|
81
|
+
return binaryen.setAlwaysInlineMaxSize(size);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
//Provides: caml_binaryen_get_flexible_inline_max_size
|
|
85
|
+
//Requires: binaryen
|
|
86
|
+
function caml_binaryen_get_flexible_inline_max_size() {
|
|
87
|
+
return binaryen.getFlexibleInlineMaxSize();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
//Provides: caml_binaryen_set_flexible_inline_max_size
|
|
91
|
+
//Requires: binaryen
|
|
92
|
+
function caml_binaryen_set_flexible_inline_max_size(size) {
|
|
93
|
+
return binaryen.setFlexibleInlineMaxSize(size);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
//Provides: caml_binaryen_get_one_caller_inline_max_size
|
|
97
|
+
//Requires: binaryen
|
|
98
|
+
function caml_binaryen_get_one_caller_inline_max_size() {
|
|
99
|
+
return binaryen.getOneCallerInlineMaxSize();
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
//Provides: caml_binaryen_set_one_caller_inline_max_size
|
|
103
|
+
//Requires: binaryen
|
|
104
|
+
function caml_binaryen_set_one_caller_inline_max_size(size) {
|
|
105
|
+
return binaryen.setOneCallerInlineMaxSize(size);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
//Provides: caml_binaryen_set_colors_enabled
|
|
109
|
+
//Requires: binaryen
|
|
110
|
+
function caml_binaryen_set_colors_enabled(on) {
|
|
111
|
+
// Uses the `_Binaryen` function because then we are working with ints which are also booleans to JSOO
|
|
112
|
+
return binaryen._BinaryenSetColorsEnabled(on);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
//Provides: caml_binaryen_are_colors_enabled
|
|
116
|
+
//Requires: binaryen
|
|
117
|
+
function caml_binaryen_are_colors_enabled() {
|
|
118
|
+
// Uses the `_Binaryen` function because then we are working with ints which are also booleans to JSOO
|
|
119
|
+
return binaryen._BinaryenAreColorsEnabled();
|
|
120
|
+
}
|
|
@@ -98,6 +98,7 @@ caml_binaryen_element_segment_get_name(value _elem) {
|
|
|
98
98
|
CAMLreturn(caml_copy_string(BinaryenElementSegmentGetName(elem)));
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
+
// TODO: Expose to bindings
|
|
101
102
|
CAMLprim value
|
|
102
103
|
caml_binaryen_element_segment_set_name(value _elem, value _name) {
|
|
103
104
|
CAMLparam2(_elem, _name);
|
|
@@ -114,6 +115,7 @@ caml_binaryen_element_segment_get_table(value _elem) {
|
|
|
114
115
|
CAMLreturn(caml_copy_string(BinaryenElementSegmentGetTable(elem)));
|
|
115
116
|
}
|
|
116
117
|
|
|
118
|
+
// TODO: Expose to bindings
|
|
117
119
|
CAMLprim value
|
|
118
120
|
caml_binaryen_element_segment_set_table(value _elem, value _table) {
|
|
119
121
|
CAMLparam2(_elem, _table);
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
//Provides: caml_binaryen_add_table
|
|
2
|
+
//Requires: caml_jsstring_of_string
|
|
3
|
+
function caml_binaryen_add_table(wasm_mod, table, initial, maximum, tableType) {
|
|
4
|
+
return wasm_mod.addTable(
|
|
5
|
+
caml_jsstring_of_string(table),
|
|
6
|
+
initial,
|
|
7
|
+
maximum,
|
|
8
|
+
tableType
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
//Provides: caml_binaryen_add_active_element_segment
|
|
13
|
+
//Requires: caml_jsstring_of_string, caml_list_to_js_array
|
|
14
|
+
function caml_binaryen_add_active_element_segment(wasm_mod, table, name, funcnames, offset) {
|
|
15
|
+
return wasm_mod.addActiveElementSegment(
|
|
16
|
+
caml_jsstring_of_string(table),
|
|
17
|
+
caml_jsstring_of_string(name),
|
|
18
|
+
caml_list_to_js_array(funcnames).map(caml_jsstring_of_string),
|
|
19
|
+
offset
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
//Provides: caml_binaryen_remove_element_segment
|
|
24
|
+
//Requires: caml_jsstring_of_string
|
|
25
|
+
function caml_binaryen_remove_element_segment(wasm_mod, name) {
|
|
26
|
+
return wasm_mod.removeElementSegment(caml_jsstring_of_string(name));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//Provides: caml_binaryen_get_num_element_segments
|
|
30
|
+
function caml_binaryen_get_num_element_segments(wasm_mod) {
|
|
31
|
+
return wasm_mod.getNumElementSegments();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
//Provides: caml_binaryen_get_element_segment
|
|
35
|
+
//Requires: caml_jsstring_of_string
|
|
36
|
+
function caml_binaryen_get_element_segment(wasm_mod, name) {
|
|
37
|
+
return wasm_mod.getElementSegment(caml_jsstring_of_string(name));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
//Provides: caml_binaryen_get_element_segment_by_index
|
|
41
|
+
function caml_binaryen_get_element_segment_by_index(wasm_mod, index) {
|
|
42
|
+
return wasm_mod.getElementSegmentByIndex(index);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
//Provides: caml_binaryen_element_segment_get_name
|
|
46
|
+
//Requires: binaryen
|
|
47
|
+
//Requires: caml_string_of_jsstring
|
|
48
|
+
function caml_binaryen_element_segment_get_name(elem) {
|
|
49
|
+
var element_segment_info = binaryen.getElementSegmentInfo(elem);
|
|
50
|
+
return caml_string_of_jsstring(element_segment_info.name)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// TODO: Implement caml_binaryen_element_segment_set_name
|
|
54
|
+
|
|
55
|
+
//Provides: caml_binaryen_element_segment_get_table
|
|
56
|
+
//Requires: binaryen
|
|
57
|
+
//Requires: caml_string_of_jsstring
|
|
58
|
+
function caml_binaryen_element_segment_get_table(elem) {
|
|
59
|
+
var element_segment_info = binaryen.getElementSegmentInfo(elem);
|
|
60
|
+
return caml_string_of_jsstring(element_segment_info.table);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// TODO: Implement caml_binaryen_element_segment_set_table
|
|
64
|
+
|
|
65
|
+
//Provides: caml_binaryen_element_segment_get_offset
|
|
66
|
+
//Requires: binaryen
|
|
67
|
+
function caml_binaryen_element_segment_get_offset(elem) {
|
|
68
|
+
var element_segment_info = binaryen.getElementSegmentInfo(elem);
|
|
69
|
+
return element_segment_info.offset;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
//Provides: caml_binaryen_element_segment_get_length
|
|
73
|
+
//Requires: binaryen
|
|
74
|
+
function caml_binaryen_element_segment_get_length(elem) {
|
|
75
|
+
return binaryen._BinaryenElementSegmentGetLength(elem);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
//Provides: caml_binaryen_element_segment_get_data
|
|
79
|
+
//Requires: binaryen
|
|
80
|
+
//Requires: caml_string_of_jsstring
|
|
81
|
+
function caml_binaryen_element_segment_get_data(elem, index) {
|
|
82
|
+
var element_segment_info = binaryen.getElementSegmentInfo(elem);
|
|
83
|
+
return caml_string_of_jsstring(element_segment_info.data[index]);
|
|
84
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
//Provides: caml_binaryen_type_none
|
|
2
|
+
//Requires: binaryen
|
|
3
|
+
function caml_binaryen_type_none() {
|
|
4
|
+
return binaryen.none;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
//Provides: caml_binaryen_type_int32
|
|
8
|
+
//Requires: binaryen
|
|
9
|
+
function caml_binaryen_type_int32() {
|
|
10
|
+
return binaryen.i32;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
//Provides: caml_binaryen_type_int64
|
|
14
|
+
//Requires: binaryen
|
|
15
|
+
function caml_binaryen_type_int64() {
|
|
16
|
+
return binaryen.i64;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//Provides: caml_binaryen_type_float32
|
|
20
|
+
//Requires: binaryen
|
|
21
|
+
function caml_binaryen_type_float32() {
|
|
22
|
+
return binaryen.f32;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//Provides: caml_binaryen_type_float64
|
|
26
|
+
//Requires: binaryen
|
|
27
|
+
function caml_binaryen_type_float64() {
|
|
28
|
+
return binaryen.f64;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//Provides: caml_binaryen_type_vec128
|
|
32
|
+
//Requires: binaryen
|
|
33
|
+
function caml_binaryen_type_vec128() {
|
|
34
|
+
return binaryen.v128;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//Provides: caml_binaryen_type_funcref
|
|
38
|
+
//Requires: binaryen
|
|
39
|
+
function caml_binaryen_type_funcref() {
|
|
40
|
+
return binaryen.funcref;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//Provides: caml_binaryen_type_externref
|
|
44
|
+
//Requires: binaryen
|
|
45
|
+
function caml_binaryen_type_externref() {
|
|
46
|
+
return binaryen.externref;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
//Provides: caml_binaryen_type_unreachable
|
|
50
|
+
//Requires: binaryen
|
|
51
|
+
function caml_binaryen_type_unreachable() {
|
|
52
|
+
return binaryen.unreachable;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
//Provides: caml_binaryen_type_auto
|
|
56
|
+
//Requires: binaryen
|
|
57
|
+
function caml_binaryen_type_auto() {
|
|
58
|
+
return binaryen.auto;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
//Provides: caml_binaryen_type_create
|
|
62
|
+
//Requires: binaryen
|
|
63
|
+
//Requires: caml_js_from_array
|
|
64
|
+
function caml_binaryen_type_create(typs) {
|
|
65
|
+
return binaryen.createType(caml_js_from_array(typs));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
//Provides: caml_binaryen_type_expand
|
|
69
|
+
//Requires: binaryen
|
|
70
|
+
//Requires: caml_js_to_array
|
|
71
|
+
function caml_binaryen_type_expand(typ) {
|
|
72
|
+
return caml_js_to_array(binaryen.expandType(typ));
|
|
73
|
+
}
|
binaryen-archive/src/dune
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
(library
|
|
2
|
-
(name
|
|
3
|
-
(public_name binaryen
|
|
4
|
-
(implements binaryen)
|
|
2
|
+
(name binaryen)
|
|
3
|
+
(public_name binaryen)
|
|
5
4
|
(libraries libbinaryen.c)
|
|
6
5
|
(foreign_stubs
|
|
7
6
|
(language c)
|
|
@@ -10,4 +9,12 @@
|
|
|
10
9
|
binaryen_stubs_imports binaryen_stubs_exports binaryen_stubs_globals
|
|
11
10
|
binaryen_stubs_tables binaryen_stubs_memory binaryen_stubs_features
|
|
12
11
|
binaryen_stubs_modules binaryen_stubs_settings ocaml_helpers)
|
|
13
|
-
(flags :standard -O2 -Wall -Wextra))
|
|
12
|
+
(flags :standard -O2 -Wall -Wextra))
|
|
13
|
+
(js_of_ocaml
|
|
14
|
+
(javascript_files binaryen_stubs_types.js binaryen_stubs_ops.js
|
|
15
|
+
binaryen_stubs_literals.js binaryen_stubs_expressions.js
|
|
16
|
+
binaryen_stubs_functions.js binaryen_stubs_imports.js
|
|
17
|
+
binaryen_stubs_exports.js binaryen_stubs_globals.js
|
|
18
|
+
binaryen_stubs_tables.js binaryen_stubs_memory.js
|
|
19
|
+
binaryen_stubs_features.js binaryen_stubs_modules.js
|
|
20
|
+
binaryen_stubs_settings.js)))
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
binaryen-archive/src/literal.ml
CHANGED
|
@@ -8,16 +8,3 @@ external float64_bits : int64 -> t = "caml_binaryen_literal_float64_bits"
|
|
|
8
8
|
let float32 n = float32_bits @@ Int32.bits_of_float n
|
|
9
9
|
|
|
10
10
|
external float64 : float -> t = "caml_binaryen_literal_float64"
|
|
11
|
-
|
|
12
|
-
(* Hacks for Binaryen.js stack allocations, Don't use in binaryen.native *)
|
|
13
|
-
type jsoo =
|
|
14
|
-
| Int32 of int32
|
|
15
|
-
| Int64 of int32 * int32
|
|
16
|
-
| Float32Bits of int32
|
|
17
|
-
| Float64Bits of int32 * int32
|
|
18
|
-
| Float32 of float
|
|
19
|
-
| Float64 of float
|
|
20
|
-
|
|
21
|
-
exception Invalid_usage
|
|
22
|
-
|
|
23
|
-
let to_jsoo _ = raise Invalid_usage
|
binaryen-archive/src/memory.ml
CHANGED
|
@@ -11,7 +11,7 @@ external set_memory :
|
|
|
11
11
|
unit = "caml_binaryen_set_memory__bytecode" "caml_binaryen_set_memory"
|
|
12
12
|
|
|
13
13
|
type segment = {
|
|
14
|
-
|
|
14
|
+
data : string;
|
|
15
15
|
passive : bool;
|
|
16
16
|
offset : Expression.t;
|
|
17
17
|
size : int;
|
|
@@ -22,18 +22,18 @@ let set_memory wasm_mod initial maximum export_name (segments : segment list)
|
|
|
22
22
|
shared =
|
|
23
23
|
let split_segments segments =
|
|
24
24
|
List.fold_right
|
|
25
|
-
(fun {
|
|
26
|
-
(
|
|
27
|
-
(
|
|
25
|
+
(fun { data; passive; offset; size }
|
|
26
|
+
(segment_data, segment_passive, segment_offsets, segment_sizes) ->
|
|
27
|
+
( data :: segment_data,
|
|
28
28
|
passive :: segment_passive,
|
|
29
29
|
offset :: segment_offsets,
|
|
30
30
|
size :: segment_sizes ))
|
|
31
31
|
segments ([], [], [], [])
|
|
32
32
|
in
|
|
33
|
-
let
|
|
33
|
+
let segment_data, segment_passive, segment_offsets, segment_sizes =
|
|
34
34
|
split_segments segments
|
|
35
35
|
in
|
|
36
|
-
set_memory wasm_mod initial maximum export_name
|
|
36
|
+
set_memory wasm_mod initial maximum export_name segment_data segment_passive
|
|
37
37
|
segment_offsets segment_sizes shared
|
|
38
38
|
|
|
39
39
|
let unlimited = -1
|
binaryen-archive/src/module.ml
CHANGED
|
@@ -104,7 +104,7 @@ external set_features : t -> int -> unit = "caml_binaryen_module_set_features"
|
|
|
104
104
|
let set_features wasm_mod features =
|
|
105
105
|
set_features wasm_mod (List.fold_left ( lor ) 0 features)
|
|
106
106
|
|
|
107
|
-
external run_passes : t ->
|
|
107
|
+
external run_passes : t -> Passes.t list -> unit
|
|
108
108
|
= "caml_binaryen_module_run_passes"
|
|
109
109
|
|
|
110
110
|
external auto_drop : t -> unit = "caml_binaryen_module_auto_drop"
|
|
@@ -31,7 +31,7 @@ val validate : t -> int
|
|
|
31
31
|
val optimize : t -> unit
|
|
32
32
|
val get_features : t -> Feature.t list
|
|
33
33
|
val set_features : t -> Feature.t list -> unit
|
|
34
|
-
val run_passes : t ->
|
|
34
|
+
val run_passes : t -> Passes.t list -> unit
|
|
35
35
|
val auto_drop : t -> unit
|
|
36
36
|
val write : t -> string option -> bytes * string option
|
|
37
37
|
val write_text : t -> string
|
|
File without changes
|