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. |
2019 } |
2019 } |
2020 } |
2020 } |
2021 return found_check; |
2021 return found_check; |
2022 } |
2022 } |
2023 |
2023 |
2024 bool nmethod::is_evol_dependent_on(Klass* dependee) { |
2024 bool nmethod::is_evol_dependent() { |
2025 InstanceKlass *dependee_ik = InstanceKlass::cast(dependee); |
|
2026 Array<Method*>* dependee_methods = dependee_ik->methods(); |
|
2027 for (Dependencies::DepStream deps(this); deps.next(); ) { |
2025 for (Dependencies::DepStream deps(this); deps.next(); ) { |
2028 if (deps.type() == Dependencies::evol_method) { |
2026 if (deps.type() == Dependencies::evol_method) { |
2029 Method* method = deps.method_argument(0); |
2027 Method* method = deps.method_argument(0); |
2030 for (int j = 0; j < dependee_methods->length(); j++) { |
2028 if (method->is_old()) { |
2031 if (dependee_methods->at(j) == method) { |
2029 if (log_is_enabled(Debug, redefine, class, nmethod)) { |
2032 if (log_is_enabled(Debug, redefine, class, nmethod)) { |
2030 ResourceMark rm; |
2033 ResourceMark rm; |
2031 log_debug(redefine, class, nmethod) |
2034 log_debug(redefine, class, nmethod) |
2032 ("Found evol dependency of nmethod %s.%s(%s) compile_id=%d on method %s.%s(%s)", |
2035 ("Found evol dependency of nmethod %s.%s(%s) compile_id=%d on method %s.%s(%s)", |
2033 _method->method_holder()->external_name(), |
2036 _method->method_holder()->external_name(), |
2034 _method->name()->as_C_string(), |
2037 _method->name()->as_C_string(), |
2035 _method->signature()->as_C_string(), |
2038 _method->signature()->as_C_string(), |
2036 compile_id(), |
2039 compile_id(), |
2037 method->method_holder()->external_name(), |
2040 method->method_holder()->external_name(), |
2038 method->name()->as_C_string(), |
2041 method->name()->as_C_string(), |
2039 method->signature()->as_C_string()); |
2042 method->signature()->as_C_string()); |
|
2043 } |
|
2044 if (TraceDependencies || LogCompilation) |
|
2045 deps.log_dependency(dependee); |
|
2046 return true; |
|
2047 } |
2040 } |
|
2041 if (TraceDependencies || LogCompilation) |
|
2042 deps.log_dependency(method->method_holder()); |
|
2043 return true; |
2048 } |
2044 } |
2049 } |
2045 } |
2050 } |
2046 } |
2051 return false; |
2047 return false; |
2052 } |
2048 } |