diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2019-04-05 19:48:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-05 19:48:54 -0700 |
commit | 37443aef8c22f100dc59e81aff6af5a252f3217d (patch) | |
tree | ae68bcc8b6bbc4f2b7fdd1f50349b9980e59f10f /src/js | |
parent | 5b24f039ba1f55520a61f6dd6bb8ca46556c592b (diff) | |
download | binaryen-37443aef8c22f100dc59e81aff6af5a252f3217d.tar.gz binaryen-37443aef8c22f100dc59e81aff6af5a252f3217d.tar.bz2 binaryen-37443aef8c22f100dc59e81aff6af5a252f3217d.zip |
Passive segments (#1976)
Adds support for the bulk memory proposal's passive segments. Uses a
new (data passive ...) s-expression syntax to mark sections as
passive.
Diffstat (limited to 'src/js')
-rw-r--r-- | src/js/binaryen.js-post.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js index 1796080fc..b9f6b426c 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -1831,8 +1831,8 @@ function wrapModule(module, self) { ); }); }; - self['setMemory'] = function(initial, maximum, exportName, segments, shared) { - // segments are assumed to be { offset: expression ref, data: array of 8-bit data } + self['setMemory'] = function(initial, maximum, exportName, segments, flags, shared) { + // segments are assumed to be { passive: bool, offset: expression ref, data: array of 8-bit data } if (!segments) segments = []; return preserveStack(function() { return Module['_BinaryenSetMemory']( @@ -1842,6 +1842,11 @@ function wrapModule(module, self) { return allocate(segment.data, 'i8', ALLOC_STACK); }) ), + i8sToStack( + segments.map(function(segment) { + return segment.passive; + }) + ), i32sToStack( segments.map(function(segment) { return segment.offset; |