8031819: Remove legacy jdk checks and code

Delete old jdk specific code.

Reviewed-by: dholmes, coleenp, zgu, lfoltan
This commit is contained in:
Harold Seigel 2014-06-11 09:58:23 -04:00
parent 6f97a45429
commit b6a2f946f6
24 changed files with 95 additions and 507 deletions

View file

@ -857,9 +857,7 @@ void java_lang_Class::compute_offsets() {
}
int java_lang_Class::classRedefinedCount(oop the_class_mirror) {
if (!JDK_Version::is_gte_jdk15x_version()
|| classRedefinedCount_offset == -1) {
// The classRedefinedCount field is only present starting in 1.5.
if (classRedefinedCount_offset == -1) {
// If we don't have an offset for it then just return -1 as a marker.
return -1;
}
@ -868,9 +866,7 @@ int java_lang_Class::classRedefinedCount(oop the_class_mirror) {
}
void java_lang_Class::set_classRedefinedCount(oop the_class_mirror, int value) {
if (!JDK_Version::is_gte_jdk15x_version()
|| classRedefinedCount_offset == -1) {
// The classRedefinedCount field is only present starting in 1.5.
if (classRedefinedCount_offset == -1) {
// If we don't have an offset for it then nothing to set.
return;
}
@ -1000,9 +996,7 @@ oop java_lang_Thread::inherited_access_control_context(oop java_thread) {
jlong java_lang_Thread::stackSize(oop java_thread) {
// The stackSize field is only present starting in 1.4
if (_stackSize_offset > 0) {
assert(JDK_Version::is_gte_jdk14x_version(), "sanity check");
return java_thread->long_field(_stackSize_offset);
} else {
return 0;
@ -1078,7 +1072,7 @@ bool java_lang_Thread::set_park_event(oop java_thread, jlong ptr) {
const char* java_lang_Thread::thread_status_name(oop java_thread) {
assert(JDK_Version::is_gte_jdk15x_version() && _thread_status_offset != 0, "Must have thread status");
assert(_thread_status_offset != 0, "Must have thread status");
ThreadStatus status = (java_lang_Thread::ThreadStatus)java_thread->int_field(_thread_status_offset);
switch (status) {
case NEW : return "NEW";
@ -1217,7 +1211,6 @@ void java_lang_Throwable::set_stacktrace(oop throwable, oop st_element_array) {
}
void java_lang_Throwable::clear_stacktrace(oop throwable) {
assert(JDK_Version::is_gte_jdk14x_version(), "should only be called in >= 1.4");
set_stacktrace(throwable, NULL);
}
@ -1548,12 +1541,9 @@ void java_lang_Throwable::fill_in_stack_trace(Handle throwable, methodHandle met
// Start out by clearing the backtrace for this object, in case the VM
// runs out of memory while allocating the stack trace
set_backtrace(throwable(), NULL);
if (JDK_Version::is_gte_jdk14x_version()) {
// New since 1.4, clear lazily constructed Java level stacktrace if
// refilling occurs
// This is unnecessary in 1.7+ but harmless
clear_stacktrace(throwable());
}
// Clear lazily constructed Java level stacktrace if refilling occurs
// This is unnecessary in 1.7+ but harmless
clear_stacktrace(throwable());
int max_depth = MaxJavaStackTraceDepth;
JavaThread* thread = (JavaThread*)THREAD;
@ -1739,13 +1729,9 @@ void java_lang_Throwable::fill_in_stack_trace_of_preallocated_backtrace(Handle t
if (chunk_count >= max_chunks) break;
}
// For Java 7+ we support the Throwable immutability protocol defined for Java 7. This support
// was missing in 7u0 so in 7u0 there is a workaround in the Throwable class. That workaround
// can be removed in a JDK using this JVM version
if (JDK_Version::is_gte_jdk17x_version()) {
java_lang_Throwable::set_stacktrace(throwable(), java_lang_Throwable::unassigned_stacktrace());
assert(java_lang_Throwable::unassigned_stacktrace() != NULL, "not initialized");
}
// We support the Throwable immutability protocol defined for Java 7.
java_lang_Throwable::set_stacktrace(throwable(), java_lang_Throwable::unassigned_stacktrace());
assert(java_lang_Throwable::unassigned_stacktrace() != NULL, "not initialized");
}
@ -3022,8 +3008,7 @@ bool java_lang_ClassLoader::isAncestor(oop loader, oop cl) {
// based on non-null field
// Written to by java.lang.ClassLoader, vm only reads this field, doesn't set it
bool java_lang_ClassLoader::parallelCapable(oop class_loader) {
if (!JDK_Version::is_gte_jdk17x_version()
|| parallelCapable_offset == -1) {
if (parallelCapable_offset == -1) {
// Default for backward compatibility is false
return false;
}
@ -3219,7 +3204,6 @@ void java_nio_Buffer::compute_offsets() {
void java_util_concurrent_locks_AbstractOwnableSynchronizer::initialize(TRAPS) {
if (_owner_offset != 0) return;
assert(JDK_Version::is_gte_jdk16x_version(), "Must be JDK 1.6 or later");
SystemDictionary::load_abstract_ownable_synchronizer_klass(CHECK);
Klass* k = SystemDictionary::abstract_ownable_synchronizer_klass();
compute_offset(_owner_offset, k,
@ -3309,15 +3293,10 @@ void JavaClasses::compute_offsets() {
java_lang_reflect_Method::compute_offsets();
java_lang_reflect_Constructor::compute_offsets();
java_lang_reflect_Field::compute_offsets();
if (JDK_Version::is_gte_jdk14x_version()) {
java_nio_Buffer::compute_offsets();
}
if (JDK_Version::is_gte_jdk15x_version()) {
sun_reflect_ConstantPool::compute_offsets();
sun_reflect_UnsafeStaticFieldAccessorImpl::compute_offsets();
}
if (JDK_Version::is_gte_jdk18x_version())
java_lang_reflect_Parameter::compute_offsets();
java_nio_Buffer::compute_offsets();
sun_reflect_ConstantPool::compute_offsets();
sun_reflect_UnsafeStaticFieldAccessorImpl::compute_offsets();
java_lang_reflect_Parameter::compute_offsets();
// generated interpreter code wants to know about the offsets we just computed:
AbstractAssembler::update_delayed_values();
@ -3502,7 +3481,7 @@ void JavaClasses::check_offsets() {
// into merlin "for some time." Without it, the vm will fail with early
// merlin builds.
if (CheckAssertionStatusDirectives && JDK_Version::is_gte_jdk14x_version()) {
if (CheckAssertionStatusDirectives) {
const char* nm = "java/lang/AssertionStatusDirectives";
const char* sig = "[Ljava/lang/String;";
CHECK_OFFSET(nm, java_lang_AssertionStatusDirectives, classes, sig);