diff --git a/src/hotspot/share/classfile/fieldLayoutBuilder.hpp b/src/hotspot/share/classfile/fieldLayoutBuilder.hpp index 0a41fff509a42..e60552530e0a5 100644 --- a/src/hotspot/share/classfile/fieldLayoutBuilder.hpp +++ b/src/hotspot/share/classfile/fieldLayoutBuilder.hpp @@ -101,17 +101,11 @@ class LayoutRawBlock : public ResourceObj { // sort fields in decreasing order. // Note: with line types, the comparison should include alignment constraint if sizes are equals static int compare_size_inverted(LayoutRawBlock** x, LayoutRawBlock** y) { -#if defined (_WINDOWS) || defined (__APPLE__) - // qsort() on Windows/macOS reverse the order of fields with the same size - // the extension of the comparison function below preserves this order int diff = (*y)->size() - (*x)->size(); if (diff == 0) { diff = (*x)->field_index() - (*y)->field_index(); } return diff; -#else - return (*y)->size() - (*x)->size(); -#endif // _WINDOWS || __APPLE__ } }; diff --git a/test/hotspot/jtreg/runtime/FieldLayout/TestFieldLayout.java b/test/hotspot/jtreg/runtime/FieldLayout/TestFieldLayout.java index c44fef162d539..4066d6dd743d5 100644 --- a/test/hotspot/jtreg/runtime/FieldLayout/TestFieldLayout.java +++ b/test/hotspot/jtreg/runtime/FieldLayout/TestFieldLayout.java @@ -27,7 +27,7 @@ /* * @test * @bug 8341471 - * @summary [macOS_aarch64] Reversed field layout caused by unstable sorting + * @summary Reversed field layout caused by unstable sorting * @modules java.base/jdk.internal.misc * @run main/othervm TestFieldLayout */