diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2019-05-17 12:56:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-17 12:56:53 -0700 |
commit | 9c637288cf3b1c7505fa7d8edc1536b6e64d5967 (patch) | |
tree | fc7b0e579f3f9de41fca28c65551fb3359c8f40b /src/js/binaryen.js-post.js | |
parent | 1184678086b284944bb119a97ca048b64d4078b6 (diff) | |
download | binaryen-9c637288cf3b1c7505fa7d8edc1536b6e64d5967.tar.gz binaryen-9c637288cf3b1c7505fa7d8edc1536b6e64d5967.tar.bz2 binaryen-9c637288cf3b1c7505fa7d8edc1536b6e64d5967.zip |
Features C/JS API (#2049)
Add feature handling to the C/JS APIs. No features are enabled by
default, so all used features will have to be explicitly enabled in
order for modules to validate.
Diffstat (limited to 'src/js/binaryen.js-post.js')
-rw-r--r-- | src/js/binaryen.js-post.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js index 8aa28a08c..fe0594b91 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -85,6 +85,17 @@ Module['ExternalTable'] = Module['_BinaryenExternalTable'](); Module['ExternalMemory'] = Module['_BinaryenExternalMemory'](); Module['ExternalGlobal'] = Module['_BinaryenExternalGlobal'](); +// Features +Module['Features'] = { + 'Atomics': Module['_BinaryenFeatureAtomics'](), + 'BulkMemory': Module['_BinaryenFeatureBulkMemory'](), + 'MutableGlobals': Module['_BinaryenFeatureMutableGlobals'](), + 'NontrappingFPToInt': Module['_BinaryenFeatureNontrappingFPToInt'](), + 'SignExt': Module['_BinaryenFeatureSignExt'](), + 'SIMD128': Module['_BinaryenFeatureSIMD128'](), + 'ExceptionHandling': Module['_BinaryenFeatureExceptionHandling'](), +}; + // Operations Module['ClzInt32'] = Module['_BinaryenClzInt32'](); Module['CtzInt32'] = Module['_BinaryenCtzInt32'](); @@ -1866,6 +1877,12 @@ function wrapModule(module, self) { self['setStart'] = function(start) { return Module['_BinaryenSetStart'](module, start); }; + self['getFeatures'] = function() { + return Module['_BinaryenGetFeatures'](module); + }; + self['setFeatures'] = function(features) { + Module['_BinaryenSetFeatures'](module, features); + }; self['emitText'] = function() { var old = out; var ret = ''; |