Subj : Rhino line counting To : netscape.public.mozilla.jseng From : rickr_mc@lycos.com (Rick Romero) Date : Wed Sep 17 2003 08:15 am I'm trying to use the line counting functionality in Rhino. I know about the setInstructionObserverThreshold, and how to extend the Context in order to trap these events. I believe, though, that there may be a bug in the current source. Check out Interpreter.java:2132-38 case TokenStream.CALL : { if (instructionThreshold != 0) { instructionCount += INVOCATION_COST; cx.instructionCount = instructionCount; instructionCount = -1; } cx.instructionCount = instructionCount; Note that after this code is executed, (cx.instructionCount == -1). It appears that this last line is incorrect. It essentially resets the instructionCount. On a related note, does anyone have any idea what the intention here was? This switch case, TokenStream.NEW and TokenStream.CALLSPECIAL all have the same sort of thing happening with the INVOCATION_COST. Anyone out there able to explain the rationale here? I haven't spent too much time trying to figure out the programmer's intent, and would appreciate it if someone in the know could provide some insight into this section of code. Thanks, Rick Romero .