equal
deleted
inserted
replaced
2963 } |
2963 } |
2964 #endif // INCLUDE_JVMTI |
2964 #endif // INCLUDE_JVMTI |
2965 |
2965 |
2966 // On-stack replacement stuff |
2966 // On-stack replacement stuff |
2967 void InstanceKlass::add_osr_nmethod(nmethod* n) { |
2967 void InstanceKlass::add_osr_nmethod(nmethod* n) { |
|
2968 #ifndef PRODUCT |
|
2969 if (TieredCompilation) { |
|
2970 nmethod * prev = lookup_osr_nmethod(n->method(), n->osr_entry_bci(), n->comp_level(), true); |
|
2971 assert(prev == NULL || !prev->is_in_use(), |
|
2972 "redundunt OSR recompilation detected. memory leak in CodeCache!"); |
|
2973 } |
|
2974 #endif |
2968 // only one compilation can be active |
2975 // only one compilation can be active |
2969 { |
2976 { |
2970 // This is a short non-blocking critical region, so the no safepoint check is ok. |
2977 // This is a short non-blocking critical region, so the no safepoint check is ok. |
2971 MutexLocker ml(OsrList_lock, Mutex::_no_safepoint_check_flag); |
2978 MutexLocker ml(OsrList_lock, Mutex::_no_safepoint_check_flag); |
2972 assert(n->is_osr_method(), "wrong kind of nmethod"); |
2979 assert(n->is_osr_method(), "wrong kind of nmethod"); |
3081 } |
3088 } |
3082 } |
3089 } |
3083 } |
3090 } |
3084 osr = osr->osr_link(); |
3091 osr = osr->osr_link(); |
3085 } |
3092 } |
3086 if (best != NULL && best->comp_level() >= comp_level && match_level == false) { |
3093 |
|
3094 assert(match_level == false || best == NULL, "shouldn't pick up anything if match_level is set"); |
|
3095 if (best != NULL && best->comp_level() >= comp_level) { |
3087 return best; |
3096 return best; |
3088 } |
3097 } |
3089 return NULL; |
3098 return NULL; |
3090 } |
3099 } |
3091 |
3100 |