From 8b436ba3046deb69e5b736a6cef003b8b0dde0c0 Mon Sep 17 00:00:00 2001 From: Max Graey Date: Sat, 5 Sep 2020 04:30:25 +0300 Subject: Improve inlining "heavyweight" (#3085) Split that mode into an option to check for loops (which indicate a function is "heavy") and a constant check for having calls. The case of calls is different as we would need more logic to avoid infinite recursion if we are willing to inling functions with calls. Practically, this renames allowHeavyweight to allowFunctionsWithLoops. --- src/js/binaryen.js-post.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/js/binaryen.js-post.js') diff --git a/src/js/binaryen.js-post.js b/src/js/binaryen.js-post.js index 057252f78..4e673ab4b 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -3031,13 +3031,13 @@ Module['setOneCallerInlineMaxSize'] = function(size) { }; // Gets the value which allow inline functions that are not "lightweight". -Module['getAllowHeavyweight'] = function() { - return Boolean(Module['_BinaryenGetAllowHeavyweight']()); +Module['getAllowInliningFunctionsWithLoops'] = function() { + return Boolean(Module['_BinaryenGetAllowInliningFunctionsWithLoops']()); }; // Sets the value which allow inline functions that are not "lightweight". -Module['setAllowHeavyweight'] = function(value) { - Module['_BinaryenSetAllowHeavyweight'](value); +Module['setAllowInliningFunctionsWithLoops'] = function(value) { + Module['_BinaryenSetAllowInliningFunctionsWithLoops'](value); }; // Expression wrappers -- cgit v1.2.3