annotate agent/src/share/classes/sun/jvm/hotspot/runtime/BasicType.java @ 12226:7944aba7ba41

8015107: NPG: Use consistent naming for metaspace concepts Reviewed-by: coleenp, mgerdin, hseigel
author ehelin
date Mon, 12 Aug 2013 17:37:02 +0200
parents c18cbe5936b8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a61af66fc99e Initial load
duke
parents:
diff changeset
1 /*
1552
c18cbe5936b8 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 0
diff changeset
2 * Copyright (c) 2000, 2004, 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
a61af66fc99e Initial load
duke
parents:
diff changeset
25 package sun.jvm.hotspot.runtime;
a61af66fc99e Initial load
duke
parents:
diff changeset
26
a61af66fc99e Initial load
duke
parents:
diff changeset
27 /** Encapsulates the BasicType enum in globalDefinitions.hpp in the
a61af66fc99e Initial load
duke
parents:
diff changeset
28 VM. */
a61af66fc99e Initial load
duke
parents:
diff changeset
29
a61af66fc99e Initial load
duke
parents:
diff changeset
30 public class BasicType {
a61af66fc99e Initial load
duke
parents:
diff changeset
31 public static final int tBoolean = 4;
a61af66fc99e Initial load
duke
parents:
diff changeset
32 public static final int tChar = 5;
a61af66fc99e Initial load
duke
parents:
diff changeset
33 public static final int tFloat = 6;
a61af66fc99e Initial load
duke
parents:
diff changeset
34 public static final int tDouble = 7;
a61af66fc99e Initial load
duke
parents:
diff changeset
35 public static final int tByte = 8;
a61af66fc99e Initial load
duke
parents:
diff changeset
36 public static final int tShort = 9;
a61af66fc99e Initial load
duke
parents:
diff changeset
37 public static final int tInt = 10;
a61af66fc99e Initial load
duke
parents:
diff changeset
38 public static final int tLong = 11;
a61af66fc99e Initial load
duke
parents:
diff changeset
39 public static final int tObject = 12;
a61af66fc99e Initial load
duke
parents:
diff changeset
40 public static final int tArray = 13;
a61af66fc99e Initial load
duke
parents:
diff changeset
41 public static final int tVoid = 14;
a61af66fc99e Initial load
duke
parents:
diff changeset
42 public static final int tAddress = 15;
a61af66fc99e Initial load
duke
parents:
diff changeset
43 public static final int tConflict = 16;
a61af66fc99e Initial load
duke
parents:
diff changeset
44 public static final int tIllegal = 99;
a61af66fc99e Initial load
duke
parents:
diff changeset
45
a61af66fc99e Initial load
duke
parents:
diff changeset
46 public static final BasicType T_BOOLEAN = new BasicType(tBoolean);
a61af66fc99e Initial load
duke
parents:
diff changeset
47 public static final BasicType T_CHAR = new BasicType(tChar);
a61af66fc99e Initial load
duke
parents:
diff changeset
48 public static final BasicType T_FLOAT = new BasicType(tFloat);
a61af66fc99e Initial load
duke
parents:
diff changeset
49 public static final BasicType T_DOUBLE = new BasicType(tDouble);
a61af66fc99e Initial load
duke
parents:
diff changeset
50 public static final BasicType T_BYTE = new BasicType(tByte);
a61af66fc99e Initial load
duke
parents:
diff changeset
51 public static final BasicType T_SHORT = new BasicType(tShort);
a61af66fc99e Initial load
duke
parents:
diff changeset
52 public static final BasicType T_INT = new BasicType(tInt);
a61af66fc99e Initial load
duke
parents:
diff changeset
53 public static final BasicType T_LONG = new BasicType(tLong);
a61af66fc99e Initial load
duke
parents:
diff changeset
54 public static final BasicType T_OBJECT = new BasicType(tObject);
a61af66fc99e Initial load
duke
parents:
diff changeset
55 public static final BasicType T_ARRAY = new BasicType(tArray);
a61af66fc99e Initial load
duke
parents:
diff changeset
56 public static final BasicType T_VOID = new BasicType(tVoid);
a61af66fc99e Initial load
duke
parents:
diff changeset
57 public static final BasicType T_ADDRESS = new BasicType(tAddress);
a61af66fc99e Initial load
duke
parents:
diff changeset
58 public static final BasicType T_CONFLICT = new BasicType(tConflict);
a61af66fc99e Initial load
duke
parents:
diff changeset
59 public static final BasicType T_ILLEGAL = new BasicType(tIllegal);
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61 public static int getTBoolean() {
a61af66fc99e Initial load
duke
parents:
diff changeset
62 return tBoolean;
a61af66fc99e Initial load
duke
parents:
diff changeset
63 }
a61af66fc99e Initial load
duke
parents:
diff changeset
64
a61af66fc99e Initial load
duke
parents:
diff changeset
65 public static int getTChar() {
a61af66fc99e Initial load
duke
parents:
diff changeset
66 return tChar;
a61af66fc99e Initial load
duke
parents:
diff changeset
67 }
a61af66fc99e Initial load
duke
parents:
diff changeset
68
a61af66fc99e Initial load
duke
parents:
diff changeset
69 public static int getTFloat() {
a61af66fc99e Initial load
duke
parents:
diff changeset
70 return tFloat;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 }
a61af66fc99e Initial load
duke
parents:
diff changeset
72
a61af66fc99e Initial load
duke
parents:
diff changeset
73 public static int getTDouble() {
a61af66fc99e Initial load
duke
parents:
diff changeset
74 return tDouble;
a61af66fc99e Initial load
duke
parents:
diff changeset
75 }
a61af66fc99e Initial load
duke
parents:
diff changeset
76
a61af66fc99e Initial load
duke
parents:
diff changeset
77 public static int getTByte() {
a61af66fc99e Initial load
duke
parents:
diff changeset
78 return tByte;
a61af66fc99e Initial load
duke
parents:
diff changeset
79 }
a61af66fc99e Initial load
duke
parents:
diff changeset
80
a61af66fc99e Initial load
duke
parents:
diff changeset
81 public static int getTShort() {
a61af66fc99e Initial load
duke
parents:
diff changeset
82 return tShort;
a61af66fc99e Initial load
duke
parents:
diff changeset
83 }
a61af66fc99e Initial load
duke
parents:
diff changeset
84
a61af66fc99e Initial load
duke
parents:
diff changeset
85 public static int getTInt() {
a61af66fc99e Initial load
duke
parents:
diff changeset
86 return tInt;
a61af66fc99e Initial load
duke
parents:
diff changeset
87 }
a61af66fc99e Initial load
duke
parents:
diff changeset
88
a61af66fc99e Initial load
duke
parents:
diff changeset
89 public static int getTLong() {
a61af66fc99e Initial load
duke
parents:
diff changeset
90 return tLong;
a61af66fc99e Initial load
duke
parents:
diff changeset
91 }
a61af66fc99e Initial load
duke
parents:
diff changeset
92
a61af66fc99e Initial load
duke
parents:
diff changeset
93 public static int getTObject() {
a61af66fc99e Initial load
duke
parents:
diff changeset
94 return tObject;
a61af66fc99e Initial load
duke
parents:
diff changeset
95 }
a61af66fc99e Initial load
duke
parents:
diff changeset
96
a61af66fc99e Initial load
duke
parents:
diff changeset
97 public static int getTArray() {
a61af66fc99e Initial load
duke
parents:
diff changeset
98 return tArray;
a61af66fc99e Initial load
duke
parents:
diff changeset
99 }
a61af66fc99e Initial load
duke
parents:
diff changeset
100
a61af66fc99e Initial load
duke
parents:
diff changeset
101 public static int getTVoid() {
a61af66fc99e Initial load
duke
parents:
diff changeset
102 return tVoid;
a61af66fc99e Initial load
duke
parents:
diff changeset
103 }
a61af66fc99e Initial load
duke
parents:
diff changeset
104
a61af66fc99e Initial load
duke
parents:
diff changeset
105 public static int getTAddress() {
a61af66fc99e Initial load
duke
parents:
diff changeset
106 return tAddress;
a61af66fc99e Initial load
duke
parents:
diff changeset
107 }
a61af66fc99e Initial load
duke
parents:
diff changeset
108
a61af66fc99e Initial load
duke
parents:
diff changeset
109 /** For stack value type with conflicting contents */
a61af66fc99e Initial load
duke
parents:
diff changeset
110 public static int getTConflict() {
a61af66fc99e Initial load
duke
parents:
diff changeset
111 return tConflict;
a61af66fc99e Initial load
duke
parents:
diff changeset
112 }
a61af66fc99e Initial load
duke
parents:
diff changeset
113
a61af66fc99e Initial load
duke
parents:
diff changeset
114 public static int getTIllegal() {
a61af66fc99e Initial load
duke
parents:
diff changeset
115 return tIllegal;
a61af66fc99e Initial load
duke
parents:
diff changeset
116 }
a61af66fc99e Initial load
duke
parents:
diff changeset
117
a61af66fc99e Initial load
duke
parents:
diff changeset
118 public static BasicType charToBasicType(char c) {
a61af66fc99e Initial load
duke
parents:
diff changeset
119 switch( c ) {
a61af66fc99e Initial load
duke
parents:
diff changeset
120 case 'B': return T_BYTE;
a61af66fc99e Initial load
duke
parents:
diff changeset
121 case 'C': return T_CHAR;
a61af66fc99e Initial load
duke
parents:
diff changeset
122 case 'D': return T_DOUBLE;
a61af66fc99e Initial load
duke
parents:
diff changeset
123 case 'F': return T_FLOAT;
a61af66fc99e Initial load
duke
parents:
diff changeset
124 case 'I': return T_INT;
a61af66fc99e Initial load
duke
parents:
diff changeset
125 case 'J': return T_LONG;
a61af66fc99e Initial load
duke
parents:
diff changeset
126 case 'S': return T_SHORT;
a61af66fc99e Initial load
duke
parents:
diff changeset
127 case 'Z': return T_BOOLEAN;
a61af66fc99e Initial load
duke
parents:
diff changeset
128 case 'V': return T_VOID;
a61af66fc99e Initial load
duke
parents:
diff changeset
129 case 'L': return T_OBJECT;
a61af66fc99e Initial load
duke
parents:
diff changeset
130 case '[': return T_ARRAY;
a61af66fc99e Initial load
duke
parents:
diff changeset
131 }
a61af66fc99e Initial load
duke
parents:
diff changeset
132 return T_ILLEGAL;
a61af66fc99e Initial load
duke
parents:
diff changeset
133 }
a61af66fc99e Initial load
duke
parents:
diff changeset
134
a61af66fc99e Initial load
duke
parents:
diff changeset
135 public static int charToType(char c) {
a61af66fc99e Initial load
duke
parents:
diff changeset
136 return charToBasicType(c).getType();
a61af66fc99e Initial load
duke
parents:
diff changeset
137 }
a61af66fc99e Initial load
duke
parents:
diff changeset
138
a61af66fc99e Initial load
duke
parents:
diff changeset
139 public int getType() {
a61af66fc99e Initial load
duke
parents:
diff changeset
140 return type;
a61af66fc99e Initial load
duke
parents:
diff changeset
141 }
a61af66fc99e Initial load
duke
parents:
diff changeset
142
a61af66fc99e Initial load
duke
parents:
diff changeset
143 //-- Internals only below this point
a61af66fc99e Initial load
duke
parents:
diff changeset
144 private BasicType(int type) {
a61af66fc99e Initial load
duke
parents:
diff changeset
145 this.type = type;
a61af66fc99e Initial load
duke
parents:
diff changeset
146 }
a61af66fc99e Initial load
duke
parents:
diff changeset
147
a61af66fc99e Initial load
duke
parents:
diff changeset
148 private int type;
a61af66fc99e Initial load
duke
parents:
diff changeset
149 }