Add a mechanism to enable additional (experimental) features and start with sign extension operations; Hashing experimentation

This commit is contained in:
dcodeIO
2018-05-08 00:36:19 +02:00
parent 00fee73022
commit 1bf0ca6525
17 changed files with 2337 additions and 1935 deletions

View File

@ -373,6 +373,18 @@ exports.main = function main(argv, options, callback) {
}
}
// Enable additional features if specified
var features = args.feature;
if (features != null) {
if (typeof features === "string") features = features.split(",");
for (let i = 0, k = features.length; i < k; ++i) {
let name = features[i].trim();
let flag = assemblyscript["FEATURE_" + name.toUpperCase()];
if (!flag) return callback(Error("Feature '" + name + "' is invalid."));
assemblyscript.enableFeature(compilerOptions, flag);
}
}
var module;
stats.compileCount++;
(() => {

View File

@ -149,6 +149,10 @@
],
"type": "string"
},
"feature": {
"desc": "Enables additional (experimental) WebAssembly features.",
"type": "string"
},
"measure": {
"desc": "Prints measuring information on I/O and compile times.",
"type": "boolean"