src/share/vm/oops/instanceKlass.cpp

changeset 9690
61d955db2a5b
parent 9507
7e72702243a4
child 9703
2fdf635bcf28
child 9721
78c11f573795
equal deleted inserted replaced
9689:89dcef434423 9690:61d955db2a5b
1 /* 1 /*
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
2923 } 2923 }
2924 #endif // INCLUDE_JVMTI 2924 #endif // INCLUDE_JVMTI
2925 2925
2926 // On-stack replacement stuff 2926 // On-stack replacement stuff
2927 void InstanceKlass::add_osr_nmethod(nmethod* n) { 2927 void InstanceKlass::add_osr_nmethod(nmethod* n) {
2928 #ifndef PRODUCT
2929 if (TieredCompilation) {
2930 nmethod * prev = lookup_osr_nmethod(n->method(), n->osr_entry_bci(), n->comp_level(), true);
2931 assert(prev == NULL || !prev->is_in_use(),
2932 "redundunt OSR recompilation detected. memory leak in CodeCache!");
2933 }
2934 #endif
2928 // only one compilation can be active 2935 // only one compilation can be active
2929 NEEDS_CLEANUP 2936 NEEDS_CLEANUP
2930 // This is a short non-blocking critical region, so the no safepoint check is ok. 2937 // This is a short non-blocking critical region, so the no safepoint check is ok.
2931 OsrList_lock->lock_without_safepoint_check(); 2938 OsrList_lock->lock_without_safepoint_check();
2932 assert(n->is_osr_method(), "wrong kind of nmethod"); 2939 assert(n->is_osr_method(), "wrong kind of nmethod");
3044 } 3051 }
3045 } 3052 }
3046 osr = osr->osr_link(); 3053 osr = osr->osr_link();
3047 } 3054 }
3048 OsrList_lock->unlock(); 3055 OsrList_lock->unlock();
3049 if (best != NULL && best->comp_level() >= comp_level && match_level == false) { 3056
3057 assert(match_level == false || best == NULL, "shouldn't pick up anything if match_level is set");
3058 if (best != NULL && best->comp_level() >= comp_level) {
3050 return best; 3059 return best;
3051 } 3060 }
3052 return NULL; 3061 return NULL;
3053 } 3062 }
3054 3063

mercurial