src/share/vm/ci/ciStreams.cpp

changeset 1161
be93aad57795
parent 435
a61af66fc99e
child 1279
bd02caa94611
     1.1 --- a/src/share/vm/ci/ciStreams.cpp	Mon Apr 20 14:48:03 2009 -0700
     1.2 +++ b/src/share/vm/ci/ciStreams.cpp	Tue Apr 21 23:21:04 2009 -0700
     1.3 @@ -301,17 +301,19 @@
     1.4  // If this is a method invocation bytecode, get the constant pool
     1.5  // index of the invoked method.
     1.6  int ciBytecodeStream::get_method_index() {
     1.7 +#ifdef ASSERT
     1.8    switch (cur_bc()) {
     1.9    case Bytecodes::_invokeinterface:
    1.10 -    return Bytes::get_Java_u2(_pc-4);
    1.11    case Bytecodes::_invokevirtual:
    1.12    case Bytecodes::_invokespecial:
    1.13    case Bytecodes::_invokestatic:
    1.14 -    return get_index_big();
    1.15 +  case Bytecodes::_invokedynamic:
    1.16 +    break;
    1.17    default:
    1.18      ShouldNotReachHere();
    1.19 -    return 0;
    1.20    }
    1.21 +#endif
    1.22 +  return get_index_int();
    1.23  }
    1.24  
    1.25  // ------------------------------------------------------------------
    1.26 @@ -337,6 +339,9 @@
    1.27  // for checking linkability when retrieving the associated method.
    1.28  ciKlass* ciBytecodeStream::get_declared_method_holder() {
    1.29    bool ignore;
    1.30 +  // report as Dynamic for invokedynamic, which is syntactically classless
    1.31 +  if (cur_bc() == Bytecodes::_invokedynamic)
    1.32 +    return CURRENT_ENV->get_klass_by_name(_holder, ciSymbol::java_dyn_Dynamic(), false);
    1.33    return CURRENT_ENV->get_klass_by_index(_holder, get_method_holder_index(), ignore);
    1.34  }
    1.35  

mercurial