annotate src/share/vm/utilities/constantTag.cpp @ 6725:da91efe96a93

6964458: Reimplement class meta-data storage to use native memory Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author coleenp
date Sat, 01 Sep 2012 13:25:18 -0400
parents ed69575596ac
children f16e75e0cf11
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 2460
diff changeset
2 * Copyright (c) 1997, 2012, 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 case JVM_CONSTANT_Object :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
56 return T_OBJECT;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
57 default:
a61af66fc99e Initial load
duke
parents:
diff changeset
58 ShouldNotReachHere();
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
59 return T_ILLEGAL;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
60 }
a61af66fc99e Initial load
duke
parents:
diff changeset
61 }
a61af66fc99e Initial load
duke
parents:
diff changeset
62
1602
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
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
65 const char* constantTag::internal_name() const {
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
66 switch (_tag) {
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
67 case JVM_CONSTANT_Invalid :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
68 return "Invalid index";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
69 case JVM_CONSTANT_Class :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
70 return "Class";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
71 case JVM_CONSTANT_Fieldref :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
72 return "Field";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
73 case JVM_CONSTANT_Methodref :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
74 return "Method";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
75 case JVM_CONSTANT_InterfaceMethodref :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
76 return "InterfaceMethod";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
77 case JVM_CONSTANT_String :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
78 return "String";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
79 case JVM_CONSTANT_Integer :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
80 return "Integer";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
81 case JVM_CONSTANT_Float :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
82 return "Float";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
83 case JVM_CONSTANT_Long :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
84 return "Long";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
85 case JVM_CONSTANT_Double :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
86 return "Double";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
87 case JVM_CONSTANT_NameAndType :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
88 return "NameAndType";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
89 case JVM_CONSTANT_MethodHandle :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
90 return "MethodHandle";
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 2460
diff changeset
91 case JVM_CONSTANT_MethodHandleInError :
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 2460
diff changeset
92 return "MethodHandle Error";
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
93 case JVM_CONSTANT_MethodType :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
94 return "MethodType";
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 2460
diff changeset
95 case JVM_CONSTANT_MethodTypeInError :
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 2460
diff changeset
96 return "MethodType Error";
1660
083fde3b838e 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 1602
diff changeset
97 case JVM_CONSTANT_InvokeDynamic :
083fde3b838e 6964498: JSR 292 invokedynamic sites need local bootstrap methods
jrose
parents: 1602
diff changeset
98 return "InvokeDynamic";
1602
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
99 case JVM_CONSTANT_Object :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
100 return "Object";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
101 case JVM_CONSTANT_Utf8 :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
102 return "Utf8";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
103 case JVM_CONSTANT_UnresolvedClass :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
104 return "Unresolved Class";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
105 case JVM_CONSTANT_UnresolvedClassInError :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
106 return "Unresolved Class Error";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
107 case JVM_CONSTANT_ClassIndex :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
108 return "Unresolved Class Index";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
109 case JVM_CONSTANT_StringIndex :
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
110 return "Unresolved String Index";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
111 default:
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
112 ShouldNotReachHere();
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
113 return "Illegal";
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
114 }
136b78722a08 6939203: JSR 292 needs method handle constants
jrose
parents: 1552
diff changeset
115 }