1 /*
2 * Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #include "compiler/abstractCompiler.hpp"
26 #include "compiler/compileBroker.hpp"
27 #include "compiler/disassembler.hpp"
28 #include "oops/oop.inline.hpp"
29 #include "runtime/interfaceSupport.inline.hpp"
30 #include "runtime/methodDetails.hpp"
31
32 Symbol* MethodDetails::class_name() {
33 if (_class_name == nullptr) {
34 if (_method_handle != nullptr) {
35 _class_name = (*_method_handle)->method_holder()->name();
36 } else if (_ci_method != nullptr) {
37 _class_name = _ci_method->holder()->name()->get_symbol();
38 } else if (_method != nullptr) {
39 _class_name = _method->method_holder()->name();
40 }
41 }
42 return _class_name;
43 }
44
45 Symbol* MethodDetails::method_name() {
46 if (_method_name == nullptr) {
47 if (_method_handle != nullptr) {
48 _method_name = (*_method_handle)->name();
49 } else if (_ci_method != nullptr) {
50 _method_name = _ci_method->name()->get_symbol();
51 } else if (_method != nullptr) {
52 _method_name = _method->name();
53 }
54 }
55 return _method_name;
56 }
57
58 Symbol* MethodDetails::signature() {
59 if (_signature == nullptr) {
60 if (_method_handle != nullptr) {
61 _signature = (*_method_handle)->signature();
62 } else if (_ci_method != nullptr) {
63 _signature = _ci_method->signature()->as_symbol()->get_symbol();
64 } else if (_method != nullptr) {
65 _signature = _method->signature();
66 }
67 }
68 return _signature;
69 }