8149141: Optimized build is broken
authorvlivanov
Mon, 15 Feb 2016 20:02:51 +0300
changeset 36073 1c0381cc1e1d
parent 36071 96ae0e7ed4fa
child 36074 11263906664c
8149141: Optimized build is broken Reviewed-by: kvn, kbarrett
hotspot/src/share/vm/gc/shared/memset_with_concurrent_readers.cpp
hotspot/src/share/vm/utilities/quickSort.cpp
--- a/hotspot/src/share/vm/gc/shared/memset_with_concurrent_readers.cpp	Mon Feb 15 13:26:44 2016 +0100
+++ b/hotspot/src/share/vm/gc/shared/memset_with_concurrent_readers.cpp	Mon Feb 15 20:02:51 2016 +0300
@@ -34,7 +34,7 @@
 #if INCLUDE_ALL_GCS
 
 // Unit test
-#ifdef ASSERT
+#ifndef PRODUCT
 
 static unsigned line_byte(const char* line, size_t i) {
   return unsigned(line[i]) & 0xFF;
--- a/hotspot/src/share/vm/utilities/quickSort.cpp	Mon Feb 15 13:26:44 2016 +0100
+++ b/hotspot/src/share/vm/utilities/quickSort.cpp	Mon Feb 15 20:02:51 2016 +0300
@@ -44,6 +44,31 @@
   }
   return 1;
 }
+
+static void print_array(const char* prefix, int* array, int length) {
+  tty->print("%s:", prefix);
+  for (int i = 0; i < length; i++) {
+    tty->print(" %d", array[i]);
+  }
+  tty->cr();
+}
+
+static bool compare_arrays(int* actual, int* expected, int length) {
+  for (int i = 0; i < length; i++) {
+    if (actual[i] != expected[i]) {
+      print_array("Sorted array  ", actual, length);
+      print_array("Expected array", expected, length);
+      return false;
+    }
+  }
+  return true;
+}
+
+template <class C>
+static bool sort_and_compare(int* arrayToSort, int* expectedResult, int length, C comparator, bool idempotent = false) {
+  QuickSort::sort<int, C>(arrayToSort, length, comparator, idempotent);
+  return compare_arrays(arrayToSort, expectedResult, length);
+}
 #endif // ASSERT
 
 static int test_even_odd_comparator(int a, int b) {
@@ -72,31 +97,6 @@
   }
 }
 
-static void print_array(const char* prefix, int* array, int length) {
-  tty->print("%s:", prefix);
-  for (int i = 0; i < length; i++) {
-    tty->print(" %d", array[i]);
-  }
-  tty->cr();
-}
-
-static bool compare_arrays(int* actual, int* expected, int length) {
-  for (int i = 0; i < length; i++) {
-    if (actual[i] != expected[i]) {
-      print_array("Sorted array  ", actual, length);
-      print_array("Expected array", expected, length);
-      return false;
-    }
-  }
-  return true;
-}
-
-template <class C>
-static bool sort_and_compare(int* arrayToSort, int* expectedResult, int length, C comparator, bool idempotent = false) {
-  QuickSort::sort<int, C>(arrayToSort, length, comparator, idempotent);
-  return compare_arrays(arrayToSort, expectedResult, length);
-}
-
 void QuickSort_test() {
   {
     int* test_array = NULL;