diff options
-rw-r--r-- | src/jsifier.js | 4 | ||||
-rw-r--r-- | src/settings.js | 4 | ||||
-rw-r--r-- | tests/runner.py | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index 5f75b374..8d9e65c6 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -553,6 +553,10 @@ function JSify(data, functionsOnly, givenFunctions, givenGlobalVariables) { func.JS += 'Module["' + func.ident + '"] = ' + func.ident + ';'; } + if (func.lines.length >= CLOSURE_INLINE_PREVENTION_LINES) { + func.JS += func.ident + '["X"]=1;'; + } + return func; } }); diff --git a/src/settings.js b/src/settings.js index 7e076288..e8f65f58 100644 --- a/src/settings.js +++ b/src/settings.js @@ -71,6 +71,10 @@ SKIP_STACK_IN_SMALL = 1; // When enabled, does not push/pop the stack at all in // a lot can exhaust the stack very fast, with this option. // In particular, be careful with the autodebugger! INLINE_LIBRARY_FUNCS = 1; // Will inline library functions that have __inline defined +CLOSURE_INLINE_PREVENTION_LINES = 50; // Functions of this number of lines or larger will have + // code generated that tells the closure compiler not to + // inline them. This is useful to prevent the generation of + // overly large functions. // Generated code debugging options SAFE_HEAP = 0; // Check each write to the heap against a list of blocked addresses diff --git a/tests/runner.py b/tests/runner.py index dea4f1fe..d06425a7 100644 --- a/tests/runner.py +++ b/tests/runner.py @@ -4646,7 +4646,7 @@ else: self.do_benchmark(src, ['10000', '1000'], 'blah=0.000000', llvm_opts=True) def test_dlmalloc(self): - global POST_OPTIMIZATIONS; POST_OPTIMIZATIONS = ['eliminator'] + global POST_OPTIMIZATIONS; POST_OPTIMIZATIONS = ['eliminator', 'closure'] Building.COMPILER_TEST_OPTS = ['-g'] Settings.CORRECT_SIGNS = 2 |