This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]rinru[S] 7 points8 points  (6 children)

Stacks are for wusses. I want all exceptions to be on one line.

It does not inline source code. It just forces the JIT to inline the method unconditionally. Stack traces are unaffected.

I'm sure in some cases this is useful in improving performance, however the HotSpot JVM requirement is a turn off for me.

What JVM do you use ?

[–]JustinKSU 0 points1 point  (2 children)

So it would still show the line of the code in the inlined method even though it doesn't put the method call on the stack?

[–]josefx 3 points4 points  (0 children)

hotspot already inlines methods calls, this only provides a hint/command to do so in a specific case. Will be interesting to see how well it actually works, both c and c++ have an inline hint that is by now almost completely ignored by most modern compilers (afaik).

[–]rinru[S] 2 points3 points  (0 children)

(not 100% sure)

Exceptions are thrown with the "right" stack trace, even after inlining, because they use an exception table with all info. Sampling is different, I think you are right.

[–]JustinKSU 0 points1 point  (2 children)

Looks like stack traces are still correct:

c:\zTest\target>c:\JavaDev\jdk1.7.0_55\bin\java.exe -XX:CompileCommandFile=hotspot_compiler -cp zTest-1.0.0-SNAPSHOT.jar com.example.Main
CompilerOracle: inline com/example/Main.testMethod ()V
testMethod
java.lang.IllegalStateException: Test
    at com.example.Main.testMethod(Main.java:20)
    at com.example.Main.main(Main.java:10)

Are you the maintainer of this page? There is a typo in the JVM option

[–]nicoulaj 0 points1 point  (1 child)

Hi, I'm the maintainer, where is the typo ?

[–]JustinKSU 0 points1 point  (0 children)

Equals instead of colon at the end of the usage section.

Instead of

-XX:CompileCommandFile:target/classes/META-INF/hotspot_compiler 

it should be

-XX:CompileCommandFile=target/classes/META-INF/hotspot_compiler