< prev index next >

src/share/vm/classfile/javaClasses.cpp

Print this page

        

*** 1428,1438 **** int java_lang_ThreadGroup::_daemon_offset = 0; int java_lang_ThreadGroup::_nthreads_offset = 0; int java_lang_ThreadGroup::_ngroups_offset = 0; oop java_lang_ThreadGroup::parent(oop java_thread_group) { ! assert(java_thread_group->is_oop(), "thread group must be oop"); return java_thread_group->obj_field(_parent_offset); } // ("name as oop" accessor is not necessary) --- 1428,1438 ---- int java_lang_ThreadGroup::_daemon_offset = 0; int java_lang_ThreadGroup::_nthreads_offset = 0; int java_lang_ThreadGroup::_ngroups_offset = 0; oop java_lang_ThreadGroup::parent(oop java_thread_group) { ! assert(oopDesc::is_oop(java_thread_group), "thread group must be oop"); return java_thread_group->obj_field(_parent_offset); } // ("name as oop" accessor is not necessary)
*** 1444,1454 **** } return NULL; } int java_lang_ThreadGroup::nthreads(oop java_thread_group) { ! assert(java_thread_group->is_oop(), "thread group must be oop"); return java_thread_group->int_field(_nthreads_offset); } objArrayOop java_lang_ThreadGroup::threads(oop java_thread_group) { oop threads = java_thread_group->obj_field(_threads_offset); --- 1444,1454 ---- } return NULL; } int java_lang_ThreadGroup::nthreads(oop java_thread_group) { ! assert(oopDesc::is_oop(java_thread_group), "thread group must be oop"); return java_thread_group->int_field(_nthreads_offset); } objArrayOop java_lang_ThreadGroup::threads(oop java_thread_group) { oop threads = java_thread_group->obj_field(_threads_offset);
*** 1456,1487 **** assert(threads->is_objArray(), "just checking"); // Todo: Add better type checking code return objArrayOop(threads); } int java_lang_ThreadGroup::ngroups(oop java_thread_group) { ! assert(java_thread_group->is_oop(), "thread group must be oop"); return java_thread_group->int_field(_ngroups_offset); } objArrayOop java_lang_ThreadGroup::groups(oop java_thread_group) { oop groups = java_thread_group->obj_field(_groups_offset); assert(groups == NULL || groups->is_objArray(), "just checking"); // Todo: Add better type checking code return objArrayOop(groups); } ThreadPriority java_lang_ThreadGroup::maxPriority(oop java_thread_group) { ! assert(java_thread_group->is_oop(), "thread group must be oop"); return (ThreadPriority) java_thread_group->int_field(_maxPriority_offset); } bool java_lang_ThreadGroup::is_destroyed(oop java_thread_group) { ! assert(java_thread_group->is_oop(), "thread group must be oop"); return java_thread_group->bool_field(_destroyed_offset) != 0; } bool java_lang_ThreadGroup::is_daemon(oop java_thread_group) { ! assert(java_thread_group->is_oop(), "thread group must be oop"); return java_thread_group->bool_field(_daemon_offset) != 0; } void java_lang_ThreadGroup::compute_offsets() { assert(_parent_offset == 0, "offsets should be initialized only once"); --- 1456,1487 ---- assert(threads->is_objArray(), "just checking"); // Todo: Add better type checking code return objArrayOop(threads); } int java_lang_ThreadGroup::ngroups(oop java_thread_group) { ! assert(oopDesc::is_oop(java_thread_group), "thread group must be oop"); return java_thread_group->int_field(_ngroups_offset); } objArrayOop java_lang_ThreadGroup::groups(oop java_thread_group) { oop groups = java_thread_group->obj_field(_groups_offset); assert(groups == NULL || groups->is_objArray(), "just checking"); // Todo: Add better type checking code return objArrayOop(groups); } ThreadPriority java_lang_ThreadGroup::maxPriority(oop java_thread_group) { ! assert(oopDesc::is_oop(java_thread_group), "thread group must be oop"); return (ThreadPriority) java_thread_group->int_field(_maxPriority_offset); } bool java_lang_ThreadGroup::is_destroyed(oop java_thread_group) { ! assert(oopDesc::is_oop(java_thread_group), "thread group must be oop"); return java_thread_group->bool_field(_destroyed_offset) != 0; } bool java_lang_ThreadGroup::is_daemon(oop java_thread_group) { ! assert(oopDesc::is_oop(java_thread_group), "thread group must be oop"); return java_thread_group->bool_field(_daemon_offset) != 0; } void java_lang_ThreadGroup::compute_offsets() { assert(_parent_offset == 0, "offsets should be initialized only once");
*** 2866,2876 **** } ModuleEntry* java_lang_Module::module_entry(oop module, TRAPS) { assert(_module_entry_offset != -1, "Uninitialized module_entry_offset"); assert(module != NULL, "module can't be null"); ! assert(module->is_oop(), "module must be oop"); ModuleEntry* module_entry = (ModuleEntry*)module->address_field(_module_entry_offset); if (module_entry == NULL) { // If the inject field containing the ModuleEntry* is null then return the // class loader's unnamed module. --- 2866,2876 ---- } ModuleEntry* java_lang_Module::module_entry(oop module, TRAPS) { assert(_module_entry_offset != -1, "Uninitialized module_entry_offset"); assert(module != NULL, "module can't be null"); ! assert(oopDesc::is_oop(module), "module must be oop"); ModuleEntry* module_entry = (ModuleEntry*)module->address_field(_module_entry_offset); if (module_entry == NULL) { // If the inject field containing the ModuleEntry* is null then return the // class loader's unnamed module.
*** 2883,2893 **** } void java_lang_Module::set_module_entry(oop module, ModuleEntry* module_entry) { assert(_module_entry_offset != -1, "Uninitialized module_entry_offset"); assert(module != NULL, "module can't be null"); ! assert(module->is_oop(), "module must be oop"); module->address_field_put(_module_entry_offset, (address)module_entry); } Handle reflect_ConstantPool::create(TRAPS) { assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem"); --- 2883,2893 ---- } void java_lang_Module::set_module_entry(oop module, ModuleEntry* module_entry) { assert(_module_entry_offset != -1, "Uninitialized module_entry_offset"); assert(module != NULL, "module can't be null"); ! assert(oopDesc::is_oop(module), "module must be oop"); module->address_field_put(_module_entry_offset, (address)module_entry); } Handle reflect_ConstantPool::create(TRAPS) { assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem");
*** 3086,3101 **** int java_lang_invoke_DirectMethodHandle::_member_offset; oop java_lang_invoke_DirectMethodHandle::member(oop dmh) { oop member_name = NULL; ! bool is_dmh = dmh->is_oop() && java_lang_invoke_DirectMethodHandle::is_instance(dmh); ! assert(is_dmh, "a DirectMethodHandle oop is expected"); ! if (is_dmh) { ! member_name = dmh->obj_field(member_offset_in_bytes()); ! } ! return member_name; } void java_lang_invoke_DirectMethodHandle::compute_offsets() { Klass* k = SystemDictionary::DirectMethodHandle_klass(); if (k != NULL) { --- 3086,3098 ---- int java_lang_invoke_DirectMethodHandle::_member_offset; oop java_lang_invoke_DirectMethodHandle::member(oop dmh) { oop member_name = NULL; ! assert(oopDesc::is_oop(dmh) && java_lang_invoke_DirectMethodHandle::is_instance(dmh), ! "a DirectMethodHandle oop is expected"); ! return dmh->obj_field(member_offset_in_bytes()); } void java_lang_invoke_DirectMethodHandle::compute_offsets() { Klass* k = SystemDictionary::DirectMethodHandle_klass(); if (k != NULL) {
*** 3474,3484 **** int java_lang_ClassLoader::parallelCapable_offset = -1; int java_lang_ClassLoader::name_offset = -1; int java_lang_ClassLoader::unnamedModule_offset = -1; ClassLoaderData** java_lang_ClassLoader::loader_data_addr(oop loader) { ! assert(loader != NULL && loader->is_oop(), "loader must be oop"); return (ClassLoaderData**) loader->address_field_addr(_loader_data_offset); } ClassLoaderData* java_lang_ClassLoader::loader_data(oop loader) { return *java_lang_ClassLoader::loader_data_addr(loader); --- 3471,3481 ---- int java_lang_ClassLoader::parallelCapable_offset = -1; int java_lang_ClassLoader::name_offset = -1; int java_lang_ClassLoader::unnamedModule_offset = -1; ClassLoaderData** java_lang_ClassLoader::loader_data_addr(oop loader) { ! assert(loader != NULL && oopDesc::is_oop(loader), "loader must be oop"); return (ClassLoaderData**) loader->address_field_addr(_loader_data_offset); } ClassLoaderData* java_lang_ClassLoader::loader_data(oop loader) { return *java_lang_ClassLoader::loader_data_addr(loader);
< prev index next >