[Dojo-interest] Exception in ShrinkSafe?
Ryan Moore
rmoore at plaxo.com
Tue Feb 20 18:18:11 MST 2007
Your file is too big for the default Java memory settings, you have to
change a couple of command-line switches to expand the available memory:
java -Xmn100M -Xms500M -Xmx500M -jar ~/shrinksafe/custom_rhino.jar -opt
-1 -c input.js > output.js 2>&1
________________________________
From: dojo-interest-bounces at dojotoolkit.org
[mailto:dojo-interest-bounces at dojotoolkit.org] On Behalf Of Stephen
Tonkin
Sent: Tuesday, February 20, 2007 5:15 PM
To: dojo-interest at dojotoolkit.org
Subject: [Dojo-interest] Exception in ShrinkSafe?
Hello. Great work on the project so far.
I'm currently working on a project with just over 3MB of Javascript.
Obviously, this is quite large, so we were hoping to use Dojo's
ShrinkSafe to make it as small as possible. I tested ShrinkSafe with a
subset of our project's functionality and it all worked fine. However,
when I try to use ShrinkSafe on our entire code base, I ShrinkSafe
throws the following exception:
Exception in thread "main" java.lang.IllegalArgumentException: out of
range index
at org.mozilla.classfile.ClassFileWriter.add(ClassFileWriter.java:541)
at
org.mozilla.classfile.ClassFileWriter.addLoadConstant(ClassFileWriter.ja
va:601)
at
org.mozilla.classfile.ClassFileWriter.addPush(ClassFileWriter.java:837)
at
org.mozilla.javascript.optimizer.Codegen.generateNativeFunctionOverrides
(Codegen.java:806)
at
org.mozilla.javascript.optimizer.Codegen.generateCode(Codegen.java:273)
at
org.mozilla.javascript.optimizer.Codegen.compileToClassFile(Codegen.java
:157)
at org.mozilla.javascript.optimizer.Codegen.compile(Codegen.java:67)
at org.mozilla.javascript.Context.compileImpl(Context.java:2321)
at org.mozilla.javascript.Context.compileString(Context.java:1323)
at org.mozilla.javascript.Context.compileString(Context.java:1312)
at
org.mozilla.javascript.tools.shell.Main.loadScriptFromSource(Main.java:5
00)
at
org.mozilla.javascript.tools.shell.Main.processFileSecure(Main.java:439)
at org.mozilla.javascript.tools.shell.Main.processFile(Main.java:406)
at org.mozilla.javascript.tools.shell.Main.processSource(Main.java:397)
at org.mozilla.javascript.tools.shell.Main.processFiles(Main.java:181)
at org.mozilla.javascript.tools.shell.Main$IProxy.run(Main.java:102)
at org.mozilla.javascript.Context.call(Context.java:540)
at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:447)
at org.mozilla.javascript.tools.shell.Main.exec(Main.java:164)
at org.mozilla.javascript.tools.shell.Main.main(Main.java:142)
The process I'm following is I'm rolling all our Javascript into one
file, checking the Javascript still works, then running ShrinkSafe from
the .jar file with the directions provided at the following page:
http://dojotoolkit.org/docs/compressor_system.html#about-the-author .
I have little idea at the moment what the problem might be, so I'm going
to go through our Javascript to see if I can discover if any of our code
is the problem. However, I was wondering if there was anyone with
suggestions as to what the problem may be.
Any suggestions, anyone?
Stephen Tonkin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20070220/ba92b225/attachment.html
More information about the Dojo-interest
mailing list