annotate src/share/vm/c1/c1_ValueType.hpp @ 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 1d7922586cf6
children 78bbf4d43a14
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: 6266
diff changeset
2 * Copyright (c) 1999, 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: 1584
diff changeset
25 #ifndef SHARE_VM_C1_C1_VALUETYPE_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1584
diff changeset
26 #define SHARE_VM_C1_C1_VALUETYPE_HPP
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1584
diff changeset
27
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1584
diff changeset
28 #include "c1/c1_Compilation.hpp"
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1584
diff changeset
29 #include "ci/ciConstant.hpp"
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
30 #include "ci/ciMethodData.hpp"
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1584
diff changeset
31
0
a61af66fc99e Initial load
duke
parents:
diff changeset
32 // type hierarchy
a61af66fc99e Initial load
duke
parents:
diff changeset
33 class ValueType;
a61af66fc99e Initial load
duke
parents:
diff changeset
34 class VoidType;
a61af66fc99e Initial load
duke
parents:
diff changeset
35 class IntType;
a61af66fc99e Initial load
duke
parents:
diff changeset
36 class IntConstant;
a61af66fc99e Initial load
duke
parents:
diff changeset
37 class IntInterval;
a61af66fc99e Initial load
duke
parents:
diff changeset
38 class LongType;
a61af66fc99e Initial load
duke
parents:
diff changeset
39 class LongConstant;
a61af66fc99e Initial load
duke
parents:
diff changeset
40 class FloatType;
a61af66fc99e Initial load
duke
parents:
diff changeset
41 class FloatConstant;
a61af66fc99e Initial load
duke
parents:
diff changeset
42 class DoubleType;
a61af66fc99e Initial load
duke
parents:
diff changeset
43 class DoubleConstant;
a61af66fc99e Initial load
duke
parents:
diff changeset
44 class ObjectType;
a61af66fc99e Initial load
duke
parents:
diff changeset
45 class ObjectConstant;
a61af66fc99e Initial load
duke
parents:
diff changeset
46 class ArrayType;
a61af66fc99e Initial load
duke
parents:
diff changeset
47 class ArrayConstant;
a61af66fc99e Initial load
duke
parents:
diff changeset
48 class InstanceType;
a61af66fc99e Initial load
duke
parents:
diff changeset
49 class InstanceConstant;
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
50 class MetadataType;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
51 class ClassType;
a61af66fc99e Initial load
duke
parents:
diff changeset
52 class ClassConstant;
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
53 class MethodType;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
54 class MethodConstant;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
55 class MethodDataType;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
56 class MethodDataConstant;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
57 class AddressType;
a61af66fc99e Initial load
duke
parents:
diff changeset
58 class AddressConstant;
a61af66fc99e Initial load
duke
parents:
diff changeset
59 class IllegalType;
a61af66fc99e Initial load
duke
parents:
diff changeset
60
a61af66fc99e Initial load
duke
parents:
diff changeset
61
a61af66fc99e Initial load
duke
parents:
diff changeset
62 // predefined types
a61af66fc99e Initial load
duke
parents:
diff changeset
63 extern VoidType* voidType;
a61af66fc99e Initial load
duke
parents:
diff changeset
64 extern IntType* intType;
a61af66fc99e Initial load
duke
parents:
diff changeset
65 extern LongType* longType;
a61af66fc99e Initial load
duke
parents:
diff changeset
66 extern FloatType* floatType;
a61af66fc99e Initial load
duke
parents:
diff changeset
67 extern DoubleType* doubleType;
a61af66fc99e Initial load
duke
parents:
diff changeset
68 extern ObjectType* objectType;
a61af66fc99e Initial load
duke
parents:
diff changeset
69 extern ArrayType* arrayType;
a61af66fc99e Initial load
duke
parents:
diff changeset
70 extern InstanceType* instanceType;
a61af66fc99e Initial load
duke
parents:
diff changeset
71 extern ClassType* classType;
a61af66fc99e Initial load
duke
parents:
diff changeset
72 extern AddressType* addressType;
a61af66fc99e Initial load
duke
parents:
diff changeset
73 extern IllegalType* illegalType;
a61af66fc99e Initial load
duke
parents:
diff changeset
74
a61af66fc99e Initial load
duke
parents:
diff changeset
75
a61af66fc99e Initial load
duke
parents:
diff changeset
76 // predefined constants
a61af66fc99e Initial load
duke
parents:
diff changeset
77 extern IntConstant* intZero;
a61af66fc99e Initial load
duke
parents:
diff changeset
78 extern IntConstant* intOne;
a61af66fc99e Initial load
duke
parents:
diff changeset
79 extern ObjectConstant* objectNull;
a61af66fc99e Initial load
duke
parents:
diff changeset
80
a61af66fc99e Initial load
duke
parents:
diff changeset
81
a61af66fc99e Initial load
duke
parents:
diff changeset
82 // tags
a61af66fc99e Initial load
duke
parents:
diff changeset
83 enum ValueTag {
a61af66fc99e Initial load
duke
parents:
diff changeset
84 // all legal tags must come first
a61af66fc99e Initial load
duke
parents:
diff changeset
85 intTag,
a61af66fc99e Initial load
duke
parents:
diff changeset
86 longTag,
a61af66fc99e Initial load
duke
parents:
diff changeset
87 floatTag,
a61af66fc99e Initial load
duke
parents:
diff changeset
88 doubleTag,
a61af66fc99e Initial load
duke
parents:
diff changeset
89 objectTag,
a61af66fc99e Initial load
duke
parents:
diff changeset
90 addressTag,
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
91 metaDataTag,
0
a61af66fc99e Initial load
duke
parents:
diff changeset
92 number_of_legal_tags,
a61af66fc99e Initial load
duke
parents:
diff changeset
93 // all other tags must follow afterwards
a61af66fc99e Initial load
duke
parents:
diff changeset
94 voidTag = number_of_legal_tags,
a61af66fc99e Initial load
duke
parents:
diff changeset
95 illegalTag,
a61af66fc99e Initial load
duke
parents:
diff changeset
96 number_of_tags
a61af66fc99e Initial load
duke
parents:
diff changeset
97 };
a61af66fc99e Initial load
duke
parents:
diff changeset
98
a61af66fc99e Initial load
duke
parents:
diff changeset
99
a61af66fc99e Initial load
duke
parents:
diff changeset
100 class ValueType: public CompilationResourceObj {
a61af66fc99e Initial load
duke
parents:
diff changeset
101 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
102 const int _size;
a61af66fc99e Initial load
duke
parents:
diff changeset
103 const ValueTag _tag;
a61af66fc99e Initial load
duke
parents:
diff changeset
104 ValueType();
a61af66fc99e Initial load
duke
parents:
diff changeset
105 protected:
a61af66fc99e Initial load
duke
parents:
diff changeset
106 ValueType(ValueTag tag, int size): _tag(tag), _size(size) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
107
a61af66fc99e Initial load
duke
parents:
diff changeset
108 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
109 // initialization
1584
b812ff5abc73 6958292: C1: Enable parallel compilation
iveresov
parents: 1552
diff changeset
110 static void initialize(Arena* arena);
0
a61af66fc99e Initial load
duke
parents:
diff changeset
111
a61af66fc99e Initial load
duke
parents:
diff changeset
112 // accessors
a61af66fc99e Initial load
duke
parents:
diff changeset
113 virtual ValueType* base() const = 0; // the 'canonical' type (e.g., intType for an IntConstant)
a61af66fc99e Initial load
duke
parents:
diff changeset
114 ValueTag tag() const { return _tag; } // the 'canonical' tag (useful for type matching)
a61af66fc99e Initial load
duke
parents:
diff changeset
115 int size() const { // the size of an object of the type in words
a61af66fc99e Initial load
duke
parents:
diff changeset
116 assert(_size > -1, "shouldn't be asking for size");
a61af66fc99e Initial load
duke
parents:
diff changeset
117 return _size;
a61af66fc99e Initial load
duke
parents:
diff changeset
118 }
a61af66fc99e Initial load
duke
parents:
diff changeset
119 virtual const char tchar() const = 0; // the type 'character' for printing
a61af66fc99e Initial load
duke
parents:
diff changeset
120 virtual const char* name() const = 0; // the type name for printing
a61af66fc99e Initial load
duke
parents:
diff changeset
121 virtual bool is_constant() const { return false; }
a61af66fc99e Initial load
duke
parents:
diff changeset
122
a61af66fc99e Initial load
duke
parents:
diff changeset
123 // testers
a61af66fc99e Initial load
duke
parents:
diff changeset
124 bool is_void() { return tag() == voidTag; }
a61af66fc99e Initial load
duke
parents:
diff changeset
125 bool is_int() { return tag() == intTag; }
a61af66fc99e Initial load
duke
parents:
diff changeset
126 bool is_long() { return tag() == longTag; }
a61af66fc99e Initial load
duke
parents:
diff changeset
127 bool is_float() { return tag() == floatTag; }
a61af66fc99e Initial load
duke
parents:
diff changeset
128 bool is_double() { return tag() == doubleTag; }
a61af66fc99e Initial load
duke
parents:
diff changeset
129 bool is_object() { return as_ObjectType() != NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
130 bool is_array() { return as_ArrayType() != NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
131 bool is_instance() { return as_InstanceType() != NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
132 bool is_class() { return as_ClassType() != NULL; }
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
133 bool is_method() { return as_MethodType() != NULL; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
134 bool is_method_data() { return as_MethodDataType() != NULL; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
135 bool is_address() { return as_AddressType() != NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
136 bool is_illegal() { return tag() == illegalTag; }
a61af66fc99e Initial load
duke
parents:
diff changeset
137
a61af66fc99e Initial load
duke
parents:
diff changeset
138 bool is_int_kind() const { return tag() == intTag || tag() == longTag; }
a61af66fc99e Initial load
duke
parents:
diff changeset
139 bool is_float_kind() const { return tag() == floatTag || tag() == doubleTag; }
a61af66fc99e Initial load
duke
parents:
diff changeset
140 bool is_object_kind() const { return tag() == objectTag; }
a61af66fc99e Initial load
duke
parents:
diff changeset
141
a61af66fc99e Initial load
duke
parents:
diff changeset
142 bool is_single_word() const { return _size == 1; }
a61af66fc99e Initial load
duke
parents:
diff changeset
143 bool is_double_word() const { return _size == 2; }
a61af66fc99e Initial load
duke
parents:
diff changeset
144
a61af66fc99e Initial load
duke
parents:
diff changeset
145 // casting
a61af66fc99e Initial load
duke
parents:
diff changeset
146 virtual VoidType* as_VoidType() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
147 virtual IntType* as_IntType() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
148 virtual LongType* as_LongType() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
149 virtual FloatType* as_FloatType() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
150 virtual DoubleType* as_DoubleType() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
151 virtual ObjectType* as_ObjectType() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
152 virtual ArrayType* as_ArrayType() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
153 virtual InstanceType* as_InstanceType() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
154 virtual ClassType* as_ClassType() { return NULL; }
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
155 virtual MetadataType* as_MetadataType() { return NULL; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
156 virtual MethodType* as_MethodType() { return NULL; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
157 virtual MethodDataType* as_MethodDataType() { return NULL; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
158 virtual AddressType* as_AddressType() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
159 virtual IllegalType* as_IllegalType() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
160
a61af66fc99e Initial load
duke
parents:
diff changeset
161 virtual IntConstant* as_IntConstant() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
162 virtual LongConstant* as_LongConstant() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
163 virtual FloatConstant* as_FloatConstant() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
164 virtual DoubleConstant* as_DoubleConstant() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
165 virtual ObjectConstant* as_ObjectConstant() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
166 virtual InstanceConstant* as_InstanceConstant(){ return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
167 virtual ClassConstant* as_ClassConstant() { return NULL; }
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
168 virtual MethodConstant* as_MethodConstant() { return NULL; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
169 virtual MethodDataConstant* as_MethodDataConstant() { return NULL; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
170 virtual ArrayConstant* as_ArrayConstant() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
171 virtual AddressConstant* as_AddressConstant() { return NULL; }
a61af66fc99e Initial load
duke
parents:
diff changeset
172
a61af66fc99e Initial load
duke
parents:
diff changeset
173 // type operations
a61af66fc99e Initial load
duke
parents:
diff changeset
174 ValueType* meet(ValueType* y) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
175 ValueType* join(ValueType* y) const;
a61af66fc99e Initial load
duke
parents:
diff changeset
176
a61af66fc99e Initial load
duke
parents:
diff changeset
177 // debugging
a61af66fc99e Initial load
duke
parents:
diff changeset
178 void print(outputStream* s = tty) { s->print(name()); }
a61af66fc99e Initial load
duke
parents:
diff changeset
179 };
a61af66fc99e Initial load
duke
parents:
diff changeset
180
a61af66fc99e Initial load
duke
parents:
diff changeset
181
a61af66fc99e Initial load
duke
parents:
diff changeset
182 class VoidType: public ValueType {
a61af66fc99e Initial load
duke
parents:
diff changeset
183 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
184 VoidType(): ValueType(voidTag, 0) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
185 virtual ValueType* base() const { return voidType; }
a61af66fc99e Initial load
duke
parents:
diff changeset
186 virtual const char tchar() const { return 'v'; }
a61af66fc99e Initial load
duke
parents:
diff changeset
187 virtual const char* name() const { return "void"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
188 virtual VoidType* as_VoidType() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
189 };
a61af66fc99e Initial load
duke
parents:
diff changeset
190
a61af66fc99e Initial load
duke
parents:
diff changeset
191
a61af66fc99e Initial load
duke
parents:
diff changeset
192 class IntType: public ValueType {
a61af66fc99e Initial load
duke
parents:
diff changeset
193 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
194 IntType(): ValueType(intTag, 1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
195 virtual ValueType* base() const { return intType; }
a61af66fc99e Initial load
duke
parents:
diff changeset
196 virtual const char tchar() const { return 'i'; }
a61af66fc99e Initial load
duke
parents:
diff changeset
197 virtual const char* name() const { return "int"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
198 virtual IntType* as_IntType() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
199 };
a61af66fc99e Initial load
duke
parents:
diff changeset
200
a61af66fc99e Initial load
duke
parents:
diff changeset
201
a61af66fc99e Initial load
duke
parents:
diff changeset
202 class IntConstant: public IntType {
a61af66fc99e Initial load
duke
parents:
diff changeset
203 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
204 jint _value;
a61af66fc99e Initial load
duke
parents:
diff changeset
205
a61af66fc99e Initial load
duke
parents:
diff changeset
206 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
207 IntConstant(jint value) { _value = value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
208
a61af66fc99e Initial load
duke
parents:
diff changeset
209 jint value() const { return _value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
210
a61af66fc99e Initial load
duke
parents:
diff changeset
211 virtual bool is_constant() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
212 virtual IntConstant* as_IntConstant() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
213 };
a61af66fc99e Initial load
duke
parents:
diff changeset
214
a61af66fc99e Initial load
duke
parents:
diff changeset
215
a61af66fc99e Initial load
duke
parents:
diff changeset
216 class IntInterval: public IntType {
a61af66fc99e Initial load
duke
parents:
diff changeset
217 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
218 jint _beg;
a61af66fc99e Initial load
duke
parents:
diff changeset
219 jint _end;
a61af66fc99e Initial load
duke
parents:
diff changeset
220
a61af66fc99e Initial load
duke
parents:
diff changeset
221 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
222 IntInterval(jint beg, jint end) {
a61af66fc99e Initial load
duke
parents:
diff changeset
223 assert(beg <= end, "illegal interval");
a61af66fc99e Initial load
duke
parents:
diff changeset
224 _beg = beg;
a61af66fc99e Initial load
duke
parents:
diff changeset
225 _end = end;
a61af66fc99e Initial load
duke
parents:
diff changeset
226 }
a61af66fc99e Initial load
duke
parents:
diff changeset
227
a61af66fc99e Initial load
duke
parents:
diff changeset
228 jint beg() const { return _beg; }
a61af66fc99e Initial load
duke
parents:
diff changeset
229 jint end() const { return _end; }
a61af66fc99e Initial load
duke
parents:
diff changeset
230
a61af66fc99e Initial load
duke
parents:
diff changeset
231 virtual bool is_interval() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
232 };
a61af66fc99e Initial load
duke
parents:
diff changeset
233
a61af66fc99e Initial load
duke
parents:
diff changeset
234
a61af66fc99e Initial load
duke
parents:
diff changeset
235 class LongType: public ValueType {
a61af66fc99e Initial load
duke
parents:
diff changeset
236 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
237 LongType(): ValueType(longTag, 2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
238 virtual ValueType* base() const { return longType; }
a61af66fc99e Initial load
duke
parents:
diff changeset
239 virtual const char tchar() const { return 'l'; }
a61af66fc99e Initial load
duke
parents:
diff changeset
240 virtual const char* name() const { return "long"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
241 virtual LongType* as_LongType() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
242 };
a61af66fc99e Initial load
duke
parents:
diff changeset
243
a61af66fc99e Initial load
duke
parents:
diff changeset
244
a61af66fc99e Initial load
duke
parents:
diff changeset
245 class LongConstant: public LongType {
a61af66fc99e Initial load
duke
parents:
diff changeset
246 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
247 jlong _value;
a61af66fc99e Initial load
duke
parents:
diff changeset
248
a61af66fc99e Initial load
duke
parents:
diff changeset
249 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
250 LongConstant(jlong value) { _value = value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
251
a61af66fc99e Initial load
duke
parents:
diff changeset
252 jlong value() const { return _value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
253
a61af66fc99e Initial load
duke
parents:
diff changeset
254 virtual bool is_constant() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
255 virtual LongConstant* as_LongConstant() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
256 };
a61af66fc99e Initial load
duke
parents:
diff changeset
257
a61af66fc99e Initial load
duke
parents:
diff changeset
258
a61af66fc99e Initial load
duke
parents:
diff changeset
259 class FloatType: public ValueType {
a61af66fc99e Initial load
duke
parents:
diff changeset
260 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
261 FloatType(): ValueType(floatTag, 1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
262 virtual ValueType* base() const { return floatType; }
a61af66fc99e Initial load
duke
parents:
diff changeset
263 virtual const char tchar() const { return 'f'; }
a61af66fc99e Initial load
duke
parents:
diff changeset
264 virtual const char* name() const { return "float"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
265 virtual FloatType* as_FloatType() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
266 };
a61af66fc99e Initial load
duke
parents:
diff changeset
267
a61af66fc99e Initial load
duke
parents:
diff changeset
268
a61af66fc99e Initial load
duke
parents:
diff changeset
269 class FloatConstant: public FloatType {
a61af66fc99e Initial load
duke
parents:
diff changeset
270 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
271 jfloat _value;
a61af66fc99e Initial load
duke
parents:
diff changeset
272
a61af66fc99e Initial load
duke
parents:
diff changeset
273 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
274 FloatConstant(jfloat value) { _value = value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
275
a61af66fc99e Initial load
duke
parents:
diff changeset
276 jfloat value() const { return _value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
277
a61af66fc99e Initial load
duke
parents:
diff changeset
278 virtual bool is_constant() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
279 virtual FloatConstant* as_FloatConstant() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
280 };
a61af66fc99e Initial load
duke
parents:
diff changeset
281
a61af66fc99e Initial load
duke
parents:
diff changeset
282
a61af66fc99e Initial load
duke
parents:
diff changeset
283 class DoubleType: public ValueType {
a61af66fc99e Initial load
duke
parents:
diff changeset
284 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
285 DoubleType(): ValueType(doubleTag, 2) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
286 virtual ValueType* base() const { return doubleType; }
a61af66fc99e Initial load
duke
parents:
diff changeset
287 virtual const char tchar() const { return 'd'; }
a61af66fc99e Initial load
duke
parents:
diff changeset
288 virtual const char* name() const { return "double"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
289 virtual DoubleType* as_DoubleType() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
290 };
a61af66fc99e Initial load
duke
parents:
diff changeset
291
a61af66fc99e Initial load
duke
parents:
diff changeset
292
a61af66fc99e Initial load
duke
parents:
diff changeset
293 class DoubleConstant: public DoubleType {
a61af66fc99e Initial load
duke
parents:
diff changeset
294 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
295 jdouble _value;
a61af66fc99e Initial load
duke
parents:
diff changeset
296
a61af66fc99e Initial load
duke
parents:
diff changeset
297 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
298 DoubleConstant(jdouble value) { _value = value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
299
a61af66fc99e Initial load
duke
parents:
diff changeset
300 jdouble value() const { return _value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
301
a61af66fc99e Initial load
duke
parents:
diff changeset
302 virtual bool is_constant() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
303 virtual DoubleConstant* as_DoubleConstant() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
304 };
a61af66fc99e Initial load
duke
parents:
diff changeset
305
a61af66fc99e Initial load
duke
parents:
diff changeset
306
a61af66fc99e Initial load
duke
parents:
diff changeset
307 class ObjectType: public ValueType {
a61af66fc99e Initial load
duke
parents:
diff changeset
308 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
309 ObjectType(): ValueType(objectTag, 1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
310 virtual ValueType* base() const { return objectType; }
a61af66fc99e Initial load
duke
parents:
diff changeset
311 virtual const char tchar() const { return 'a'; }
a61af66fc99e Initial load
duke
parents:
diff changeset
312 virtual const char* name() const { return "object"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
313 virtual ObjectType* as_ObjectType() { return this; }
6266
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 1972
diff changeset
314 virtual ciObject* constant_value() const { ShouldNotReachHere(); return NULL; }
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 1972
diff changeset
315 virtual ciType* exact_type() const { return NULL; }
0
a61af66fc99e Initial load
duke
parents:
diff changeset
316 bool is_loaded() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
317 jobject encoding() const;
a61af66fc99e Initial load
duke
parents:
diff changeset
318 };
a61af66fc99e Initial load
duke
parents:
diff changeset
319
a61af66fc99e Initial load
duke
parents:
diff changeset
320
a61af66fc99e Initial load
duke
parents:
diff changeset
321 class ObjectConstant: public ObjectType {
a61af66fc99e Initial load
duke
parents:
diff changeset
322 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
323 ciObject* _value;
a61af66fc99e Initial load
duke
parents:
diff changeset
324
a61af66fc99e Initial load
duke
parents:
diff changeset
325 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
326 ObjectConstant(ciObject* value) { _value = value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
327
a61af66fc99e Initial load
duke
parents:
diff changeset
328 ciObject* value() const { return _value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
329
a61af66fc99e Initial load
duke
parents:
diff changeset
330 virtual bool is_constant() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
331 virtual ObjectConstant* as_ObjectConstant() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
332 virtual ciObject* constant_value() const;
6266
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 1972
diff changeset
333 virtual ciType* exact_type() const;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
334 };
a61af66fc99e Initial load
duke
parents:
diff changeset
335
a61af66fc99e Initial load
duke
parents:
diff changeset
336
a61af66fc99e Initial load
duke
parents:
diff changeset
337 class ArrayType: public ObjectType {
a61af66fc99e Initial load
duke
parents:
diff changeset
338 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
339 virtual ArrayType* as_ArrayType() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
340 };
a61af66fc99e Initial load
duke
parents:
diff changeset
341
a61af66fc99e Initial load
duke
parents:
diff changeset
342
a61af66fc99e Initial load
duke
parents:
diff changeset
343 class ArrayConstant: public ArrayType {
a61af66fc99e Initial load
duke
parents:
diff changeset
344 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
345 ciArray* _value;
a61af66fc99e Initial load
duke
parents:
diff changeset
346
a61af66fc99e Initial load
duke
parents:
diff changeset
347 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
348 ArrayConstant(ciArray* value) { _value = value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
349
a61af66fc99e Initial load
duke
parents:
diff changeset
350 ciArray* value() const { return _value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
351
a61af66fc99e Initial load
duke
parents:
diff changeset
352 virtual bool is_constant() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
353 virtual ArrayConstant* as_ArrayConstant() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
354 virtual ciObject* constant_value() const;
6266
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 1972
diff changeset
355 virtual ciType* exact_type() const;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
356 };
a61af66fc99e Initial load
duke
parents:
diff changeset
357
a61af66fc99e Initial load
duke
parents:
diff changeset
358
a61af66fc99e Initial load
duke
parents:
diff changeset
359 class InstanceType: public ObjectType {
a61af66fc99e Initial load
duke
parents:
diff changeset
360 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
361 virtual InstanceType* as_InstanceType() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
362 };
a61af66fc99e Initial load
duke
parents:
diff changeset
363
a61af66fc99e Initial load
duke
parents:
diff changeset
364
a61af66fc99e Initial load
duke
parents:
diff changeset
365 class InstanceConstant: public InstanceType {
a61af66fc99e Initial load
duke
parents:
diff changeset
366 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
367 ciInstance* _value;
a61af66fc99e Initial load
duke
parents:
diff changeset
368
a61af66fc99e Initial load
duke
parents:
diff changeset
369 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
370 InstanceConstant(ciInstance* value) { _value = value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
371
a61af66fc99e Initial load
duke
parents:
diff changeset
372 ciInstance* value() const { return _value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
373
a61af66fc99e Initial load
duke
parents:
diff changeset
374 virtual bool is_constant() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
375 virtual InstanceConstant* as_InstanceConstant(){ return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
376 virtual ciObject* constant_value() const;
6266
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 1972
diff changeset
377 virtual ciType* exact_type() const;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
378 };
a61af66fc99e Initial load
duke
parents:
diff changeset
379
a61af66fc99e Initial load
duke
parents:
diff changeset
380
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
381 class MetadataType: public ValueType {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
382 public:
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
383 MetadataType(): ValueType(metaDataTag, 1) {}
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
384 virtual ValueType* base() const { return objectType; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
385 virtual const char tchar() const { return 'a'; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
386 virtual const char* name() const { return "object"; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
387 virtual MetadataType* as_MetadataType() { return this; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
388 bool is_loaded() const;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
389 jobject encoding() const;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
390 virtual ciMetadata* constant_value() const { ShouldNotReachHere(); return NULL; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
391 };
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
392
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
393
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
394 class ClassType: public MetadataType {
0
a61af66fc99e Initial load
duke
parents:
diff changeset
395 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
396 virtual ClassType* as_ClassType() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
397 };
a61af66fc99e Initial load
duke
parents:
diff changeset
398
a61af66fc99e Initial load
duke
parents:
diff changeset
399
a61af66fc99e Initial load
duke
parents:
diff changeset
400 class ClassConstant: public ClassType {
a61af66fc99e Initial load
duke
parents:
diff changeset
401 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
402 ciInstanceKlass* _value;
a61af66fc99e Initial load
duke
parents:
diff changeset
403
a61af66fc99e Initial load
duke
parents:
diff changeset
404 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
405 ClassConstant(ciInstanceKlass* value) { _value = value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
406
a61af66fc99e Initial load
duke
parents:
diff changeset
407 ciInstanceKlass* value() const { return _value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
408
a61af66fc99e Initial load
duke
parents:
diff changeset
409 virtual bool is_constant() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
410 virtual ClassConstant* as_ClassConstant() { return this; }
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
411 virtual ciMetadata* constant_value() const { return _value; }
6266
1d7922586cf6 7023639: JSR 292 method handle invocation needs a fast path for compiled code
twisti
parents: 1972
diff changeset
412 virtual ciType* exact_type() const;
0
a61af66fc99e Initial load
duke
parents:
diff changeset
413 };
a61af66fc99e Initial load
duke
parents:
diff changeset
414
a61af66fc99e Initial load
duke
parents:
diff changeset
415
6725
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
416 class MethodType: public MetadataType {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
417 public:
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
418 virtual MethodType* as_MethodType() { return this; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
419 };
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
420
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
421
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
422 class MethodConstant: public MethodType {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
423 private:
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
424 ciMethod* _value;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
425
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
426 public:
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
427 MethodConstant(ciMethod* value) { _value = value; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
428
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
429 ciMethod* value() const { return _value; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
430
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
431 virtual bool is_constant() const { return true; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
432
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
433 virtual MethodConstant* as_MethodConstant() { return this; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
434 virtual ciMetadata* constant_value() const { return _value; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
435 };
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
436
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
437
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
438 class MethodDataType: public MetadataType {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
439 public:
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
440 virtual MethodDataType* as_MethodDataType() { return this; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
441 };
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
442
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
443
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
444 class MethodDataConstant: public MethodDataType {
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
445 private:
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
446 ciMethodData* _value;
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
447
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
448 public:
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
449 MethodDataConstant(ciMethodData* value) { _value = value; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
450
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
451 ciMethodData* value() const { return _value; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
452
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
453 virtual bool is_constant() const { return true; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
454
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
455 virtual MethodDataConstant* as_MethodDataConstant() { return this; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
456 virtual ciMetadata* constant_value() const { return _value; }
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
457 };
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
458
da91efe96a93 6964458: Reimplement class meta-data storage to use native memory
coleenp
parents: 6266
diff changeset
459
0
a61af66fc99e Initial load
duke
parents:
diff changeset
460 class AddressType: public ValueType {
a61af66fc99e Initial load
duke
parents:
diff changeset
461 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
462 AddressType(): ValueType(addressTag, 1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
463 virtual ValueType* base() const { return addressType; }
a61af66fc99e Initial load
duke
parents:
diff changeset
464 virtual const char tchar() const { return 'r'; }
a61af66fc99e Initial load
duke
parents:
diff changeset
465 virtual const char* name() const { return "address"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
466 virtual AddressType* as_AddressType() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
467 };
a61af66fc99e Initial load
duke
parents:
diff changeset
468
a61af66fc99e Initial load
duke
parents:
diff changeset
469
a61af66fc99e Initial load
duke
parents:
diff changeset
470 class AddressConstant: public AddressType {
a61af66fc99e Initial load
duke
parents:
diff changeset
471 private:
a61af66fc99e Initial load
duke
parents:
diff changeset
472 jint _value;
a61af66fc99e Initial load
duke
parents:
diff changeset
473
a61af66fc99e Initial load
duke
parents:
diff changeset
474 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
475 AddressConstant(jint value) { _value = value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
476
a61af66fc99e Initial load
duke
parents:
diff changeset
477 jint value() const { return _value; }
a61af66fc99e Initial load
duke
parents:
diff changeset
478
a61af66fc99e Initial load
duke
parents:
diff changeset
479 virtual bool is_constant() const { return true; }
a61af66fc99e Initial load
duke
parents:
diff changeset
480
a61af66fc99e Initial load
duke
parents:
diff changeset
481 virtual AddressConstant* as_AddressConstant() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
482 };
a61af66fc99e Initial load
duke
parents:
diff changeset
483
a61af66fc99e Initial load
duke
parents:
diff changeset
484
a61af66fc99e Initial load
duke
parents:
diff changeset
485 class IllegalType: public ValueType {
a61af66fc99e Initial load
duke
parents:
diff changeset
486 public:
a61af66fc99e Initial load
duke
parents:
diff changeset
487 IllegalType(): ValueType(illegalTag, -1) {}
a61af66fc99e Initial load
duke
parents:
diff changeset
488 virtual ValueType* base() const { return illegalType; }
a61af66fc99e Initial load
duke
parents:
diff changeset
489 virtual const char tchar() const { return ' '; }
a61af66fc99e Initial load
duke
parents:
diff changeset
490 virtual const char* name() const { return "illegal"; }
a61af66fc99e Initial load
duke
parents:
diff changeset
491 virtual IllegalType* as_IllegalType() { return this; }
a61af66fc99e Initial load
duke
parents:
diff changeset
492 };
a61af66fc99e Initial load
duke
parents:
diff changeset
493
a61af66fc99e Initial load
duke
parents:
diff changeset
494
a61af66fc99e Initial load
duke
parents:
diff changeset
495 // conversion between ValueTypes, BasicTypes, and ciConstants
a61af66fc99e Initial load
duke
parents:
diff changeset
496 ValueType* as_ValueType(BasicType type);
a61af66fc99e Initial load
duke
parents:
diff changeset
497 ValueType* as_ValueType(ciConstant value);
a61af66fc99e Initial load
duke
parents:
diff changeset
498 BasicType as_BasicType(ValueType* type);
a61af66fc99e Initial load
duke
parents:
diff changeset
499
a61af66fc99e Initial load
duke
parents:
diff changeset
500 inline ValueType* as_ValueType(ciType* type) { return as_ValueType(type->basic_type()); }
1972
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1584
diff changeset
501
f95d63e2154a 6989984: Use standard include model for Hospot
stefank
parents: 1584
diff changeset
502 #endif // SHARE_VM_C1_C1_VALUETYPE_HPP