hotspot/src/share/vm/oops/methodOop.cpp
changeset 9971 d496ecd7b9de
parent 9134 189a8c094016
child 9972 a91e8e564b52
--- a/hotspot/src/share/vm/oops/methodOop.cpp	Fri May 20 22:27:48 2011 -0700
+++ b/hotspot/src/share/vm/oops/methodOop.cpp	Sat May 21 15:39:54 2011 -0700
@@ -693,7 +693,10 @@
 // Called when the method_holder is getting linked. Setup entrypoints so the method
 // is ready to be called from interpreter, compiler, and vtables.
 void methodOopDesc::link_method(methodHandle h_method, TRAPS) {
-  assert(_i2i_entry == NULL, "should only be called once");
+  // If the code cache is full, we may reenter this function for the
+  // leftover methods that weren't linked.
+  if (_i2i_entry != NULL) return;
+
   assert(_adapter == NULL, "init'd to NULL" );
   assert( _code == NULL, "nothing compiled yet" );
 
@@ -717,7 +720,7 @@
   // called from the vtable.  We need adapters on such methods that get loaded
   // later.  Ditto for mega-morphic itable calls.  If this proves to be a
   // problem we'll make these lazily later.
-  (void) make_adapters(h_method, CHECK);
+  if (UseCompiler) (void) make_adapters(h_method, CHECK);
 
   // ONLY USE the h_method now as make_adapter may have blocked