public
Created

Random.next() Assembly Code

  • Download Gist
gistfile1.asm
Assembly
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
Decoding compiled method 0x00c38ec8:
Code:
[Disassembling for mach='i386']
[Entry Point]
[Constants]
# {method} 'next' '(I)I' in 'java/util/Random'
# this: ecx = 'java/util/Random'
# parm0: edx = int
# [sp+0x60] (sp of caller)
;; block B7 [0, 0]
 
0x00c38fd0: nop
0x00c38fd1: nop
0x00c38fd2: nop
0x00c38fd3: nop
0x00c38fd4: nop
0x00c38fd5: nop
0x00c38fd6: nop
0x00c38fd7: cmp 0x4(%ecx),%eax
0x00c38fda: jne 0x00bead90 ; {runtime_call}
[Verified Entry Point]
0x00c38fe0: mov %eax,0xffff8000(%esp)
0x00c38fe7: push %ebp
0x00c38fe8: sub $0x58,%esp
0x00c38feb: mov %edx,%esi ;*aload_0
; - java.util.Random::next@0 (line 179)
0x00c38fed: mov %esi,0x38(%esp)
;; block B0 [0, 6]
 
0x00c38ff1: mov 0x14(%ecx),%edi ;*getfield seed
; - java.util.Random::next@1 (line 179)
0x00c38ff4: mov %edi,0x3c(%esp)
;; 14 branch [AL] [B1]
0x00c38ff8: jmp 0x00c39002 ;*aload
; - java.util.Random::next@6 (line 181)
0x00c38ffd: nop
0x00c38ffe: nop
0x00c38fff: nop
;; block B8 [35, 35]
 
0x00c39000: mov %esi,%edi
;; block B1 [6, 35]
 
0x00c39002: movsd 0x8(%edi),%xmm0 ; implicit exception: dispatches to 0x00c390c0
0x00c39007: movd %xmm0,%ebx
0x00c3900b: psrlq $0x20,%xmm0
0x00c39010: movd %xmm0,%ecx ;*getfield value
; - java.util.concurrent.atomic.AtomicLong::get@1 (line 103)
; - java.util.Random::next@8 (line 181)
0x00c39014: mov $0xdeece66d,%eax
0x00c39019: mov $0x5,%edx
0x00c3901e: mov %eax,%esi
0x00c39020: mov %edx,%edi
0x00c39022: mov %ebx,%eax
0x00c39024: mov %ecx,%edx
0x00c39026: imul %esi,%edx
0x00c39029: imul %eax,%edi
0x00c3902c: add %edx,%edi
0x00c3902e: mul %esi
0x00c39030: add %edi,%edx
0x00c39032: add $0xb,%eax
0x00c39035: adc $0x0,%edx
0x00c39038: mov %eax,%esi
0x00c3903a: mov %edx,%edi
0x00c3903c: and $0xffffffff,%esi
0x00c3903f: and $0xffff,%edi
0x00c39045: mov $0x100d1d70,%eax ; {oop(a 'java/lang/Class' = 'java/util/concurrent/atomic/AtomicLong')}
0x00c3904a: mov 0x68(%eax),%eax ;*getstatic unsafe
; - java.util.concurrent.atomic.AtomicLong::compareAndSet@0 (line 149)
; - java.util.Random::next@32 (line 183)
0x00c3904d: mov %ebx,%eax
0x00c3904f: mov %ecx,%edx
0x00c39051: mov %esi,%ebx
0x00c39053: mov %edi,%ecx
0x00c39055: mov %esi,0x40(%esp)
0x00c39059: mov %edi,0x44(%esp)
0x00c3905d: mov 0x3c(%esp),%esi
0x00c39061: lea 0x8(%esi),%edi
0x00c39064: lock cmpxchg8b (%edi)
0x00c39068: mov $0x1,%ecx
0x00c3906d: je 0x00c39078
0x00c39073: mov $0x0,%ecx ; OopMap{esi=Oop [60]=Oop off=168}
;*ifeq
; - java.util.Random::next@35 (line 183)
0x00c39078: test %eax,0x9f0100 ; {poll}
0x00c3907e: cmp $0x0,%ecx
;; 60 branch [EQ] [B8]
0x00c39081: je 0x00c39000 ;*ifeq
; - java.util.Random::next@35 (line 183)
;; block B2 [38, 46]
 
0x00c39087: mov 0x40(%esp),%edi
0x00c3908b: mov 0x44(%esp),%eax
0x00c3908f: mov 0x38(%esp),%esi
0x00c39093: mov $0x30,%ecx
0x00c39098: sub %esi,%ecx
0x00c3909a: mov %edi,%esi
0x00c3909c: mov %eax,%edi
0x00c3909e: and $0x3f,%ecx
0x00c390a1: cmp $0x20,%ecx
0x00c390a4: jl 0x00c390ae
0x00c390aa: mov %edi,%esi
0x00c390ac: xor %edi,%edi
0x00c390ae: shrd %cl,%edi,%esi
0x00c390b1: shr %cl,%edi
0x00c390b3: mov %esi,%eax
0x00c390b5: add $0x58,%esp
0x00c390b8: pop %ebp
0x00c390b9: test %eax,0x9f0100 ; {poll_return}
0x00c390bf: ret
;; ImplicitNullCheckStub slow case
0x00c390c0: call 0x00c28620 ; OopMap{edi=Oop [60]=Oop off=245}
;*invokevirtual get
; - java.util.Random::next@8 (line 181)
; {runtime_call}
0x00c390c5: push $0x84117f8 ; {external_word}
0x00c390ca: call 0x00c390cf
0x00c390cf: pusha
0x00c390d0: call 0x08260100 ; {runtime_call}
0x00c390d5: hlt
0x00c390d6: nop
0x00c390d7: nop
;; Unwind handler
0x00c390d8: mov %fs:0x0,%esi
0x00c390e0: mov 0xfffffff4(%esi),%esi
0x00c390e3: mov 0x198(%esi),%eax
0x00c390e9: movl $0x0,0x198(%esi)
0x00c390f3: movl $0x0,0x19c(%esi)
0x00c390fd: add $0x58,%esp
0x00c39100: pop %ebp
0x00c39101: jmp 0x00c27e60 ; {runtime_call}
0x00c39106: hlt
0x00c39107: hlt
0x00c39108: hlt
0x00c39109: hlt
0x00c3910a: hlt
0x00c3910b: hlt
0x00c3910c: hlt
0x00c3910d: hlt
0x00c3910e: hlt
0x00c3910f: hlt
[Exception Handler]
[Stub Code]
0x00c39110: mov $0xdead,%ebx ; {no_reloc}
0x00c39115: mov $0xdead,%ecx
0x00c3911a: mov $0xdead,%esi
0x00c3911f: mov $0xdead,%edi
0x00c39124: call 0x00c2a260 ; {runtime_call}
0x00c39129: push $0x84117f8 ; {external_word}
0x00c3912e: call 0x00c39133
0x00c39133: pusha
0x00c39134: call 0x08260100 ; {runtime_call}
0x00c39139: hlt
[Deopt Handler Code]
0x00c3913a: push $0xc3913a ; {section_word}
0x00c3913f: jmp 0x00bebac0 ; {runtime_call}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.