diff -r 928912ce8438 -r be93aad57795 src/share/vm/ci/ciStreams.cpp --- a/src/share/vm/ci/ciStreams.cpp Mon Apr 20 14:48:03 2009 -0700 +++ b/src/share/vm/ci/ciStreams.cpp Tue Apr 21 23:21:04 2009 -0700 @@ -301,17 +301,19 @@ // If this is a method invocation bytecode, get the constant pool // index of the invoked method. int ciBytecodeStream::get_method_index() { +#ifdef ASSERT switch (cur_bc()) { case Bytecodes::_invokeinterface: - return Bytes::get_Java_u2(_pc-4); case Bytecodes::_invokevirtual: case Bytecodes::_invokespecial: case Bytecodes::_invokestatic: - return get_index_big(); + case Bytecodes::_invokedynamic: + break; default: ShouldNotReachHere(); - return 0; } +#endif + return get_index_int(); } // ------------------------------------------------------------------ @@ -337,6 +339,9 @@ // for checking linkability when retrieving the associated method. ciKlass* ciBytecodeStream::get_declared_method_holder() { bool ignore; + // report as Dynamic for invokedynamic, which is syntactically classless + if (cur_bc() == Bytecodes::_invokedynamic) + return CURRENT_ENV->get_klass_by_name(_holder, ciSymbol::java_dyn_Dynamic(), false); return CURRENT_ENV->get_klass_by_index(_holder, get_method_holder_index(), ignore); }