public
Created

MathRandomGenerator 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 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394
Decoding compiled method 0x00c39288:
Code:
[Constants]
0x00c393e0 (offset: 0): 0x00000000 0x4340000000000000
0x00c393e4 (offset: 4): 0x43400000
0x00c393e8 (offset: 8): 0xf4f4f4f4 0xf4f4f4f4f4f4f4f4
0x00c393ec (offset: 12): 0xf4f4f4f4
[Disassembling for mach='i386']
[Entry Point]
# {method} 'run' '()V' in 'com/schlimm/java7/concurrency/random/generators/MathRandomGenerator'
# [sp+0x80] (sp of caller)
;; block B15 [0, 0]
 
0x00c393f0: nop ; {no_reloc}
0x00c393f1: nop
0x00c393f2: nop
0x00c393f3: nop
0x00c393f4: nop
0x00c393f5: nop
0x00c393f6: nop
0x00c393f7: cmp 0x4(%ecx),%eax
0x00c393fa: jne 0x00bead90 ; {runtime_call}
[Verified Entry Point]
0x00c39400: mov %eax,0xffff8000(%esp)
0x00c39407: push %ebp
0x00c39408: sub $0x78,%esp ;*aload_0
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@0 (line 12)
0x00c3940b: mov %ecx,0x3c(%esp)
;; block B0 [0, 5]
 
0x00c3940f: movsd 0x8(%ecx),%xmm0 ;*getfield r
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@2 (line 12)
0x00c39414: movsd %xmm0,0x58(%esp)
0x00c3941a: mov $0x1004ad30,%eax ; {oop(a 'java/lang/Class' = 'java/lang/Math')}
0x00c3941f: mov 0x68(%eax),%eax ;*getstatic randomNumberGenerator
; - java.lang.Math::random@0 (line 714)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
0x00c39422: cmp $0x0,%eax
;; 18 branch [NE] [B4]
0x00c39425: jne 0x00c395b5 ;*ifnonnull
; - java.lang.Math::random@5 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
;; block B3 [8, 5]
 
0x00c3942b: mov $0x1004ad30,%edx ; {oop(a 'java/lang/Class' = 'java/lang/Math')}
0x00c39430: lea 0x60(%esp),%esi
0x00c39434: mov %edx,0x4(%esi)
0x00c39437: mov (%edx),%eax ; implicit exception: dispatches to 0x00c396a1
0x00c39439: mov %eax,%edi
0x00c3943b: and $0x7,%edi
0x00c3943e: cmp $0x5,%edi
0x00c39441: jne 0x00c394cd
0x00c39447: mov %eax,(%esi)
0x00c39449: mov %fs:0x0,%edi
0x00c39451: mov 0xfffffff4(%edi),%edi
0x00c39454: xor %edi,%eax
0x00c39456: mov 0x4(%edx),%edi
0x00c39459: xor 0x68(%edi),%eax
0x00c3945c: and $0xffffff87,%eax
0x00c3945f: je 0x00c394ee
0x00c39465: test $0x7,%eax
0x00c3946a: jne 0x00c394c1
0x00c39470: test $0x180,%eax
0x00c39475: jne 0x00c3949f
0x00c3947b: mov (%esi),%eax
0x00c3947d: and $0x1ff,%eax
0x00c39483: mov %fs:0x0,%edi
0x00c3948b: mov 0xfffffff4(%edi),%edi
0x00c3948e: or %eax,%edi
0x00c39490: lock cmpxchg %edi,(%edx)
0x00c39494: jne 0x00c396b7
0x00c3949a: jmp 0x00c394ee
0x00c3949f: mov %fs:0x0,%edi
0x00c394a7: mov 0xfffffff4(%edi),%edi
0x00c394aa: mov 0x4(%edx),%eax
0x00c394ad: or 0x68(%eax),%edi
0x00c394b0: mov (%esi),%eax
0x00c394b2: lock cmpxchg %edi,(%edx)
0x00c394b6: jne 0x00c396b7
0x00c394bc: jmp 0x00c394ee
0x00c394c1: mov (%esi),%eax
0x00c394c3: mov 0x4(%edx),%edi
0x00c394c6: mov 0x68(%edi),%edi
0x00c394c9: lock cmpxchg %edi,(%edx)
0x00c394cd: mov (%edx),%eax
0x00c394cf: or $0x1,%eax
0x00c394d2: mov %eax,(%esi)
0x00c394d4: lock cmpxchg %esi,(%edx)
0x00c394d8: je 0x00c394ee
0x00c394de: sub %esp,%eax
0x00c394e0: and $0xfffff003,%eax
0x00c394e6: mov %eax,(%esi)
0x00c394e8: jne 0x00c396b7 ;*synchronization entry
; - java.lang.Math::initRNG@-1 (line 686)
; - java.lang.Math::random@8 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
0x00c394ee: mov 0x68(%edx),%esi ;*getstatic randomNumberGenerator
; - java.lang.Math::initRNG@0 (line 686)
; - java.lang.Math::random@8 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
0x00c394f1: cmp $0x0,%esi
;; 40 branch [NE] [B8]
0x00c394f4: jne 0x00c39583 ;*ifnonnull
; - java.lang.Math::initRNG@5 (line 687)
; - java.lang.Math::random@8 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
;; block B7 [8, 19]
 
