aboutsummaryrefslogtreecommitdiff
path: root/src/runtime.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-05-19 18:21:21 -0700
committerAlon Zakai <alonzakai@gmail.com>2011-05-19 18:21:21 -0700
commitd318f7adda7b622b51e655d04dbac1161d1a82c4 (patch)
treecf3acb649e397f62c44d77511bcfb4598222f936 /src/runtime.js
parent95022360758d466485157c21bdda1c9ec1aaf97d (diff)
SKIP_STACK_IN_SMALL option
Diffstat (limited to 'src/runtime.js')
-rw-r--r--src/runtime.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/runtime.js b/src/runtime.js
index 0b809d6b..c99d9d6f 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -30,10 +30,7 @@ RuntimeGenerator = {
},
stackEnter: function(initial) {
- if (initial === 0) return ''; // Note that we don't even push the stack! This is faster, but
- // means that we don't clear stack allocations done in this function
- // until the parent unwinds its stack. So potentially if we are in
- // a loop, we can use a lot of memory.
+ if (initial === 0 && SKIP_STACK_IN_SMALL) return '';
var ret = 'var __stackBase__ = STACKTOP; STACKTOP += ' + initial;
if (ASSERTIONS) {
ret += '; assert(STACKTOP < STACK_MAX)';
@@ -45,7 +42,7 @@ RuntimeGenerator = {
},
stackExit: function(initial) {
- if (initial === 0) return ''; // See comment in stackEnter
+ if (initial === 0 && SKIP_STACK_IN_SMALL) return '';
var ret = '';
if (SAFE_HEAP) {
ret += 'for (var i = __stackBase__; i < STACKTOP; i++) SAFE_HEAP_CLEAR(i);';