src/share/vm/oops/methodOop.cpp

Print this page
rev 4509 : 7196277: JSR 292: Two jck/runtime tests crash on java.lang.invoke.MethodHandle.invokeExact
Reviewed-by: jrose, kvn


 738   set_interpreter_throwout_count(0);
 739   set_interpreter_invocation_count(0);
 740 }
 741 
 742 // Called when the method_holder is getting linked. Setup entrypoints so the method
 743 // is ready to be called from interpreter, compiler, and vtables.
 744 void methodOopDesc::link_method(methodHandle h_method, TRAPS) {
 745   // If the code cache is full, we may reenter this function for the
 746   // leftover methods that weren't linked.
 747   if (_i2i_entry != NULL) return;
 748 
 749   assert(_adapter == NULL, "init'd to NULL" );
 750   assert( _code == NULL, "nothing compiled yet" );
 751 
 752   // Setup interpreter entrypoint
 753   assert(this == h_method(), "wrong h_method()" );
 754   address entry = Interpreter::entry_for_method(h_method);
 755   assert(entry != NULL, "interpreter entry must be non-null");
 756   // Sets both _i2i_entry and _from_interpreted_entry
 757   set_interpreter_entry(entry);
 758   if (is_native() && !is_method_handle_intrinsic()) {


 759     set_native_function(
 760       SharedRuntime::native_method_throw_unsatisfied_link_error_entry(),
 761       !native_bind_event_is_interesting);
 762   }
 763 
 764   // Setup compiler entrypoint.  This is made eagerly, so we do not need
 765   // special handling of vtables.  An alternative is to make adapters more
 766   // lazily by calling make_adapter() from from_compiled_entry() for the
 767   // normal calls.  For vtable calls life gets more complicated.  When a
 768   // call-site goes mega-morphic we need adapters in all methods which can be
 769   // called from the vtable.  We need adapters on such methods that get loaded
 770   // later.  Ditto for mega-morphic itable calls.  If this proves to be a
 771   // problem we'll make these lazily later.
 772   (void) make_adapters(h_method, CHECK);
 773 
 774   // ONLY USE the h_method now as make_adapter may have blocked
 775 
 776 }
 777 
 778 address methodOopDesc::make_adapters(methodHandle mh, TRAPS) {




 738   set_interpreter_throwout_count(0);
 739   set_interpreter_invocation_count(0);
 740 }
 741 
 742 // Called when the method_holder is getting linked. Setup entrypoints so the method
 743 // is ready to be called from interpreter, compiler, and vtables.
 744 void methodOopDesc::link_method(methodHandle h_method, TRAPS) {
 745   // If the code cache is full, we may reenter this function for the
 746   // leftover methods that weren't linked.
 747   if (_i2i_entry != NULL) return;
 748 
 749   assert(_adapter == NULL, "init'd to NULL" );
 750   assert( _code == NULL, "nothing compiled yet" );
 751 
 752   // Setup interpreter entrypoint
 753   assert(this == h_method(), "wrong h_method()" );
 754   address entry = Interpreter::entry_for_method(h_method);
 755   assert(entry != NULL, "interpreter entry must be non-null");
 756   // Sets both _i2i_entry and _from_interpreted_entry
 757   set_interpreter_entry(entry);
 758 
 759   // Don't overwrite already registered native entries.
 760   if (is_native() && !has_native_function()) {
 761     set_native_function(
 762       SharedRuntime::native_method_throw_unsatisfied_link_error_entry(),
 763       !native_bind_event_is_interesting);
 764   }
 765 
 766   // Setup compiler entrypoint.  This is made eagerly, so we do not need
 767   // special handling of vtables.  An alternative is to make adapters more
 768   // lazily by calling make_adapter() from from_compiled_entry() for the
 769   // normal calls.  For vtable calls life gets more complicated.  When a
 770   // call-site goes mega-morphic we need adapters in all methods which can be
 771   // called from the vtable.  We need adapters on such methods that get loaded
 772   // later.  Ditto for mega-morphic itable calls.  If this proves to be a
 773   // problem we'll make these lazily later.
 774   (void) make_adapters(h_method, CHECK);
 775 
 776   // ONLY USE the h_method now as make_adapter may have blocked
 777 
 778 }
 779 
 780 address methodOopDesc::make_adapters(methodHandle mh, TRAPS) {