A small favor if you can PrintAssembly on non x86?

Christian Thalinger Christian.Thalinger at Sun.COM
Fri Nov 27 16:30:48 UTC 2009


On Fri, 2009-11-27 at 06:42 -0900, Dennis Byrne wrote:
> $ wget http://people.apache.org/~dennisbyrne/memory/WriterReader.java
> $ javac WriterReader.java
> $ java -XX:+UnlockDiagnosticVMOptions
> -XX:PrintAssemblyOptions=hsdis-print-bytes
> -XX:CompileCommand=print,WriterReader.write WriterReader > write.txt
> $ java -XX:+UnlockDiagnosticVMOptions
> -XX:PrintAssemblyOptions=hsdis-print-bytes
> -XX:CompileCommand=print,WriterReader.read WriterReader > read.txt
> 
> Ideal would be Itanium or PPC output.  These memory models are much
> different and would give me more examples to write about.  The weaker
> the better.  Sparc would still be interesting also.
> 
> Getting a hold of a non-x86 system has been more difficult than
> writing the article itself.  Any help you can give me is greatly
> appreciated.

I did a run on SPARC for you (had to increase the loop length a little).

-- Christian
-------------- next part --------------
CompilerOracle: print WriterReader.read
VM option 'PrintAssemblyOptions=hsdis-print-bytes'
VM option 'CompileCommand=print,WriterReader.read'
Loaded disassembler from hsdis-sparc.so
Compiled (c2)   1   nmethod (2)  WriterReader::read (14 bytes)
 total in heap  [0xfa8ecd88,0xfa8ecf2c] = 420
 relocation     [0xfa8ece48,0xfa8ece54] = 12
 main code      [0xfa8ece60,0xfa8ecea0] = 64
 stub code      [0xfa8ecea0,0xfa8ecebc] = 28
 scopes data    [0xfa8ecebc,0xfa8eced0] = 20
 scopes pcs     [0xfa8eced0,0xfa8ecf20] = 80
 dependencies   [0xfa8ecf20,0xfa8ecf24] = 4
 oops           [0xfa8ecf24,0xfa8ecf2c] = 8
Decoding compiled method 0xfa8ecd88:
Code:
[Disassembling for mach='sparc:v8plusb']
[Entry Point]
[Verified Entry Point]
  0xfa8ece60: save  %sp, -72, %sp       ;...9de3bfb8
                                        ;*synchronization entry
                                        ; - WriterReader::read at -1 (line 25)
  0xfa8ece64: sethi  %hi(0xb61f9000), %l1  ;...232d87e4
                                        ;   {oop('WriterReader')}
  0xfa8ece68: add  %l1, 0x3d8, %l1	! 'WriterReader'
                                        ;...a20463d8
                                        ;   {oop('WriterReader')}
  0xfa8ece6c: ldub  [ %l1 + 0x154 ], %l0  ;...e00c6154
                                        ;*getstatic ready
                                        ; - WriterReader::read at 0 (line 25)
  0xfa8ece70: cmp  %l0, 0               ;...80a42000
  0xfa8ece74: be,pn   %icc, 0xfa8ece8c  ;...02400006
  0xfa8ece78: ld  [ %l1 + 0x150 ], %i0  ;...f0046150
                                        ;*ireturn
                                        ; - WriterReader::read at 13 (line 25)
  0xfa8ece7c: sethi  %hi(0xff3fc000), %l0  ;...213fcff0
  0xfa8ece80: ld  [ %l0 ], %g0          ;...c0042000
                                        ;   {poll_return}
  0xfa8ece84: ret                       ;...81c7e008
  0xfa8ece88: restore                   ;...81e80000
  0xfa8ece8c: b  %icc, 0xfa8ece7c       ;...104ffffc
  0xfa8ece90: mov  -1, %i0              ;...b0103fff
  0xfa8ece94: illtrap  0                ;...00000000
  0xfa8ece98: illtrap  0                ;...00000000
  0xfa8ece9c: illtrap  0                ;...00000000
[Exception Handler]
[Stub Code]
  0xfa8ecea0: sethi  %hi(0xfa8e5400), %g3  ;...073ea395
  0xfa8ecea4: jmp  %g3 + 0xc0	! 0xfa8e54c0  ;...81c0e0c0
  0xfa8ecea8: nop                       ;...01000000
  0xfa8eceac: save  %sp, -96, %sp       ;...9de3bfa0
  0xfa8eceb0: sethi  %hi(0xfa8bb000), %l0  ;...213ea2ec
  0xfa8eceb4: jmp  %l0 + 0x3a0	! 0xfa8bb3a0  ;...81c423a0
  0xfa8eceb8: restore                   ;...81e80000
pc-bytecode offsets:
PcDesc(pc=0xfa8ece5f offset=ffffffff):
PcDesc(pc=0xfa8ece64 offset=4):
   WriterReader::read  @-1  reexecute=false
