Skip to content

Instantly share code, notes, and snippets.

@iminto
Created November 4, 2012 14:12
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iminto/4012082 to your computer and use it in GitHub Desktop.
Save iminto/4012082 to your computer and use it in GitHub Desktop.
Java代码汇编后的完整代码
Java HotSpot(TM) Client VM warning: PrintAssembly is enabled; turning on DebugNonSafepoints to gain additional output
Loaded disassembler from E:\dev\java\jre\bin\client\hsdis-i386.dll
Decoding compiled method 0x0185ff48:
Code:
[Disassembling for mach='i386']
[Entry Point]
[Constants]
# {method} 'hashCode' '()I' in 'java/lang/String'
# [sp+0x20] (sp of caller)
0x01860040: nop
0x01860041: nop
0x01860042: nop
0x01860043: nop
0x01860044: nop
0x01860045: nop
0x01860046: nop
0x01860047: cmp 0x4(%ecx),%eax
0x0186004a: jne 0x017fd100 ; {runtime_call}
[Verified Entry Point]
0x01860050: mov %eax,-0x4000(%esp)
0x01860057: push %ebp
0x01860058: sub $0x18,%esp ;*aload_0
; - java.lang.String::hashCode@0 (line 1446)
0x0186005b: mov %ecx,0x10(%esp)
0x0186005f: mov 0xc(%ecx),%eax ;*getfield hash
; - java.lang.String::hashCode@1 (line 1446)
0x01860062: cmp $0x0,%eax
0x01860065: jne 0x018600ad ;*ifne
; - java.lang.String::hashCode@6 (line 1447)
0x0186006b: mov 0x8(%ecx),%esi ;*getfield value
; - java.lang.String::hashCode@10 (line 1447)
0x0186006e: mov 0x8(%esi),%edi ;*arraylength
; - java.lang.String::hashCode@13 (line 1447)
; implicit exception: dispatches to 0x018600b8
0x01860071: cmp $0x0,%edi
0x01860074: jle 0x018600ad ;*ifle
; - java.lang.String::hashCode@14 (line 1447)
0x0186007a: mov $0x0,%ebx
0x0186007f: jmp 0x018600a2 ;*iload_3
; - java.lang.String::hashCode@24 (line 1450)
0x01860084: cmp 0x8(%esi),%ebx ; implicit exception: dispatches to 0x018600bd
0x01860087: jae 0x018600c7
0x0186008d: movzwl 0xc(%esi,%ebx,2),%edx ;*caload
; - java.lang.String::hashCode@39 (line 1451)
0x01860092: mov %eax,%ecx
0x01860094: shl $0x5,%eax
0x01860097: sub %ecx,%eax
0x01860099: add %edx,%eax
0x0186009b: inc %ebx ; OopMap{esi=Oop [16]=Oop off=92}
;*goto
; - java.lang.String::hashCode@45 (line 1450)
0x0186009c: test %eax,0xb0100 ;*goto
; - java.lang.String::hashCode@45 (line 1450)
; {poll}
0x018600a2: cmp %edi,%ebx
0x018600a4: jl 0x01860084 ;*if_icmpge
; - java.lang.String::hashCode@30 (line 1450)
0x018600a6: mov 0x10(%esp),%ecx
0x018600aa: mov %eax,0xc(%ecx) ;*putfield hash
; - java.lang.String::hashCode@50 (line 1453)
0x018600ad: add $0x18,%esp
0x018600b0: pop %ebp
0x018600b1: test %eax,0xb0100 ; {poll_return}
0x018600b7: ret
0x018600b8: call 0x0185db90 ; OopMap{ecx=Oop [16]=Oop esi=Oop off=125}
;*arraylength
; - java.lang.String::hashCode@13 (line 1447)
; {runtime_call}
0x018600bd: call 0x0185db90 ; OopMap{esi=Oop [16]=Oop off=130}
;*caload
; - java.lang.String::hashCode@39 (line 1451)
; {runtime_call}
0x018600c2: call 0x0185db90 ; OopMap{esi=Oop [16]=Oop off=135}
;*caload
; - java.lang.String::hashCode@39 (line 1451)
; {runtime_call}
0x018600c7: mov %ebx,(%esp)
0x018600ca: call 0x0185d890 ; OopMap{esi=Oop [16]=Oop off=143}
;*caload
; - java.lang.String::hashCode@39 (line 1451)
; {runtime_call}
0x018600cf: nop
0x018600d0: nop
0x018600d1: mov %fs:0x0(,%eiz,1),%esi
0x018600d9: mov -0xc(%esi),%esi
0x018600dc: mov 0x188(%esi),%eax
0x018600e2: movl $0x0,0x188(%esi)
0x018600ec: movl $0x0,0x18c(%esi)
0x018600f6: add $0x18,%esp
0x018600f9: pop %ebp
0x018600fa: jmp 0x0180bb80 ; {runtime_call}
0x018600ff: hlt
[Exception Handler]
[Stub Code]
0x01860100: call 0x0185eec0 ; {no_reloc}
0x01860105: push $0x60cac9fc ; {external_word}
0x0186010a: call 0x0186010f
0x0186010f: pusha
0x01860110: call 0x60b8d370 ; {runtime_call}
0x01860115: hlt
[Deopt Handler Code]
0x01860116: push $0x1860116 ; {section_word}
0x0186011b: jmp 0x017fca70 ; {runtime_call}
Decoding compiled method 0x018605c8:
Code:
[Entry Point]
[Constants]
# {method} 'charAt' '(I)C' in 'java/lang/String'
# this: ecx = 'java/lang/String'
# parm0: edx = int
# [sp+0x20] (sp of caller)
0x018606d0: nop
0x018606d1: nop
0x018606d2: nop
0x018606d3: nop
0x018606d4: nop
0x018606d5: nop
0x018606d6: nop
0x018606d7: cmp 0x4(%ecx),%eax
0x018606da: jne 0x017fd100 ; {runtime_call}
[Verified Entry Point]
0x018606e0: mov %eax,-0x4000(%esp)
0x018606e7: push %ebp
0x018606e8: sub $0x18,%esp
0x018606eb: mov %edx,%esi ;*iload_1
; - java.lang.String::charAt@0 (line 657)
0x018606ed: cmp $0x0,%esi
0x018606f0: jl 0x0186071d ;*iflt
; - java.lang.String::charAt@1 (line 657)
0x018606f6: mov 0x8(%ecx),%eax ;*getfield value
; - java.lang.String::charAt@6 (line 657)
0x018606f9: mov 0x8(%eax),%edx ;*arraylength
; - java.lang.String::charAt@9 (line 657)
; implicit exception: dispatches to 0x01860741
0x018606fc: cmp %edx,%esi
0x018606fe: jge 0x0186071d ;*if_icmplt
; - java.lang.String::charAt@10 (line 657)
0x01860704: cmp 0x8(%eax),%esi ; implicit exception: dispatches to 0x01860746
0x01860707: jae 0x01860750
0x0186070d: movzwl 0xc(%eax,%esi,2),%eax ;*caload
; - java.lang.String::charAt@27 (line 660)
0x01860712: add $0x18,%esp
0x01860715: pop %ebp
0x01860716: test %eax,0xb0100 ; {poll_return}
0x0186071c: ret ;*ireturn
; - java.lang.String::charAt@28 (line 660)
0x0186071d: xchg %ax,%ax
0x01860720: jmp 0x01860782 ; {no_reloc}
0x01860725: jmp 0x0186078c ;*new ; - java.lang.String::charAt@13 (line 658)
0x0186072a: mov %esi,%edx
0x0186072c: mov %eax,%ecx ;*invokespecial <init>
; - java.lang.String::charAt@18 (line 658)
0x0186072e: mov %eax,0x10(%esp)
0x01860732: nop
0x01860733: call 0x017fd300 ; OopMap{[16]=Oop off=104}
;*invokespecial <init>
; - java.lang.String::charAt@18 (line 658)
; {optimized virtual_call}
0x01860738: mov 0x10(%esp),%eax
0x0186073c: jmp 0x018607bc
0x01860741: call 0x0185db90 ; OopMap{eax=Oop off=118}
;*arraylength
; - java.lang.String::charAt@9 (line 657)
; {runtime_call}
0x01860746: call 0x0185db90 ; OopMap{eax=Oop off=123}
;*caload
; - java.lang.String::charAt@27 (line 660)
; {runtime_call}
0x0186074b: call 0x0185db90 ; OopMap{eax=Oop off=128}
;*caload
; - java.lang.String::charAt@27 (line 660)
; {runtime_call}
0x01860750: mov %esi,(%esp)
0x01860753: call 0x0185d890 ; OopMap{eax=Oop off=136}
;*caload
; - java.lang.String::charAt@27 (line 660)
; {runtime_call}
0x01860758: mov $0x0,%edx ; {oop(NULL)}
0x0186075d: push %eax
0x0186075e: push %ebx
0x0186075f: mov 0x50(%edx),%ebx
0x01860762: mov %fs:0x0(,%eiz,1),%eax
0x0186076a: mov -0xc(%eax),%eax
0x0186076d: cmp 0xec(%ebx),%eax
0x01860773: pop %ebx
0x01860774: pop %eax
0x01860775: jne 0x01860782
0x0186077b: jmp 0x01860725
0x0186077d: mov $0x5252a00,%eax
0x01860782: call 0x0185fa10 ; OopMap{off=183}
;*new ; - java.lang.String::charAt@13 (line 658)
; {runtime_call}
0x01860787: jmp 0x01860720
0x01860789: nop
0x0186078a: nop
0x0186078b: nop
0x0186078c: mov %edx,%edx
0x0186078e: call 0x0185ddc0 ; OopMap{off=195}
;*new ; - java.lang.String::charAt@13 (line 658)
; {runtime_call}
0x01860793: jmp 0x0186072a
0x01860795: nop
0x01860796: nop
0x01860797: mov %fs:0x0(,%eiz,1),%esi
0x0186079f: mov -0xc(%esi),%esi
0x018607a2: mov 0x188(%esi),%eax
0x018607a8: movl $0x0,0x188(%esi)
0x018607b2: movl $0x0,0x18c(%esi)
0x018607bc: add $0x18,%esp
0x018607bf: pop %ebp
0x018607c0: jmp 0x0180bb80 ; {runtime_call}
0x018607c5: hlt
0x018607c6: hlt
0x018607c7: hlt
0x018607c8: hlt
0x018607c9: hlt
0x018607ca: hlt
0x018607cb: hlt
0x018607cc: hlt
0x018607cd: hlt
0x018607ce: hlt
0x018607cf: hlt
[Stub Code]
0x018607d0: nop ; {no_reloc}
0x018607d1: nop
0x018607d2: mov $0x0,%ebx ; {static_stub}
0x018607d7: jmp 0x018607d7 ; {runtime_call}
[Exception Handler]
0x018607dc: call 0x0185eec0 ; {runtime_call}
0x018607e1: push $0x60cac9fc ; {external_word}
0x018607e6: call 0x018607eb
0x018607eb: pusha
0x018607ec: call 0x60b8d370 ; {runtime_call}
0x018607f1: hlt
[Deopt Handler Code]
0x018607f2: push $0x18607f2 ; {section_word}
0x018607f7: jmp 0x017fca70 ; {runtime_call}
Decoding compiled method 0x018609c8:
Code:
[Entry Point]
[Constants]
# {method} 'length' '()I' in 'java/lang/String'
# [sp+0x20] (sp of caller)
0x01860ac0: nop
0x01860ac1: nop
0x01860ac2: nop
0x01860ac3: nop
0x01860ac4: nop
0x01860ac5: nop
0x01860ac6: nop
0x01860ac7: cmp 0x4(%ecx),%eax
0x01860aca: jne 0x017fd100 ; {runtime_call}
[Verified Entry Point]
0x01860ad0: mov %eax,-0x4000(%esp)
0x01860ad7: push %ebp
0x01860ad8: sub $0x18,%esp ;*aload_0
; - java.lang.String::length@0 (line 623)
0x01860adb: mov 0x8(%ecx),%eax ;*getfield value
; - java.lang.String::length@1 (line 623)
0x01860ade: mov 0x8(%eax),%eax ;*arraylength
; - java.lang.String::length@4 (line 623)
; implicit exception: dispatches to 0x01860aec
0x01860ae1: add $0x18,%esp
0x01860ae4: pop %ebp
0x01860ae5: test %eax,0xb0100 ; {poll_return}
0x01860aeb: ret
0x01860aec: call 0x0185db90 ; OopMap{off=49}
;*arraylength
; - java.lang.String::length@4 (line 623)
; {runtime_call}
0x01860af1: nop
0x01860af2: nop
0x01860af3: mov %fs:0x0(,%eiz,1),%esi
0x01860afb: mov -0xc(%esi),%esi
0x01860afe: mov 0x188(%esi),%eax
0x01860b04: movl $0x0,0x188(%esi)
0x01860b0e: movl $0x0,0x18c(%esi)
0x01860b18: add $0x18,%esp
0x01860b1b: pop %ebp
0x01860b1c: jmp 0x0180bb80 ; {runtime_call}
0x01860b21: hlt
0x01860b22: hlt
0x01860b23: hlt
0x01860b24: hlt
0x01860b25: hlt
0x01860b26: hlt
0x01860b27: hlt
0x01860b28: hlt
0x01860b29: hlt
0x01860b2a: hlt
0x01860b2b: hlt
0x01860b2c: hlt
0x01860b2d: hlt
0x01860b2e: hlt
0x01860b2f: hlt
[Exception Handler]
[Stub Code]
0x01860b30: call 0x0185eec0 ; {no_reloc}
0x01860b35: push $0x60cac9fc ; {external_word}
0x01860b3a: call 0x01860b3f
0x01860b3f: pusha
0x01860b40: call 0x60b8d370 ; {runtime_call}
0x01860b45: hlt
[Deopt Handler Code]
0x01860b46: push $0x1860b46 ; {section_word}
0x01860b4b: jmp 0x017fca70 ; {runtime_call}
Decoding compiled method 0x01860c08:
Code:
[Entry Point]
[Constants]
# {method} '<init>' '()V' in 'java/lang/Object'
# [sp+0x20] (sp of caller)
0x01860d00: nop
0x01860d01: nop
0x01860d02: nop
0x01860d03: nop
0x01860d04: nop
0x01860d05: nop
0x01860d06: nop
0x01860d07: cmp 0x4(%ecx),%eax
0x01860d0a: jne 0x017fd100 ; {runtime_call}
[Verified Entry Point]
0x01860d10: mov %eax,-0x4000(%esp)
0x01860d17: push %ebp
0x01860d18: sub $0x18,%esp
0x01860d1b: mov %ecx,(%esp) ;*return
; - java.lang.Object::<init>@0 (line 37)
0x01860d1e: mov %ecx,0x10(%esp)
0x01860d22: call 0x0185dc80 ; OopMap{[16]=Oop off=39}
;*return
; - java.lang.Object::<init>@0 (line 37)
; {runtime_call}
0x01860d27: add $0x18,%esp
0x01860d2a: pop %ebp
0x01860d2b: test %eax,0xb0100 ; {poll_return}
0x01860d31: ret
0x01860d32: nop
0x01860d33: nop
0x01860d34: mov %fs:0x0(,%eiz,1),%esi
0x01860d3c: mov -0xc(%esi),%esi
0x01860d3f: mov 0x188(%esi),%eax
0x01860d45: movl $0x0,0x188(%esi)
0x01860d4f: movl $0x0,0x18c(%esi)
0x01860d59: add $0x18,%esp
0x01860d5c: pop %ebp
0x01860d5d: jmp 0x0180bb80 ; {runtime_call}
0x01860d62: hlt
0x01860d63: hlt
0x01860d64: hlt
0x01860d65: hlt
0x01860d66: hlt
0x01860d67: hlt
0x01860d68: hlt
0x01860d69: hlt
0x01860d6a: hlt
0x01860d6b: hlt
0x01860d6c: hlt
0x01860d6d: hlt
0x01860d6e: hlt
0x01860d6f: hlt
[Exception Handler]
[Stub Code]
0x01860d70: call 0x0185eec0 ; {no_reloc}
0x01860d75: push $0x60cac9fc ; {external_word}
0x01860d7a: call 0x01860d7f
0x01860d7f: pusha
0x01860d80: call 0x60b8d370 ; {runtime_call}
0x01860d85: hlt
[Deopt Handler Code]
0x01860d86: push $0x1860d86 ; {section_word}
0x01860d8b: jmp 0x017fca70 ; {runtime_call}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment