<i>contestants are required to turn in their source, rather than compiled code</i><p>If there's nothing about the language in which the source must be written in but only that it compiles to JVM bytecode that meets the requirements, I'd be very tempted to write most or almost all of it in bytecode... java.lang.ClassLoader is allowed and it provides some useful methods for that purpose. ;-)<p><i>At each block’s exit, a checkpoint is injected with the block’s total cost. During live execution, these checkpoints increment the AI’s internal total bytecode counter. If at any checkpoint the running tally exceeds GameConstants.BYTECODE_LIMIT, the AI’s execution is halted and execution of the next robot’s AI begins.</i><p>That sounds to me like it might be possible to squeeze in some more extra instructions at the end.
I think it is worth to mention that you can inspect Java bytecode [1][2] with radare2 tool (use the git version [3])<p>[1] <a href="http://dso.thecoverofnight.com/posts/2014/04/radare-java-intro/" rel="nofollow">http://dso.thecoverofnight.com/posts/2014/04/radare-java-int...</a><p>[2] <a href="http://radare.org/get/radare_java.pdf" rel="nofollow">http://radare.org/get/radare_java.pdf</a><p>[3] <a href="https://github.com/radare/radare2" rel="nofollow">https://github.com/radare/radare2</a>
very interesting !<p>>>There are some who may scoff at bytecode optimization, reasoning that it’s a worthless skill for modern computer science, especially those working in high-level languages. Understanding what the compiler emits however is a skill still very much alive and well in embedded programming, FPGA programming, and other performance-oriented disciplines.<p>A few more use-cases are with building instrumentation modules, profilers besides byte-code analytic for automated-binary-audits,obfuscation amongst others.
Cory's link to the instrumentation source doesn't seem to exist anymore, but here's the latest public version... <a href="https://github.com/battlecode/battlecode-server/tree/master/src/main/battlecode/engine/instrumenter" rel="nofollow">https://github.com/battlecode/battlecode-server/tree/master/...</a><p>Most of the interesting bits happen in RoboMethodTree.
Dexer, a .NET-based tool to work with Android Dalvik bytecode in a manner similar to Mono.Cecil:<p><a href="http://sebastien.lebreton.free.fr/blog/index.php?/categories/4-Dexer" rel="nofollow">http://sebastien.lebreton.free.fr/blog/index.php?/categories...</a><p>The IKVM.NET blog covers a lot of low-level details as the author implements 'JVM on .NET CLR':<p><a href="http://weblog.ikvm.net/" rel="nofollow">http://weblog.ikvm.net/</a>