annotate src/share/vm/utilities/constantTag.cpp @ 2177:3582bf76420e

6990754: Use native memory and reference counting to implement SymbolTable Summary: move symbols from permgen into C heap and reference count them Reviewed-by: never, acorn, jmasa, stefank
author coleenp
date Thu, 27 Jan 2011 16:11:27 -0800
parents dad31fc330cd
children ed69575596ac
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1660
diff changeset
2 * Copyright (c) 1997, 2010, 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_UnresolvedString :
a61af66fc99e Initial load
duke
parents:
diff changeset
53 case JVM_CONSTANT_StringIndex :
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
54 case JVM_CONSTANT_MethodHandle :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
55 case JVM_CONSTANT_MethodType :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
56 case JVM_CONSTANT_Object :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
57 return T_OBJECT;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
58 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
59 ShouldNotReachHere();
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
60 return T_ILLEGAL;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
61 }
a61af66fc99e Initial load
duke
parents:
diff changeset
62 }
a61af66fc99e Initial load
duke
parents:
diff changeset
63
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
64
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
65
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
66 const char* constantTag::internal_name() const {
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
67 switch (_tag) {
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
68 case JVM_CONSTANT_Invalid :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
69 return "Invalid index";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
70 case JVM_CONSTANT_Class :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
71 return "Class";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
72 case JVM_CONSTANT_Fieldref :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
73 return "Field";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
74 case JVM_CONSTANT_Methodref :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
75 return "Method";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
76 case JVM_CONSTANT_InterfaceMethodref :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
77 return "InterfaceMethod";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
78 case JVM_CONSTANT_String :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
79 return "String";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
80 case JVM_CONSTANT_Integer :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
81 return "Integer";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
82 case JVM_CONSTANT_Float :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
83 return "Float";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
84 case JVM_CONSTANT_Long :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
85 return "Long";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
86 case JVM_CONSTANT_Double :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
87 return "Double";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
88 case JVM_CONSTANT_NameAndType :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
89 return "NameAndType";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
90 case JVM_CONSTANT_MethodHandle :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
91 return "MethodHandle";
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";
1660
083fde3b838e 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 1602
diff changeset
94 case JVM_CONSTANT_InvokeDynamic :
083fde3b838e 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 1602
diff changeset
95 return "InvokeDynamic";
2011
dad31fc330cd 7001379: bootstrap method data needs to be moved from constant pool to a classfile attribute
jrose
parents: 1972
diff changeset
96 case JVM_CONSTANT_InvokeDynamicTrans :
dad31fc330cd 7001379: bootstrap method data needs to be moved from constant pool to a classfile attribute
jrose
parents: 1972
diff changeset
97 return "InvokeDynamic/transitional";
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
98 case JVM_CONSTANT_Object :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
99 return "Object";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
100 case JVM_CONSTANT_Utf8 :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
101 return "Utf8";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
102 case JVM_CONSTANT_UnresolvedClass :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
103 return "Unresolved Class";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
104 case JVM_CONSTANT_UnresolvedClassInError :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
105 return "Unresolved Class Error";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
106 case JVM_CONSTANT_ClassIndex :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
107 return "Unresolved Class Index";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
108 case JVM_CONSTANT_UnresolvedString :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
109 return "Unresolved String";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
110 case JVM_CONSTANT_StringIndex :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
111 return "Unresolved String Index";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
112 default:
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
113 ShouldNotReachHere();
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
114 return "Illegal";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
115 }
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
116 }