diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/binaryen-c.cpp | 8 | ||||
-rw-r--r-- | src/binaryen-c.h | 7 | ||||
-rw-r--r-- | src/js/binaryen.js-post.js | 10 |
3 files changed, 25 insertions, 0 deletions
diff --git a/src/binaryen-c.cpp b/src/binaryen-c.cpp index 2260a93b1..7c826f0f2 100644 --- a/src/binaryen-c.cpp +++ b/src/binaryen-c.cpp @@ -3798,6 +3798,14 @@ void BinaryenSetLowMemoryUnused(bool on) { globalPassOptions.lowMemoryUnused = on != 0; } +bool BinaryenGetZeroFilledMemory(void) { + return globalPassOptions.zeroFilledMemory; +} + +void BinaryenSetZeroFilledMemory(bool on) { + globalPassOptions.zeroFilledMemory = on != 0; +} + bool BinaryenGetFastMath(void) { return globalPassOptions.fastMath; } void BinaryenSetFastMath(bool value) { globalPassOptions.fastMath = value; } diff --git a/src/binaryen-c.h b/src/binaryen-c.h index 8609496d0..08cf12b90 100644 --- a/src/binaryen-c.h +++ b/src/binaryen-c.h @@ -2284,6 +2284,13 @@ BINARYEN_API bool BinaryenGetLowMemoryUnused(void); // when optimizing. Applies to all modules, globally. BINARYEN_API void BinaryenSetLowMemoryUnused(bool on); +// Gets whether to assume that an imported memory is zero-initialized. +BINARYEN_API bool BinaryenGetZeroFilledMemory(void); + +// Enables or disables whether to assume that an imported memory is +// zero-initialized. +BINARYEN_API void BinaryenSetZeroFilledMemory(bool on); + // Gets whether fast math optimizations are enabled, ignoring for example // corner cases of floating-point math like NaN changes. // Applies to all modules, globally. diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js index d86cb07af..8e41b4e7c 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -3303,6 +3303,16 @@ Module['setLowMemoryUnused'] = function(on) { Module['_BinaryenSetLowMemoryUnused'](on); }; +// Gets whether that an imported memory will be zero-initialized speculation. +Module['getZeroFilledMemory'] = function() { + return Boolean(Module['_BinaryenGetZeroFilledMemory']()); +}; + +// Enables or disables whether that an imported memory will be +// zero-initialized speculation. +Module['setZeroFilledMemory'] = function(on) { + Module['_BinaryenSetZeroFilledMemory'](on); +}; // Gets whether fast math optimizations are enabled, ignoring for example // corner cases of floating-point math like NaN changes. Module['getFastMath'] = function() { |