8036956: remove EnableInvokeDynamic flag

The EnableInvokeDynamic flag and all support code is removed because it is not longer used in JDK 9.

Reviewed-by: kvn, twisti
This commit is contained in:
Tobias Hartmann 2014-04-29 08:08:44 +02:00 committed by Albert Noll
parent 3fddcd2712
commit 06c26b6f97
35 changed files with 51 additions and 235 deletions

View file

@ -507,25 +507,8 @@ BytecodeInterpreter::run(interpreterState istate) {
#ifdef ASSERT
if (istate->_msg != initialize) {
// We have a problem here if we are running with a pre-hsx24 JDK (for example during bootstrap)
// because in that case, EnableInvokeDynamic is true by default but will be later switched off
// if java_lang_invoke_MethodHandle::compute_offsets() detects that the JDK only has the classes
// for the old JSR292 implementation.
// This leads to a situation where 'istate->_stack_limit' always accounts for
// methodOopDesc::extra_stack_entries() because it is computed in
// CppInterpreterGenerator::generate_compute_interpreter_state() which was generated while
// EnableInvokeDynamic was still true. On the other hand, istate->_method->max_stack() doesn't
// account for extra_stack_entries() anymore because at the time when it is called
// EnableInvokeDynamic was already set to false.
// So we have a second version of the assertion which handles the case where EnableInvokeDynamic was
// switched off because of the wrong classes.
if (EnableInvokeDynamic || FLAG_IS_CMDLINE(EnableInvokeDynamic)) {
assert(labs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + 1), "bad stack limit");
} else {
const int extra_stack_entries = Method::extra_stack_entries_for_jsr292;
assert(labs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + extra_stack_entries
+ 1), "bad stack limit");
}
assert(labs(istate->_stack_base - istate->_stack_limit) == (istate->_method->max_stack() + 1), "bad stack limit");
}
#ifndef SHARK
IA32_ONLY(assert(istate->_stack_limit == istate->_thread->last_Java_sp() + 1, "wrong"));
#endif // !SHARK
@ -2458,15 +2441,6 @@ run:
CASE(_invokedynamic): {
if (!EnableInvokeDynamic) {
// We should not encounter this bytecode if !EnableInvokeDynamic.
// The verifier will stop it. However, if we get past the verifier,
// this will stop the thread in a reasonable way, without crashing the JVM.
CALL_VM(InterpreterRuntime::throw_IncompatibleClassChangeError(THREAD),
handle_exception);
ShouldNotReachHere();
}
u4 index = Bytes::get_native_u4(pc+1);
ConstantPoolCacheEntry* cache = cp->constant_pool()->invokedynamic_cp_cache_entry_at(index);
@ -2501,10 +2475,6 @@ run:
CASE(_invokehandle): {
if (!EnableInvokeDynamic) {
ShouldNotReachHere();
}
u2 index = Bytes::get_native_u2(pc+1);
ConstantPoolCacheEntry* cache = cp->entry_at(index);

View file

@ -224,7 +224,7 @@ class Bytecodes: AllStatic {
_invokespecial = 183, // 0xb7
_invokestatic = 184, // 0xb8
_invokeinterface = 185, // 0xb9
_invokedynamic = 186, // 0xba // if EnableInvokeDynamic
_invokedynamic = 186, // 0xba
_new = 187, // 0xbb
_newarray = 188, // 0xbc
_anewarray = 189, // 0xbd

View file

@ -769,7 +769,6 @@ IRT_END
// First time execution: Resolve symbols, create a permanent MethodType object.
IRT_ENTRY(void, InterpreterRuntime::resolve_invokehandle(JavaThread* thread)) {
assert(EnableInvokeDynamic, "");
const Bytecodes::Code bytecode = Bytecodes::_invokehandle;
// resolve method
@ -789,7 +788,6 @@ IRT_END
// First time execution: Resolve symbols, create a permanent CallSite object.
IRT_ENTRY(void, InterpreterRuntime::resolve_invokedynamic(JavaThread* thread)) {
assert(EnableInvokeDynamic, "");
const Bytecodes::Code bytecode = Bytecodes::_invokedynamic;
//TO DO: consider passing BCI to Java.

View file

@ -270,7 +270,7 @@ void LinkResolver::lookup_method_in_klasses(methodHandle& result, KlassHandle kl
}
}
if (checkpolymorphism && EnableInvokeDynamic && result_oop != NULL) {
if (checkpolymorphism && result_oop != NULL) {
vmIntrinsics::ID iid = result_oop->intrinsic_id();
if (MethodHandles::is_signature_polymorphic(iid)) {
// Do not link directly to these. The VM must produce a synthetic one using lookup_polymorphic_method.
@ -345,8 +345,7 @@ void LinkResolver::lookup_polymorphic_method(methodHandle& result,
vmIntrinsics::name_at(iid), klass->external_name(),
name->as_C_string(), full_signature->as_C_string());
}
if (EnableInvokeDynamic &&
klass() == SystemDictionary::MethodHandle_klass() &&
if (klass() == SystemDictionary::MethodHandle_klass() &&
iid != vmIntrinsics::_none) {
if (MethodHandles::is_signature_polymorphic_intrinsic(iid)) {
// Most of these do not need an up-call to Java to resolve, so can be done anywhere.
@ -1543,7 +1542,6 @@ void LinkResolver::resolve_invokeinterface(CallInfo& result, Handle recv, consta
void LinkResolver::resolve_invokehandle(CallInfo& result, constantPoolHandle pool, int index, TRAPS) {
assert(EnableInvokeDynamic, "");
// This guy is reached from InterpreterRuntime::resolve_invokehandle.
KlassHandle resolved_klass;
Symbol* method_name = NULL;
@ -1575,8 +1573,6 @@ void LinkResolver::resolve_handle_call(CallInfo& result, KlassHandle resolved_kl
void LinkResolver::resolve_invokedynamic(CallInfo& result, constantPoolHandle pool, int index, TRAPS) {
assert(EnableInvokeDynamic, "");
//resolve_pool(<resolved_klass>, method_name, method_signature, current_klass, pool, index, CHECK);
Symbol* method_name = pool->name_ref_at(index);
Symbol* method_signature = pool->signature_ref_at(index);