• Home
    • View
    • Login
    This page
    • Normal
    • Export PDF
    • Page Information

    Loading...
  1. Dashboard
  2. Undefined Space
  3. HotSpot
  4. PrintAssembly

Page History

Versions Compared

Old Version 20

changes.mady.by.user J. Duke

Saved on Sep 20, 2012

compared with

New Version 21

changes.mady.by.user Volker Simonis

Saved on Jul 17, 2013

  • Previous Change: Difference between versions 19 and 20
  • Next Change: Difference between versions 21 and 22
  • View Page History

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Document workaround for build error due to new binutils versions
Excerpt

Puzzled by a performance glitch? You might have to look at the generated code.

Examining generated code

The following HotSpot options (with an -XX: prefix on the command line) require OpenJDK 7 and an externally loadable disassembler plugin:

...

The disassembly output is annotated with various kinds of debugging information, such as field names and source locations. The quality of this information improved markedly in January 2010 (bug fix 6912062).

Examples

Code Block

0x0188272f: mov	ecx, [ecx+0x1A8B8B30]  ;   {oop(cache [42] for constant pool [234]/invokedynamic for 'SumWithIndy' cache=0x1a8b8b30)}
  0x01882735: mov	edx, [ecx+0x10]
  0x01882738: cmp	edx, a 'sun/dyn/ToGeneric$A2'
                                        ;   {oop(a 'sun/dyn/ToGeneric$A2')}
  0x0188273e: jnz	0x018827c1      ;*invokedynamic
                                        ; - SumWithIndy::test@17 (line 90)
  0x01882744: mov	edi, 0x00000150
  0x01882749: mov	edx, [edi+0x1A8B9110]  ;*getstatic cache
                                        ; - java.lang.Integer::valueOf@35 (line 651)
                                        ; - sun.dyn.ToGeneric$A2::targetA2@3 (line 663)
                                        ; - sun.dyn.ToGeneric$A2::invoke_L@4 (line 672)
                                        ; - java.dyn.InvokeDynamic::invokeExact@4
                                        ; - SumWithIndy::test@17 (line 90)
                                        ;   {oop('java/lang/Integer$IntegerCache')}

...

Look at the README for instructions on building.

With recent binutils version (i.e. binutils-2.23.2) you may get the following build error:

WARNING: `makeinfo' is missing on your system.  You should only need it if
         you modified a `.texi' or `.texinfo' file, or any other file
...

This is because of "Bug 15345 - [2.23.2 regression] binutils-2.23.2 tarball doesn't build without makeinfo". The simplest workaround is to touch 'bfd/doc/bfd.info' in the biuntils source directory.

Pre-built binaries do not seem to be available (help... anyone?). Prebuilt binaries for Windows-x86: hsdis-i386.dll

...

No Format
titleinstalling the plugin on Solaris

$ JDK7=my/copy/of/jre1.7.0
$ cp -p hsdis/.libs/hsdis.so $JDK7/lib/i386/client/hsdis-i386.so
$ cp -p hsdis/.libs/hsdis.so $JDK7/lib/i386/server/hsdis-i386.so
$ XJAVA="$JDK7/bin/java -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly"
$ $XJAVA -Xcomp -cp ~/Classes hello
$ $XJAVA -Xcomp -cp ~/Classes -XX:PrintAssemblyOptions=hsdis-print-bytes hello
$ $XJAVA -XX:-PrintAssembly -XX:+PrintStubCode
$ $XJAVA -XX:-PrintAssembly -XX:+PrintInterpreter
$ $XJAVA -XX:-PrintAssembly -XX:+PrintSignatureHandlers
$ $XJAVA -Xbatch -cp ~/Classes -XX:+PrintCompilation myloopingbenchmark

...

Overview
Content Tools
ThemeBuilder

Terms of Use
• License: GPLv2
• Privacy • Trademarks • Contact Us

Powered by a free Atlassian Confluence Open Source Project License granted to https://www.atlassian.com/software/views/opensource-community-additional-license-offer. Evaluate Confluence today.

  • Kolekti ThemeBuilder Powered by Atlassian Confluence 8.5.23
  • Kolekti ThemeBuilder printed.by.atlassian.confluence
  • Report a bug
  • Atlassian News
Atlassian
Kolekti ThemeBuilder EngineAtlassian Confluence
{"serverDuration": 166, "requestCorrelationId": "38dfa375cd0290ca"}