Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 33199 invoked from network); 10 Mar 2008 14:56:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Mar 2008 14:56:38 -0000 Received: (qmail 10606 invoked by uid 500); 10 Mar 2008 14:56:35 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 10483 invoked by uid 500); 10 Mar 2008 14:56:35 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 10472 invoked by uid 99); 10 Mar 2008 14:56:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Mar 2008 07:56:35 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Mar 2008 14:55:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3DED31A9832; Mon, 10 Mar 2008 07:56:07 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r635574 - /cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java Date: Mon, 10 Mar 2008 14:56:06 -0000 To: cvs@cocoon.apache.org From: vgritsenko@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080310145607.3DED31A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: vgritsenko Date: Mon Mar 10 07:56:01 2008 New Revision: 635574 URL: http://svn.apache.org/viewvc?rev=635574&view=rev Log: still need to set optimization level, but for another reason. See http://markmail.org/message/myogixaqnqmgepjj Modified: cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java Modified: cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java?rev=635574&r1=635573&r2=635574&view=diff ============================================================================== --- cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java (original) +++ cocoon/trunk/blocks/cocoon-flowscript/cocoon-flowscript-impl/src/main/java/org/apache/cocoon/components/flow/javascript/fom/FOM_JavaScriptInterpreter.java Mon Mar 10 07:56:01 2008 @@ -92,6 +92,13 @@ private static final String USER_GLOBAL_SCOPE = "FOM JavaScript GLOBAL SCOPE/"; /** + * Rhino supports Debuggers only in interpreting mode, and we are using + * LocationTrackerDebugger. Hence need to force rhino into interpreted + * mode by setting optimization level on a context. + */ + private static final int OPTIMIZATION_LEVEL = -1; + + /** * When was the last time we checked for script modifications. Used * only if {@link #reloadScripts} is true. Access is synchronized by * {@link #compiledScripts}. @@ -131,6 +138,7 @@ db.setVisible(false); } }); + db.setOptimizationLevel(OPTIMIZATION_LEVEL); db.setVisible(true); debugger = db; ContextFactory.getGlobal().addListener(debugger); @@ -159,6 +167,7 @@ getDebugger().doBreak(); } Context context = Context.enter(); + context.setOptimizationLevel(OPTIMIZATION_LEVEL); context.setCompileFunctionsWithDynamicScope(true); context.setGeneratingDebug(true); // add support for Rhino objects to JXPath @@ -545,6 +554,7 @@ public void callFunction(String funName, List params, Redirector redirector) throws Exception { Context context = Context.enter(); + context.setOptimizationLevel(OPTIMIZATION_LEVEL); context.setGeneratingDebug(true); context.setCompileFunctionsWithDynamicScope(true); context.setErrorReporter(new JSErrorReporter()); @@ -641,6 +651,7 @@ } Context context = Context.enter(); + context.setOptimizationLevel(OPTIMIZATION_LEVEL); context.setGeneratingDebug(true); context.setCompileFunctionsWithDynamicScope(true); LocationTrackingDebugger locationTracker = new LocationTrackingDebugger();