Jump to content
  • Advertisement
Sign in to follow this  
Thygrrr

[java] [solved] Need to Optimize: ICONST/BIPUSH TABLESWITCH

This topic is 4297 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

[EDIT] Damn it! I was inadvertently using a very old version of proguard. In fact, Proguard 3.6 optimizes that kind of code away just fine! D'oh! and there I was, working with Jikes and Jode and Jshrink and all sorts of tools when I was using the right one all the way... Heyas! I found jikes to be somewhat unstable, and I'm looking for a reliable tool or java compiler (preferrably a byte code optimizer, though) that optimizes away the following:
public static final int constant = 123;

...

{
  switch (constant)
    {
      case 123:
       importantCode();
       break;
      case 124:
       otherCode();
       break;
}







This is basically for a compile time optimization of Java in order to do away with preprocessors for mobile java. However, javac generates code that does ICONST oder BIPUSH with a constant immediate value, and then TABLESWITCH, and thusly keeps all the otherCode() intact... which is undesirable for a host of reasons, primarily selective use of Profiles/Configurations and size reduction. [Edited by - Thygrrr on September 14, 2006 8:28:21 AM]

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!