# HG changeset patch # User kvn # Date 1203731713 28800 # Node ID 67914967a4b5187fca09e2712bbf0c6581831abb # Parent 1f530c629c7d369c9f750d960eea02d8e1bffd6f 6650373: Assert in methodOopDesc::make_adapters() Summary: AdapterHandlerLibrary::get_create_adapter_index() returns incorrect value (-2) when CodeCache is full. Reviewed-by: sgoldman diff -r 1f530c629c7d -r 67914967a4b5 src/share/vm/opto/output.cpp --- a/src/share/vm/opto/output.cpp Thu Feb 21 19:03:44 2008 -0800 +++ b/src/share/vm/opto/output.cpp Fri Feb 22 17:55:13 2008 -0800 @@ -921,11 +921,8 @@ // blown the code cache size. C->record_failure("excessive request to CodeCache"); } else { - UseInterpreter = true; - UseCompiler = false; - AlwaysCompileLoopMethods = false; + // Let CompilerBroker disable further compilations. C->record_failure("CodeCache is full"); - warning("CodeCache is full. Compiling has been disabled"); } } diff -r 1f530c629c7d -r 67914967a4b5 src/share/vm/runtime/sharedRuntime.cpp --- a/src/share/vm/runtime/sharedRuntime.cpp Thu Feb 21 19:03:44 2008 -0800 +++ b/src/share/vm/runtime/sharedRuntime.cpp Fri Feb 22 17:55:13 2008 -0800 @@ -1839,7 +1839,25 @@ regs); B = BufferBlob::create(AdapterHandlerEntry::name, &buffer); - if (B == NULL) return -2; // Out of CodeCache space + if (B == NULL) { + // CodeCache is full, disable compilation + // Ought to log this but compile log is only per compile thread + // and we're some non descript Java thread. + UseInterpreter = true; + if (UseCompiler || AlwaysCompileLoopMethods ) { +#ifndef PRODUCT + warning("CodeCache is full. Compiler has been disabled"); + if (CompileTheWorld || ExitOnFullCodeCache) { + before_exit(JavaThread::current()); + exit_globals(); // will delete tty + vm_direct_exit(CompileTheWorld ? 0 : 1); + } +#endif + UseCompiler = false; + AlwaysCompileLoopMethods = false; + } + return 0; // Out of CodeCache space (_handlers[0] == NULL) + } entry->relocate(B->instructions_begin()); #ifndef PRODUCT // debugging suppport