src/share/vm/runtime/sharedRuntime.cpp

changeset 6240
9b4ce069642e
parent 5628
f98f5d48f511
child 5762
891687731b59
child 5784
190899198332
     1.1 --- a/src/share/vm/runtime/sharedRuntime.cpp	Fri Sep 06 09:55:38 2013 +0100
     1.2 +++ b/src/share/vm/runtime/sharedRuntime.cpp	Sat Sep 14 20:40:34 2013 +0100
     1.3 @@ -1051,7 +1051,8 @@
     1.4  
     1.5    // Find receiver for non-static call
     1.6    if (bc != Bytecodes::_invokestatic &&
     1.7 -      bc != Bytecodes::_invokedynamic) {
     1.8 +      bc != Bytecodes::_invokedynamic &&
     1.9 +      bc != Bytecodes::_invokehandle) {
    1.10      // This register map must be update since we need to find the receiver for
    1.11      // compiled frames. The receiver might be in a register.
    1.12      RegisterMap reg_map2(thread);
    1.13 @@ -1078,7 +1079,7 @@
    1.14  
    1.15  #ifdef ASSERT
    1.16    // Check that the receiver klass is of the right subtype and that it is initialized for virtual calls
    1.17 -  if (bc != Bytecodes::_invokestatic && bc != Bytecodes::_invokedynamic) {
    1.18 +  if (bc != Bytecodes::_invokestatic && bc != Bytecodes::_invokedynamic && bc != Bytecodes::_invokehandle) {
    1.19      assert(receiver.not_null(), "should have thrown exception");
    1.20      KlassHandle receiver_klass(THREAD, receiver->klass());
    1.21      Klass* rk = constants->klass_ref_at(bytecode_index, CHECK_(nullHandle));
    1.22 @@ -1240,9 +1241,9 @@
    1.23  #endif
    1.24  
    1.25    if (is_virtual) {
    1.26 -    assert(receiver.not_null(), "sanity check");
    1.27 +    assert(receiver.not_null() || invoke_code == Bytecodes::_invokehandle, "sanity check");
    1.28      bool static_bound = call_info.resolved_method()->can_be_statically_bound();
    1.29 -    KlassHandle h_klass(THREAD, receiver->klass());
    1.30 +    KlassHandle h_klass(THREAD, invoke_code == Bytecodes::_invokehandle ? NULL : receiver->klass());
    1.31      CompiledIC::compute_monomorphic_entry(callee_method, h_klass,
    1.32                       is_optimized, static_bound, virtual_call_info,
    1.33                       CHECK_(methodHandle()));

mercurial