Mercurial > hg > truffle
diff src/share/vm/ci/ciStreams.cpp @ 726:be93aad57795
6655646: dynamic languages need dynamically linked call sites
Summary: invokedynamic instruction (JSR 292 RI)
Reviewed-by: twisti, never
author | jrose |
---|---|
date | Tue, 21 Apr 2009 23:21:04 -0700 |
parents | a61af66fc99e |
children | bd02caa94611 |
line wrap: on
line diff
--- 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); }