--- a/hotspot/src/share/vm/ci/ciEnv.cpp Wed Nov 06 06:51:24 2013 -0800
+++ b/hotspot/src/share/vm/ci/ciEnv.cpp Fri Nov 08 01:13:11 2013 -0800
@@ -935,7 +935,9 @@
// Prevent SystemDictionary::add_to_hierarchy from running
// and invalidating our dependencies until we install this method.
+ // No safepoints are allowed. Otherwise, class redefinition can occur in between.
MutexLocker ml(Compile_lock);
+ No_Safepoint_Verifier nsv;
// Change in Jvmti state may invalidate compilation.
if (!failing() &&
@@ -1001,16 +1003,6 @@
// Free codeBlobs
code_buffer->free_blob();
- // stress test 6243940 by immediately making the method
- // non-entrant behind the system's back. This has serious
- // side effects on the code cache and is not meant for
- // general stress testing
- if (nm != NULL && StressNonEntrant) {
- MutexLockerEx pl(Patching_lock, Mutex::_no_safepoint_check_flag);
- NativeJump::patch_verified_entry(nm->entry_point(), nm->verified_entry_point(),
- SharedRuntime::get_handle_wrong_method_stub());
- }
-
if (nm == NULL) {
// The CodeCache is full. Print out warning and disable compilation.
record_failure("code cache is full");
@@ -1036,11 +1028,11 @@
char *method_name = method->name_and_sig_as_C_string();
tty->print_cr("Replacing method %s", method_name);
}
- if (old != NULL ) {
+ if (old != NULL) {
old->make_not_entrant();
}
}
- if (TraceNMethodInstalls ) {
+ if (TraceNMethodInstalls) {
ResourceMark rm;
char *method_name = method->name_and_sig_as_C_string();
ttyLocker ttyl;
@@ -1051,7 +1043,7 @@
// Allow the code to be executed
method->set_code(method, nm);
} else {
- if (TraceNMethodInstalls ) {
+ if (TraceNMethodInstalls) {
ResourceMark rm;
char *method_name = method->name_and_sig_as_C_string();
ttyLocker ttyl;
@@ -1061,7 +1053,6 @@
entry_bci);
}
method->method_holder()->add_osr_nmethod(nm);
-
}
}
}