7090259: Fix hotspot sources to build with old compilers
Fixed warnings which prevent building VM with old compilers. Reviewed-by: never
This commit is contained in:
parent
9b101c8ba6
commit
f99084037a
@ -148,6 +148,9 @@ endif
|
||||
# -DDONT_USE_PRECOMPILED_HEADER will exclude all includes in precompiled.hpp.
|
||||
CFLAGS += -DDONT_USE_PRECOMPILED_HEADER
|
||||
|
||||
# Compiler warnings are treated as errors
|
||||
CFLAGS_WARN = -xwe
|
||||
|
||||
################################################
|
||||
# Begin current (>=5.9) Forte compiler options #
|
||||
#################################################
|
||||
|
@ -2701,7 +2701,7 @@ void java_lang_invoke_CallSite::compute_offsets() {
|
||||
instanceKlass* ik = instanceKlass::cast(k);
|
||||
methodOop m_normal = ik->lookup_method(vmSymbols::setTargetNormal_name(), vmSymbols::setTarget_signature());
|
||||
methodOop m_volatile = ik->lookup_method(vmSymbols::setTargetVolatile_name(), vmSymbols::setTarget_signature());
|
||||
guarantee(m_normal && m_volatile, "must exist");
|
||||
guarantee(m_normal != NULL && m_volatile != NULL, "must exist");
|
||||
m_normal->set_not_compilable_quietly();
|
||||
m_volatile->set_not_compilable_quietly();
|
||||
}
|
||||
|
@ -45,7 +45,7 @@
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
static void specialized_oop_follow_contents(instanceRefKlass* ref, oop obj) {
|
||||
void specialized_oop_follow_contents(instanceRefKlass* ref, oop obj) {
|
||||
T* referent_addr = (T*)java_lang_ref_Reference::referent_addr(obj);
|
||||
T heap_oop = oopDesc::load_heap_oop(referent_addr);
|
||||
debug_only(
|
||||
@ -99,7 +99,7 @@ static void specialized_oop_follow_contents(instanceRefKlass* ref, oop obj) {
|
||||
oop discovered = java_lang_ref_Reference::discovered(obj);
|
||||
assert(oopDesc::is_null(next) || oopDesc::is_null(discovered),
|
||||
err_msg("Found an inactive reference " PTR_FORMAT " with a non-NULL discovered field",
|
||||
obj));
|
||||
(oopDesc*)obj));
|
||||
#endif
|
||||
}
|
||||
// treat next as normal oop. next is a link in the reference queue.
|
||||
@ -179,7 +179,7 @@ void specialized_oop_follow_contents(instanceRefKlass* ref,
|
||||
oop discovered = java_lang_ref_Reference::discovered(obj);
|
||||
assert(oopDesc::is_null(next) || oopDesc::is_null(discovered),
|
||||
err_msg("Found an inactive reference " PTR_FORMAT " with a non-NULL discovered field",
|
||||
obj));
|
||||
(oopDesc*)obj));
|
||||
#endif
|
||||
}
|
||||
PSParallelCompact::mark_and_push(cm, next_addr);
|
||||
@ -285,7 +285,7 @@ int instanceRefKlass::oop_adjust_pointers(oop obj) {
|
||||
T disc_oop = oopDesc::load_heap_oop(disc_addr); \
|
||||
assert(oopDesc::is_null(next_oop) || oopDesc::is_null(disc_oop), \
|
||||
err_msg("Found an inactive reference " PTR_FORMAT " with a non-NULL" \
|
||||
"discovered field", obj)); \
|
||||
"discovered field", (oopDesc*)obj)); \
|
||||
) \
|
||||
} \
|
||||
/* treat next as normal oop */ \
|
||||
@ -403,7 +403,7 @@ void specialized_oop_push_contents(instanceRefKlass *ref,
|
||||
oop discovered = java_lang_ref_Reference::discovered(obj);
|
||||
assert(oopDesc::is_null(next) || oopDesc::is_null(discovered),
|
||||
err_msg("Found an inactive reference " PTR_FORMAT " with a non-NULL discovered field",
|
||||
obj));
|
||||
(oopDesc*)obj));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -1268,12 +1268,19 @@ static void reorder_based_on_method_index(objArrayOop methods,
|
||||
|
||||
// Comparer for sorting an object array containing
|
||||
// methodOops.
|
||||
template <class T>
|
||||
static int method_comparator(T a, T b) {
|
||||
// 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,
|
||||
@ -1299,9 +1306,9 @@ void methodOopDesc::sort_methods(objArrayOop methods,
|
||||
{
|
||||
No_Safepoint_Verifier nsv;
|
||||
if (UseCompressedOops) {
|
||||
QuickSort::sort<narrowOop>((narrowOop*)(methods->base()), length, method_comparator<narrowOop>, idempotent);
|
||||
QuickSort::sort<narrowOop>((narrowOop*)(methods->base()), length, method_comparator_narrowOop, idempotent);
|
||||
} else {
|
||||
QuickSort::sort<oop>((oop*)(methods->base()), length, method_comparator<oop>, idempotent);
|
||||
QuickSort::sort<oop>((oop*)(methods->base()), length, method_comparator_oop, idempotent);
|
||||
}
|
||||
if (UseConcMarkSweepGC) {
|
||||
// For CMS we need to dirty the cards for the array
|
||||
|
@ -1107,7 +1107,7 @@ static int edge_order(CFGEdge **e0, CFGEdge **e1) {
|
||||
|
||||
//------------------------------trace_frequency_order--------------------------
|
||||
// Comparison function for edges
|
||||
static int trace_frequency_order(const void *p0, const void *p1) {
|
||||
extern "C" int trace_frequency_order(const void *p0, const void *p1) {
|
||||
Trace *tr0 = *(Trace **) p0;
|
||||
Trace *tr1 = *(Trace **) p1;
|
||||
Block *b0 = tr0->first_block();
|
||||
|
Loading…
x
Reference in New Issue
Block a user