src/share/vm/runtime/sharedRuntime.cpp

changeset 6113
570aaefce624
parent 5785
a5ac0873476c
child 6172
df832bd8edb9
child 6492
1174c8abbdb6
     1.1 --- a/src/share/vm/runtime/sharedRuntime.cpp	Fri Nov 15 07:58:06 2013 -0800
     1.2 +++ b/src/share/vm/runtime/sharedRuntime.cpp	Mon Nov 18 12:26:51 2013 -0800
     1.3 @@ -84,6 +84,7 @@
     1.4  
     1.5  // Shared stub locations
     1.6  RuntimeStub*        SharedRuntime::_wrong_method_blob;
     1.7 +RuntimeStub*        SharedRuntime::_wrong_method_abstract_blob;
     1.8  RuntimeStub*        SharedRuntime::_ic_miss_blob;
     1.9  RuntimeStub*        SharedRuntime::_resolve_opt_virtual_call_blob;
    1.10  RuntimeStub*        SharedRuntime::_resolve_virtual_call_blob;
    1.11 @@ -101,11 +102,12 @@
    1.12  
    1.13  //----------------------------generate_stubs-----------------------------------
    1.14  void SharedRuntime::generate_stubs() {
    1.15 -  _wrong_method_blob                   = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::handle_wrong_method),         "wrong_method_stub");
    1.16 -  _ic_miss_blob                        = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::handle_wrong_method_ic_miss), "ic_miss_stub");
    1.17 -  _resolve_opt_virtual_call_blob       = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_opt_virtual_call_C),  "resolve_opt_virtual_call");
    1.18 -  _resolve_virtual_call_blob           = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_virtual_call_C),      "resolve_virtual_call");
    1.19 -  _resolve_static_call_blob            = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_static_call_C),       "resolve_static_call");
    1.20 +  _wrong_method_blob                   = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::handle_wrong_method),          "wrong_method_stub");
    1.21 +  _wrong_method_abstract_blob          = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::handle_wrong_method_abstract), "wrong_method_abstract_stub");
    1.22 +  _ic_miss_blob                        = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::handle_wrong_method_ic_miss),  "ic_miss_stub");
    1.23 +  _resolve_opt_virtual_call_blob       = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_opt_virtual_call_C),   "resolve_opt_virtual_call");
    1.24 +  _resolve_virtual_call_blob           = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_virtual_call_C),       "resolve_virtual_call");
    1.25 +  _resolve_static_call_blob            = generate_resolve_blob(CAST_FROM_FN_PTR(address, SharedRuntime::resolve_static_call_C),        "resolve_static_call");
    1.26  
    1.27  #ifdef COMPILER2
    1.28    // Vectors are generated only by C2.
    1.29 @@ -1345,6 +1347,11 @@
    1.30    return callee_method->verified_code_entry();
    1.31  JRT_END
    1.32  
    1.33 +// Handle abstract method call
    1.34 +JRT_BLOCK_ENTRY(address, SharedRuntime::handle_wrong_method_abstract(JavaThread* thread))
    1.35 +  return StubRoutines::throw_AbstractMethodError_entry();
    1.36 +JRT_END
    1.37 +
    1.38  
    1.39  // resolve a static call and patch code
    1.40  JRT_BLOCK_ENTRY(address, SharedRuntime::resolve_static_call_C(JavaThread *thread ))
    1.41 @@ -2341,12 +2348,13 @@
    1.42  
    1.43    // Create a special handler for abstract methods.  Abstract methods
    1.44    // are never compiled so an i2c entry is somewhat meaningless, but
    1.45 -  // fill it in with something appropriate just in case.  Pass handle
    1.46 -  // wrong method for the c2i transitions.
    1.47 -  address wrong_method = SharedRuntime::get_handle_wrong_method_stub();
    1.48 +  // throw AbstractMethodError just in case.
    1.49 +  // Pass wrong_method_abstract for the c2i transitions to return
    1.50 +  // AbstractMethodError for invalid invocations.
    1.51 +  address wrong_method_abstract = SharedRuntime::get_handle_wrong_method_abstract_stub();
    1.52    _abstract_method_handler = AdapterHandlerLibrary::new_entry(new AdapterFingerPrint(0, NULL),
    1.53                                                                StubRoutines::throw_AbstractMethodError_entry(),
    1.54 -                                                              wrong_method, wrong_method);
    1.55 +                                                              wrong_method_abstract, wrong_method_abstract);
    1.56  }
    1.57  
    1.58  AdapterHandlerEntry* AdapterHandlerLibrary::new_entry(AdapterFingerPrint* fingerprint,

mercurial