mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
6655646: dynamic languages need dynamically linked call sites
Invokedynamic instruction (JSR 292 RI) Reviewed-by: twisti, never
This commit is contained in:
parent
fd05c28901
commit
34c1d72421
65 changed files with 1457 additions and 264 deletions
|
@ -2430,6 +2430,41 @@ oop java_dyn_MethodTypeForm::erasedType(oop mtform) {
|
|||
}
|
||||
|
||||
|
||||
// Support for sun_dyn_CallSiteImpl
|
||||
|
||||
int sun_dyn_CallSiteImpl::_type_offset;
|
||||
int sun_dyn_CallSiteImpl::_target_offset;
|
||||
int sun_dyn_CallSiteImpl::_vmmethod_offset;
|
||||
|
||||
void sun_dyn_CallSiteImpl::compute_offsets() {
|
||||
if (!EnableInvokeDynamic) return;
|
||||
klassOop k = SystemDictionary::CallSiteImpl_klass();
|
||||
if (k != NULL) {
|
||||
compute_offset(_type_offset, k, vmSymbols::type_name(), vmSymbols::java_dyn_MethodType_signature(), true);
|
||||
compute_offset(_target_offset, k, vmSymbols::target_name(), vmSymbols::java_dyn_MethodHandle_signature(), true);
|
||||
compute_offset(_vmmethod_offset, k, vmSymbols::vmmethod_name(), vmSymbols::object_signature(), true);
|
||||
}
|
||||
}
|
||||
|
||||
oop sun_dyn_CallSiteImpl::type(oop site) {
|
||||
return site->obj_field(_type_offset);
|
||||
}
|
||||
|
||||
oop sun_dyn_CallSiteImpl::target(oop site) {
|
||||
return site->obj_field(_target_offset);
|
||||
}
|
||||
|
||||
void sun_dyn_CallSiteImpl::set_target(oop site, oop target) {
|
||||
site->obj_field_put(_target_offset, target);
|
||||
}
|
||||
|
||||
oop sun_dyn_CallSiteImpl::vmmethod(oop site) {
|
||||
return site->obj_field(_vmmethod_offset);
|
||||
}
|
||||
|
||||
void sun_dyn_CallSiteImpl::set_vmmethod(oop site, oop ref) {
|
||||
site->obj_field_put(_vmmethod_offset, ref);
|
||||
}
|
||||
|
||||
|
||||
// Support for java_security_AccessControlContext
|
||||
|
@ -2775,6 +2810,9 @@ void JavaClasses::compute_offsets() {
|
|||
java_dyn_MethodType::compute_offsets();
|
||||
java_dyn_MethodTypeForm::compute_offsets();
|
||||
}
|
||||
if (EnableInvokeDynamic) {
|
||||
sun_dyn_CallSiteImpl::compute_offsets();
|
||||
}
|
||||
java_security_AccessControlContext::compute_offsets();
|
||||
// Initialize reflection classes. The layouts of these classes
|
||||
// changed with the new reflection implementation in JDK 1.4, and
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue