mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
6939861: JVM should handle more conversion operations
Reviewed-by: twisti, jrose
This commit is contained in:
parent
bb2c21a025
commit
6aeaca98d1
29 changed files with 3011 additions and 645 deletions
|
@ -2602,6 +2602,7 @@ int java_lang_invoke_MethodType::ptype_count(oop mt) {
|
|||
// Support for java_lang_invoke_MethodTypeForm
|
||||
|
||||
int java_lang_invoke_MethodTypeForm::_vmslots_offset;
|
||||
int java_lang_invoke_MethodTypeForm::_vmlayout_offset;
|
||||
int java_lang_invoke_MethodTypeForm::_erasedType_offset;
|
||||
int java_lang_invoke_MethodTypeForm::_genericInvoker_offset;
|
||||
|
||||
|
@ -2609,6 +2610,7 @@ void java_lang_invoke_MethodTypeForm::compute_offsets() {
|
|||
klassOop k = SystemDictionary::MethodTypeForm_klass();
|
||||
if (k != NULL) {
|
||||
compute_optional_offset(_vmslots_offset, k, vmSymbols::vmslots_name(), vmSymbols::int_signature(), true);
|
||||
compute_optional_offset(_vmlayout_offset, k, vmSymbols::vmlayout_name(), vmSymbols::object_signature());
|
||||
compute_optional_offset(_erasedType_offset, k, vmSymbols::erasedType_name(), vmSymbols::java_lang_invoke_MethodType_signature(), true);
|
||||
compute_optional_offset(_genericInvoker_offset, k, vmSymbols::genericInvoker_name(), vmSymbols::java_lang_invoke_MethodHandle_signature(), true);
|
||||
if (_genericInvoker_offset == 0) _genericInvoker_offset = -1; // set to explicit "empty" value
|
||||
|
@ -2617,9 +2619,31 @@ void java_lang_invoke_MethodTypeForm::compute_offsets() {
|
|||
|
||||
int java_lang_invoke_MethodTypeForm::vmslots(oop mtform) {
|
||||
assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only");
|
||||
assert(_vmslots_offset > 0, "");
|
||||
return mtform->int_field(_vmslots_offset);
|
||||
}
|
||||
|
||||
oop java_lang_invoke_MethodTypeForm::vmlayout(oop mtform) {
|
||||
assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only");
|
||||
assert(_vmlayout_offset > 0, "");
|
||||
return mtform->obj_field(_vmlayout_offset);
|
||||
}
|
||||
|
||||
oop java_lang_invoke_MethodTypeForm::init_vmlayout(oop mtform, oop cookie) {
|
||||
assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only");
|
||||
oop previous = vmlayout(mtform);
|
||||
if (previous != NULL) {
|
||||
return previous; // someone else beat us to it
|
||||
}
|
||||
HeapWord* cookie_addr = (HeapWord*) mtform->obj_field_addr<oop>(_vmlayout_offset);
|
||||
OrderAccess::storestore(); // make sure our copy is fully committed
|
||||
previous = oopDesc::atomic_compare_exchange_oop(cookie, cookie_addr, previous);
|
||||
if (previous != NULL) {
|
||||
return previous; // someone else beat us to it
|
||||
}
|
||||
return cookie;
|
||||
}
|
||||
|
||||
oop java_lang_invoke_MethodTypeForm::erasedType(oop mtform) {
|
||||
assert(mtform->klass() == SystemDictionary::MethodTypeForm_klass(), "MTForm only");
|
||||
return mtform->obj_field(_erasedType_offset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue