Mercurial > hg > truffle
annotate src/share/vm/utilities/constantTag.cpp @ 14702:d4dd5204c0aa
Merge
author | ehelin |
---|---|
date | Fri, 14 Mar 2014 13:27:18 +0100 |
parents | 28ca974cc21a |
children | 78bbf4d43a14 |
rev | line source |
---|---|
0 | 1 /* |
8104 | 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
0 | 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 * | |
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 | 22 * |
23 */ | |
24 | |
1972 | 25 #include "precompiled.hpp" |
26 #include "utilities/constantTag.hpp" | |
0 | 27 |
28 #ifndef PRODUCT | |
29 | |
30 void constantTag::print_on(outputStream* st) const { | |
1602 | 31 st->print(internal_name()); |
32 } | |
33 | |
34 #endif // PRODUCT | |
35 | |
36 BasicType constantTag::basic_type() const { | |
0 | 37 switch (_tag) { |
38 case JVM_CONSTANT_Integer : | |
1602 | 39 return T_INT; |
0 | 40 case JVM_CONSTANT_Float : |
1602 | 41 return T_FLOAT; |
0 | 42 case JVM_CONSTANT_Long : |
1602 | 43 return T_LONG; |
0 | 44 case JVM_CONSTANT_Double : |
1602 | 45 return T_DOUBLE; |
46 | |
47 case JVM_CONSTANT_Class : | |
48 case JVM_CONSTANT_String : | |
0 | 49 case JVM_CONSTANT_UnresolvedClass : |
1602 | 50 case JVM_CONSTANT_UnresolvedClassInError : |
0 | 51 case JVM_CONSTANT_ClassIndex : |
52 case JVM_CONSTANT_StringIndex : | |
1602 | 53 case JVM_CONSTANT_MethodHandle : |
12850
28ca974cc21a
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents:
8104
diff
changeset
|
54 case JVM_CONSTANT_MethodHandleInError : |
1602 | 55 case JVM_CONSTANT_MethodType : |
12850
28ca974cc21a
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents:
8104
diff
changeset
|
56 case JVM_CONSTANT_MethodTypeInError : |
1602 | 57 return T_OBJECT; |
0 | 58 default: |
59 ShouldNotReachHere(); | |
1602 | 60 return T_ILLEGAL; |
0 | 61 } |
62 } | |
63 | |
1602 | 64 |
12850
28ca974cc21a
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents:
8104
diff
changeset
|
65 jbyte constantTag::non_error_value() const { |
28ca974cc21a
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents:
8104
diff
changeset
|
66 switch (_tag) { |
28ca974cc21a
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents:
8104
diff
changeset
|
67 case JVM_CONSTANT_UnresolvedClassInError: |
28ca974cc21a
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents:
8104
diff
changeset
|
68 return JVM_CONSTANT_UnresolvedClass; |
28ca974cc21a
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents:
8104
diff
changeset
|
69 case JVM_CONSTANT_MethodHandleInError: |
28ca974cc21a
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents:
8104
diff
changeset
|
70 return JVM_CONSTANT_MethodHandle; |
28ca974cc21a
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents:
8104
diff
changeset
|
71 case JVM_CONSTANT_MethodTypeInError: |
28ca974cc21a
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents:
8104
diff
changeset
|
72 return JVM_CONSTANT_MethodType; |
28ca974cc21a
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents:
8104
diff
changeset
|
73 default: |
28ca974cc21a
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents:
8104
diff
changeset
|
74 return _tag; |
28ca974cc21a
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents:
8104
diff
changeset
|
75 } |
28ca974cc21a
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents:
8104
diff
changeset
|
76 } |
28ca974cc21a
8022592: assert at constantTag.cpp:57: ShouldNotReachHere()
coleenp
parents:
8104
diff
changeset
|
77 |
1602 | 78 |
79 const char* constantTag::internal_name() const { | |
80 switch (_tag) { | |
81 case JVM_CONSTANT_Invalid : | |
82 return "Invalid index"; | |
83 case JVM_CONSTANT_Class : | |
84 return "Class"; | |
85 case JVM_CONSTANT_Fieldref : | |
86 return "Field"; | |
87 case JVM_CONSTANT_Methodref : | |
88 return "Method"; | |
89 case JVM_CONSTANT_InterfaceMethodref : | |
90 return "InterfaceMethod"; | |
91 case JVM_CONSTANT_String : | |
92 return "String"; | |
93 case JVM_CONSTANT_Integer : | |
94 return "Integer"; | |
95 case JVM_CONSTANT_Float : | |
96 return "Float"; | |
97 case JVM_CONSTANT_Long : | |
98 return "Long"; | |
99 case JVM_CONSTANT_Double : | |
100 return "Double"; | |
101 case JVM_CONSTANT_NameAndType : | |
102 return "NameAndType"; | |
103 case JVM_CONSTANT_MethodHandle : | |
104 return "MethodHandle"; | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2460
diff
changeset
|
105 case JVM_CONSTANT_MethodHandleInError : |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2460
diff
changeset
|
106 return "MethodHandle Error"; |
1602 | 107 case JVM_CONSTANT_MethodType : |
108 return "MethodType"; | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2460
diff
changeset
|
109 case JVM_CONSTANT_MethodTypeInError : |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
2460
diff
changeset
|
110 return "MethodType Error"; |
1660
083fde3b838e
6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents:
1602
diff
changeset
|
111 case JVM_CONSTANT_InvokeDynamic : |
083fde3b838e
6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents:
1602
diff
changeset
|
112 return "InvokeDynamic"; |
1602 | 113 case JVM_CONSTANT_Utf8 : |
114 return "Utf8"; | |
115 case JVM_CONSTANT_UnresolvedClass : | |
116 return "Unresolved Class"; | |
117 case JVM_CONSTANT_UnresolvedClassInError : | |
118 return "Unresolved Class Error"; | |
119 case JVM_CONSTANT_ClassIndex : | |
120 return "Unresolved Class Index"; | |
121 case JVM_CONSTANT_StringIndex : | |
122 return "Unresolved String Index"; | |
123 default: | |
124 ShouldNotReachHere(); | |
125 return "Illegal"; | |
126 } | |
127 } |