PcDesc(pc=0xfa8ece70 offset=10):
   WriterReader::read  @0  reexecute=false
PcDesc(pc=0xfa8ece7c offset=1c):
   WriterReader::read  @13  reexecute=false
PcDesc(pc=0xfa8ecebd offset=5d):
OopMapSet contains 0 OopMaps

------------------------------------------------------------------------
static WriterReader.read()I
  interpreter_invocation_count:   163805 
  invocation_counter:               8835 
  backedge_counter:                    1 

0 getstatic 7 <ready> <Z> 
3 ifeq 12
  0   bci: 3    BranchData          taken(0) displacement(28)
                                    not taken(160506)
6 getstatic 8 <shared> <I> 
9 goto 13
  16  bci: 9    JumpData            taken(160506) displacement(12)
12 iconst_m1
13 ireturn
------------------------------------------------------------------------
-------------- next part --------------
CompilerOracle: print WriterReader.write
VM option 'PrintAssemblyOptions=hsdis-print-bytes'
VM option 'CompileCommand=print,WriterReader.write'
Loaded disassembler from hsdis-sparc.so
Compiled (c2)   2   nmethod (2)  WriterReader::write (10 bytes)
 total in heap  [0xfa8ecdc8,0xfa8ecf40] = 376
 relocation     [0xfa8ece88,0xfa8ece94] = 12
 main code      [0xfa8ecea0,0xfa8ecee0] = 64
 stub code      [0xfa8ecee0,0xfa8ecefc] = 28
 scopes data    [0xfa8ecefc,0xfa8ecf04] = 8
 scopes pcs     [0xfa8ecf04,0xfa8ecf34] = 48
 dependencies   [0xfa8ecf34,0xfa8ecf38] = 4
 oops           [0xfa8ecf38,0xfa8ecf40] = 8
Decoding compiled method 0xfa8ecdc8:
Code:
[Disassembling for mach='sparc:v8plusb']
[Entry Point]
[Verified Entry Point]
  0xfa8ecea0: save  %sp, -72, %sp       ;...9de3bfb8
  0xfa8ecea4: sethi  %hi(0xb61f9000), %l1  ;...232d87e4
                                        ;   {oop('WriterReader')}
  0xfa8ecea8: add  %l1, 0x3d8, %l1	! 'WriterReader'
                                        ;...a20463d8
                                        ;   {oop('WriterReader')}
  0xfa8eceac: mov  0x2a, %l0            ;...a010202a
  0xfa8eceb0: st  %l0, [ %l1 + 0x150 ]  ;...e0246150
  0xfa8eceb4: mov  1, %l2               ;...a4102001
  0xfa8eceb8: stb  %l2, [ %l1 + 0x154 ]  ;...e42c6154
  0xfa8ecebc: membar  #StoreLoad        ;...8143e002
                                        ;*putstatic shared
                                        ; - WriterReader::write at 2 (line 29)
  0xfa8ecec0: sethi  %hi(0xff3fc000), %l0  ;...213fcff0
  0xfa8ecec4: ld  [ %l0 ], %g0          ;...c0042000
                                        ;   {poll_return}
  0xfa8ecec8: ret                       ;...81c7e008
  0xfa8ececc: restore                   ;...81e80000
  0xfa8eced0: illtrap  0                ;...00000000
  0xfa8eced4: illtrap  0                ;...00000000
  0xfa8eced8: illtrap  0                ;...00000000
  0xfa8ecedc: illtrap  0                ;...00000000
[Exception Handler]
[Stub Code]
  0xfa8ecee0: sethi  %hi(0xfa8e5400), %g3  ;...073ea395
  0xfa8ecee4: jmp  %g3 + 0xc0	! 0xfa8e54c0  ;...81c0e0c0
  0xfa8ecee8: nop                       ;...01000000
  0xfa8eceec: save  %sp, -96, %sp       ;...9de3bfa0
  0xfa8ecef0: sethi  %hi(0xfa8bb000), %l0  ;...213ea2ec
  0xfa8ecef4: jmp  %l0 + 0x3a0	! 0xfa8bb3a0  ;...81c423a0
  0xfa8ecef8: restore                   ;...81e80000
pc-bytecode offsets:
PcDesc(pc=0xfa8ece9f offset=ffffffff):
PcDesc(pc=0xfa8ecec0 offset=20):
   WriterReader::write  @2  reexecute=false
PcDesc(pc=0xfa8ecefd offset=5d):
OopMapSet contains 0 OopMaps

------------------------------------------------------------------------
static WriterReader.write()V
  interpreter_invocation_count:   173478 
  invocation_counter:               8510 
  backedge_counter:                    1 

0 bipush 42
2 putstatic 8 <shared> <I> 
5 iconst_1
6 putstatic 7 <ready> <Z> 
9 return
------------------------------------------------------------------------


More information about the discuss mailing list