Skip to content

Commit

Permalink
Add comments for if branch
Browse files Browse the repository at this point in the history
  • Loading branch information
fg1417 committed Oct 8, 2024
1 parent 3034f28 commit 32d8197
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/hotspot/share/classfile/fieldLayoutBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ class LayoutRawBlock : public ResourceObj {
// Note: with line types, the comparison should include alignment constraint if sizes are equals
static int compare_size_inverted(LayoutRawBlock** x, LayoutRawBlock** y) {
int diff = (*y)->size() - (*x)->size();
// qsort() may reverse the order of fields with the same size.
// The extension is to ensure stable sort.
if (diff == 0) {
diff = (*x)->field_index() - (*y)->field_index();
}
Expand Down

0 comments on commit 32d8197

Please sign in to comment.