0x00c394fa: mov $0x20236fc0,%edx ; {oop('java/util/Random')}
0x00c394ff: mov %fs:0x0,%ecx
0x00c39507: mov 0xfffffff4(%ecx),%ecx
0x00c3950a: mov 0x44(%ecx),%eax
0x00c3950d: lea 0x18(%eax),%edi
0x00c39510: cmp 0x4c(%ecx),%edi
0x00c39513: ja 0x00c396c8
0x00c39519: mov %edi,0x44(%ecx)
0x00c3951c: mov 0x68(%edx),%ecx
0x00c3951f: mov %ecx,(%eax)
0x00c39521: mov %edx,0x4(%eax)
0x00c39524: xor %ecx,%ecx
0x00c39526: mov %ecx,0x8(%eax)
0x00c39529: mov %ecx,0xc(%eax)
0x00c3952c: mov %ecx,0x10(%eax)
0x00c3952f: mov %ecx,0x14(%eax) ;*new ; - java.lang.Math::initRNG@8 (line 687)
; - java.lang.Math::random@8 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
0x00c39532: mov %eax,0x38(%esp)
0x00c39536: nop
0x00c39537: call 0x00beb450 ; OopMap{[60]=Oop [56]=Oop [100]=Oop off=332}
;*invokestatic seedUniquifier
; - java.util.Random::<init>@1 (line 90)
; - java.lang.Math::initRNG@12 (line 687)
; - java.lang.Math::random@8 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
; {static_call}
0x00c3953c: mov %eax,0x40(%esp)
0x00c39540: mov %edx,0x44(%esp)
0x00c39544: call 0x0824ecf0 ;*invokestatic nanoTime
; - java.util.Random::<init>@4 (line 90)
; - java.lang.Math::initRNG@12 (line 687)
; - java.lang.Math::random@8 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
; {runtime_call}
0x00c39549: mov 0x40(%esp),%esi
0x00c3954d: mov 0x44(%esp),%ecx
0x00c39551: xor %eax,%esi
0x00c39553: xor %edx,%ecx
0x00c39555: mov %esi,(%esp)
0x00c39558: mov %ecx,0x4(%esp)
0x00c3955c: mov 0x38(%esp),%ecx ;*invokespecial <init>
; - java.util.Random::<init>@8 (line 90)
; - java.lang.Math::initRNG@12 (line 687)
; - java.lang.Math::random@8 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
0x00c39560: nop
0x00c39561: nop
0x00c39562: nop
0x00c39563: call 0x00beafd0 ; OopMap{[60]=Oop [56]=Oop [100]=Oop off=376}
;*invokespecial <init>
; - java.util.Random::<init>@8 (line 90)
; - java.lang.Math::initRNG@12 (line 687)
; - java.lang.Math::random@8 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
; {optimized virtual_call}
0x00c39568: mov $0x1004ad30,%eax ; {oop(a 'java/lang/Class' = 'java/lang/Math')}
0x00c3956d: mov 0x38(%esp),%edx
0x00c39571: mov %edx,0x68(%eax)
0x00c39574: shr $0x9,%eax
0x00c39577: movb $0x0,0x2b3fe00(%eax) ;*putstatic randomNumberGenerator
; - java.lang.Math::initRNG@16 (line 687)
; - java.lang.Math::random@8 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
;; 82 branch [AL] [B9]
0x00c3957e: jmp 0x00c39585 ;*goto
; - java.lang.Math::initRNG@19 (line 687)
; - java.lang.Math::random@8 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
;; block B8 [22, 23]
 
0x00c39583: mov %esi,%edx ;*areturn
; - java.lang.Math::initRNG@23 (line 687)
; - java.lang.Math::random@8 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
;; block B9 [23, 12]
 
0x00c39585: mov $0x1004ad30,%eax ; {oop(a 'java/lang/Class' = 'java/lang/Math')}
0x00c3958a: lea 0x60(%esp),%eax
0x00c3958e: mov 0x4(%eax),%esi
0x00c39591: mov (%esi),%ecx
0x00c39593: and $0x7,%ecx
0x00c39596: cmp $0x5,%ecx
0x00c39599: je 0x00c395b3
0x00c3959f: mov (%eax),%ecx
0x00c395a1: test %ecx,%ecx
0x00c395a3: je 0x00c395b3
0x00c395a9: lock cmpxchg %ecx,(%esi)
0x00c395ad: jne 0x00c396d4 ;*synchronization entry
; - java.lang.Math::initRNG@-1 (line 686)
; - java.lang.Math::random@8 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
0x00c395b3: mov %edx,%eax ;*aload_0
; - java.lang.Math::random@12 (line 716)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
;; block B4 [12, 12]
 
0x00c395b5: cmp (%eax),%eax ;*invokevirtual nextDouble
; - java.lang.Math::random@13 (line 716)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
; implicit exception: dispatches to 0x00c396e5
0x00c395b7: mov $0x1a,%edx
0x00c395bc: mov %eax,%ecx ;*invokevirtual next
; - java.util.Random::nextDouble@3 (line 438)
; - java.lang.Math::random@13 (line 716)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
0x00c395be: mov %eax,0x48(%esp)
0x00c395c2: nop
0x00c395c3: call 0x00beafd0 ; OopMap{[60]=Oop [72]=Oop off=472}
;*invokevirtual next
; - java.util.Random::nextDouble@3 (line 438)
; - java.lang.Math::random@13 (line 716)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
; {optimized virtual_call}
0x00c395c8: mov %eax,%edx
0x00c395ca: sar $0x1f,%edx
0x00c395cd: mov $0x1b,%ecx
0x00c395d2: and $0x3f,%ecx
0x00c395d5: cmp $0x20,%ecx
0x00c395d8: jl 0x00c395e2
0x00c395de: mov %eax,%edx
0x00c395e0: xor %eax,%eax
0x00c395e2: shld %cl,%eax,%edx
0x00c395e5: shl %cl,%eax
0x00c395e7: mov %eax,0x50(%esp)
0x00c395eb: mov %edx,0x54(%esp)
0x00c395ef: mov $0x1b,%edx
0x00c395f4: mov 0x48(%esp),%ecx ;*invokevirtual next
; - java.util.Random::nextDouble@13 (line 438)
; - java.lang.Math::random@13 (line 716)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
0x00c395f8: nop
0x00c395f9: nop
0x00c395fa: nop
0x00c395fb: call 0x00beafd0 ; OopMap{[60]=Oop off=528}
;*invokevirtual next
; - java.util.Random::nextDouble@13 (line 438)
; - java.lang.Math::random@13 (line 716)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
; {optimized virtual_call}
0x00c39600: mov %eax,%esi
0x00c39602: sar $0x1f,%eax
0x00c39605: mov 0x50(%esp),%edi
0x00c39609: mov 0x54(%esp),%edx
0x00c3960d: add %esi,%edi
0x00c3960f: adc %eax,%edx
0x00c39611: mov %edi,(%esp)
0x00c39614: mov %edx,0x4(%esp)
0x00c39618: fildll (%esp)
0x00c3961b: fstpl (%esp)
0x00c3961e: movsd (%esp),%xmm0
0x00c39623: divsd 0xc393e0,%xmm0 ; {section_word}
0x00c3962b: addsd 0x58(%esp),%xmm0
0x00c39631: mov 0x3c(%esp),%ecx
0x00c39635: movsd %xmm0,0x8(%ecx) ;*putfield r
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@9 (line 12)
0x00c3963a: add $0x78,%esp
0x00c3963d: pop %ebp
0x00c3963e: test %eax,0x9f0100 ; {poll_return}
0x00c39644: ret ;*return
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@12 (line 13)
;; block B10 [-1, 8]
 
