From 7ddbd48ba4d0541cb595d5080929dbd10074290d Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Mon, 6 Jun 2011 15:17:32 -0400 Subject: [PATCH] adjusting the stack limit code to be nicer to firefox 3. Also added missing trampoline check in current-print. --- js-assembler/runtime-src/runtime.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js-assembler/runtime-src/runtime.js b/js-assembler/runtime-src/runtime.js index c7f870e..282b085 100644 --- a/js-assembler/runtime-src/runtime.js +++ b/js-assembler/runtime-src/runtime.js @@ -1,5 +1,7 @@ if(this['plt'] === undefined) { this['plt'] = {}; } + + // All of the values here are namespaced under "plt.runtime". (function(scope) { @@ -92,6 +94,8 @@ if(this['plt'] === undefined) { this['plt'] = {}; } 'current-print': new Closure( function(MACHINE) { + if(--MACHINE.callsBeforeTrampoline<0) { throw arguments.callee; } + var elt = MACHINE.env.pop(); var outputPort = MACHINE.params.currentOutputPort; @@ -1304,7 +1308,7 @@ if(this['plt'] === undefined) { this['plt'] = {}; } setTimeout(function() { findStackLimit(function(v) { // Trying to be a little conservative. - STACK_LIMIT_ESTIMATE = Math.floor(v / 2); + STACK_LIMIT_ESTIMATE = Math.floor(v / 10); }); }, 0);