Smali – lots of “move-object”



I’m using mt manager to edit Smali in dex.

I found that there are many move-object in some classes, most of them are unnecessary.

move-object statements

Does it impact performance?

Answer

Does it impact performance?

No. The optimizer should eliminate any unnecessary moves when the smali code1 is compiled to native code.

For what it is worth, this is similar to the strategy that is used by HotSpot (and similar) Java implementation.

  • The Java compiler produces simple (non-optimal) bytecodes
  • The JIT compiler does a lot of optimization work while compiling bytecodes to native code.

1 – Strictly speaking, Smali is a human readable syntax for Dalvik bytecodes. The compilation step where the optimization occurs will be the step where byte bytecodes are compiled to native code. This could be “ahead of time” or “just in time”.



Source: stackoverflow