On Nov 26, 3:57 am, Marc Guillemot <[EMAIL PROTECTED]> wrote: > Hi, > > as far as I know, there are different limitations in compiled mode. You > can try the interpreted mode (optimization level -1): from my experience > it's not necessarily slower. > > Cheers, > Marc. > -- > Web:http://www.efficient-webtesting.com > Blog:http://mguillem.wordpress.com > > Carlos Montagut wrote: > > Hi everyone, > > > I'm currently using Rhino (version 1.7R1)to generate some scripts > > based on http traffic; and then reproduce it. > > > We are currently generating a script of 3500 lines (half of that are > > comments /* */), which contains about 250 variables. > > > When I'm trying to run the script I get the following exception: > > > Caused by: org.mozilla.javascript.EvaluatorException: Program too > > complex (out of locals) > > > at org.mozilla.javascript.DefaultErrorReporter.runtimeError > > (DefaultErrorReporter.java:109) > > > at org.mozilla.javascript.Context.reportRuntimeError > > (Context.java:922) > > > at org.mozilla.javascript.Context.reportRuntimeError > > (Context.java:978) > > > at > > org.mozilla.javascript.optimizer.BodyCodegen.getNewWordLocal > > (Codegen.java:4919) > > > at > > org.mozilla.javascript.optimizer.BodyCodegen.generatePrologue > > (Codegen.java:1658) > > > at > > org.mozilla.javascript.optimizer.BodyCodegen.generateBodyCode > > (Codegen.java:1357) > > > at org.mozilla.javascript.optimizer.Codegen.generateCode > > (Codegen.java:328) > > > at > > org.mozilla.javascript.optimizer.Codegen.compileToClassFile > > (Codegen.java:183) > > > at org.mozilla.javascript.optimizer.Codegen.compile > > (Codegen.java:92) > > > at org.mozilla.javascript.Context.compileImpl(Context.java: > > 2275) > > > at org.mozilla.javascript.Context.compileFunction > > (Context.java:1281) > > > at org.mozilla.javascript.Context.compileFunction > > (Context.java:1270) > > > at crm.alga.js.caller.AlgaJSCaller.<init> > > (AlgaJSCaller.java:120) > > > ... 28 more > > Does anyone has any info what this error mean? (I suspect that is > > related to the amount of variables) > > Does anyone has any info regarding maximum limits on Rhino scripts > > (maximum size, variables, etc) ? > > > Thanks ! > > > Best Regards > > > Carlos
Yes, the JVM has a limit of 256 local slots, where a double/long consumes two slots. Rhino could presumably be smarter about saving and restoring locals in an object to get past this limit, but the complexity of that hasn't yet been justified as not too many people hit this limit. Marc's suggestion to try interpreted mode is a good one. --N _______________________________________________ dev-tech-js-engine-rhino mailing list dev-tech-js-engine-rhino@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino