mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-27 21:00:50 +00:00

Mon, 02 Jul 2001 12:58:44 +0200 From: Igor Bukanov <igor@icesoft.no> Organization: Wind River To: Norris Boyd <nboyd@atg.com> Hi, Norris! It turned out that in our browser implementation we need to be able to abort too-long-running scripts. I implemented that for interpreter mode via instruction counter callback. This callback is called at branch points after instruction counter reach certain threshold as you suggested once in mozilla-jseng mail list. The attached patch adds to Context.java: public int getInstructionObserverThreshold() { return instructionThreshold; } public void setInstructionObserverThreshold(int threshold) { instructionThreshold = threshold; } protected void observeInstructionCount(int instructionCount) {} ... int instructionCount; int instructionThreshold; where observeInstructionCount is a callback that should be overwritten in a custom Context to observe execution. Then as long as instructionThreshold is not 0 modifications to Interpreter.java increase instructionCount at branches/function calls/catch blocks and call cx.observeInstructionCount when it reaches instructionThreshold. I also replaces 3 catch statements in Interpreter.interpret for EcmaError, JavaScriptException and RuntimeException by single one to reduce code duplication. The patch lacks documentation in Context.java but I would add that later if the patch is ok. Regards, Igor ========================== Subject: Re: Working for Rhino Date: Tue, 3 Jul 2001 10:41:42 +0200 From: felix.meschberger@day.com To: Norris Boyd <nboyd@atg.com> Hi Norris, Well, I couldn't wait ;-) Here are my diffs : LazilyLoadedCtor: Make class and constructor public for use on my host objects NodeTransformer : Replace checks for "arguments" by call to checkActivationNeeded() in Context Context: Add the name list proposed as a hashtable with adder/checker/remover methods Hope this helps. Regards Felix
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
…
Description
Read-only Git mirror of the Mercurial gecko repositories at https://hg.mozilla.org. How to contribute: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
Languages
JavaScript
32.3%
C++
25.4%
HTML
21%
C
10.8%
Python
2.8%
Other
7.2%