Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

The Java Virtual Machine Instruction Set page provides information about mnemonics such as aaload, aastore... etc.
However neither the cpu cycles that these mnemonics would take up is mentioned nor is there any info on the byte size or word size of these mnemonics.
Any idea where this information could be found?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
244 views
Welcome To Ask or Share your Answers For Others

1 Answer

As already mentioned, the information you seek is not there because it does not exist. Apart from the also mentioned fact that different JVMs can implement instructions (or combinations of instructions) differently, a single JVM can also implement it differently.

This is true both for different combinations of intstructions (it might be more efficient to implement instructions in different ways depending on how they are used together with other instructions) and for different occasions of execution. As the JVM is always in control of the execution of your program, it can (and does) monitor the behavior of your program and decide to reoptimize code that is run often (or code meeting some other criteria for that matter). This can result in, for example, your instruction being translated into a certain set of machine instructions the first thousand times a function is executed, and being translated to another set the rest of the executions.

This advanced optimization ability (and others) is why optimization of Java byte code is best left to the JVM and also why, in some cases, a Java program can be significantly faster than the equivalent C or C++ program (C and C++ is normally only optimized statically whereas Java is optimized dynamically).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...