--- old/src/share/vm/oops/methodOop.cpp	2010-05-03 18:14:11.392030000 +0200
+++ new/src/share/vm/oops/methodOop.cpp	2010-05-03 18:14:11.068097000 +0200
@@ -1100,7 +1100,14 @@
 
 extern "C" {
   static int method_compare(methodOop* a, methodOop* b) {
-    return (*a)->name()->fast_compare((*b)->name());
+    if (UseCompressedOops) {
+      methodOop m = (methodOop)oopDesc::load_decode_heap_oop((narrowOop*)a);
+      methodOop n = (methodOop)oopDesc::load_decode_heap_oop((narrowOop*)b);
+      return m->name()->fast_compare(n->name());
+    }
+    else {
+      return (*a)->name()->fast_compare((*b)->name());
+    }
   }
 
   // Prevent qsort from reordering a previous valid sort by
@@ -1166,7 +1173,7 @@
 
     // Use a simple bubble sort for small number of methods since
     // qsort requires a functional pointer call for each comparison.
-    if (UseCompressedOops || length < 8) {
+    if (length < 8) {
       bool sorted = true;
       for (int i=length-1; i>0; i--) {
         for (int j=0; j<i; j++) {
@@ -1182,9 +1189,6 @@
           sorted = true;
       }
     } else {
-      // XXX This doesn't work for UseCompressedOops because the compare fn
-      // will have to decode the methodOop anyway making it not much faster
-      // than above.
       compareFn compare = (compareFn) (idempotent ? method_compare_idempotent : method_compare);
       qsort(methods->base(), length, heapOopSize, compare);
     }
