jake deploy error

50 views
Skip to first unread message

Todd Freese

unread,
Jun 23, 2016, 10:20:52 PM6/23/16
to Cappuccino & Objective-J
Ever since updating my build of capp from master a week ago, I am getting an error when doing a jake deploy:

org.mozilla.javascript.EvaluatorException: Encountered code generation error while compiling function "39": Program too complex: too big jump offset (file:/Users/todd/Desktop/Project_Source/Approvals/web_static/Build/Release/Approvals/MediaCellExtended.j#270)


Any idea's on what's causing this? If I revert back to an older version of capp, it compiles just fine.


T

Martin Carlberg

unread,
Jun 27, 2016, 3:46:48 AM6/27/16
to objec...@googlegroups.com
Hi Todd,

This is an error from the Rhino engine. It has some kind of limit on function and/or file size. Or to be more exact how far a jump can be in the compiled code. More info here: https://bugzilla.mozilla.org/show_bug.cgi?id=335778

The reason your compiled Objective-J code is bigger now with the latest Cappuccino is probably because it inlines the message send functions.

You might have some large function or method that needs to be refactored into smaller. It is a little hard to know which one as Rhino just says function ”39”  :)

You can also use ’jsc’ instead of Rhino if you are on a Mac as ’jsc’ does not have this problem.



Happy coding,

- Martin


--
You received this message because you are subscribed to the Google Groups "Cappuccino & Objective-J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to objectivej+...@googlegroups.com.
To post to this group, send email to objec...@googlegroups.com.
Visit this group at https://groups.google.com/group/objectivej.
For more options, visit https://groups.google.com/d/optout.

Todd Freese

unread,
Jun 27, 2016, 10:28:59 AM6/27/16
to Cappuccino & Objective-J
How do I tell it to use jsc? Is there a command line flag for this?

T

Martin Carlberg

unread,
Jun 27, 2016, 10:54:52 AM6/27/16
to objec...@googlegroups.com
You will be asked to build jsc when running the bootstrap.sh script. This is done when you install Cappuccino. Read more here: http://www.cappuccino-project.org/learn/build-source.html

The environment variable ’NARWHAL_ENGINE will tell what is used. Check it from the Terminal with the ’env’ command

martin> env
...
NARWHAL_ENGINE=jsc
...

- Martin


27 juni 2016 kl. 16:28 skrev Todd Freese <to...@filmworkers.com>:

How do I tell it to use jsc? Is there a command line flag for this?

T

Todd Freese

unread,
Jun 27, 2016, 11:31:06 AM6/27/16
to Cappuccino & Objective-J
So I have NARWAL_ENGINE=jsc already. And I did build jsc when running the bootstrap.

T

Todd Freese

unread,
Jun 28, 2016, 12:06:31 AM6/28/16
to Cappuccino & Objective-J
>The reason your compiled Objective-J code is bigger now with the latest Cappuccino is probably because it inlines the message send functions.

The in-lining is a fairly new change in capp correct? 

Is there a flag to try the older way?

T

Martin Carlberg

unread,
Jun 28, 2016, 3:50:31 AM6/28/16
to objec...@googlegroups.com
Hi!

This was merged into the master on the 1 of november 2015. https://github.com/cappuccino/cappuccino/pull/2384

There are instructions in the pull request above how to set the compiler options.

You said you have the environment variable NARWHAL_ENGINE already set to ’jsc’. The lasts parts of the ’jake deploy’ process might be run by the Rhino engine. Can you do ’jake release’ on your project? That should not use Rhino at all. ’jake deploy’ will do ’press’ and ’flatten’ on your project. Don’t know in which order. You can try to run them separate to see if you can pin down the problem.

I still think you have some huge method, function or whole file that will choke the Rhine engine. Try to find it and split it up into one or more pieces.

As a sidenote I can tell that on our project we never do ’press’ or ’flatten’ as we can't see any load or speed improvements. I don’t say that you or anyone else will see improvements but ’press’ and ’flatten’ are two very old tools and was for sure needed 5-10 years ago. But today? I don’t know...

- Martin


daboe01

unread,
Jun 28, 2016, 10:09:43 AM6/28/16
to Cappuccino & Objective-J
we always deploy the source directly.

build / flatten / press did not give me any benefits so far.

best greetings,

daniel

Prof. Michael Bach

unread,
Jun 28, 2016, 10:54:21 AM6/28/16
to objec...@googlegroups.com
> we always deploy the source directly.
> build / flatten / press did not give me any benefits so far.
I agree, based on speed comparisons between build, release and deploy, and found no noticeable difference.
However, loading time depends markedly on server-side compression. I added gzipping for “sj j cib js” and the speed gain was nearly a factor of 10.


bwm
--
Prof. Michael Bach PhD, Eye Center, University of Freiburg, Killianstr. 5, 79106 Freiburg, Germany.
Michae...@uni-freiburg.de <http://michaelbach.de>
Reply all
Reply to author
Forward
0 new messages