Skip to content

CODETOOLS-7903075: JOL: Incorrect ClassLayout header/loss calculation for arrays #20

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

Merged
merged 1 commit into from
Dec 10, 2021

Conversation

shipilev
Copy link
Member

@shipilev shipilev commented Dec 10, 2021

See the bug report.


Progress

  • Change must not contain extraneous whitespace
  • Change must be properly reviewed

Issue

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jol pull/20/head:pull/20
$ git checkout pull/20

Update a local copy of the PR:
$ git checkout pull/20
$ git pull https://git.openjdk.java.net/jol pull/20/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 20

View PR using the GUI difftool:
$ git pr show -t 20

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jol/pull/20.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Dec 10, 2021

👋 Welcome back shade! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Dec 10, 2021
@mlbridge
Copy link

mlbridge bot commented Dec 10, 2021

Webrevs

Copy link
Member

@tstuefe tstuefe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know the code but seems fine. Patch works, alignment gap is correctly shown and accounted:

3-byte array, compressed class pointers on:

[B object internals:
OFF  SZ   TYPE DESCRIPTION               VALUE
  0   8        (object header: mark)     0x0000000000000001 (non-biasable; age: 0)
  8   4        (object header: class)    0x00006328
 12   4        (array length)            3
 16   3   byte [B.<elements>             N/A
 19   5        (object alignment gap)    
Instance size: 24 bytes
Space losses: 0 bytes internal + 5 bytes external = 5 bytes total

3-byte array, compressed class pointers off:

[B object internals:
OFF  SZ   TYPE DESCRIPTION               VALUE
  0   8        (object header: mark)     0x0000000000000001 (non-biasable; age: 0)
  8   8        (object header: class)    0x00007ffb3d8007e0
 16   4        (array length)            3
 20   4        (alignment/padding gap)
 24   3   byte [B.<elements>             N/A
 27   5        (object alignment gap)
Instance size: 32 bytes
Space losses: 4 bytes internal + 5 bytes external = 9 bytes total

@shipilev shipilev merged commit eb83245 into openjdk:master Dec 10, 2021
inponomarev added a commit to atp-mipt/jol that referenced this pull request Feb 14, 2022
highlight changing array elements
@shipilev shipilev deleted the array-gaps branch February 23, 2022 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rfr Pull request is ready for review
Development

Successfully merging this pull request may close these issues.

2 participants