0x00c39645: mov %fs:0x0,%esi
0x00c3964d: mov 0xfffffff4(%esi),%esi
0x00c39650: mov 0x198(%esi),%eax
0x00c39656: movl $0x0,0x198(%esi)
0x00c39660: movl $0x0,0x19c(%esi)
0x00c3966a: mov %eax,%esi
0x00c3966c: mov $0x1004ad30,%eax ; {oop(a 'java/lang/Class' = 'java/lang/Math')}
0x00c39671: lea 0x60(%esp),%eax
0x00c39675: mov 0x4(%eax),%ebx
0x00c39678: mov (%ebx),%edi
0x00c3967a: and $0x7,%edi
0x00c3967d: cmp $0x5,%edi
0x00c39680: je 0x00c3969a
0x00c39686: mov (%eax),%edi
0x00c39688: test %edi,%edi
0x00c3968a: je 0x00c3969a
0x00c39690: lock cmpxchg %edi,(%ebx)
0x00c39694: jne 0x00c396fb ;*synchronization entry
; - java.lang.Math::initRNG@-1 (line 686)
; - java.lang.Math::random@8 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
0x00c3969a: mov %esi,%eax
0x00c3969c: jmp 0x00c39730
;; ImplicitNullCheckStub slow case
0x00c396a1: call 0x00c28620 ; OopMap{ecx=Oop [60]=Oop edx=Oop off=694}
;*synchronization entry
; - java.lang.Math::initRNG@-1 (line 686)
; - java.lang.Math::random@8 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
; {runtime_call}
0x00c396a6: push $0x84117f8 ; {external_word}
0x00c396ab: call 0x00c396b0
0x00c396b0: pusha
0x00c396b1: call 0x08260100 ; {runtime_call}
0x00c396b6: hlt
;; MonitorEnterStub slow case
0x00c396b7: mov %edx,0x4(%esp)
0x00c396bb: mov %esi,(%esp)
0x00c396be: call 0x00c2a8a0 ; OopMap{ecx=Oop [60]=Oop edx=Oop [100]=Oop off=723}
;*synchronization entry
; - java.lang.Math::initRNG@-1 (line 686)
; - java.lang.Math::random@8 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
; {runtime_call}
0x00c396c3: jmp 0x00c394ee
;; NewInstanceStub slow case
0x00c396c8: mov %edx,%edx
0x00c396ca: call 0x00c28b90 ; OopMap{[60]=Oop [100]=Oop off=735}
;*new ; - java.lang.Math::initRNG@8 (line 687)
; - java.lang.Math::random@8 (line 715)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
; {runtime_call}
0x00c396cf: jmp 0x00c39532
;; MonitorExitStub slow case
0x00c396d4: lea 0x60(%esp),%eax
0x00c396d8: mov %eax,(%esp)
0x00c396db: call 0x00c2ab60 ; {runtime_call}
0x00c396e0: jmp 0x00c395b3
;; ImplicitNullCheckStub slow case
0x00c396e5: call 0x00c28620 ; OopMap{eax=Oop [60]=Oop off=762}
;*invokevirtual nextDouble
; - java.lang.Math::random@13 (line 716)
; - com.schlimm.java7.concurrency.random.generators.MathRandomGenerator::run@5 (line 12)
; {runtime_call}
0x00c396ea: push $0x84117f8 ; {external_word}
0x00c396ef: call 0x00c396f4
0x00c396f4: pusha
0x00c396f5: call 0x08260100 ; {runtime_call}
0x00c396fa: hlt
;; MonitorExitStub slow case
0x00c396fb: lea 0x60(%esp),%eax
0x00c396ff: mov %eax,(%esp)
0x00c39702: call 0x00c2ab60 ; {runtime_call}
0x00c39707: jmp 0x00c3969a
0x00c39709: nop
0x00c3970a: nop
;; Unwind handler
0x00c3970b: mov %fs:0x0,%esi
0x00c39713: mov 0xfffffff4(%esi),%esi
0x00c39716: mov 0x198(%esi),%eax
0x00c3971c: movl $0x0,0x198(%esi)
0x00c39726: movl $0x0,0x19c(%esi)
0x00c39730: add $0x78,%esp
0x00c39733: pop %ebp
0x00c39734: jmp 0x00c27e60 ; {runtime_call}
0x00c39739: hlt
0x00c3973a: hlt
0x00c3973b: hlt
0x00c3973c: hlt
0x00c3973d: hlt
0x00c3973e: hlt
0x00c3973f: hlt
[Stub Code]
0x00c39740: nop ; {no_reloc}
0x00c39741: nop
0x00c39742: mov $0x0,%ebx ; {static_stub}
0x00c39747: jmp 0x00c39747 ; {runtime_call}
0x00c3974c: nop
0x00c3974d: nop
0x00c3974e: mov $0x0,%ebx ; {static_stub}
0x00c39753: jmp 0x00c39753 ; {runtime_call}
0x00c39758: nop
0x00c39759: nop
0x00c3975a: mov $0x0,%ebx ; {static_stub}
0x00c3975f: jmp 0x00c3975f ; {runtime_call}
0x00c39764: nop
0x00c39765: nop
0x00c39766: mov $0x0,%ebx ; {static_stub}
0x00c3976b: jmp 0x00c3976b ; {runtime_call}
[Exception Handler]
0x00c39770: mov $0xdead,%ebx
0x00c39775: mov $0xdead,%ecx
0x00c3977a: mov $0xdead,%esi
0x00c3977f: mov $0xdead,%edi
0x00c39784: call 0x00c2a260 ; {runtime_call}
0x00c39789: push $0x84117f8 ; {external_word}
0x00c3978e: call 0x00c39793
0x00c39793: pusha
0x00c39794: call 0x08260100 ; {runtime_call}
0x00c39799: hlt
[Deopt Handler Code]
0x00c3979a: push $0xc3979a ; {section_word}
0x00c3979f: jmp 0x00bebac0 ; {runtime_call}

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.