RFR: 8315487: Security Providers Filter [v17]

Martin Balao mbalao at redhat.com
Wed Dec 18 13:57:21 UTC 2024


On 12/18/24 05:25, Xuelei Fan wrote:> Hm, that would be nice if JIT 
could optimize it.  Did you have a chance
> to verify it?
> 

Yes. For example, to verify we can do the following:

  1) Debug Signature::getInstance throughout the path that calls 
Signature::getInstanceRSA and ProvidersFilter::isAllowed to make sure 
that we are hitting the filter code (i.e. the fast-path for a disabled 
filter).

  2) Dump C2's Signature::getInstance.

  3) Recompile the JDK removing the call to ProvidersFilter::isAllowed.

  4) Debug again to make sure that the call was removed (i.e. the 
classfile recompiled)

  5) Dump C2's Signature::getInstance.

  6) Compare the two Signature::getInstance dumps.

After following the previous steps, we can see how the difference 
between the methods are just addresses. Find attached to this email 
Main.java to reproducer yourself (run with 
'-XX:CompileCommand=compileonly,java.security.Signature::getInstance 
-XX:CompileCommand=print,java.security.Signature::getInstance 
-XX:-BackgroundCompilation -XX:-TieredCompilation'), and my two 
ProvidersFilter::isAllowed dumps.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Main.java
Type: text/x-java
Size: 3599 bytes
Desc: not available
URL: <https://mail.openjdk.org/pipermail/security-dev/attachments/20241218/71cb2c9e/Main-0001.java>
-------------- next part --------------
--------------------------------------------------------------------------------
----------------------------------- Assembly -----------------------------------

Compiled method (c2) 940   14             java.security.Signature::getInstance (50 bytes)
 total in heap  [0x00007f5beff32988,0x00007f5beff32e98] = 1296
 relocation     [0x00007f5beff32a70,0x00007f5beff32ae0] = 112
 main code      [0x00007f5beff32ae0,0x00007f5beff32e20] = 832
 stub code      [0x00007f5beff32e20,0x00007f5beff32e38] = 24
 oops           [0x00007f5beff32e38,0x00007f5beff32e40] = 8
 metadata       [0x00007f5beff32e40,0x00007f5beff32e98] = 88
 immutable data [0x00007f5b583469d0,0x00007f5b58346bc8] = 504
 dependencies   [0x00007f5b583469d0,0x00007f5b583469e8] = 24
 nul chk table  [0x00007f5b583469e8,0x00007f5b58346a00] = 24
 handler table  [0x00007f5b58346a00,0x00007f5b58346a18] = 24
 scopes pcs     [0x00007f5b58346a18,0x00007f5b58346b38] = 288
 scopes data    [0x00007f5b58346b38,0x00007f5b58346bc8] = 144

[Disassembly]
--------------------------------------------------------------------------------
[Constant Pool (empty)]

--------------------------------------------------------------------------------

[Verified Entry Point]
  # {method} {0x00007f5b7c09a6c0} 'getInstance' '(Lsun/security/jca/GetInstance$Instance;Ljava/lang/String;)Ljava/security/Signature;' in 'java/security/Signature'
  # parm0:    rsi:rsi   = 'sun/security/jca/GetInstance$Instance'
  # parm1:    rdx:rdx   = 'java/lang/String'
  #           [sp+0x30]  (sp of caller)
 ;; N1: #	out( B1 ) <- in( B10 B11 B9 B12 B6 )  Freq: 1
 ;; B1: #	out( B10 B2 ) <- BLOCK HEAD IS JUNK  Freq: 1
  0x00007f5beff32ae0:   mov    %eax,-0x18000(%rsp)
  0x00007f5beff32ae7:   push   %rbp
  0x00007f5beff32ae8:   sub    $0x20,%rsp
  0x00007f5beff32aec:   cmpl   $0x0,0x20(%r15)
  0x00007f5beff32af4:   jne    0x00007f5beff32e15           ;*synchronization entry
                                                            ; - java.security.Signature::getInstance at -1 (line 292)
  0x00007f5beff32afa:   mov    %rdx,(%rsp)
  0x00007f5beff32afe:   mov    %rsi,0x8(%rsp)
  0x00007f5beff32b03:   mov    0x10(%rsi),%r11d             ; implicit exception: dispatches to 0x00007f5beff32cb8
                                                            ;*getfield impl {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature::getInstance at 1 (line 292)
 ;; B2: #	out( B11 B3 ) <- in( B1 )  Freq: 0.999999
  0x00007f5beff32b07:   mov    0x8(%r12,%r11,8),%r10d       ; implicit exception: dispatches to 0x00007f5beff32ce0
 ;; B3: #	out( B9 B4 ) <- in( B2 )  Freq: 0.999998
  0x00007f5beff32b0c:   cmp    $0x1001240,%r10d             ;   {metadata('Main$MyProvider$MySignature')}
  0x00007f5beff32b13:   jne    0x00007f5beff32c85
 ;; B4: #	out( B7 B5 ) <- in( B3 )  Freq: 0.999998
  0x00007f5beff32b19:   lea    (%r12,%r11,8),%rbp           ;*instanceof {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature::getInstance at 4 (line 292)
  0x00007f5beff32b1d:   mov    0x1d0(%r15),%rax
  0x00007f5beff32b24:   mov    %rax,%r10
  0x00007f5beff32b27:   add    $0x30,%r10
  0x00007f5beff32b2b:   cmp    0x1e0(%r15),%r10
  0x00007f5beff32b32:   jae    0x00007f5beff32c69
 ;; B5: #	out( B6 ) <- in( B4 )  Freq: 0.999898
  0x00007f5beff32b38:   mov    %r10,0x1d0(%r15)
  0x00007f5beff32b3f:   prefetchw 0xc0(%r10)
  0x00007f5beff32b47:   movq   $0x1,(%rax)
  0x00007f5beff32b4e:   movl   $0x104c058,0x8(%rax)         ;   {metadata('java/security/Signature$Delegate')}
  0x00007f5beff32b55:   mov    %r12,0xc(%rax)
  0x00007f5beff32b59:   mov    %r12d,0x18(%rax)
  0x00007f5beff32b5d:   mov    %r12,0x20(%rax)
  0x00007f5beff32b61:   mov    %r12,0x28(%rax)              ;*new {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature$Delegate::of at 17 (line 1123)
                                                            ; - java.security.Signature::getInstance at 36 (line 297)
 ;; B6: #	out( N1 ) <- in( B8 B5 )  Freq: 0.999998
  0x00007f5beff32b65:   cmp    0x13698d64(%rip),%r12        # 0x00007f5c035cb8d0
                                                            ;   {external_word}
  0x00007f5beff32b6c:   je     0x00007f5beff32b86
 ;; MacroAssembler::encode_heap_oop_not_null2: heap base corrupted?
  0x00007f5beff32b72:   movabs $0x7f5c02a3edc0,%rdi         ;   {external_word}
  0x00007f5beff32b7c:   and    $0xfffffffffffffff0,%rsp
  0x00007f5beff32b80:   callq  0x00007f5c01c6e0a6           ;   {runtime_call MacroAssembler::debug64(char*, long, long*)}
  0x00007f5beff32b85:   hlt    
  0x00007f5beff32b86:   test   %rbp,%rbp
  0x00007f5beff32b89:   jne    0x00007f5beff32ba3
 ;; null oop passed to encode_heap_oop_not_null2
  0x00007f5beff32b8f:   movabs $0x7f5c02a3ee00,%rdi         ;   {external_word}
  0x00007f5beff32b99:   and    $0xfffffffffffffff0,%rsp
  0x00007f5beff32b9d:   callq  0x00007f5c01c6e0a6           ;   {runtime_call MacroAssembler::debug64(char*, long, long*)}
  0x00007f5beff32ba2:   hlt    
  0x00007f5beff32ba3:   mov    %rbp,%r11
  0x00007f5beff32ba6:   shr    $0x3,%r11                    ;*putfield sigSpi {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature$Delegate::<init>@7 (line 1130)
                                                            ; - java.security.Signature$Delegate::of at 23 (line 1123)
                                                            ; - java.security.Signature::getInstance at 36 (line 297)
  0x00007f5beff32baa:   mov    (%rsp),%r10
  0x00007f5beff32bae:   mov    %r10,%r8
  0x00007f5beff32bb1:   cmp    0x13698d18(%rip),%r12        # 0x00007f5c035cb8d0
                                                            ;   {external_word}
  0x00007f5beff32bb8:   je     0x00007f5beff32bd2
 ;; MacroAssembler::encode_heap_oop: heap base corrupted?
  0x00007f5beff32bbe:   movabs $0x7f5c02a3ec58,%rdi         ;   {external_word}
  0x00007f5beff32bc8:   and    $0xfffffffffffffff0,%rsp
  0x00007f5beff32bcc:   callq  0x00007f5c01c6e0a6           ;   {runtime_call MacroAssembler::debug64(char*, long, long*)}
  0x00007f5beff32bd1:   hlt    
  0x00007f5beff32bd2:   shr    $0x3,%r8
  0x00007f5beff32bd6:   mov    %r8d,0x14(%rax)              ;*putfield algorithm {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature::<init>@11 (line 203)
                                                            ; - java.security.Signature$Delegate::<init>@2 (line 1129)
                                                            ; - java.security.Signature$Delegate::of at 23 (line 1123)
                                                            ; - java.security.Signature::getInstance at 36 (line 297)
  0x00007f5beff32bda:   mov    %r11d,0x1c(%rax)             ;*synchronization entry
                                                            ; - java.security.Signature$Delegate::<init>@-1 (line 1129)
                                                            ; - java.security.Signature$Delegate::of at 23 (line 1123)
                                                            ; - java.security.Signature::getInstance at 36 (line 297)
  0x00007f5beff32bde:   mov    0x8(%rsp),%r10
  0x00007f5beff32be3:   mov    0xc(%r10),%r11d
  0x00007f5beff32be7:   lea    0x18(%rax),%r8
  0x00007f5beff32beb:   cmpb   $0x0,0x48(%r15)
  0x00007f5beff32bf0:   jne    0x00007f5beff32d19
  0x00007f5beff32bf6:   mov    %r11d,(%r8)
  0x00007f5beff32bf9:   mov    %r11d,%r9d
  0x00007f5beff32bfc:   cmp    0x13698ccd(%rip),%r12        # 0x00007f5c035cb8d0
                                                            ;   {external_word}
  0x00007f5beff32c03:   je     0x00007f5beff32c1d
 ;; MacroAssembler::decode_heap_oop: heap base corrupted?
  0x00007f5beff32c09:   movabs $0x7f5c02a3ee70,%rdi         ;   {external_word}
  0x00007f5beff32c13:   and    $0xfffffffffffffff0,%rsp
  0x00007f5beff32c17:   callq  0x00007f5c01c6e0a6           ;   {runtime_call MacroAssembler::debug64(char*, long, long*)}
  0x00007f5beff32c1c:   hlt    
  0x00007f5beff32c1d:   shl    $0x3,%r9
  0x00007f5beff32c21:   mov    %r8,%r10
  0x00007f5beff32c24:   xor    %r9,%r10
  0x00007f5beff32c27:   shr    $0x16,%r10
  0x00007f5beff32c2b:   je     0x00007f5beff32c59
  0x00007f5beff32c31:   cmp    $0x0,%r9
  0x00007f5beff32c35:   je     0x00007f5beff32c59
  0x00007f5beff32c3b:   mov    %r8,%r10
  0x00007f5beff32c3e:   shr    $0x9,%r10
  0x00007f5beff32c42:   movabs $0x7f5bea962000,%r9
  0x00007f5beff32c4c:   add    %r9,%r10
  0x00007f5beff32c4f:   cmpb   $0x2,(%r10)
  0x00007f5beff32c53:   jne    0x00007f5beff32da5           ;*putfield provider {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature::getInstance at 45 (line 299)
  0x00007f5beff32c59:   add    $0x20,%rsp
  0x00007f5beff32c5d:   pop    %rbp
  0x00007f5beff32c5e:   cmp    0x28(%r15),%rsp              ;   {poll_return}
  0x00007f5beff32c62:   ja     0x00007f5beff32dff
  0x00007f5beff32c68:   retq   
 ;; B7: #	out( B12 B8 ) <- in( B4 )  Freq: 0.000100016
  0x00007f5beff32c69:   movabs $0x7f5b8704c058,%rsi         ;   {metadata('java/security/Signature$Delegate')}
  0x00007f5beff32c73:   callq  0x00007f5befe334e0           ; ImmutableOopMap {rbp=Oop [0]=Oop [8]=Oop }
                                                            ;*new {reexecute=0 rethrow=0 return_oop=1}
                                                            ; - java.security.Signature$Delegate::of at 17 (line 1123)
                                                            ; - java.security.Signature::getInstance at 36 (line 297)
                                                            ;   {runtime_call C2 Runtime new_instance}
  0x00007f5beff32c78:   nopl   0x2f0(%rax,%rax,1)           ;*new {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature$Delegate::of at 17 (line 1123)
                                                            ; - java.security.Signature::getInstance at 36 (line 297)
                                                            ;   {post_call_nop}
 ;; B8: #	out( B6 ) <- in( B7 )  Freq: 0.000100014
  0x00007f5beff32c80:   jmpq   0x00007f5beff32b65
 ;; B9: #	out( N1 ) <- in( B3 )  Freq: 1e-35
  0x00007f5beff32c85:   mov    $0xffffffde,%esi
  0x00007f5beff32c8a:   mov    0x8(%rsp),%rbp
  0x00007f5beff32c8f:   mov    %r11d,0x8(%rsp)
  0x00007f5beff32c94:   nop
  0x00007f5beff32c95:   nop
  0x00007f5beff32c96:   nop
  0x00007f5beff32c97:   callq  0x00007f5beff12f60           ; ImmutableOopMap {rbp=Oop [0]=Oop [8]=NarrowOop }
                                                            ;*instanceof {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature::getInstance at 4 (line 292)
                                                            ;   {runtime_call UncommonTrapBlob}
  0x00007f5beff32c9c:   nopl   0x1000314(%rax,%rax,1)       ;   {post_call_nop}
  0x00007f5beff32ca4:   movabs $0x7f5c027fa178,%rdi         ;   {external_word}
  0x00007f5beff32cae:   and    $0xfffffffffffffff0,%rsp
  0x00007f5beff32cb2:   callq  0x00007f5c01c6e0a6           ;   {runtime_call MacroAssembler::debug64(char*, long, long*)}
  0x00007f5beff32cb7:   hlt                                 ;*instanceof {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature::getInstance at 4 (line 292)
 ;; B10: #	out( N1 ) <- in( B1 )  Freq: 1.01328e-06
  0x00007f5beff32cb8:   mov    $0xfffffff6,%esi
  0x00007f5beff32cbd:   nop
  0x00007f5beff32cbe:   nop
  0x00007f5beff32cbf:   callq  0x00007f5beff12f60           ; ImmutableOopMap {}
                                                            ;*getfield impl {reexecute=1 rethrow=0 return_oop=0}
                                                            ; - (reexecute) java.security.Signature::getInstance at 1 (line 292)
                                                            ;   {runtime_call UncommonTrapBlob}
  0x00007f5beff32cc4:   nopl   0x200033c(%rax,%rax,1)       ;   {post_call_nop}
  0x00007f5beff32ccc:   movabs $0x7f5c027fa178,%rdi         ;   {external_word}
  0x00007f5beff32cd6:   and    $0xfffffffffffffff0,%rsp
  0x00007f5beff32cda:   callq  0x00007f5c01c6e0a6           ;   {runtime_call MacroAssembler::debug64(char*, long, long*)}
  0x00007f5beff32cdf:   hlt                                 ;*getfield impl {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature::getInstance at 1 (line 292)
 ;; B11: #	out( N1 ) <- in( B2 )  Freq: 1.01328e-06
  0x00007f5beff32ce0:   mov    $0xfffffff4,%esi
  0x00007f5beff32ce5:   mov    0x8(%rsp),%rbp
  0x00007f5beff32cea:   nop
  0x00007f5beff32ceb:   callq  0x00007f5beff12f60           ; ImmutableOopMap {rbp=Oop [0]=Oop }
                                                            ;*instanceof {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature::getInstance at 4 (line 292)
                                                            ;   {runtime_call UncommonTrapBlob}
  0x00007f5beff32cf0:   nopl   0x3000368(%rax,%rax,1)       ;   {post_call_nop}
  0x00007f5beff32cf8:   movabs $0x7f5c027fa178,%rdi         ;   {external_word}
  0x00007f5beff32d02:   and    $0xfffffffffffffff0,%rsp
  0x00007f5beff32d06:   callq  0x00007f5c01c6e0a6           ;   {runtime_call MacroAssembler::debug64(char*, long, long*)}
  0x00007f5beff32d0b:   hlt                                 ;*new {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature$Delegate::of at 17 (line 1123)
                                                            ; - java.security.Signature::getInstance at 36 (line 297)
 ;; B12: #	out( N1 ) <- in( B7 )  Freq: 1.00016e-09
  0x00007f5beff32d0c:   mov    %rax,%rsi
  0x00007f5beff32d0f:   add    $0x20,%rsp
  0x00007f5beff32d13:   pop    %rbp
  0x00007f5beff32d14:   jmpq   0x00007f5befe2c360           ;   {runtime_call C2 Runtime rethrow}
  0x00007f5beff32d19:   mov    (%r8),%r9d
  0x00007f5beff32d1c:   cmp    0x13698bad(%rip),%r12        # 0x00007f5c035cb8d0
                                                            ;   {external_word}
  0x00007f5beff32d23:   je     0x00007f5beff32d3d
 ;; MacroAssembler::decode_heap_oop: heap base corrupted?
  0x00007f5beff32d29:   movabs $0x7f5c02a3ee70,%rdi         ;   {external_word}
  0x00007f5beff32d33:   and    $0xfffffffffffffff0,%rsp
  0x00007f5beff32d37:   callq  0x00007f5c01c6e0a6           ;   {runtime_call MacroAssembler::debug64(char*, long, long*)}
  0x00007f5beff32d3c:   hlt    
  0x00007f5beff32d3d:   shl    $0x3,%r9
  0x00007f5beff32d41:   cmp    $0x0,%r9
  0x00007f5beff32d45:   je     0x00007f5beff32bf6
  0x00007f5beff32d4b:   mov    0x38(%r15),%r10
  0x00007f5beff32d4f:   test   %r10,%r10
  0x00007f5beff32d52:   je     0x00007f5beff32d6c
  0x00007f5beff32d58:   sub    $0x8,%r10
  0x00007f5beff32d5c:   mov    %r10,0x38(%r15)
  0x00007f5beff32d60:   add    0x40(%r15),%r10
  0x00007f5beff32d64:   mov    %r9,(%r10)
  0x00007f5beff32d67:   jmpq   0x00007f5beff32bf6
  0x00007f5beff32d6c:   sub    $0x20,%rsp
  0x00007f5beff32d70:   mov    %r11,0x18(%rsp)
  0x00007f5beff32d75:   mov    %r8,0x10(%rsp)
  0x00007f5beff32d7a:   mov    %rax,0x8(%rsp)
  0x00007f5beff32d7f:   mov    %r9,%rdi
  0x00007f5beff32d82:   mov    %r15,%rsi
  0x00007f5beff32d85:   callq  0x00007f5c016dec90           ;   {runtime_call G1BarrierSetRuntime::write_ref_field_pre_entry(oopDesc*, JavaThread*)}
  0x00007f5beff32d8a:   mov    0x8(%rsp),%rax
  0x00007f5beff32d8f:   mov    0x10(%rsp),%r8
  0x00007f5beff32d94:   mov    0x18(%rsp),%r11
  0x00007f5beff32d99:   vzeroupper 
  0x00007f5beff32d9c:   add    $0x20,%rsp
  0x00007f5beff32da0:   jmpq   0x00007f5beff32bf6
  0x00007f5beff32da5:   lock addl $0x0,-0x40(%rsp)
  0x00007f5beff32dab:   cmpb   $0x0,(%r10)
  0x00007f5beff32daf:   je     0x00007f5beff32c59
  0x00007f5beff32db5:   movb   $0x0,(%r10)
  0x00007f5beff32db9:   mov    0x50(%r15),%r9
  0x00007f5beff32dbd:   test   %r9,%r9
  0x00007f5beff32dc0:   je     0x00007f5beff32dda
  0x00007f5beff32dc6:   sub    $0x8,%r9
  0x00007f5beff32dca:   mov    %r9,0x50(%r15)
  0x00007f5beff32dce:   add    0x58(%r15),%r9
  0x00007f5beff32dd2:   mov    %r10,(%r9)
  0x00007f5beff32dd5:   jmpq   0x00007f5beff32c59
  0x00007f5beff32dda:   sub    $0x10,%rsp
  0x00007f5beff32dde:   mov    %rax,0x8(%rsp)
  0x00007f5beff32de3:   mov    %r10,%rdi
  0x00007f5beff32de6:   mov    %r15,%rsi
  0x00007f5beff32de9:   callq  0x00007f5c016dee14           ;   {runtime_call G1BarrierSetRuntime::write_ref_field_post_entry(unsigned char volatile*, JavaThread*)}
  0x00007f5beff32dee:   mov    0x8(%rsp),%rax
  0x00007f5beff32df3:   vzeroupper 
  0x00007f5beff32df6:   add    $0x10,%rsp
  0x00007f5beff32dfa:   jmpq   0x00007f5beff32c59
  0x00007f5beff32dff:   movabs $0x7f5beff32c5e,%r10         ;   {internal_word}
  0x00007f5beff32e09:   mov    %r10,0x498(%r15)
  0x00007f5beff32e10:   jmpq   0x00007f5beff13e60           ;   {runtime_call SafepointBlob}
  0x00007f5beff32e15:   callq  Stub::nmethod_entry_barrier  ;   {runtime_call StubRoutines (final stubs)}
  0x00007f5beff32e1a:   jmpq   0x00007f5beff32afa
  0x00007f5beff32e1f:   hlt    
[Exception Handler]
  0x00007f5beff32e20:   jmpq   0x00007f5befe331e0           ;   {no_reloc}
[Deopt Handler Code]
  0x00007f5beff32e25:   callq  0x00007f5beff32e2a
  0x00007f5beff32e2a:   subq   $0x5,(%rsp)
  0x00007f5beff32e2f:   jmpq   0x00007f5beff13320           ;   {runtime_call DeoptimizationBlob}
  0x00007f5beff32e34:   hlt    
  0x00007f5beff32e35:   hlt    
  0x00007f5beff32e36:   hlt    
  0x00007f5beff32e37:   hlt    
--------------------------------------------------------------------------------
[/Disassembly]
-------------- next part --------------
--------------------------------------------------------------------------------
----------------------------------- Assembly -----------------------------------

Compiled method (c2) 889   14             java.security.Signature::getInstance (50 bytes)
 total in heap  [0x00007f87b0737988,0x00007f87b0737e98] = 1296
 relocation     [0x00007f87b0737a70,0x00007f87b0737ae0] = 112
 main code      [0x00007f87b0737ae0,0x00007f87b0737e20] = 832
 stub code      [0x00007f87b0737e20,0x00007f87b0737e38] = 24
 oops           [0x00007f87b0737e38,0x00007f87b0737e40] = 8
 metadata       [0x00007f87b0737e40,0x00007f87b0737e98] = 88
 immutable data [0x00007f871c27c970,0x00007f871c27cb68] = 504
 dependencies   [0x00007f871c27c970,0x00007f871c27c988] = 24
 nul chk table  [0x00007f871c27c988,0x00007f871c27c9a0] = 24
 handler table  [0x00007f871c27c9a0,0x00007f871c27c9b8] = 24
 scopes pcs     [0x00007f871c27c9b8,0x00007f871c27cad8] = 288
 scopes data    [0x00007f871c27cad8,0x00007f871c27cb68] = 144

[Disassembly]
--------------------------------------------------------------------------------
[Constant Pool (empty)]

--------------------------------------------------------------------------------

[Verified Entry Point]
  # {method} {0x00007f873c09a688} 'getInstance' '(Lsun/security/jca/GetInstance$Instance;Ljava/lang/String;)Ljava/security/Signature;' in 'java/security/Signature'
  # parm0:    rsi:rsi   = 'sun/security/jca/GetInstance$Instance'
  # parm1:    rdx:rdx   = 'java/lang/String'
  #           [sp+0x30]  (sp of caller)
 ;; N1: #	out( B1 ) <- in( B10 B11 B9 B12 B6 )  Freq: 1
 ;; B1: #	out( B10 B2 ) <- BLOCK HEAD IS JUNK  Freq: 1
  0x00007f87b0737ae0:   mov    %eax,-0x18000(%rsp)
  0x00007f87b0737ae7:   push   %rbp
  0x00007f87b0737ae8:   sub    $0x20,%rsp
  0x00007f87b0737aec:   cmpl   $0x0,0x20(%r15)
  0x00007f87b0737af4:   jne    0x00007f87b0737e15           ;*synchronization entry
                                                            ; - java.security.Signature::getInstance at -1 (line 292)
  0x00007f87b0737afa:   mov    %rdx,(%rsp)
  0x00007f87b0737afe:   mov    %rsi,0x8(%rsp)
  0x00007f87b0737b03:   mov    0x10(%rsi),%r11d             ; implicit exception: dispatches to 0x00007f87b0737cb8
                                                            ;*getfield impl {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature::getInstance at 1 (line 292)
 ;; B2: #	out( B11 B3 ) <- in( B1 )  Freq: 0.999999
  0x00007f87b0737b07:   mov    0x8(%r12,%r11,8),%r10d       ; implicit exception: dispatches to 0x00007f87b0737ce0
 ;; B3: #	out( B9 B4 ) <- in( B2 )  Freq: 0.999998
  0x00007f87b0737b0c:   cmp    $0x1001240,%r10d             ;   {metadata('Main$MyProvider$MySignature')}
  0x00007f87b0737b13:   jne    0x00007f87b0737c85
 ;; B4: #	out( B7 B5 ) <- in( B3 )  Freq: 0.999998
  0x00007f87b0737b19:   lea    (%r12,%r11,8),%rbp           ;*instanceof {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature::getInstance at 4 (line 292)
  0x00007f87b0737b1d:   mov    0x1d0(%r15),%rax
  0x00007f87b0737b24:   mov    %rax,%r10
  0x00007f87b0737b27:   add    $0x30,%r10
  0x00007f87b0737b2b:   cmp    0x1e0(%r15),%r10
  0x00007f87b0737b32:   jae    0x00007f87b0737c69
 ;; B5: #	out( B6 ) <- in( B4 )  Freq: 0.999898
  0x00007f87b0737b38:   mov    %r10,0x1d0(%r15)
  0x00007f87b0737b3f:   prefetchw 0xc0(%r10)
  0x00007f87b0737b47:   movq   $0x1,(%rax)
  0x00007f87b0737b4e:   movl   $0x104c058,0x8(%rax)         ;   {metadata('java/security/Signature$Delegate')}
  0x00007f87b0737b55:   mov    %r12,0xc(%rax)
  0x00007f87b0737b59:   mov    %r12d,0x18(%rax)
  0x00007f87b0737b5d:   mov    %r12,0x20(%rax)
  0x00007f87b0737b61:   mov    %r12,0x28(%rax)              ;*new {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature$Delegate::of at 17 (line 1123)
                                                            ; - java.security.Signature::getInstance at 36 (line 297)
 ;; B6: #	out( N1 ) <- in( B8 B5 )  Freq: 0.999998
  0x00007f87b0737b65:   cmp    0x15428d64(%rip),%r12        # 0x00007f87c5b608d0
                                                            ;   {external_word}
  0x00007f87b0737b6c:   je     0x00007f87b0737b86
 ;; MacroAssembler::encode_heap_oop_not_null2: heap base corrupted?
  0x00007f87b0737b72:   movabs $0x7f87c4fd3dc0,%rdi         ;   {external_word}
  0x00007f87b0737b7c:   and    $0xfffffffffffffff0,%rsp
  0x00007f87b0737b80:   callq  0x00007f87c42030a6           ;   {runtime_call MacroAssembler::debug64(char*, long, long*)}
  0x00007f87b0737b85:   hlt    
  0x00007f87b0737b86:   test   %rbp,%rbp
  0x00007f87b0737b89:   jne    0x00007f87b0737ba3
 ;; null oop passed to encode_heap_oop_not_null2
  0x00007f87b0737b8f:   movabs $0x7f87c4fd3e00,%rdi         ;   {external_word}
  0x00007f87b0737b99:   and    $0xfffffffffffffff0,%rsp
  0x00007f87b0737b9d:   callq  0x00007f87c42030a6           ;   {runtime_call MacroAssembler::debug64(char*, long, long*)}
  0x00007f87b0737ba2:   hlt    
  0x00007f87b0737ba3:   mov    %rbp,%r11
  0x00007f87b0737ba6:   shr    $0x3,%r11                    ;*putfield sigSpi {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature$Delegate::<init>@7 (line 1130)
                                                            ; - java.security.Signature$Delegate::of at 23 (line 1123)
                                                            ; - java.security.Signature::getInstance at 36 (line 297)
  0x00007f87b0737baa:   mov    (%rsp),%r10
  0x00007f87b0737bae:   mov    %r10,%r8
  0x00007f87b0737bb1:   cmp    0x15428d18(%rip),%r12        # 0x00007f87c5b608d0
                                                            ;   {external_word}
  0x00007f87b0737bb8:   je     0x00007f87b0737bd2
 ;; MacroAssembler::encode_heap_oop: heap base corrupted?
  0x00007f87b0737bbe:   movabs $0x7f87c4fd3c58,%rdi         ;   {external_word}
  0x00007f87b0737bc8:   and    $0xfffffffffffffff0,%rsp
  0x00007f87b0737bcc:   callq  0x00007f87c42030a6           ;   {runtime_call MacroAssembler::debug64(char*, long, long*)}
  0x00007f87b0737bd1:   hlt    
  0x00007f87b0737bd2:   shr    $0x3,%r8
  0x00007f87b0737bd6:   mov    %r8d,0x14(%rax)              ;*putfield algorithm {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature::<init>@11 (line 203)
                                                            ; - java.security.Signature$Delegate::<init>@2 (line 1129)
                                                            ; - java.security.Signature$Delegate::of at 23 (line 1123)
                                                            ; - java.security.Signature::getInstance at 36 (line 297)
  0x00007f87b0737bda:   mov    %r11d,0x1c(%rax)             ;*synchronization entry
                                                            ; - java.security.Signature$Delegate::<init>@-1 (line 1129)
                                                            ; - java.security.Signature$Delegate::of at 23 (line 1123)
                                                            ; - java.security.Signature::getInstance at 36 (line 297)
  0x00007f87b0737bde:   mov    0x8(%rsp),%r10
  0x00007f87b0737be3:   mov    0xc(%r10),%r11d
  0x00007f87b0737be7:   lea    0x18(%rax),%r8
  0x00007f87b0737beb:   cmpb   $0x0,0x48(%r15)
  0x00007f87b0737bf0:   jne    0x00007f87b0737d19
  0x00007f87b0737bf6:   mov    %r11d,(%r8)
  0x00007f87b0737bf9:   mov    %r11d,%r9d
  0x00007f87b0737bfc:   cmp    0x15428ccd(%rip),%r12        # 0x00007f87c5b608d0
                                                            ;   {external_word}
  0x00007f87b0737c03:   je     0x00007f87b0737c1d
 ;; MacroAssembler::decode_heap_oop: heap base corrupted?
  0x00007f87b0737c09:   movabs $0x7f87c4fd3e70,%rdi         ;   {external_word}
  0x00007f87b0737c13:   and    $0xfffffffffffffff0,%rsp
  0x00007f87b0737c17:   callq  0x00007f87c42030a6           ;   {runtime_call MacroAssembler::debug64(char*, long, long*)}
  0x00007f87b0737c1c:   hlt    
  0x00007f87b0737c1d:   shl    $0x3,%r9
  0x00007f87b0737c21:   mov    %r8,%r10
  0x00007f87b0737c24:   xor    %r9,%r10
  0x00007f87b0737c27:   shr    $0x16,%r10
  0x00007f87b0737c2b:   je     0x00007f87b0737c59
  0x00007f87b0737c31:   cmp    $0x0,%r9
  0x00007f87b0737c35:   je     0x00007f87b0737c59
  0x00007f87b0737c3b:   mov    %r8,%r10
  0x00007f87b0737c3e:   shr    $0x9,%r10
  0x00007f87b0737c42:   movabs $0x7f87ac5fa000,%r9
  0x00007f87b0737c4c:   add    %r9,%r10
  0x00007f87b0737c4f:   cmpb   $0x2,(%r10)
  0x00007f87b0737c53:   jne    0x00007f87b0737da5           ;*putfield provider {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature::getInstance at 45 (line 299)
  0x00007f87b0737c59:   add    $0x20,%rsp
  0x00007f87b0737c5d:   pop    %rbp
  0x00007f87b0737c5e:   cmp    0x28(%r15),%rsp              ;   {poll_return}
  0x00007f87b0737c62:   ja     0x00007f87b0737dff
  0x00007f87b0737c68:   retq   
 ;; B7: #	out( B12 B8 ) <- in( B4 )  Freq: 0.000100016
  0x00007f87b0737c69:   movabs $0x7f874f04c058,%rsi         ;   {metadata('java/security/Signature$Delegate')}
  0x00007f87b0737c73:   callq  0x00007f87b06384e0           ; ImmutableOopMap {rbp=Oop [0]=Oop [8]=Oop }
                                                            ;*new {reexecute=0 rethrow=0 return_oop=1}
                                                            ; - java.security.Signature$Delegate::of at 17 (line 1123)
                                                            ; - java.security.Signature::getInstance at 36 (line 297)
                                                            ;   {runtime_call C2 Runtime new_instance}
  0x00007f87b0737c78:   nopl   0x2f0(%rax,%rax,1)           ;*new {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature$Delegate::of at 17 (line 1123)
                                                            ; - java.security.Signature::getInstance at 36 (line 297)
                                                            ;   {post_call_nop}
 ;; B8: #	out( B6 ) <- in( B7 )  Freq: 0.000100014
  0x00007f87b0737c80:   jmpq   0x00007f87b0737b65
 ;; B9: #	out( N1 ) <- in( B3 )  Freq: 1e-35
  0x00007f87b0737c85:   mov    $0xffffffde,%esi
  0x00007f87b0737c8a:   mov    0x8(%rsp),%rbp
  0x00007f87b0737c8f:   mov    %r11d,0x8(%rsp)
  0x00007f87b0737c94:   nop
  0x00007f87b0737c95:   nop
  0x00007f87b0737c96:   nop
  0x00007f87b0737c97:   callq  0x00007f87b0717f60           ; ImmutableOopMap {rbp=Oop [0]=Oop [8]=NarrowOop }
                                                            ;*instanceof {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature::getInstance at 4 (line 292)
                                                            ;   {runtime_call UncommonTrapBlob}
  0x00007f87b0737c9c:   nopl   0x1000314(%rax,%rax,1)       ;   {post_call_nop}
  0x00007f87b0737ca4:   movabs $0x7f87c4d8f178,%rdi         ;   {external_word}
  0x00007f87b0737cae:   and    $0xfffffffffffffff0,%rsp
  0x00007f87b0737cb2:   callq  0x00007f87c42030a6           ;   {runtime_call MacroAssembler::debug64(char*, long, long*)}
  0x00007f87b0737cb7:   hlt                                 ;*instanceof {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature::getInstance at 4 (line 292)
 ;; B10: #	out( N1 ) <- in( B1 )  Freq: 1.01328e-06
  0x00007f87b0737cb8:   mov    $0xfffffff6,%esi
  0x00007f87b0737cbd:   nop
  0x00007f87b0737cbe:   nop
  0x00007f87b0737cbf:   callq  0x00007f87b0717f60           ; ImmutableOopMap {}
                                                            ;*getfield impl {reexecute=1 rethrow=0 return_oop=0}
                                                            ; - (reexecute) java.security.Signature::getInstance at 1 (line 292)
                                                            ;   {runtime_call UncommonTrapBlob}
  0x00007f87b0737cc4:   nopl   0x200033c(%rax,%rax,1)       ;   {post_call_nop}
  0x00007f87b0737ccc:   movabs $0x7f87c4d8f178,%rdi         ;   {external_word}
  0x00007f87b0737cd6:   and    $0xfffffffffffffff0,%rsp
  0x00007f87b0737cda:   callq  0x00007f87c42030a6           ;   {runtime_call MacroAssembler::debug64(char*, long, long*)}
  0x00007f87b0737cdf:   hlt                                 ;*getfield impl {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature::getInstance at 1 (line 292)
 ;; B11: #	out( N1 ) <- in( B2 )  Freq: 1.01328e-06
  0x00007f87b0737ce0:   mov    $0xfffffff4,%esi
  0x00007f87b0737ce5:   mov    0x8(%rsp),%rbp
  0x00007f87b0737cea:   nop
  0x00007f87b0737ceb:   callq  0x00007f87b0717f60           ; ImmutableOopMap {rbp=Oop [0]=Oop }
                                                            ;*instanceof {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature::getInstance at 4 (line 292)
                                                            ;   {runtime_call UncommonTrapBlob}
  0x00007f87b0737cf0:   nopl   0x3000368(%rax,%rax,1)       ;   {post_call_nop}
  0x00007f87b0737cf8:   movabs $0x7f87c4d8f178,%rdi         ;   {external_word}
  0x00007f87b0737d02:   and    $0xfffffffffffffff0,%rsp
  0x00007f87b0737d06:   callq  0x00007f87c42030a6           ;   {runtime_call MacroAssembler::debug64(char*, long, long*)}
  0x00007f87b0737d0b:   hlt                                 ;*new {reexecute=0 rethrow=0 return_oop=0}
                                                            ; - java.security.Signature$Delegate::of at 17 (line 1123)
                                                            ; - java.security.Signature::getInstance at 36 (line 297)
 ;; B12: #	out( N1 ) <- in( B7 )  Freq: 1.00016e-09
  0x00007f87b0737d0c:   mov    %rax,%rsi
  0x00007f87b0737d0f:   add    $0x20,%rsp
  0x00007f87b0737d13:   pop    %rbp
  0x00007f87b0737d14:   jmpq   0x00007f87b0631360           ;   {runtime_call C2 Runtime rethrow}
  0x00007f87b0737d19:   mov    (%r8),%r9d
  0x00007f87b0737d1c:   cmp    0x15428bad(%rip),%r12        # 0x00007f87c5b608d0
                                                            ;   {external_word}
  0x00007f87b0737d23:   je     0x00007f87b0737d3d
 ;; MacroAssembler::decode_heap_oop: heap base corrupted?
  0x00007f87b0737d29:   movabs $0x7f87c4fd3e70,%rdi         ;   {external_word}
  0x00007f87b0737d33:   and    $0xfffffffffffffff0,%rsp
  0x00007f87b0737d37:   callq  0x00007f87c42030a6           ;   {runtime_call MacroAssembler::debug64(char*, long, long*)}
  0x00007f87b0737d3c:   hlt    
  0x00007f87b0737d3d:   shl    $0x3,%r9
  0x00007f87b0737d41:   cmp    $0x0,%r9
  0x00007f87b0737d45:   je     0x00007f87b0737bf6
  0x00007f87b0737d4b:   mov    0x38(%r15),%r10
  0x00007f87b0737d4f:   test   %r10,%r10
  0x00007f87b0737d52:   je     0x00007f87b0737d6c
  0x00007f87b0737d58:   sub    $0x8,%r10
  0x00007f87b0737d5c:   mov    %r10,0x38(%r15)
  0x00007f87b0737d60:   add    0x40(%r15),%r10
  0x00007f87b0737d64:   mov    %r9,(%r10)
  0x00007f87b0737d67:   jmpq   0x00007f87b0737bf6
  0x00007f87b0737d6c:   sub    $0x20,%rsp
  0x00007f87b0737d70:   mov    %r11,0x18(%rsp)
  0x00007f87b0737d75:   mov    %r8,0x10(%rsp)
  0x00007f87b0737d7a:   mov    %rax,0x8(%rsp)
  0x00007f87b0737d7f:   mov    %r9,%rdi
  0x00007f87b0737d82:   mov    %r15,%rsi
  0x00007f87b0737d85:   callq  0x00007f87c3c73c90           ;   {runtime_call G1BarrierSetRuntime::write_ref_field_pre_entry(oopDesc*, JavaThread*)}
  0x00007f87b0737d8a:   mov    0x8(%rsp),%rax
  0x00007f87b0737d8f:   mov    0x10(%rsp),%r8
  0x00007f87b0737d94:   mov    0x18(%rsp),%r11
  0x00007f87b0737d99:   vzeroupper 
  0x00007f87b0737d9c:   add    $0x20,%rsp
  0x00007f87b0737da0:   jmpq   0x00007f87b0737bf6
  0x00007f87b0737da5:   lock addl $0x0,-0x40(%rsp)
  0x00007f87b0737dab:   cmpb   $0x0,(%r10)
  0x00007f87b0737daf:   je     0x00007f87b0737c59
  0x00007f87b0737db5:   movb   $0x0,(%r10)
  0x00007f87b0737db9:   mov    0x50(%r15),%r9
  0x00007f87b0737dbd:   test   %r9,%r9
  0x00007f87b0737dc0:   je     0x00007f87b0737dda
  0x00007f87b0737dc6:   sub    $0x8,%r9
  0x00007f87b0737dca:   mov    %r9,0x50(%r15)
  0x00007f87b0737dce:   add    0x58(%r15),%r9
  0x00007f87b0737dd2:   mov    %r10,(%r9)
  0x00007f87b0737dd5:   jmpq   0x00007f87b0737c59
  0x00007f87b0737dda:   sub    $0x10,%rsp
  0x00007f87b0737dde:   mov    %rax,0x8(%rsp)
  0x00007f87b0737de3:   mov    %r10,%rdi
  0x00007f87b0737de6:   mov    %r15,%rsi
  0x00007f87b0737de9:   callq  0x00007f87c3c73e14           ;   {runtime_call G1BarrierSetRuntime::write_ref_field_post_entry(unsigned char volatile*, JavaThread*)}
  0x00007f87b0737dee:   mov    0x8(%rsp),%rax
  0x00007f87b0737df3:   vzeroupper 
  0x00007f87b0737df6:   add    $0x10,%rsp
  0x00007f87b0737dfa:   jmpq   0x00007f87b0737c59
  0x00007f87b0737dff:   movabs $0x7f87b0737c5e,%r10         ;   {internal_word}
  0x00007f87b0737e09:   mov    %r10,0x498(%r15)
  0x00007f87b0737e10:   jmpq   0x00007f87b0718e60           ;   {runtime_call SafepointBlob}
  0x00007f87b0737e15:   callq  Stub::nmethod_entry_barrier  ;   {runtime_call StubRoutines (final stubs)}
  0x00007f87b0737e1a:   jmpq   0x00007f87b0737afa
  0x00007f87b0737e1f:   hlt    
[Exception Handler]
  0x00007f87b0737e20:   jmpq   0x00007f87b06381e0           ;   {no_reloc}
[Deopt Handler Code]
  0x00007f87b0737e25:   callq  0x00007f87b0737e2a
  0x00007f87b0737e2a:   subq   $0x5,(%rsp)
  0x00007f87b0737e2f:   jmpq   0x00007f87b0718320           ;   {runtime_call DeoptimizationBlob}
  0x00007f87b0737e34:   hlt    
  0x00007f87b0737e35:   hlt    
  0x00007f87b0737e36:   hlt    
  0x00007f87b0737e37:   hlt    
--------------------------------------------------------------------------------
[/Disassembly]


More information about the security-dev mailing list