From 32bb67f4660de4b5b03bdff5c9c59ab92f8a0049 Mon Sep 17 00:00:00 2001 From: Daniel Wirtz Date: Thu, 13 Feb 2020 22:48:12 +0100 Subject: Add C-/JS-APIs for inlining options (#2655) Allows a user to modify the inlining limits using the C- and JS-APIs. * binaryen.**getAlwaysInlineMaxSize**(): `number` * binaryen.**setAlwaysInlineMaxSize**(size: `number`): `void` * binaryen.**getFlexibleInlineMaxSize**(): `number` * binaryen.**setFlexibleInlineMaxSize**(size: `number`): `void` * binaryen.**getOneCallerInlineMaxSize**(): `number` * binaryen.**setOneCallerInlineMaxSize**(size: `number`): `void` --- src/js/binaryen.js-post.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (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 d41e9575b..3ef19fd7d 100644 --- a/src/js/binaryen.js-post.js +++ b/src/js/binaryen.js-post.js @@ -2928,6 +2928,36 @@ Module['clearPassArguments'] = function() { Module['_BinaryenClearPassArguments'](); }; +// Gets the function size at which we always inline. +Module['getAlwaysInlineMaxSize'] = function() { + return Module['_BinaryenGetAlwaysInlineMaxSize'](); +}; + +// Sets the function size at which we always inline. +Module['setAlwaysInlineMaxSize'] = function(size) { + Module['_BinaryenSetAlwaysInlineMaxSize'](size); +}; + +// Gets the function size which we inline when functions are lightweight. +Module['getFlexibleInlineMaxSize'] = function() { + return Module['_BinaryenGetFlexibleInlineMaxSize'](); +}; + +// Sets the function size which we inline when functions are lightweight. +Module['setFlexibleInlineMaxSize'] = function(size) { + Module['_BinaryenSetFlexibleInlineMaxSize'](size); +}; + +// Gets the function size which we inline when there is only one caller. +Module['getOneCallerInlineMaxSize'] = function() { + return Module['_BinaryenGetOneCallerInlineMaxSize'](); +}; + +// Sets the function size which we inline when there is only one caller. +Module['setOneCallerInlineMaxSize'] = function(size) { + Module['_BinaryenSetOneCallerInlineMaxSize'](size); +}; + // Enables or disables C-API tracing Module['setAPITracing'] = function(on) { return Module['_BinaryenSetAPITracing'](on); -- cgit v1.2.3