src/share/vm/ci/ciEnv.cpp

Print this page
rev 1083 : code cache unloading for webrev 091214
rev 1085 : checkpoint unloading changes on 100107


 921                                frame_words, oop_map_set,
 922                                handler_table, inc_table,
 923                                compiler, comp_level);
 924 
 925     // Free codeBlobs
 926     code_buffer->free_blob();
 927 
 928     // stress test 6243940 by immediately making the method
 929     // non-entrant behind the system's back. This has serious
 930     // side effects on the code cache and is not meant for
 931     // general stress testing
 932     if (nm != NULL && StressNonEntrant) {
 933       MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag);
 934       NativeJump::patch_verified_entry(nm->entry_point(), nm->verified_entry_point(),
 935                   SharedRuntime::get_handle_wrong_method_stub());
 936     }
 937 
 938     if (nm == NULL) {
 939       // The CodeCache is full.  Print out warning and disable compilation.
 940       record_failure("code cache is full");
 941       UseInterpreter = true;
 942       if (UseCompiler || AlwaysCompileLoopMethods ) {
 943 #ifndef PRODUCT
 944         warning("CodeCache is full. Compiler has been disabled");
 945         if (CompileTheWorld || ExitOnFullCodeCache) {
 946           before_exit(JavaThread::current());
 947           exit_globals(); // will delete tty
 948           vm_direct_exit(CompileTheWorld ? 0 : 1);
 949         }
 950 #endif
 951         UseCompiler               = false;
 952         AlwaysCompileLoopMethods  = false;
 953       }
 954     } else {
 955       NOT_PRODUCT(nm->set_has_debug_info(has_debug_info); )
 956       nm->set_has_unsafe_access(has_unsafe_access);
 957 
 958       // Record successful registration.
 959       // (Put nm into the task handle *before* publishing to the Java heap.)
 960       if (task() != NULL)  task()->set_code(nm);
 961 
 962       if (entry_bci == InvocationEntryBci) {
 963 #ifdef TIERED
 964         // If there is an old version we're done with it
 965         nmethod* old = method->code();
 966         if (TraceMethodReplacement && old != NULL) {
 967           ResourceMark rm;
 968           char *method_name = method->name_and_sig_as_C_string();
 969           tty->print_cr("Replacing method %s", method_name);
 970         }
 971         if (old != NULL ) {
 972           old->make_not_entrant();




 921                                frame_words, oop_map_set,
 922                                handler_table, inc_table,
 923                                compiler, comp_level);
 924 
 925     // Free codeBlobs
 926     code_buffer->free_blob();
 927 
 928     // stress test 6243940 by immediately making the method
 929     // non-entrant behind the system's back. This has serious
 930     // side effects on the code cache and is not meant for
 931     // general stress testing
 932     if (nm != NULL && StressNonEntrant) {
 933       MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag);
 934       NativeJump::patch_verified_entry(nm->entry_point(), nm->verified_entry_point(),
 935                   SharedRuntime::get_handle_wrong_method_stub());
 936     }
 937 
 938     if (nm == NULL) {
 939       // The CodeCache is full.  Print out warning and disable compilation.
 940       record_failure("code cache is full");
 941       {
 942         MutexUnlocker ml(Compile_lock);
 943         MutexUnlocker locker(MethodCompileQueue_lock);
 944         CompileBroker::handle_full_code_cache();








 945       }
 946     } else {
 947       NOT_PRODUCT(nm->set_has_debug_info(has_debug_info); )
 948       nm->set_has_unsafe_access(has_unsafe_access);
 949 
 950       // Record successful registration.
 951       // (Put nm into the task handle *before* publishing to the Java heap.)
 952       if (task() != NULL)  task()->set_code(nm);
 953 
 954       if (entry_bci == InvocationEntryBci) {
 955 #ifdef TIERED
 956         // If there is an old version we're done with it
 957         nmethod* old = method->code();
 958         if (TraceMethodReplacement && old != NULL) {
 959           ResourceMark rm;
 960           char *method_name = method->name_and_sig_as_C_string();
 961           tty->print_cr("Replacing method %s", method_name);
 962         }
 963         if (old != NULL ) {
 964           old->make_not_entrant();