Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GR-51491] Adapt to ICStubs removal. #8287

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

[GR-51491] Adapt to ICStubs removal. #8287

wants to merge 3 commits into from

Conversation

graalvmbot
Copy link
Collaborator

@graalvmbot graalvmbot commented Jan 31, 2024

This PR adapts to JDK-8322630 which removes the use of ICStubs from HotSpot.

AMD64

With ICStubs (ie., before JDK-8322630):

[Entry Point]
  # {method} {0x00007ffa1641ee10} 'isLatin1' '()Z' in 'java/lang/String'
  #           [sp+0x20]  (sp of caller)
  0x00007ffa8172f900:   mov    r10d,DWORD PTR [rsi+0x8]
  0x00007ffa8172f904:   movabs r12,0x7ffa16000000
  0x00007ffa8172f90e:   add    r10,r12
  0x00007ffa8172f911:   xor    r12,r12
  0x00007ffa8172f914:   cmp    rax,r10
  0x00007ffa8172f917:   jne    0x00007ffa8164e080           ;   {runtime_call ic_miss_stub}
  0x00007ffa8172f91d:   data16 xchg ax,ax
[Verified Entry Point]
  0x00007ffa8172f920:   mov    DWORD PTR [rsp-0x14000],eax

Without ICStubs (i.e., after JDK-8322630):

[Instructions begin]
  0x00007f40b572a380:   data16 data16 nop WORD PTR [rax+rax*1+0x0]
  0x00007f40b572a38b:   data16 data16 xchg ax,ax
  0x00007f40b572a38f:   data16 xchg ax,ax
[Entry Point]
  # {method} {0x00007f404241e630} 'isLatin1' '()Z' in 'java/lang/String'
  #           [sp+0x20]  (sp of caller)
  0x00007f40b572a392:   mov    r10d,DWORD PTR [rsi+0x8]
  0x00007f40b572a396:   cmp    r10d,DWORD PTR [rax+0x8]
  0x00007f40b572a39a:   jne    0x00007f40b564e080           ;   {runtime_call ic_miss_stub}
[Verified Entry Point]
  0x00007f40b572a3a0:   mov    DWORD PTR [rsp-0x14000],eax

AArch64

With ICStubs (ie., before JDK-8322630):

[Entry Point]
  # {method} {0x0000000148012f00} 'isLatin1' '()Z' in 'java/lang/String'
  #           [sp+0x20]  (sp of caller)
  0x000000010d39ce40:   ldr	x8, [x1, #8]                ;   {no_reloc}
  0x000000010d39ce44:   cmp	x9, x8
  0x000000010d39ce48:   b.eq	0x000000010d39ce80  // b.none
  0x000000010d39ce4c:   b	0x000000010d2d7e80          ;   {runtime_call ic_miss_stub}
  0x000000010d39ce50:   nop
  0x000000010d39ce54:   nop
  0x000000010d39ce58:   nop
  0x000000010d39ce5c:   nop
  0x000000010d39ce60:   nop
  0x000000010d39ce64:   nop
  0x000000010d39ce68:   nop
  0x000000010d39ce6c:   nop
  0x000000010d39ce70:   nop
  0x000000010d39ce74:   nop
  0x000000010d39ce78:   nop
  0x000000010d39ce7c:   nop
[Verified Entry Point]
  0x000000010d39ce80:   nop

Without ICStubs (i.e., after JDK-8322630):

[Instructions begin]
  0x000000010d72a740:   nop                                 ;   {no_reloc}
  0x000000010d72a744:   nop
  0x000000010d72a748:   nop
  0x000000010d72a74c:   nop
  0x000000010d72a750:   nop
  0x000000010d72a754:   nop
  0x000000010d72a758:   nop
  0x000000010d72a75c:   nop
  0x000000010d72a760:   nop
  0x000000010d72a764:   nop
  0x000000010d72a768:   nop
[Entry Point]
  # {method} {0x0000000128012f00} 'isLatin1' '()Z' in 'java/lang/String'
  #           [sp+0x30]  (sp of caller)
  0x000000010d72a76c:   ldr     x8, [x1, #8]
  0x000000010d72a770:   ldr     x10, [x9, #8]
  0x000000010d72a774:   cmp     x8, x10
  0x000000010d72a778:   b.eq    0x000000010d72a780  // b.none
  0x000000010d72a77c:   b       0x000000010d67be80          ;   {runtime_call ic_miss_stub}
[Verified Entry Point]
  0x000000010d72a780:   nop

Note that the above output comes from a run with -XX:-UseCompressedClassPointers.

@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 31, 2024
@fisk
Copy link
Member

fisk commented Jan 31, 2024

Hmm. In the generated code you show from before my change, I'm surprised that you seem to decode the receiver klass on AMD64 (which looks correct), but seemingly not decoding any compressed class pointer on AArch64, which to me seems a bit surprising. Why is that?

@dougxc
Copy link
Member

dougxc commented Jan 31, 2024

Hmm. In the generated code you show from before my change, I'm surprised that you seem to decode the receiver klass on AMD64 (which looks correct), but seemingly not decoding any compressed class pointer on AArch64, which to me seems a bit surprising. Why is that?

The output comes from a run with -XX:-UseCompressedClassPointers.

@fisk
Copy link
Member

fisk commented Jan 31, 2024

Hmm. In the generated code you show from before my change, I'm surprised that you seem to decode the receiver klass on AMD64 (which looks correct), but seemingly not decoding any compressed class pointer on AArch64, which to me seems a bit surprising. Why is that?

The output comes from a run with -XX:-UseCompressedClassPointers.

Okay good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants