Filtering the output of -XX:+PrintAssembly
Dennis Byrne
dennisbyrne at apache.org
Tue Nov 17 08:52:27 PST 2009
Thanks for your reply Christian. Unfortunately I get nothing when I
omit -XX:+PrintAssembly
dbyrne at wud-nbyrne01:~/print_assembly/java$ javac HelloWorld.java
dbyrne at wud-nbyrne01:~/print_assembly/java$
/usr/lib/jvm/java-6-openjdk/jre/bin/java
-XX:+UnlockDiagnosticVMOptions
-XX:PrintAssemblyOptions=hsdis-print-bytes -Xbatch
-XX:CompileCommand=print,*HelloWorld.main HelloWorld
CompilerOracle: print *HelloWorld.main
3331
Here is the source code if it helps.
class HelloWorld{
private static int i = 1;
private static int j = 22;
public static void main(String[] args){
for(int j = 0; j < 10; j++){
i += 333;
}
System.out.println(i);
}
}
On Tue, Nov 17, 2009 at 10:47 AM, Christian Thalinger
<Christian.Thalinger at sun.com> wrote:
> On Tue, 2009-11-17 at 10:24 -0600, Dennis Byrne wrote:
>> The final paragraph of the hsdis README file [1] and second to last
>> paragraph of the wiki page [2] suggests that the following command
>> line only prints the assembly for the main method of my HelloWorld
>> class.
>>
>> /usr/lib/jvm/java-6-openjdk/jre/bin/java
>> -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly
>> -XX:PrintAssemblyOptions=hsdis-print-bytes -Xbatch
>> -XX:CompileCommand=print,*HelloWorld.main HelloWorld
>
> Omit -XX:+PrintAssembly, that should do the trick. -- Christian
>
>
--
Dennis Byrne
More information about the hotspot-dev
mailing list