1055 // If there is an old version we're done with it
1056 CompiledMethod* old = method->code();
1057 if (TraceMethodReplacement && old != NULL) {
1058 ResourceMark rm;
1059 char *method_name = method->name_and_sig_as_C_string();
1060 tty->print_cr("Replacing method %s", method_name);
1061 }
1062 if (old != NULL) {
1063 old->make_not_used();
1064 }
1065 }
1066
1067 LogTarget(Info, nmethod, install) lt;
1068 if (lt.is_enabled()) {
1069 ResourceMark rm;
1070 char *method_name = method->name_and_sig_as_C_string();
1071 lt.print("Installing method (%d) %s ",
1072 task()->comp_level(), method_name);
1073 }
1074 // Allow the code to be executed
1075 method->set_code(method, nm);
1076 } else {
1077 LogTarget(Info, nmethod, install) lt;
1078 if (lt.is_enabled()) {
1079 ResourceMark rm;
1080 char *method_name = method->name_and_sig_as_C_string();
1081 lt.print("Installing osr method (%d) %s @ %d",
1082 task()->comp_level(), method_name, entry_bci);
1083 }
1084 method->method_holder()->add_osr_nmethod(nm);
1085 }
1086 nm->make_in_use();
1087 }
1088 } // safepoints are allowed again
1089
1090 if (nm != NULL) {
1091 // JVMTI -- compiled method notification (must be done outside lock)
1092 nm->post_compiled_method_load_event();
1093 } else {
1094 // The CodeCache is full.
1095 record_failure("code cache is full");
1096 }
1097 }
1098
1099
1100 // ------------------------------------------------------------------
1101 // ciEnv::find_system_klass
1102 ciKlass* ciEnv::find_system_klass(ciSymbol* klass_name) {
1103 VM_ENTRY_MARK;
1104 return get_klass_by_name_impl(NULL, constantPoolHandle(), klass_name, false);
1105 }
1106
|
1055 // If there is an old version we're done with it
1056 CompiledMethod* old = method->code();
1057 if (TraceMethodReplacement && old != NULL) {
1058 ResourceMark rm;
1059 char *method_name = method->name_and_sig_as_C_string();
1060 tty->print_cr("Replacing method %s", method_name);
1061 }
1062 if (old != NULL) {
1063 old->make_not_used();
1064 }
1065 }
1066
1067 LogTarget(Info, nmethod, install) lt;
1068 if (lt.is_enabled()) {
1069 ResourceMark rm;
1070 char *method_name = method->name_and_sig_as_C_string();
1071 lt.print("Installing method (%d) %s ",
1072 task()->comp_level(), method_name);
1073 }
1074 // Allow the code to be executed
1075 MutexLocker ml(CompiledMethod_lock, Mutex::_no_safepoint_check_flag);
1076 if (nm->make_in_use()) {
1077 method->set_code(method, nm);
1078 }
1079 } else {
1080 LogTarget(Info, nmethod, install) lt;
1081 if (lt.is_enabled()) {
1082 ResourceMark rm;
1083 char *method_name = method->name_and_sig_as_C_string();
1084 lt.print("Installing osr method (%d) %s @ %d",
1085 task()->comp_level(), method_name, entry_bci);
1086 }
1087 MutexLocker ml(CompiledMethod_lock, Mutex::_no_safepoint_check_flag);
1088 if (nm->make_in_use()) {
1089 method->method_holder()->add_osr_nmethod(nm);
1090 }
1091 }
1092 }
1093 } // safepoints are allowed again
1094
1095 if (nm != NULL) {
1096 // JVMTI -- compiled method notification (must be done outside lock)
1097 nm->post_compiled_method_load_event();
1098 } else {
1099 // The CodeCache is full.
1100 record_failure("code cache is full");
1101 }
1102 }
1103
1104
1105 // ------------------------------------------------------------------
1106 // ciEnv::find_system_klass
1107 ciKlass* ciEnv::find_system_klass(ciSymbol* klass_name) {
1108 VM_ENTRY_MARK;
1109 return get_klass_by_name_impl(NULL, constantPoolHandle(), klass_name, false);
1110 }
1111
|