src/share/vm/interpreter/interpreterRuntime.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
8014013 Cdiff src/share/vm/interpreter/interpreterRuntime.cpp
src/share/vm/interpreter/interpreterRuntime.cpp
Print this page
*** 494,512 ****
// Fields
//
IRT_ENTRY(void, InterpreterRuntime::resolve_get_put(JavaThread* thread, Bytecodes::Code bytecode))
// resolve field
! FieldAccessInfo info;
constantPoolHandle pool(thread, method(thread)->constants());
bool is_put = (bytecode == Bytecodes::_putfield || bytecode == Bytecodes::_putstatic);
bool is_static = (bytecode == Bytecodes::_getstatic || bytecode == Bytecodes::_putstatic);
{
JvmtiHideSingleStepping jhss(thread);
! LinkResolver::resolve_field(info, pool, get_index_u2_cpcache(thread, bytecode),
! bytecode, false, CHECK);
} // end JvmtiHideSingleStepping
// check if link resolution caused cpCache to be updated
if (already_resolved(thread)) return;
--- 494,512 ----
// Fields
//
IRT_ENTRY(void, InterpreterRuntime::resolve_get_put(JavaThread* thread, Bytecodes::Code bytecode))
// resolve field
! fieldDescriptor info;
constantPoolHandle pool(thread, method(thread)->constants());
bool is_put = (bytecode == Bytecodes::_putfield || bytecode == Bytecodes::_putstatic);
bool is_static = (bytecode == Bytecodes::_getstatic || bytecode == Bytecodes::_putstatic);
{
JvmtiHideSingleStepping jhss(thread);
! LinkResolver::resolve_field_access(info, pool, get_index_u2_cpcache(thread, bytecode),
! bytecode, CHECK);
} // end JvmtiHideSingleStepping
// check if link resolution caused cpCache to be updated
if (already_resolved(thread)) return;
*** 522,532 ****
// We also need to delay resolving getstatic instructions until the
// class is intitialized. This is required so that access to the static
// field will call the initialization function every time until the class
// is completely initialized ala. in 2.17.5 in JVM Specification.
! InstanceKlass *klass = InstanceKlass::cast(info.klass()());
bool uninitialized_static = ((bytecode == Bytecodes::_getstatic || bytecode == Bytecodes::_putstatic) &&
!klass->is_initialized());
Bytecodes::Code get_code = (Bytecodes::Code)0;
if (!uninitialized_static) {
--- 522,532 ----
// We also need to delay resolving getstatic instructions until the
// class is intitialized. This is required so that access to the static
// field will call the initialization function every time until the class
// is completely initialized ala. in 2.17.5 in JVM Specification.
! InstanceKlass* klass = InstanceKlass::cast(info.field_holder());
bool uninitialized_static = ((bytecode == Bytecodes::_getstatic || bytecode == Bytecodes::_putstatic) &&
!klass->is_initialized());
Bytecodes::Code get_code = (Bytecodes::Code)0;
if (!uninitialized_static) {
*** 537,549 ****
}
cache_entry(thread)->set_field(
get_code,
put_code,
! info.klass(),
! info.field_index(),
! info.field_offset(),
state,
info.access_flags().is_final(),
info.access_flags().is_volatile(),
pool->pool_holder()
);
--- 537,549 ----
}
cache_entry(thread)->set_field(
get_code,
put_code,
! info.field_holder(),
! info.index(),
! info.offset(),
state,
info.access_flags().is_final(),
info.access_flags().is_volatile(),
pool->pool_holder()
);
*** 684,716 ****
// check if link resolution caused cpCache to be updated
if (already_resolved(thread)) return;
if (bytecode == Bytecodes::_invokeinterface) {
-
if (TraceItables && Verbose) {
ResourceMark rm(thread);
tty->print_cr("Resolving: klass: %s to method: %s", info.resolved_klass()->name()->as_C_string(), info.resolved_method()->name()->as_C_string());
}
if (info.resolved_method()->method_holder() ==
SystemDictionary::Object_klass()) {
// NOTE: THIS IS A FIX FOR A CORNER CASE in the JVM spec
! // (see also cpCacheOop.cpp for details)
methodHandle rm = info.resolved_method();
assert(rm->is_final() || info.has_vtable_index(),
"should have been set already");
! cache_entry(thread)->set_method(bytecode, rm, info.vtable_index());
} else {
// Setup itable entry
! int index = klassItable::compute_itable_index(info.resolved_method()());
! cache_entry(thread)->set_interface_call(info.resolved_method(), index);
}
} else {
! cache_entry(thread)->set_method(
bytecode,
info.resolved_method(),
info.vtable_index());
}
}
IRT_END
--- 684,742 ----
// check if link resolution caused cpCache to be updated
if (already_resolved(thread)) return;
if (bytecode == Bytecodes::_invokeinterface) {
if (TraceItables && Verbose) {
ResourceMark rm(thread);
tty->print_cr("Resolving: klass: %s to method: %s", info.resolved_klass()->name()->as_C_string(), info.resolved_method()->name()->as_C_string());
}
+ }
+ #ifdef ASSERT
+ if (bytecode == Bytecodes::_invokeinterface) {
if (info.resolved_method()->method_holder() ==
SystemDictionary::Object_klass()) {
// NOTE: THIS IS A FIX FOR A CORNER CASE in the JVM spec
! // (see also CallInfo::set_interface for details)
! assert(info.call_kind() == CallInfo::vtable_call ||
! info.call_kind() == CallInfo::direct_call, "");
methodHandle rm = info.resolved_method();
assert(rm->is_final() || info.has_vtable_index(),
"should have been set already");
! } else if (!info.resolved_method()->has_itable_index()) {
! // Resolved something like CharSequence.toString. Use vtable not itable.
! assert(info.call_kind() != CallInfo::itable_call, "");
} else {
// Setup itable entry
! assert(info.call_kind() == CallInfo::itable_call, "");
! int index = info.resolved_method()->itable_index();
! assert(info.itable_index() == index, "");
}
} else {
! assert(info.call_kind() == CallInfo::direct_call ||
! info.call_kind() == CallInfo::vtable_call, "");
! }
! #endif
! switch (info.call_kind()) {
! case CallInfo::direct_call:
! cache_entry(thread)->set_direct_call(
! bytecode,
! info.resolved_method());
! break;
! case CallInfo::vtable_call:
! cache_entry(thread)->set_vtable_call(
bytecode,
info.resolved_method(),
info.vtable_index());
+ break;
+ case CallInfo::itable_call:
+ cache_entry(thread)->set_itable_call(
+ bytecode,
+ info.resolved_method(),
+ info.itable_index());
+ break;
+ default: ShouldNotReachHere();
}
}
IRT_END
src/share/vm/interpreter/interpreterRuntime.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File