--- old/src/share/vm/opto/callGenerator.cpp 2011-10-24 02:24:27.543074789 -0700 +++ new/src/share/vm/opto/callGenerator.cpp 2011-10-24 02:24:27.277283643 -0700 @@ -738,6 +738,11 @@ ciMethod* caller, ciMethod* callee, ciCallProfile profile) { ciMethodHandle* method_handle = call_site->get_target(); + // Don't inline if there were already too many traps. + if (call_site->too_many_traps()) { + return NULL; + } + // Set the callee to have access to the class and signature in the // MethodHandleCompiler. method_handle->set_callee(callee);