< prev index next >

src/hotspot/share/classfile/javaClasses.cpp

Print this page
rev 52749 : Bootstrap method consolidation
* clean up and simplify JDK support code for BSM invocation
* simplify JVM bootstrap handshake: use BootstrapCallInfo only
* remove unused JVM paths and data fields
* move bootstrap argument processing from MethodHandleNatives to ConstantPool
* remove ConstantGroup; merge argument access into BootstrapCallInfo
* adjust BSM argument access: remove copyArguments, add argumentRef API
* add metadata-free BSM modes, including symbolic arguments from CP

*** 2990,3011 **** void java_lang_reflect_Field::set_annotations(oop field, oop value) { assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem"); field->obj_field_put(annotations_offset, value); } - #define CONSTANTPOOL_FIELDS_DO(macro) \ - macro(_oop_offset, k, "constantPoolOop", object_signature, false) void reflect_ConstantPool::compute_offsets() { InstanceKlass* k = SystemDictionary::reflect_ConstantPool_klass(); ! // The field is called ConstantPool* in the sun.reflect.ConstantPool class. ! CONSTANTPOOL_FIELDS_DO(FIELD_COMPUTE_OFFSET); } #if INCLUDE_CDS void reflect_ConstantPool::serialize_offsets(SerializeClosure* f) { ! CONSTANTPOOL_FIELDS_DO(FIELD_SERIALIZE_OFFSET); } #endif #define PARAMETER_FIELDS_DO(macro) \ macro(name_offset, k, vmSymbols::name_name(), string_signature, false); \ --- 2990,3008 ---- void java_lang_reflect_Field::set_annotations(oop field, oop value) { assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem"); field->obj_field_put(annotations_offset, value); } void reflect_ConstantPool::compute_offsets() { InstanceKlass* k = SystemDictionary::reflect_ConstantPool_klass(); ! CONSTANTPOOL_INJECTED_FIELDS(INJECTED_FIELD_COMPUTE_OFFSET); } #if INCLUDE_CDS void reflect_ConstantPool::serialize_offsets(SerializeClosure* f) { ! CONSTANTPOOL_INJECTED_FIELDS(INJECTED_FIELD_SERIALIZE_OFFSET); } #endif #define PARAMETER_FIELDS_DO(macro) \ macro(name_offset, k, vmSymbols::name_name(), string_signature, false); \
*** 3145,3174 **** 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"); InstanceKlass* k = SystemDictionary::reflect_ConstantPool_klass(); // Ensure it is initialized k->initialize(CHECK_NH); ! return k->allocate_instance_handle(THREAD); ! } ! ! ! void reflect_ConstantPool::set_cp(oop reflect, ConstantPool* value) { ! assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem"); oop mirror = value->pool_holder()->java_mirror(); // Save the mirror to get back the constant pool. ! reflect->obj_field_put(_oop_offset, mirror); } ConstantPool* reflect_ConstantPool::get_cp(oop reflect) { assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem"); ! oop mirror = reflect->obj_field(_oop_offset); Klass* k = java_lang_Class::as_Klass(mirror); assert(k->is_instance_klass(), "Must be"); // Get the constant pool back from the klass. Since class redefinition // merges the new constant pool into the old, this is essentially the --- 3142,3167 ---- 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_from_pool(ConstantPool* value, TRAPS) { assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem"); InstanceKlass* k = SystemDictionary::reflect_ConstantPool_klass(); // Ensure it is initialized k->initialize(CHECK_NH); ! Handle reflect = k->allocate_instance_handle(THREAD); oop mirror = value->pool_holder()->java_mirror(); // Save the mirror to get back the constant pool. ! reflect->obj_field_put(_constantPoolOop_offset, mirror); ! return reflect; } ConstantPool* reflect_ConstantPool::get_cp(oop reflect) { assert(Universe::is_fully_initialized(), "Need to find another solution to the reflection problem"); ! oop mirror = reflect->obj_field(_constantPoolOop_offset); Klass* k = java_lang_Class::as_Klass(mirror); assert(k->is_instance_klass(), "Must be"); // Get the constant pool back from the klass. Since class redefinition // merges the new constant pool into the old, this is essentially the
*** 4061,4071 **** int java_lang_AssertionStatusDirectives::packages_offset; int java_lang_AssertionStatusDirectives::packageEnabled_offset; int java_lang_AssertionStatusDirectives::deflt_offset; int java_nio_Buffer::_limit_offset; int java_util_concurrent_locks_AbstractOwnableSynchronizer::_owner_offset; ! int reflect_ConstantPool::_oop_offset; int reflect_UnsafeStaticFieldAccessorImpl::_base_offset; #define STACKTRACEELEMENT_FIELDS_DO(macro) \ macro(declaringClassObject_offset, k, "declaringClassObject", class_signature, false); \ --- 4054,4064 ---- int java_lang_AssertionStatusDirectives::packages_offset; int java_lang_AssertionStatusDirectives::packageEnabled_offset; int java_lang_AssertionStatusDirectives::deflt_offset; int java_nio_Buffer::_limit_offset; int java_util_concurrent_locks_AbstractOwnableSynchronizer::_owner_offset; ! int reflect_ConstantPool::_constantPoolOop_offset; int reflect_UnsafeStaticFieldAccessorImpl::_base_offset; #define STACKTRACEELEMENT_FIELDS_DO(macro) \ macro(declaringClassObject_offset, k, "declaringClassObject", class_signature, false); \
< prev index next >