src/share/vm/oops/methodOop.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
7090259 Cdiff src/share/vm/oops/methodOop.cpp
src/share/vm/oops/methodOop.cpp
Print this page
*** 1266,1281 ****
}
}
// Comparer for sorting an object array containing
// methodOops.
! template <class T>
! static int method_comparator(T a, T b) {
methodOop m = (methodOop)oopDesc::decode_heap_oop_not_null(a);
methodOop n = (methodOop)oopDesc::decode_heap_oop_not_null(b);
return m->name()->fast_compare(n->name());
}
// This is only done during class loading, so it is OK to assume method_idnum matches the methods() array
void methodOopDesc::sort_methods(objArrayOop methods,
objArrayOop methods_annotations,
objArrayOop methods_parameter_annotations,
--- 1266,1288 ----
}
}
// Comparer for sorting an object array containing
// methodOops.
! // Used non-template method_comparator methods since
! // Visual Studio 2003 compiler generates incorrect
! // optimized code for it.
! static int method_comparator_narrowOop(narrowOop a, narrowOop b) {
methodOop m = (methodOop)oopDesc::decode_heap_oop_not_null(a);
methodOop n = (methodOop)oopDesc::decode_heap_oop_not_null(b);
return m->name()->fast_compare(n->name());
}
+ static int method_comparator_oop(oop a, oop b) {
+ methodOop m = (methodOop)a;
+ methodOop n = (methodOop)b;
+ return m->name()->fast_compare(n->name());
+ }
// This is only done during class loading, so it is OK to assume method_idnum matches the methods() array
void methodOopDesc::sort_methods(objArrayOop methods,
objArrayOop methods_annotations,
objArrayOop methods_parameter_annotations,
*** 1297,1309 ****
}
}
{
No_Safepoint_Verifier nsv;
if (UseCompressedOops) {
! QuickSort::sort<narrowOop>((narrowOop*)(methods->base()), length, method_comparator<narrowOop>, idempotent);
} else {
! QuickSort::sort<oop>((oop*)(methods->base()), length, method_comparator<oop>, idempotent);
}
if (UseConcMarkSweepGC) {
// For CMS we need to dirty the cards for the array
BarrierSet* bs = Universe::heap()->barrier_set();
assert(bs->has_write_ref_array_opt(), "Barrier set must have ref array opt");
--- 1304,1316 ----
}
}
{
No_Safepoint_Verifier nsv;
if (UseCompressedOops) {
! QuickSort::sort<narrowOop>((narrowOop*)(methods->base()), length, method_comparator_narrowOop, idempotent);
} else {
! QuickSort::sort<oop>((oop*)(methods->base()), length, method_comparator_oop, idempotent);
}
if (UseConcMarkSweepGC) {
// For CMS we need to dirty the cards for the array
BarrierSet* bs = Universe::heap()->barrier_set();
assert(bs->has_write_ref_array_opt(), "Barrier set must have ref array opt");
src/share/vm/oops/methodOop.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File