Skip to content

Commit 4ad12c1

Browse files
authored
Update to latest Binaryen & introduce anyref (#800)
1 parent a4dd3a9 commit 4ad12c1

File tree

152 files changed

+6713
-3598
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+6713
-3598
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ jobs:
2323
- npm run clean && npm run test:compiler rt/flags threads
2424
env:
2525
- Runs experimental tests on node.js v8-canary using
26-
- ASC_FEATURES="simd,threads"
26+
- ASC_FEATURES="mutable-globals,simd,threads,reference-types,bigint-integration"
2727
- NVM_NODEJS_ORG_MIRROR="https://nodejs.org/download/v8-canary/"

cli/asc.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,20 @@ exports.main = function main(argv, options, callback) {
572572
}
573573
}
574574

575-
// Enable additional features if specified
576-
var features = args.enable;
577-
if (features != null) {
575+
// Disable default features if specified
576+
var features;
577+
if ((features = args.disable) != null) {
578+
if (typeof features === "string") features = features.split(",");
579+
for (let i = 0, k = features.length; i < k; ++i) {
580+
let name = features[i].trim();
581+
let flag = assemblyscript["FEATURE_" + name.replace(/\-/g, "_").toUpperCase()];
582+
if (!flag) return callback(Error("Feature '" + name + "' is unknown."));
583+
assemblyscript.disableFeature(compilerOptions, flag);
584+
}
585+
}
586+
587+
// Enable experimental features if specified
588+
if ((features = args.enable) != null) {
578589
if (typeof features === "string") features = features.split(",");
579590
for (let i = 0, k = features.length; i < k; ++i) {
580591
let name = features[i].trim();

cli/asc.json

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,17 +186,30 @@
186186
},
187187
"enable": {
188188
"description": [
189-
"Enables additional (experimental) WebAssembly features.",
189+
"Enables WebAssembly features that are disabled by default.",
190190
"",
191-
" sign-extension Enables sign-extension operations",
192-
" mutable-global Enables mutable global imports and exports",
193-
" bulk-memory Enables bulk memory operations",
194-
" simd Enables SIMD types and operations.",
195-
" threads Enables threading and atomic operations.",
191+
" sign-extension Sign-extension operations",
192+
" bulk-memory Bulk memory operations.",
193+
" simd SIMD types and operations.",
194+
" threads Threading and atomic operations.",
195+
" reference-types Reference types and operations.",
196196
""
197197
],
198+
"TODO_doesNothingYet": [
199+
" nontrapping-f2i Non-trapping float to integer ops.",
200+
" exception-handling Exception handling.",
201+
" tail-calls Tail call operations."
202+
],
198203
"type": "s"
199204
},
205+
"disable": {
206+
"description": [
207+
"Disables WebAssembly features that are enabled by default.",
208+
"",
209+
" mutable-globals Mutable global imports and exports.",
210+
""
211+
]
212+
},
200213
"transform": {
201214
"description": "Specifies the path to a custom transform to 'require'.",
202215
"type": "S"

0 commit comments

Comments
 (0)