8064811: Use THREAD instead of CHECK_NULL in return statements
Reviewed-by: coleenp, simonis, dholmes
--- a/hotspot/src/os/aix/vm/perfMemory_aix.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/os/aix/vm/perfMemory_aix.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -422,7 +422,7 @@
// return the name of the user that owns the JVM indicated by the given vmid.
//
static char* get_user_name(int vmid, TRAPS) {
- return get_user_name_slow(vmid, CHECK_NULL);
+ return get_user_name_slow(vmid, THREAD);
}
// return the file name of the backing store file for the named
--- a/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/os/bsd/vm/perfMemory_bsd.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -422,7 +422,7 @@
// return the name of the user that owns the JVM indicated by the given vmid.
//
static char* get_user_name(int vmid, TRAPS) {
- return get_user_name_slow(vmid, CHECK_NULL);
+ return get_user_name_slow(vmid, THREAD);
}
// return the file name of the backing store file for the named
--- a/hotspot/src/os/linux/vm/perfMemory_linux.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/os/linux/vm/perfMemory_linux.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -422,7 +422,7 @@
// return the name of the user that owns the JVM indicated by the given vmid.
//
static char* get_user_name(int vmid, TRAPS) {
- return get_user_name_slow(vmid, CHECK_NULL);
+ return get_user_name_slow(vmid, THREAD);
}
// return the file name of the backing store file for the named
--- a/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/os/solaris/vm/perfMemory_solaris.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -461,7 +461,7 @@
// since the structured procfs and old procfs interfaces can't be
// mixed, we attempt to find the file through a directory search.
- return get_user_name_slow(vmid, CHECK_NULL);
+ return get_user_name_slow(vmid, THREAD);
}
// return the file name of the backing store file for the named
--- a/hotspot/src/share/vm/ci/ciReplay.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/ci/ciReplay.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -332,7 +332,7 @@
// Lookup a klass
Klass* resolve_klass(const char* klass, TRAPS) {
Symbol* klass_name = SymbolTable::lookup(klass, (int)strlen(klass), CHECK_NULL);
- return SystemDictionary::resolve_or_fail(klass_name, _loader, _protection_domain, true, CHECK_NULL);
+ return SystemDictionary::resolve_or_fail(klass_name, _loader, _protection_domain, true, THREAD);
}
// Parse the standard tuple of <klass> <name> <signature>
--- a/hotspot/src/share/vm/classfile/classLoaderData.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/classfile/classLoaderData.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -472,7 +472,7 @@
// These anonymous class loaders are to contain classes used for JSR292
ClassLoaderData* ClassLoaderData::anonymous_class_loader_data(oop loader, TRAPS) {
// Add a new class loader data to the graph.
- return ClassLoaderDataGraph::add(loader, true, CHECK_NULL);
+ return ClassLoaderDataGraph::add(loader, true, THREAD);
}
const char* ClassLoaderData::loader_name() {
--- a/hotspot/src/share/vm/classfile/defaultMethods.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -493,7 +493,7 @@
};
Symbol* MethodFamily::generate_no_defaults_message(TRAPS) const {
- return SymbolTable::new_symbol("No qualifying defaults found", CHECK_NULL);
+ return SymbolTable::new_symbol("No qualifying defaults found", THREAD);
}
Symbol* MethodFamily::generate_method_message(Symbol *klass_name, Method* method, TRAPS) const {
--- a/hotspot/src/share/vm/classfile/javaClasses.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/classfile/javaClasses.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -1952,7 +1952,7 @@
// This class is eagerly initialized during VM initialization, since we keep a refence
// to one of the methods
assert(InstanceKlass::cast(klass)->is_initialized(), "must be initialized");
- return InstanceKlass::cast(klass)->allocate_instance_handle(CHECK_NH);
+ return InstanceKlass::cast(klass)->allocate_instance_handle(THREAD);
}
oop java_lang_reflect_Method::clazz(oop reflect) {
@@ -2130,7 +2130,7 @@
instanceKlassHandle klass (THREAD, k);
// Ensure it is initialized
klass->initialize(CHECK_NH);
- return klass->allocate_instance_handle(CHECK_NH);
+ return klass->allocate_instance_handle(THREAD);
}
oop java_lang_reflect_Constructor::clazz(oop reflect) {
@@ -2270,7 +2270,7 @@
instanceKlassHandle klass (THREAD, k);
// Ensure it is initialized
klass->initialize(CHECK_NH);
- return klass->allocate_instance_handle(CHECK_NH);
+ return klass->allocate_instance_handle(THREAD);
}
oop java_lang_reflect_Field::clazz(oop reflect) {
@@ -2397,7 +2397,7 @@
instanceKlassHandle klass (THREAD, k);
// Ensure it is initialized
klass->initialize(CHECK_NH);
- return klass->allocate_instance_handle(CHECK_NH);
+ return klass->allocate_instance_handle(THREAD);
}
oop java_lang_reflect_Parameter::name(oop param) {
@@ -2447,7 +2447,7 @@
instanceKlassHandle klass (THREAD, k);
// Ensure it is initialized
klass->initialize(CHECK_NH);
- return klass->allocate_instance_handle(CHECK_NH);
+ return klass->allocate_instance_handle(THREAD);
}
--- a/hotspot/src/share/vm/classfile/systemDictionary.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -123,7 +123,7 @@
ClassLoaderData* SystemDictionary::register_loader(Handle class_loader, TRAPS) {
if (class_loader() == NULL) return ClassLoaderData::the_null_class_loader_data();
- return ClassLoaderDataGraph::find_or_create(class_loader, CHECK_NULL);
+ return ClassLoaderDataGraph::find_or_create(class_loader, THREAD);
}
// ----------------------------------------------------------------------------
--- a/hotspot/src/share/vm/classfile/verificationType.hpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/classfile/verificationType.hpp Fri Nov 14 09:47:09 2014 +0100
@@ -289,7 +289,7 @@
if (is_reference() && from.is_reference()) {
return is_reference_assignable_from(from, context,
from_field_is_protected,
- CHECK_false);
+ THREAD);
} else {
return false;
}
--- a/hotspot/src/share/vm/classfile/verifier.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/classfile/verifier.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -1927,7 +1927,7 @@
return SystemDictionary::resolve_or_fail(
name, Handle(THREAD, loader), Handle(THREAD, protection_domain),
- true, CHECK_NULL);
+ true, THREAD);
}
bool ClassVerifier::is_protected_access(instanceKlassHandle this_class,
--- a/hotspot/src/share/vm/memory/allocation.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/memory/allocation.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -50,8 +50,7 @@
size_t word_size, bool read_only,
MetaspaceObj::Type type, TRAPS) throw() {
// Klass has it's own operator new
- return Metaspace::allocate(loader_data, word_size, read_only,
- type, CHECK_NULL);
+ return Metaspace::allocate(loader_data, word_size, read_only, type, THREAD);
}
bool MetaspaceObj::is_shared() const {
--- a/hotspot/src/share/vm/memory/oopFactory.hpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/memory/oopFactory.hpp Fri Nov 14 09:47:09 2014 +0100
@@ -41,20 +41,20 @@
class oopFactory: AllStatic {
public:
// Basic type leaf array allocation
- static typeArrayOop new_boolArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::boolArrayKlassObj ())->allocate(length, CHECK_NULL); }
- static typeArrayOop new_charArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::charArrayKlassObj ())->allocate(length, CHECK_NULL); }
- static typeArrayOop new_singleArray(int length, TRAPS) { return TypeArrayKlass::cast(Universe::singleArrayKlassObj())->allocate(length, CHECK_NULL); }
- static typeArrayOop new_doubleArray(int length, TRAPS) { return TypeArrayKlass::cast(Universe::doubleArrayKlassObj())->allocate(length, CHECK_NULL); }
- static typeArrayOop new_byteArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::byteArrayKlassObj ())->allocate(length, CHECK_NULL); }
- static typeArrayOop new_shortArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::shortArrayKlassObj ())->allocate(length, CHECK_NULL); }
- static typeArrayOop new_intArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::intArrayKlassObj ())->allocate(length, CHECK_NULL); }
- static typeArrayOop new_longArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::longArrayKlassObj ())->allocate(length, CHECK_NULL); }
+ static typeArrayOop new_boolArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::boolArrayKlassObj ())->allocate(length, THREAD); }
+ static typeArrayOop new_charArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::charArrayKlassObj ())->allocate(length, THREAD); }
+ static typeArrayOop new_singleArray(int length, TRAPS) { return TypeArrayKlass::cast(Universe::singleArrayKlassObj())->allocate(length, THREAD); }
+ static typeArrayOop new_doubleArray(int length, TRAPS) { return TypeArrayKlass::cast(Universe::doubleArrayKlassObj())->allocate(length, THREAD); }
+ static typeArrayOop new_byteArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::byteArrayKlassObj ())->allocate(length, THREAD); }
+ static typeArrayOop new_shortArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::shortArrayKlassObj ())->allocate(length, THREAD); }
+ static typeArrayOop new_intArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::intArrayKlassObj ())->allocate(length, THREAD); }
+ static typeArrayOop new_longArray (int length, TRAPS) { return TypeArrayKlass::cast(Universe::longArrayKlassObj ())->allocate(length, THREAD); }
// create java.lang.Object[]
static objArrayOop new_objectArray(int length, TRAPS) {
assert(Universe::objectArrayKlassObj() != NULL, "Too early?");
return ObjArrayKlass::
- cast(Universe::objectArrayKlassObj())->allocate(length, CHECK_NULL);
+ cast(Universe::objectArrayKlassObj())->allocate(length, THREAD);
}
static typeArrayOop new_charArray (const char* utf8_str, TRAPS);
--- a/hotspot/src/share/vm/oops/constantPool.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/oops/constantPool.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -461,7 +461,7 @@
Klass* ConstantPool::klass_ref_at(int which, TRAPS) {
- return klass_at(klass_ref_index_at(which), CHECK_NULL);
+ return klass_at(klass_ref_index_at(which), THREAD);
}
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -532,7 +532,7 @@
// 1) Verify the bytecodes
Verifier::Mode mode =
throw_verifyerror ? Verifier::ThrowException : Verifier::NoException;
- return Verifier::verify(this_k, mode, this_k->should_verify_class(), CHECK_false);
+ return Verifier::verify(this_k, mode, this_k->should_verify_class(), THREAD);
}
@@ -1130,7 +1130,7 @@
if (or_null) {
return oak->array_klass_or_null(n);
}
- return oak->array_klass(n, CHECK_NULL);
+ return oak->array_klass(n, THREAD);
}
Klass* InstanceKlass::array_klass_impl(bool or_null, TRAPS) {
--- a/hotspot/src/share/vm/oops/klass.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/oops/klass.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -152,7 +152,7 @@
void* Klass::operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS) throw() {
return Metaspace::allocate(loader_data, word_size, /*read_only*/false,
- MetaspaceObj::ClassType, CHECK_NULL);
+ MetaspaceObj::ClassType, THREAD);
}
Klass::Klass() {
--- a/hotspot/src/share/vm/oops/methodData.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/oops/methodData.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -658,7 +658,7 @@
int size = MethodData::compute_allocation_size_in_words(method);
return new (loader_data, size, false, MetaspaceObj::MethodDataType, THREAD)
- MethodData(method(), size, CHECK_NULL);
+ MethodData(method(), size, THREAD);
}
int MethodData::bytecode_cell_count(Bytecodes::Code code) {
--- a/hotspot/src/share/vm/oops/objArrayKlass.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/oops/objArrayKlass.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -189,7 +189,7 @@
if (length <= arrayOopDesc::max_array_length(T_OBJECT)) {
int size = objArrayOopDesc::object_size(length);
KlassHandle h_k(THREAD, this);
- return (objArrayOop)CollectedHeap::array_allocate(h_k, size, length, CHECK_NULL);
+ return (objArrayOop)CollectedHeap::array_allocate(h_k, size, length, THREAD);
} else {
report_java_out_of_memory("Requested array size exceeds VM limit");
JvmtiExport::post_array_size_exhausted();
@@ -362,11 +362,11 @@
if (or_null) {
return ak->array_klass_or_null(n);
}
- return ak->array_klass(n, CHECK_NULL);
+ return ak->array_klass(n, THREAD);
}
Klass* ObjArrayKlass::array_klass_impl(bool or_null, TRAPS) {
- return array_klass_impl(or_null, dimension() + 1, CHECK_NULL);
+ return array_klass_impl(or_null, dimension() + 1, THREAD);
}
bool ObjArrayKlass::can_be_primary_super_slow() const {
--- a/hotspot/src/share/vm/oops/typeArrayKlass.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/oops/typeArrayKlass.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -191,7 +191,7 @@
if (or_null) {
return h_ak->array_klass_or_null(n);
}
- return h_ak->array_klass(n, CHECK_NULL);
+ return h_ak->array_klass(n, THREAD);
}
Klass* TypeArrayKlass::array_klass_impl(bool or_null, TRAPS) {
--- a/hotspot/src/share/vm/prims/methodHandles.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/prims/methodHandles.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -399,12 +399,12 @@
// convert the external string or reflective type to an internal signature
Symbol* MethodHandles::lookup_signature(oop type_str, bool intern_if_not_found, TRAPS) {
if (java_lang_invoke_MethodType::is_instance(type_str)) {
- return java_lang_invoke_MethodType::as_signature(type_str, intern_if_not_found, CHECK_NULL);
+ return java_lang_invoke_MethodType::as_signature(type_str, intern_if_not_found, THREAD);
} else if (java_lang_Class::is_instance(type_str)) {
- return java_lang_Class::as_signature(type_str, false, CHECK_NULL);
+ return java_lang_Class::as_signature(type_str, false, THREAD);
} else if (java_lang_String::is_instance(type_str)) {
if (intern_if_not_found) {
- return java_lang_String::as_symbol(type_str, CHECK_NULL);
+ return java_lang_String::as_symbol(type_str, THREAD);
} else {
return java_lang_String::as_symbol_or_null(type_str);
}
--- a/hotspot/src/share/vm/runtime/fieldDescriptor.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/runtime/fieldDescriptor.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -94,7 +94,7 @@
}
oop fieldDescriptor::string_initial_value(TRAPS) const {
- return constants()->uncached_string_at(initial_value_index(), CHECK_0);
+ return constants()->uncached_string_at(initial_value_index(), THREAD);
}
void fieldDescriptor::reinitialize(InstanceKlass* ik, int index) {
--- a/hotspot/src/share/vm/runtime/perfData.hpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/runtime/perfData.hpp Fri Nov 14 09:47:09 2014 +0100
@@ -773,7 +773,7 @@
static PerfStringVariable* create_string_variable(CounterNS ns,
const char* name,
const char *s, TRAPS) {
- return create_string_variable(ns, name, 0, s, CHECK_NULL);
+ return create_string_variable(ns, name, 0, s, THREAD);
};
static PerfLongVariable* create_long_variable(CounterNS ns,
@@ -784,7 +784,7 @@
static PerfLongVariable* create_long_variable(CounterNS ns,
const char* name,
PerfData::Units u, TRAPS) {
- return create_long_variable(ns, name, u, (jlong)0, CHECK_NULL);
+ return create_long_variable(ns, name, u, (jlong)0, THREAD);
};
static PerfLongVariable* create_long_variable(CounterNS, const char* name,
@@ -805,7 +805,7 @@
static PerfLongCounter* create_long_counter(CounterNS ns, const char* name,
PerfData::Units u, TRAPS) {
- return create_long_counter(ns, name, u, (jlong)0, CHECK_NULL);
+ return create_long_counter(ns, name, u, (jlong)0, THREAD);
};
static PerfLongCounter* create_long_counter(CounterNS ns, const char* name,
@@ -823,49 +823,49 @@
static PerfConstant* create_constant(CounterNS ns, const char* name,
PerfData::Units u, jlong val, TRAPS) {
- return create_long_constant(ns, name, u, val, CHECK_NULL);
+ return create_long_constant(ns, name, u, val, THREAD);
}
static PerfVariable* create_variable(CounterNS ns, const char* name,
PerfData::Units u, jlong ival, TRAPS) {
- return create_long_variable(ns, name, u, ival, CHECK_NULL);
+ return create_long_variable(ns, name, u, ival, THREAD);
}
static PerfVariable* create_variable(CounterNS ns, const char* name,
PerfData::Units u, TRAPS) {
- return create_long_variable(ns, name, u, (jlong)0, CHECK_NULL);
+ return create_long_variable(ns, name, u, (jlong)0, THREAD);
}
static PerfVariable* create_variable(CounterNS ns, const char* name,
PerfData::Units u, jlong* sp, TRAPS) {
- return create_long_variable(ns, name, u, sp, CHECK_NULL);
+ return create_long_variable(ns, name, u, sp, THREAD);
}
static PerfVariable* create_variable(CounterNS ns, const char* name,
PerfData::Units u,
PerfSampleHelper* sh, TRAPS) {
- return create_long_variable(ns, name, u, sh, CHECK_NULL);
+ return create_long_variable(ns, name, u, sh, THREAD);
}
static PerfCounter* create_counter(CounterNS ns, const char* name,
PerfData::Units u, jlong ival, TRAPS) {
- return create_long_counter(ns, name, u, ival, CHECK_NULL);
+ return create_long_counter(ns, name, u, ival, THREAD);
}
static PerfCounter* create_counter(CounterNS ns, const char* name,
PerfData::Units u, TRAPS) {
- return create_long_counter(ns, name, u, (jlong)0, CHECK_NULL);
+ return create_long_counter(ns, name, u, (jlong)0, THREAD);
}
static PerfCounter* create_counter(CounterNS ns, const char* name,
PerfData::Units u, jlong* sp, TRAPS) {
- return create_long_counter(ns, name, u, sp, CHECK_NULL);
+ return create_long_counter(ns, name, u, sp, THREAD);
}
static PerfCounter* create_counter(CounterNS ns, const char* name,
PerfData::Units u,
PerfSampleHelper* sh, TRAPS) {
- return create_long_counter(ns, name, u, sh, CHECK_NULL);
+ return create_long_counter(ns, name, u, sh, THREAD);
}
static void destroy();
--- a/hotspot/src/share/vm/runtime/reflection.cpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/runtime/reflection.cpp Fri Nov 14 09:47:09 2014 +0100
@@ -635,7 +635,7 @@
}
objArrayHandle Reflection::get_exception_types(methodHandle method, TRAPS) {
- return method->resolved_checked_exceptions(CHECK_(objArrayHandle()));
+ return method->resolved_checked_exceptions(THREAD);
}
--- a/hotspot/src/share/vm/runtime/synchronizer.hpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/runtime/synchronizer.hpp Fri Nov 14 09:47:09 2014 +0100
@@ -169,7 +169,7 @@
void waitUninterruptibly(TRAPS) { ObjectSynchronizer::waitUninterruptibly(_obj, 0, CHECK); }
// complete_exit gives up lock completely, returning recursion count
// reenter reclaims lock with original recursion count
- intptr_t complete_exit(TRAPS) { return ObjectSynchronizer::complete_exit(_obj, CHECK_0); }
+ intptr_t complete_exit(TRAPS) { return ObjectSynchronizer::complete_exit(_obj, THREAD); }
void reenter(intptr_t recursion, TRAPS) { ObjectSynchronizer::reenter(_obj, recursion, CHECK); }
};
--- a/hotspot/src/share/vm/utilities/array.hpp Thu Nov 13 11:14:01 2014 +0100
+++ b/hotspot/src/share/vm/utilities/array.hpp Fri Nov 14 09:47:09 2014 +0100
@@ -322,7 +322,7 @@
void* operator new(size_t size, ClassLoaderData* loader_data, int length, bool read_only, TRAPS) throw() {
size_t word_size = Array::size(length);
return (void*) Metaspace::allocate(loader_data, word_size, read_only,
- MetaspaceObj::array_type(sizeof(T)), CHECK_NULL);
+ MetaspaceObj::array_type(sizeof(T)), THREAD);
}
static size_t byte_sizeof(int length) { return sizeof(Array<T>) + MAX2(length - 1, 0) * sizeof(T); }