What java compiler uses JSR instructions and what?

Java bytecode language has JSR instructions

None of the code I compiled with the Java 7 compiler uses this instruction

However, sometimes I download Java binaries, although I rarely use it

I'm interested to know that compilers use this instruction and what java code constructs cause them to use it

Edit this is not repeated because it refers to JSR bytecode instructions rather than Java specification requests

Solution

JSR directives are actually not even allowed in Java 7 class files It is only allowed to correspond to Java 5 or earlier in class files of version 49.0 or earlier In practice, it is no longer used

The JSR / ret mechanism was originally used to implement finally blocks However, they believe that the code size savings are not worth the additional complexity and are gradually eliminated

I don't know the exact version because I can't find any old compilers, but based on the discussion I found on the Internet, it seems that the transformation took place in the Java 1.2-1.3 era, and different compilers switch at different times I've never seen a legal class file in these old compilers, but you never know when it might happen

In practice, the only use of JSR I've seen in the wild is confusion For example, Zelix klassmaster used it for string decryption code I also use it in several of my own Java cracking

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>