binaryen 98.0.0 → 99.0.0-nightly.20210113

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.
package/index.d.ts CHANGED
@@ -12,9 +12,11 @@ declare module binaryen {
12
12
  const f64: Type;
13
13
  const v128: Type;
14
14
  const funcref: Type;
15
- const anyref: Type;
16
- const nullref: Type;
15
+ const externref: Type;
17
16
  const exnref: Type;
17
+ const anyref: Type;
18
+ const eqref: Type;
19
+ const i31ref: Type;
18
20
  const unreachable: Type;
19
21
  const auto: Type;
20
22
 
@@ -42,7 +44,8 @@ declare module binaryen {
42
44
  Select,
43
45
  Drop,
44
46
  Return,
45
- Host,
47
+ MemorySize,
48
+ MemoryGrow,
46
49
  Nop,
47
50
  Unreachable,
48
51
  AtomicCmpxchg,
@@ -63,14 +66,29 @@ declare module binaryen {
63
66
  RefNull,
64
67
  RefIsNull,
65
68
  RefFunc,
69
+ RefEq,
66
70
  Try,
67
71
  Throw,
68
72
  Rethrow,
69
73
  BrOnExn,
70
74
  TupleMake,
71
75
  TupleExtract,
72
- Push,
73
- Pop
76
+ Pop,
77
+ I31New,
78
+ I31Get,
79
+ CallRef,
80
+ RefTest,
81
+ RefCast,
82
+ BrOnCast,
83
+ RttCanon,
84
+ RttSub,
85
+ StructNew,
86
+ StructGet,
87
+ StructSet,
88
+ ArrayNew,
89
+ ArrayGet,
90
+ ArraySet,
91
+ ArrayLen
74
92
  }
75
93
 
76
94
  const InvalidId: ExpressionIds;
@@ -93,7 +111,8 @@ declare module binaryen {
93
111
  const SelectId: ExpressionIds;
94
112
  const DropId: ExpressionIds;
95
113
  const ReturnId: ExpressionIds;
96
- const HostId: ExpressionIds;
114
+ const MemorySizeId: ExpressionIds;
115
+ const MemoryGrowId: ExpressionIds;
97
116
  const NopId: ExpressionIds;
98
117
  const UnreachableId: ExpressionIds;
99
118
  const AtomicCmpxchgId: ExpressionIds;
@@ -114,14 +133,29 @@ declare module binaryen {
114
133
  const RefNullId: ExpressionIds;
115
134
  const RefIsNullId: ExpressionIds;
116
135
  const RefFuncId: ExpressionIds;
136
+ const RefEqId: ExpressionIds;
117
137
  const TryId: ExpressionIds;
118
138
  const ThrowId: ExpressionIds;
119
139
  const RethrowId: ExpressionIds;
120
140
  const BrOnExnId: ExpressionIds;
121
141
  const TupleMakeId: ExpressionIds;
122
142
  const TupleExtractId: ExpressionIds;
123
- const PushId: ExpressionIds;
124
143
  const PopId: ExpressionIds;
144
+ const I31NewId: ExpressionIds;
145
+ const I31GetId: ExpressionIds;
146
+ const CallRefId: ExpressionIds;
147
+ const RefTestId: ExpressionIds;
148
+ const RefCastId: ExpressionIds;
149
+ const BrOnCastId: ExpressionIds;
150
+ const RttCanonId: ExpressionIds;
151
+ const RttSubId: ExpressionIds;
152
+ const StructNewId: ExpressionIds;
153
+ const StructGetId: ExpressionIds;
154
+ const StructSetId: ExpressionIds;
155
+ const ArrayNewId: ExpressionIds;
156
+ const ArrayGetId: ExpressionIds;
157
+ const ArraySetId: ExpressionIds;
158
+ const ArrayLenId: ExpressionIds;
125
159
 
126
160
  const enum ExternalKinds {
127
161
  Function,
@@ -140,11 +174,11 @@ declare module binaryen {
140
174
  enum Features {
141
175
  MVP,
142
176
  Atomics,
143
- MutableGlobals,
144
- TruncSat,
145
- SIMD,
146
177
  BulkMemory,
178
+ MutableGlobals,
179
+ NontrappingFPToInt,
147
180
  SignExt,
181
+ SIMD128,
148
182
  ExceptionHandling,
149
183
  TailCall,
150
184
  ReferenceTypes,
@@ -291,8 +325,6 @@ declare module binaryen {
291
325
  LeFloat64,
292
326
  GtFloat64,
293
327
  GeFloat64,
294
- MemorySize,
295
- MemoryGrow,
296
328
  AtomicRMWAdd,
297
329
  AtomicRMWSub,
298
330
  AtomicRMWAnd,
@@ -614,8 +646,6 @@ declare module binaryen {
614
646
  const LeFloat64: Operations;
615
647
  const GtFloat64: Operations;
616
648
  const GeFloat64: Operations;
617
- const MemorySize: Operations;
618
- const MemoryGrow: Operations;
619
649
  const AtomicRMWAdd: Operations;
620
650
  const AtomicRMWSub: Operations;
621
651
  const AtomicRMWAnd: Operations;
@@ -834,6 +864,11 @@ declare module binaryen {
834
864
  init(segment: number, dest: ExpressionRef, offset: ExpressionRef, size: ExpressionRef): ExpressionRef;
835
865
  copy(dest: ExpressionRef, source: ExpressionRef, size: ExpressionRef): ExpressionRef;
836
866
  fill(dest: ExpressionRef, value: ExpressionRef, size: ExpressionRef): ExpressionRef;
867
+ atomic: {
868
+ notify(ptr: ExpressionRef, notifyCount: ExpressionRef): ExpressionRef;
869
+ wait32(ptr: ExpressionRef, expected: ExpressionRef, timeout: ExpressionRef): ExpressionRef;
870
+ wait64(ptr: ExpressionRef, expected: ExpressionRef, timeout: ExpressionRef): ExpressionRef;
871
+ }
837
872
  };
838
873
  data: {
839
874
  drop(segment: number): ExpressionRef;
@@ -931,7 +966,6 @@ declare module binaryen {
931
966
  xchg(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef;
932
967
  cmpxchg(offset: number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef): ExpressionRef;
933
968
  },
934
- wait(ptr: ExpressionRef, expected: ExpressionRef, timeout: ExpressionRef): ExpressionRef;
935
969
  },
936
970
  pop(): ExpressionRef;
937
971
  };
@@ -1044,7 +1078,6 @@ declare module binaryen {
1044
1078
  xchg(offset: number, ptr: ExpressionRef, value: ExpressionRef): ExpressionRef;
1045
1079
  cmpxchg(offset: number, ptr: ExpressionRef, expected: ExpressionRef, replacement: ExpressionRef): ExpressionRef;
1046
1080
  },
1047
- wait(ptr: ExpressionRef, expected: ExpressionRef, timeout: ExpressionRef): ExpressionRef;
1048
1081
  },
1049
1082
  pop(): ExpressionRef;
1050
1083
  };
@@ -1326,22 +1359,33 @@ declare module binaryen {
1326
1359
  funcref: {
1327
1360
  pop(): ExpressionRef;
1328
1361
  };
1362
+ externref: {
1363
+ pop(): ExpressionRef;
1364
+ };
1365
+ exnref: {
1366
+ pop(): ExpressionRef;
1367
+ };
1329
1368
  anyref: {
1330
1369
  pop(): ExpressionRef;
1331
1370
  };
1332
- nullref: {
1371
+ eqref: {
1333
1372
  pop(): ExpressionRef;
1334
1373
  };
1335
- exnref: {
1374
+ i31ref: {
1336
1375
  pop(): ExpressionRef;
1337
1376
  };
1338
1377
  ref: {
1339
- null(): ExpressionRef;
1378
+ null(type: Type): ExpressionRef;
1340
1379
  is_null(value: ExpressionRef): ExpressionRef;
1341
- func(name: string): ExpressionRef;
1380
+ func(name: string, type: Type): ExpressionRef;
1381
+ eq(left: ExpressionRef, right: ExpressionRef): ExpressionRef;
1342
1382
  };
1383
+ i31: {
1384
+ 'new'(value: ExpressionRef): ExpressionRef;
1385
+ get_s(i31: ExpressionRef): ExpressionRef;
1386
+ get_u(i31: ExpressionRef): ExpressionRef;
1387
+ }
1343
1388
  atomic: {
1344
- notify(ptr: ExpressionRef, notifyCount: ExpressionRef): ExpressionRef;
1345
1389
  fence(): ExpressionRef;
1346
1390
  };
1347
1391
  tuple: {
@@ -1352,11 +1396,9 @@ declare module binaryen {
1352
1396
  throw(event: string, operands: ExpressionRef[]): ExpressionRef;
1353
1397
  rethrow(exnref: ExpressionRef): ExpressionRef;
1354
1398
  br_on_exn(label: string, event: string, exnref: ExpressionRef): ExpressionRef;
1355
- push(value: ExpressionRef): ExpressionRef;
1356
1399
  select(condition: ExpressionRef, ifTrue: ExpressionRef, ifFalse: ExpressionRef, type?: Type): ExpressionRef;
1357
1400
  drop(value: ExpressionRef): ExpressionRef;
1358
1401
  return(value?: ExpressionRef): ExpressionRef;
1359
- host(op: Operations, name: string, operands: ExpressionRef[]): ExpressionRef;
1360
1402
  nop(): ExpressionRef;
1361
1403
  unreachable(): ExpressionRef;
1362
1404
  addFunction(name: string, params: Type, results: Type, vars: Type[], body: ExpressionRef): FunctionRef;
@@ -1747,6 +1789,7 @@ declare module binaryen {
1747
1789
  ImplicitTrap,
1748
1790
  IsAtomic,
1749
1791
  Throws,
1792
+ DanglingPop,
1750
1793
  Any
1751
1794
  }
1752
1795
 
@@ -1761,6 +1804,8 @@ declare module binaryen {
1761
1804
  function setDebugInfo(on: boolean): void;
1762
1805
  function getLowMemoryUnused(): boolean;
1763
1806
  function setLowMemoryUnused(on: boolean): void;
1807
+ function getFastMath(): boolean;
1808
+ function setFastMath(on: boolean): void;
1764
1809
  function getPassArgument(key: string): string | null;
1765
1810
  function setPassArgument(key: string, value: string | null): void;
1766
1811
  function clearPassArguments(): void;