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"); |