Skip to content

Commit

Permalink
Make Debug Info work with --gc=G1.
Browse files Browse the repository at this point in the history
In particular, when G1 is used together with `-H:-UseCompressedReferences`.
  • Loading branch information
fniephaus committed Jan 16, 2023
1 parent fe66a0d commit 058563c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,8 @@ public void installDebugInfo(DebugInfoProvider debugInfoProvider) {
*/
int oopTagsMask = debugInfoProvider.oopTagsMask();

/* Tag bits must be between 1 and 32 for us to emit as DW_OP_lit<n>. */
assert oopTagsMask > 0 && oopTagsMask < 32;
/* Tag bits must be between 0 and 32 for us to emit as DW_OP_lit<n>. */
assert oopTagsMask >= 0 && oopTagsMask < 32;
/* Mask must be contiguous from bit 0. */
assert ((oopTagsMask + 1) & oopTagsMask) == 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1687,7 +1687,7 @@ public int writeIndirectOopConversionExpression(boolean isHub, byte[] buffer, in
*
* The setting for option -H:+/-SpawnIsolates is determined by useHeapBase == true/false.
*
* The setting for option -H:+/-UseCompressedReferences is determined by oopShiftCount ==
* The setting for option -H:+/-UseCompressedReferences is determined by oopTagsShift ==
* zero/non-zero
*/

Expand Down Expand Up @@ -1760,10 +1760,13 @@ public int writeIndirectOopConversionExpression(boolean isHub, byte[] buffer, in
mask = dwarfSections.oopTagsMask();
exprSize += 3;
} else {
/* We need two shifts to remove the bits. */
rightShift = oopTagsShift;
/* We need one or two shifts to remove the bits. */
if (oopTagsShift != 0) { // -H:+UseCompressedReferences
rightShift = oopTagsShift;
exprSize += 2;
}
leftShift = oopCompressShift;
exprSize += 4;
exprSize += 2;
}
} else {
/* No flags to deal with, so we need either an uncompress or nothing. */
Expand Down

0 comments on commit 058563c

Please sign in to comment.