aboutsummaryrefslogtreecommitdiff
path: root/src/runtime.js
diff options
context:
space:
mode:
authoralon@honor <none@none>2010-10-11 21:10:02 -0700
committeralon@honor <none@none>2010-10-11 21:10:02 -0700
commitcb9319ec92505750d2e1a17dd230141aba9edcf7 (patch)
treebe0af9b260a5ba9fa894a5be1fbd6110b31bd977 /src/runtime.js
parent425295d786880c7741a9eab9768d5aa32a7c3faf (diff)
increment stack all at once; 2% speedup
Diffstat (limited to 'src/runtime.js')
-rw-r--r--src/runtime.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/runtime.js b/src/runtime.js
index 346020b0..0ae70fa3 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -25,8 +25,12 @@ RuntimeGenerator = {
return ret;
},
- stackEnter: function() {
- return 'STACK_STACK.push(STACKTOP);';
+ stackEnter: function(initial) {
+ var ret = 'STACK_STACK.push(STACKTOP); STACKTOP += ' + initial;
+ if (GUARD_MEMORY) {
+ ret += '; assert(STACKTOP < STACK_MAX)';
+ }
+ return ret;
},
stackExit: function() {