annotate src/share/vm/utilities/constantTag.cpp @ 11092:59b052799158

8015884: runThese crashed with SIGSEGV, hs_err has an error instead of stacktrace Summary: Dl_info struct should only be used if dladdr() has returned non-zero (no errors) and always check the dladdr() return value; Dl_info.dli_sname and Dl_info.dli_saddr fields should only be used if non-NULL; update/improve runtime/6888954/vmerrors.sh test Reviewed-by: dsamersoff, zgu, hseigel, coleenp
author dcubed
date Thu, 04 Jul 2013 21:10:17 -0700
parents f16e75e0cf11
children 28ca974cc21a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
8104
f16e75e0cf11 8000797: NPG: is_pseudo_string_at() doesn't work
coleenp
parents: 6725
diff changeset
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
a61af66fc99e Initial load
duke
parents:
diff changeset
4 *
a61af66fc99e Initial load
duke
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
a61af66fc99e Initial load
duke
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
a61af66fc99e Initial load
duke
parents:
diff changeset
7 * published by the Free Software Foundation.
a61af66fc99e Initial load
duke
parents:
diff changeset
8 *
a61af66fc99e Initial load
duke
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
a61af66fc99e Initial load
duke
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a61af66fc99e Initial load
duke
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a61af66fc99e Initial load
duke
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
a61af66fc99e Initial load
duke
parents:
diff changeset
13 * accompanied this code).
a61af66fc99e Initial load
duke
parents:
diff changeset
14 *
a61af66fc99e Initial load
duke
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
a61af66fc99e Initial load
duke
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
a61af66fc99e Initial load
duke
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a61af66fc99e Initial load
duke
parents:
diff changeset
18 *
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
21 * questions.
0
a61af66fc99e Initial load
duke
parents:
diff changeset
22 *
a61af66fc99e Initial load
duke
parents:
diff changeset
23 */
a61af66fc99e Initial load
duke
parents:
diff changeset
24
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1660
diff changeset
25 #include "precompiled.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1660
diff changeset
26 #include "utilities/constantTag.hpp"
0
a61af66fc99e Initial load
duke
parents:
diff changeset
27
a61af66fc99e Initial load
duke
parents:
diff changeset
28 #ifndef PRODUCT
a61af66fc99e Initial load
duke
parents:
diff changeset
29
a61af66fc99e Initial load
duke
parents:
diff changeset
30 void constantTag::print_on(outputStream* st) const {
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
31 st->print(internal_name());
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
32 }
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
33
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
34 #endif // PRODUCT
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
35
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
36 BasicType constantTag::basic_type() const {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
37 switch (_tag) {
a61af66fc99e Initial load
duke
parents:
diff changeset
38 case JVM_CONSTANT_Integer :
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
39 return T_INT;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
40 case JVM_CONSTANT_Float :
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
41 return T_FLOAT;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
42 case JVM_CONSTANT_Long :
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
43 return T_LONG;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
44 case JVM_CONSTANT_Double :
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
45 return T_DOUBLE;
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
46
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
47 case JVM_CONSTANT_Class :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
48 case JVM_CONSTANT_String :
0
a61af66fc99e Initial load
duke
parents:
diff changeset
49 case JVM_CONSTANT_UnresolvedClass :
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
50 case JVM_CONSTANT_UnresolvedClassInError :
0
a61af66fc99e Initial load
duke
parents:
diff changeset
51 case JVM_CONSTANT_ClassIndex :
a61af66fc99e Initial load
duke
parents:
diff changeset
52 case JVM_CONSTANT_StringIndex :
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
53 case JVM_CONSTANT_MethodHandle :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
54 case JVM_CONSTANT_MethodType :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
55 return T_OBJECT;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
56 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
57 ShouldNotReachHere();
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
58 return T_ILLEGAL;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
59 }
a61af66fc99e Initial load
duke
parents:
diff changeset
60 }
a61af66fc99e Initial load
duke
parents:
diff changeset
61
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
62
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
63
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
64 const char* constantTag::internal_name() const {
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
65 switch (_tag) {
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
66 case JVM_CONSTANT_Invalid :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
67 return "Invalid index";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
68 case JVM_CONSTANT_Class :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
69 return "Class";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
70 case JVM_CONSTANT_Fieldref :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
71 return "Field";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
72 case JVM_CONSTANT_Methodref :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
73 return "Method";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
74 case JVM_CONSTANT_InterfaceMethodref :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
75 return "InterfaceMethod";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
76 case JVM_CONSTANT_String :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
77 return "String";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
78 case JVM_CONSTANT_Integer :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
79 return "Integer";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
80 case JVM_CONSTANT_Float :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
81 return "Float";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
82 case JVM_CONSTANT_Long :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
83 return "Long";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
84 case JVM_CONSTANT_Double :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
85 return "Double";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
86 case JVM_CONSTANT_NameAndType :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
87 return "NameAndType";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
88 case JVM_CONSTANT_MethodHandle :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
89 return "MethodHandle";
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 2460
diff changeset
90 case JVM_CONSTANT_MethodHandleInError :
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 2460
diff changeset
91 return "MethodHandle Error";
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
92 case JVM_CONSTANT_MethodType :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
93 return "MethodType";
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 2460
diff changeset
94 case JVM_CONSTANT_MethodTypeInError :
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 2460
diff changeset
95 return "MethodType Error";
1660
083fde3b838e 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 1602
diff changeset
96 case JVM_CONSTANT_InvokeDynamic :
083fde3b838e 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 1602
diff changeset
97 return "InvokeDynamic";
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
98 case JVM_CONSTANT_Utf8 :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
99 return "Utf8";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
100 case JVM_CONSTANT_UnresolvedClass :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
101 return "Unresolved Class";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
102 case JVM_CONSTANT_UnresolvedClassInError :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
103 return "Unresolved Class Error";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
104 case JVM_CONSTANT_ClassIndex :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
105 return "Unresolved Class Index";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
106 case JVM_CONSTANT_StringIndex :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
107 return "Unresolved String Index";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
108 default:
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
109 ShouldNotReachHere();
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
110 return "Illegal";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
111 }
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
112 }