Mercurial > hg > truffle
annotate src/share/vm/opto/type.hpp @ 11918:234aea2460bb
removed the IterableNodeType marker interface from PhiNode (GRAAL-471)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Sun, 06 Oct 2013 23:45:02 +0200 |
parents | 6f3fd5150b67 |
children | 9758d9f36299 |
rev | line source |
---|---|
0 | 1 /* |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
2 * Copyright (c) 1997, 2012, 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:
1080
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1080
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:
1080
diff
changeset
|
21 * questions. |
0 | 22 * |
23 */ | |
24 | |
1972 | 25 #ifndef SHARE_VM_OPTO_TYPE_HPP |
26 #define SHARE_VM_OPTO_TYPE_HPP | |
27 | |
28 #include "libadt/port.hpp" | |
29 #include "opto/adlcVMDeps.hpp" | |
30 #include "runtime/handles.hpp" | |
31 | |
0 | 32 // Portions of code courtesy of Clifford Click |
33 | |
34 // Optimization - Graph Style | |
35 | |
36 | |
37 // This class defines a Type lattice. The lattice is used in the constant | |
38 // propagation algorithms, and for some type-checking of the iloc code. | |
39 // Basic types include RSD's (lower bound, upper bound, stride for integers), | |
40 // float & double precision constants, sets of data-labels and code-labels. | |
41 // The complete lattice is described below. Subtypes have no relationship to | |
42 // up or down in the lattice; that is entirely determined by the behavior of | |
43 // the MEET/JOIN functions. | |
44 | |
45 class Dict; | |
46 class Type; | |
47 class TypeD; | |
48 class TypeF; | |
49 class TypeInt; | |
50 class TypeLong; | |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
51 class TypeNarrowPtr; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
52 class TypeNarrowOop; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
53 class TypeNarrowKlass; |
0 | 54 class TypeAry; |
55 class TypeTuple; | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
56 class TypeVect; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
57 class TypeVectS; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
58 class TypeVectD; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
59 class TypeVectX; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
60 class TypeVectY; |
0 | 61 class TypePtr; |
62 class TypeRawPtr; | |
63 class TypeOopPtr; | |
64 class TypeInstPtr; | |
65 class TypeAryPtr; | |
66 class TypeKlassPtr; | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
67 class TypeMetadataPtr; |
0 | 68 |
69 //------------------------------Type------------------------------------------- | |
70 // Basic Type object, represents a set of primitive Values. | |
71 // Types are hash-cons'd into a private class dictionary, so only one of each | |
72 // different kind of Type exists. Types are never modified after creation, so | |
73 // all their interesting fields are constant. | |
74 class Type { | |
3939 | 75 friend class VMStructs; |
76 | |
0 | 77 public: |
78 enum TYPES { | |
79 Bad=0, // Type check | |
80 Control, // Control of code (not in lattice) | |
81 Top, // Top of the lattice | |
82 Int, // Integer range (lo-hi) | |
83 Long, // Long integer range (lo-hi) | |
84 Half, // Placeholder half of doubleword | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
85 NarrowOop, // Compressed oop pointer |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
86 NarrowKlass, // Compressed klass pointer |
0 | 87 |
88 Tuple, // Method signature or object layout | |
89 Array, // Array types | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
90 VectorS, // 32bit Vector types |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
91 VectorD, // 64bit Vector types |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
92 VectorX, // 128bit Vector types |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
93 VectorY, // 256bit Vector types |
0 | 94 |
95 AnyPtr, // Any old raw, klass, inst, or array pointer | |
96 RawPtr, // Raw (non-oop) pointers | |
97 OopPtr, // Any and all Java heap entities | |
98 InstPtr, // Instance pointers (non-array objects) | |
99 AryPtr, // Array pointers | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
100 // (Ptr order matters: See is_ptr, isa_ptr, is_oopptr, isa_oopptr.) |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
101 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
102 MetadataPtr, // Generic metadata |
0 | 103 KlassPtr, // Klass pointers |
104 | |
105 Function, // Function signature | |
106 Abio, // Abstract I/O | |
107 Return_Address, // Subroutine return address | |
108 Memory, // Abstract store | |
109 FloatTop, // No float value | |
110 FloatCon, // Floating point constant | |
111 FloatBot, // Any float value | |
112 DoubleTop, // No double value | |
113 DoubleCon, // Double precision constant | |
114 DoubleBot, // Any double value | |
115 Bottom, // Bottom of lattice | |
116 lastype // Bogus ending type (not in lattice) | |
117 }; | |
118 | |
119 // Signal values for offsets from a base pointer | |
120 enum OFFSET_SIGNALS { | |
121 OffsetTop = -2000000000, // undefined offset | |
122 OffsetBot = -2000000001 // any possible offset | |
123 }; | |
124 | |
125 // Min and max WIDEN values. | |
126 enum WIDEN { | |
127 WidenMin = 0, | |
128 WidenMax = 3 | |
129 }; | |
130 | |
131 private: | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
132 typedef struct { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
133 const TYPES dual_type; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
134 const BasicType basic_type; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
135 const char* msg; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
136 const bool isa_oop; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
137 const int ideal_reg; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
138 const relocInfo::relocType reloc; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
139 } TypeInfo; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
140 |
0 | 141 // Dictionary of types shared among compilations. |
142 static Dict* _shared_type_dict; | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
143 static TypeInfo _type_info[]; |
0 | 144 |
145 static int uhash( const Type *const t ); | |
146 // Structural equality check. Assumes that cmp() has already compared | |
147 // the _base types and thus knows it can cast 't' appropriately. | |
148 virtual bool eq( const Type *t ) const; | |
149 | |
150 // Top-level hash-table of types | |
151 static Dict *type_dict() { | |
152 return Compile::current()->type_dict(); | |
153 } | |
154 | |
155 // DUAL operation: reflect around lattice centerline. Used instead of | |
156 // join to ensure my lattice is symmetric up and down. Dual is computed | |
157 // lazily, on demand, and cached in _dual. | |
158 const Type *_dual; // Cached dual value | |
159 // Table for efficient dualing of base types | |
160 static const TYPES dual_type[lastype]; | |
161 | |
162 protected: | |
163 // Each class of type is also identified by its base. | |
164 const TYPES _base; // Enum of Types type | |
165 | |
166 Type( TYPES t ) : _dual(NULL), _base(t) {} // Simple types | |
167 // ~Type(); // Use fast deallocation | |
168 const Type *hashcons(); // Hash-cons the type | |
169 | |
170 public: | |
171 | |
172 inline void* operator new( size_t x ) { | |
173 Compile* compile = Compile::current(); | |
174 compile->set_type_last_size(x); | |
175 void *temp = compile->type_arena()->Amalloc_D(x); | |
176 compile->set_type_hwm(temp); | |
177 return temp; | |
178 } | |
179 inline void operator delete( void* ptr ) { | |
180 Compile* compile = Compile::current(); | |
181 compile->type_arena()->Afree(ptr,compile->type_last_size()); | |
182 } | |
183 | |
184 // Initialize the type system for a particular compilation. | |
185 static void Initialize(Compile* compile); | |
186 | |
187 // Initialize the types shared by all compilations. | |
188 static void Initialize_shared(Compile* compile); | |
189 | |
190 TYPES base() const { | |
191 assert(_base > Bad && _base < lastype, "sanity"); | |
192 return _base; | |
193 } | |
194 | |
195 // Create a new hash-consd type | |
196 static const Type *make(enum TYPES); | |
197 // Test for equivalence of types | |
198 static int cmp( const Type *const t1, const Type *const t2 ); | |
199 // Test for higher or equal in lattice | |
200 int higher_equal( const Type *t ) const { return !cmp(meet(t),t); } | |
201 | |
202 // MEET operation; lower in lattice. | |
203 const Type *meet( const Type *t ) const; | |
204 // WIDEN: 'widens' for Ints and other range types | |
1009
03b336640699
6885584: A particular class structure causes large allocation spike for jit
never
parents:
992
diff
changeset
|
205 virtual const Type *widen( const Type *old, const Type* limit ) const { return this; } |
0 | 206 // NARROW: complement for widen, used by pessimistic phases |
207 virtual const Type *narrow( const Type *old ) const { return this; } | |
208 | |
209 // DUAL operation: reflect around lattice centerline. Used instead of | |
210 // join to ensure my lattice is symmetric up and down. | |
211 const Type *dual() const { return _dual; } | |
212 | |
213 // Compute meet dependent on base type | |
214 virtual const Type *xmeet( const Type *t ) const; | |
215 virtual const Type *xdual() const; // Compute dual right now. | |
216 | |
217 // JOIN operation; higher in lattice. Done by finding the dual of the | |
218 // meet of the dual of the 2 inputs. | |
219 const Type *join( const Type *t ) const { | |
220 return dual()->meet(t->dual())->dual(); } | |
221 | |
222 // Modified version of JOIN adapted to the needs Node::Value. | |
223 // Normalizes all empty values to TOP. Does not kill _widen bits. | |
224 // Currently, it also works around limitations involving interface types. | |
225 virtual const Type *filter( const Type *kills ) const; | |
226 | |
820
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
227 #ifdef ASSERT |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
228 // One type is interface, the other is oop |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
229 virtual bool interface_vs_oop(const Type *t) const; |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
230 #endif |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
231 |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
232 // Returns true if this pointer points at memory which contains a |
163 | 233 // compressed oop references. |
234 bool is_ptr_to_narrowoop() const; | |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
235 bool is_ptr_to_narrowklass() const; |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
236 |
10278 | 237 bool is_ptr_to_boxing_obj() const; |
238 | |
239 | |
0 | 240 // Convenience access |
241 float getf() const; | |
242 double getd() const; | |
243 | |
244 const TypeInt *is_int() const; | |
245 const TypeInt *isa_int() const; // Returns NULL if not an Int | |
246 const TypeLong *is_long() const; | |
247 const TypeLong *isa_long() const; // Returns NULL if not a Long | |
7194
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
248 const TypeD *isa_double() const; // Returns NULL if not a Double{Top,Con,Bot} |
0 | 249 const TypeD *is_double_constant() const; // Asserts it is a DoubleCon |
250 const TypeD *isa_double_constant() const; // Returns NULL if not a DoubleCon | |
7194
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
251 const TypeF *isa_float() const; // Returns NULL if not a Float{Top,Con,Bot} |
0 | 252 const TypeF *is_float_constant() const; // Asserts it is a FloatCon |
253 const TypeF *isa_float_constant() const; // Returns NULL if not a FloatCon | |
254 const TypeTuple *is_tuple() const; // Collection of fields, NOT a pointer | |
255 const TypeAry *is_ary() const; // Array, NOT array pointer | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
256 const TypeVect *is_vect() const; // Vector |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
257 const TypeVect *isa_vect() const; // Returns NULL if not a Vector |
0 | 258 const TypePtr *is_ptr() const; // Asserts it is a ptr type |
259 const TypePtr *isa_ptr() const; // Returns NULL if not ptr type | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
260 const TypeRawPtr *isa_rawptr() const; // NOT Java oop |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
261 const TypeRawPtr *is_rawptr() const; // Asserts is rawptr |
163 | 262 const TypeNarrowOop *is_narrowoop() const; // Java-style GC'd pointer |
263 const TypeNarrowOop *isa_narrowoop() const; // Returns NULL if not oop ptr type | |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
264 const TypeNarrowKlass *is_narrowklass() const; // compressed klass pointer |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
265 const TypeNarrowKlass *isa_narrowklass() const;// Returns NULL if not oop ptr type |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
266 const TypeOopPtr *isa_oopptr() const; // Returns NULL if not oop ptr type |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
267 const TypeOopPtr *is_oopptr() const; // Java-style GC'd pointer |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
268 const TypeInstPtr *isa_instptr() const; // Returns NULL if not InstPtr |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
269 const TypeInstPtr *is_instptr() const; // Instance |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
270 const TypeAryPtr *isa_aryptr() const; // Returns NULL if not AryPtr |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
271 const TypeAryPtr *is_aryptr() const; // Array oop |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
272 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
273 const TypeMetadataPtr *isa_metadataptr() const; // Returns NULL if not oop ptr type |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
274 const TypeMetadataPtr *is_metadataptr() const; // Java-style GC'd pointer |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
275 const TypeKlassPtr *isa_klassptr() const; // Returns NULL if not KlassPtr |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
276 const TypeKlassPtr *is_klassptr() const; // assert if not KlassPtr |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
277 |
0 | 278 virtual bool is_finite() const; // Has a finite value |
279 virtual bool is_nan() const; // Is not a number (NaN) | |
280 | |
221
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
281 // Returns this ptr type or the equivalent ptr type for this compressed pointer. |
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
282 const TypePtr* make_ptr() const; |
827
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
283 |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
284 // Returns this oopptr type or the equivalent oopptr type for this compressed pointer. |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
285 // Asserts if the underlying type is not an oopptr or narrowoop. |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
286 const TypeOopPtr* make_oopptr() const; |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
287 |
221
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
288 // Returns this compressed pointer or the equivalent compressed version |
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
289 // of this pointer type. |
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
290 const TypeNarrowOop* make_narrowoop() const; |
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
291 |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
292 // Returns this compressed klass pointer or the equivalent |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
293 // compressed version of this pointer type. |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
294 const TypeNarrowKlass* make_narrowklass() const; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
295 |
0 | 296 // Special test for register pressure heuristic |
297 bool is_floatingpoint() const; // True if Float or Double base type | |
298 | |
299 // Do you have memory, directly or through a tuple? | |
300 bool has_memory( ) const; | |
301 | |
302 // TRUE if type is a singleton | |
303 virtual bool singleton(void) const; | |
304 | |
305 // TRUE if type is above the lattice centerline, and is therefore vacuous | |
306 virtual bool empty(void) const; | |
307 | |
308 // Return a hash for this type. The hash function is public so ConNode | |
309 // (constants) can hash on their constant, which is represented by a Type. | |
310 virtual int hash() const; | |
311 | |
312 // Map ideal registers (machine types) to ideal types | |
313 static const Type *mreg2type[]; | |
314 | |
315 // Printing, statistics | |
316 #ifndef PRODUCT | |
317 void dump_on(outputStream *st) const; | |
318 void dump() const { | |
319 dump_on(tty); | |
320 } | |
321 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
322 static void dump_stats(); | |
323 #endif | |
324 void typerr(const Type *t) const; // Mixing types error | |
325 | |
326 // Create basic type | |
327 static const Type* get_const_basic_type(BasicType type) { | |
328 assert((uint)type <= T_CONFLICT && _const_basic_type[type] != NULL, "bad type"); | |
329 return _const_basic_type[type]; | |
330 } | |
331 | |
332 // Mapping to the array element's basic type. | |
333 BasicType array_element_basic_type() const; | |
334 | |
335 // Create standard type for a ciType: | |
336 static const Type* get_const_type(ciType* type); | |
337 | |
338 // Create standard zero value: | |
339 static const Type* get_zero_type(BasicType type) { | |
340 assert((uint)type <= T_CONFLICT && _zero_type[type] != NULL, "bad type"); | |
341 return _zero_type[type]; | |
342 } | |
343 | |
344 // Report if this is a zero value (not top). | |
345 bool is_zero_type() const { | |
346 BasicType type = basic_type(); | |
347 if (type == T_VOID || type >= T_CONFLICT) | |
348 return false; | |
349 else | |
350 return (this == _zero_type[type]); | |
351 } | |
352 | |
353 // Convenience common pre-built types. | |
354 static const Type *ABIO; | |
355 static const Type *BOTTOM; | |
356 static const Type *CONTROL; | |
357 static const Type *DOUBLE; | |
358 static const Type *FLOAT; | |
359 static const Type *HALF; | |
360 static const Type *MEMORY; | |
361 static const Type *MULTI; | |
362 static const Type *RETURN_ADDRESS; | |
363 static const Type *TOP; | |
364 | |
365 // Mapping from compiler type to VM BasicType | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
366 BasicType basic_type() const { return _type_info[_base].basic_type; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
367 int ideal_reg() const { return _type_info[_base].ideal_reg; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
368 const char* msg() const { return _type_info[_base].msg; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
369 bool isa_oop_ptr() const { return _type_info[_base].isa_oop; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
370 relocInfo::relocType reloc() const { return _type_info[_base].reloc; } |
0 | 371 |
372 // Mapping from CI type system to compiler type: | |
373 static const Type* get_typeflow_type(ciType* type); | |
374 | |
375 private: | |
376 // support arrays | |
377 static const BasicType _basic_type[]; | |
378 static const Type* _zero_type[T_CONFLICT+1]; | |
379 static const Type* _const_basic_type[T_CONFLICT+1]; | |
380 }; | |
381 | |
382 //------------------------------TypeF------------------------------------------ | |
383 // Class of Float-Constant Types. | |
384 class TypeF : public Type { | |
385 TypeF( float f ) : Type(FloatCon), _f(f) {}; | |
386 public: | |
387 virtual bool eq( const Type *t ) const; | |
388 virtual int hash() const; // Type specific hashing | |
389 virtual bool singleton(void) const; // TRUE if type is a singleton | |
390 virtual bool empty(void) const; // TRUE if type is vacuous | |
391 public: | |
392 const float _f; // Float constant | |
393 | |
394 static const TypeF *make(float f); | |
395 | |
396 virtual bool is_finite() const; // Has a finite value | |
397 virtual bool is_nan() const; // Is not a number (NaN) | |
398 | |
399 virtual const Type *xmeet( const Type *t ) const; | |
400 virtual const Type *xdual() const; // Compute dual right now. | |
401 // Convenience common pre-built types. | |
402 static const TypeF *ZERO; // positive zero only | |
403 static const TypeF *ONE; | |
404 #ifndef PRODUCT | |
405 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
406 #endif | |
407 }; | |
408 | |
409 //------------------------------TypeD------------------------------------------ | |
410 // Class of Double-Constant Types. | |
411 class TypeD : public Type { | |
412 TypeD( double d ) : Type(DoubleCon), _d(d) {}; | |
413 public: | |
414 virtual bool eq( const Type *t ) const; | |
415 virtual int hash() const; // Type specific hashing | |
416 virtual bool singleton(void) const; // TRUE if type is a singleton | |
417 virtual bool empty(void) const; // TRUE if type is vacuous | |
418 public: | |
419 const double _d; // Double constant | |
420 | |
421 static const TypeD *make(double d); | |
422 | |
423 virtual bool is_finite() const; // Has a finite value | |
424 virtual bool is_nan() const; // Is not a number (NaN) | |
425 | |
426 virtual const Type *xmeet( const Type *t ) const; | |
427 virtual const Type *xdual() const; // Compute dual right now. | |
428 // Convenience common pre-built types. | |
429 static const TypeD *ZERO; // positive zero only | |
430 static const TypeD *ONE; | |
431 #ifndef PRODUCT | |
432 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
433 #endif | |
434 }; | |
435 | |
436 //------------------------------TypeInt---------------------------------------- | |
437 // Class of integer ranges, the set of integers between a lower bound and an | |
438 // upper bound, inclusive. | |
439 class TypeInt : public Type { | |
440 TypeInt( jint lo, jint hi, int w ); | |
441 public: | |
442 virtual bool eq( const Type *t ) const; | |
443 virtual int hash() const; // Type specific hashing | |
444 virtual bool singleton(void) const; // TRUE if type is a singleton | |
445 virtual bool empty(void) const; // TRUE if type is vacuous | |
446 public: | |
447 const jint _lo, _hi; // Lower bound, upper bound | |
448 const short _widen; // Limit on times we widen this sucker | |
449 | |
450 static const TypeInt *make(jint lo); | |
451 // must always specify w | |
452 static const TypeInt *make(jint lo, jint hi, int w); | |
453 | |
454 // Check for single integer | |
455 int is_con() const { return _lo==_hi; } | |
456 bool is_con(int i) const { return is_con() && _lo == i; } | |
457 jint get_con() const { assert( is_con(), "" ); return _lo; } | |
458 | |
459 virtual bool is_finite() const; // Has a finite value | |
460 | |
461 virtual const Type *xmeet( const Type *t ) const; | |
462 virtual const Type *xdual() const; // Compute dual right now. | |
1009
03b336640699
6885584: A particular class structure causes large allocation spike for jit
never
parents:
992
diff
changeset
|
463 virtual const Type *widen( const Type *t, const Type* limit_type ) const; |
0 | 464 virtual const Type *narrow( const Type *t ) const; |
465 // Do not kill _widen bits. | |
466 virtual const Type *filter( const Type *kills ) const; | |
467 // Convenience common pre-built types. | |
468 static const TypeInt *MINUS_1; | |
469 static const TypeInt *ZERO; | |
470 static const TypeInt *ONE; | |
471 static const TypeInt *BOOL; | |
472 static const TypeInt *CC; | |
473 static const TypeInt *CC_LT; // [-1] == MINUS_1 | |
474 static const TypeInt *CC_GT; // [1] == ONE | |
475 static const TypeInt *CC_EQ; // [0] == ZERO | |
476 static const TypeInt *CC_LE; // [-1,0] | |
477 static const TypeInt *CC_GE; // [0,1] == BOOL (!) | |
478 static const TypeInt *BYTE; | |
624 | 479 static const TypeInt *UBYTE; |
0 | 480 static const TypeInt *CHAR; |
481 static const TypeInt *SHORT; | |
482 static const TypeInt *POS; | |
483 static const TypeInt *POS1; | |
484 static const TypeInt *INT; | |
485 static const TypeInt *SYMINT; // symmetric range [-max_jint..max_jint] | |
486 #ifndef PRODUCT | |
487 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
488 #endif | |
489 }; | |
490 | |
491 | |
492 //------------------------------TypeLong--------------------------------------- | |
493 // Class of long integer ranges, the set of integers between a lower bound and | |
494 // an upper bound, inclusive. | |
495 class TypeLong : public Type { | |
496 TypeLong( jlong lo, jlong hi, int w ); | |
497 public: | |
498 virtual bool eq( const Type *t ) const; | |
499 virtual int hash() const; // Type specific hashing | |
500 virtual bool singleton(void) const; // TRUE if type is a singleton | |
501 virtual bool empty(void) const; // TRUE if type is vacuous | |
502 public: | |
503 const jlong _lo, _hi; // Lower bound, upper bound | |
504 const short _widen; // Limit on times we widen this sucker | |
505 | |
506 static const TypeLong *make(jlong lo); | |
507 // must always specify w | |
508 static const TypeLong *make(jlong lo, jlong hi, int w); | |
509 | |
510 // Check for single integer | |
511 int is_con() const { return _lo==_hi; } | |
145 | 512 bool is_con(int i) const { return is_con() && _lo == i; } |
0 | 513 jlong get_con() const { assert( is_con(), "" ); return _lo; } |
514 | |
515 virtual bool is_finite() const; // Has a finite value | |
516 | |
517 virtual const Type *xmeet( const Type *t ) const; | |
518 virtual const Type *xdual() const; // Compute dual right now. | |
1009
03b336640699
6885584: A particular class structure causes large allocation spike for jit
never
parents:
992
diff
changeset
|
519 virtual const Type *widen( const Type *t, const Type* limit_type ) const; |
0 | 520 virtual const Type *narrow( const Type *t ) const; |
521 // Do not kill _widen bits. | |
522 virtual const Type *filter( const Type *kills ) const; | |
523 // Convenience common pre-built types. | |
524 static const TypeLong *MINUS_1; | |
525 static const TypeLong *ZERO; | |
526 static const TypeLong *ONE; | |
527 static const TypeLong *POS; | |
528 static const TypeLong *LONG; | |
529 static const TypeLong *INT; // 32-bit subrange [min_jint..max_jint] | |
530 static const TypeLong *UINT; // 32-bit unsigned [0..max_juint] | |
531 #ifndef PRODUCT | |
532 virtual void dump2( Dict &d, uint, outputStream *st ) const;// Specialized per-Type dumping | |
533 #endif | |
534 }; | |
535 | |
536 //------------------------------TypeTuple-------------------------------------- | |
537 // Class of Tuple Types, essentially type collections for function signatures | |
538 // and class layouts. It happens to also be a fast cache for the HotSpot | |
539 // signature types. | |
540 class TypeTuple : public Type { | |
541 TypeTuple( uint cnt, const Type **fields ) : Type(Tuple), _cnt(cnt), _fields(fields) { } | |
542 public: | |
543 virtual bool eq( const Type *t ) const; | |
544 virtual int hash() const; // Type specific hashing | |
545 virtual bool singleton(void) const; // TRUE if type is a singleton | |
546 virtual bool empty(void) const; // TRUE if type is vacuous | |
547 | |
548 public: | |
549 const uint _cnt; // Count of fields | |
550 const Type ** const _fields; // Array of field types | |
551 | |
552 // Accessors: | |
553 uint cnt() const { return _cnt; } | |
554 const Type* field_at(uint i) const { | |
555 assert(i < _cnt, "oob"); | |
556 return _fields[i]; | |
557 } | |
558 void set_field_at(uint i, const Type* t) { | |
559 assert(i < _cnt, "oob"); | |
560 _fields[i] = t; | |
561 } | |
562 | |
563 static const TypeTuple *make( uint cnt, const Type **fields ); | |
564 static const TypeTuple *make_range(ciSignature *sig); | |
565 static const TypeTuple *make_domain(ciInstanceKlass* recv, ciSignature *sig); | |
566 | |
567 // Subroutine call type with space allocated for argument types | |
568 static const Type **fields( uint arg_cnt ); | |
569 | |
570 virtual const Type *xmeet( const Type *t ) const; | |
571 virtual const Type *xdual() const; // Compute dual right now. | |
572 // Convenience common pre-built types. | |
573 static const TypeTuple *IFBOTH; | |
574 static const TypeTuple *IFFALSE; | |
575 static const TypeTuple *IFTRUE; | |
576 static const TypeTuple *IFNEITHER; | |
577 static const TypeTuple *LOOPBODY; | |
578 static const TypeTuple *MEMBAR; | |
579 static const TypeTuple *STORECONDITIONAL; | |
580 static const TypeTuple *START_I2C; | |
581 static const TypeTuple *INT_PAIR; | |
582 static const TypeTuple *LONG_PAIR; | |
583 #ifndef PRODUCT | |
584 virtual void dump2( Dict &d, uint, outputStream *st ) const; // Specialized per-Type dumping | |
585 #endif | |
586 }; | |
587 | |
588 //------------------------------TypeAry---------------------------------------- | |
589 // Class of Array Types | |
590 class TypeAry : public Type { | |
591 TypeAry( const Type *elem, const TypeInt *size) : Type(Array), | |
592 _elem(elem), _size(size) {} | |
593 public: | |
594 virtual bool eq( const Type *t ) const; | |
595 virtual int hash() const; // Type specific hashing | |
596 virtual bool singleton(void) const; // TRUE if type is a singleton | |
597 virtual bool empty(void) const; // TRUE if type is vacuous | |
598 | |
599 private: | |
600 const Type *_elem; // Element type of array | |
601 const TypeInt *_size; // Elements in array | |
602 friend class TypeAryPtr; | |
603 | |
604 public: | |
605 static const TypeAry *make( const Type *elem, const TypeInt *size); | |
606 | |
607 virtual const Type *xmeet( const Type *t ) const; | |
608 virtual const Type *xdual() const; // Compute dual right now. | |
609 bool ary_must_be_exact() const; // true if arrays of such are never generic | |
820
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
610 #ifdef ASSERT |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
611 // One type is interface, the other is oop |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
612 virtual bool interface_vs_oop(const Type *t) const; |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
613 #endif |
0 | 614 #ifndef PRODUCT |
615 virtual void dump2( Dict &d, uint, outputStream *st ) const; // Specialized per-Type dumping | |
616 #endif | |
617 }; | |
618 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
619 //------------------------------TypeVect--------------------------------------- |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
620 // Class of Vector Types |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
621 class TypeVect : public Type { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
622 const Type* _elem; // Vector's element type |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
623 const uint _length; // Elements in vector (power of 2) |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
624 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
625 protected: |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
626 TypeVect(TYPES t, const Type* elem, uint length) : Type(t), |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
627 _elem(elem), _length(length) {} |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
628 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
629 public: |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
630 const Type* element_type() const { return _elem; } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
631 BasicType element_basic_type() const { return _elem->array_element_basic_type(); } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
632 uint length() const { return _length; } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
633 uint length_in_bytes() const { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
634 return _length * type2aelembytes(element_basic_type()); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
635 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
636 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
637 virtual bool eq(const Type *t) const; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
638 virtual int hash() const; // Type specific hashing |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
639 virtual bool singleton(void) const; // TRUE if type is a singleton |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
640 virtual bool empty(void) const; // TRUE if type is vacuous |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
641 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
642 static const TypeVect *make(const BasicType elem_bt, uint length) { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
643 // Use bottom primitive type. |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
644 return make(get_const_basic_type(elem_bt), length); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
645 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
646 // Used directly by Replicate nodes to construct singleton vector. |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
647 static const TypeVect *make(const Type* elem, uint length); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
648 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
649 virtual const Type *xmeet( const Type *t) const; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
650 virtual const Type *xdual() const; // Compute dual right now. |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
651 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
652 static const TypeVect *VECTS; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
653 static const TypeVect *VECTD; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
654 static const TypeVect *VECTX; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
655 static const TypeVect *VECTY; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
656 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
657 #ifndef PRODUCT |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
658 virtual void dump2(Dict &d, uint, outputStream *st) const; // Specialized per-Type dumping |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
659 #endif |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
660 }; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
661 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
662 class TypeVectS : public TypeVect { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
663 friend class TypeVect; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
664 TypeVectS(const Type* elem, uint length) : TypeVect(VectorS, elem, length) {} |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
665 }; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
666 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
667 class TypeVectD : public TypeVect { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
668 friend class TypeVect; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
669 TypeVectD(const Type* elem, uint length) : TypeVect(VectorD, elem, length) {} |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
670 }; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
671 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
672 class TypeVectX : public TypeVect { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
673 friend class TypeVect; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
674 TypeVectX(const Type* elem, uint length) : TypeVect(VectorX, elem, length) {} |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
675 }; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
676 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
677 class TypeVectY : public TypeVect { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
678 friend class TypeVect; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
679 TypeVectY(const Type* elem, uint length) : TypeVect(VectorY, elem, length) {} |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
680 }; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
681 |
0 | 682 //------------------------------TypePtr---------------------------------------- |
683 // Class of machine Pointer Types: raw data, instances or arrays. | |
684 // If the _base enum is AnyPtr, then this refers to all of the above. | |
685 // Otherwise the _base will indicate which subset of pointers is affected, | |
686 // and the class will be inherited from. | |
687 class TypePtr : public Type { | |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
688 friend class TypeNarrowPtr; |
0 | 689 public: |
690 enum PTR { TopPTR, AnyNull, Constant, Null, NotNull, BotPTR, lastPTR }; | |
691 protected: | |
692 TypePtr( TYPES t, PTR ptr, int offset ) : Type(t), _ptr(ptr), _offset(offset) {} | |
693 virtual bool eq( const Type *t ) const; | |
694 virtual int hash() const; // Type specific hashing | |
695 static const PTR ptr_meet[lastPTR][lastPTR]; | |
696 static const PTR ptr_dual[lastPTR]; | |
697 static const char * const ptr_msg[lastPTR]; | |
698 | |
699 public: | |
700 const int _offset; // Offset into oop, with TOP & BOT | |
701 const PTR _ptr; // Pointer equivalence class | |
702 | |
703 const int offset() const { return _offset; } | |
704 const PTR ptr() const { return _ptr; } | |
705 | |
706 static const TypePtr *make( TYPES t, PTR ptr, int offset ); | |
707 | |
708 // Return a 'ptr' version of this type | |
709 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
710 | |
711 virtual intptr_t get_con() const; | |
712 | |
306
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
713 int xadd_offset( intptr_t offset ) const; |
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
714 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 715 |
716 virtual bool singleton(void) const; // TRUE if type is a singleton | |
717 virtual bool empty(void) const; // TRUE if type is vacuous | |
718 virtual const Type *xmeet( const Type *t ) const; | |
719 int meet_offset( int offset ) const; | |
720 int dual_offset( ) const; | |
721 virtual const Type *xdual() const; // Compute dual right now. | |
722 | |
723 // meet, dual and join over pointer equivalence sets | |
724 PTR meet_ptr( const PTR in_ptr ) const { return ptr_meet[in_ptr][ptr()]; } | |
725 PTR dual_ptr() const { return ptr_dual[ptr()]; } | |
726 | |
727 // This is textually confusing unless one recalls that | |
728 // join(t) == dual()->meet(t->dual())->dual(). | |
729 PTR join_ptr( const PTR in_ptr ) const { | |
730 return ptr_dual[ ptr_meet[ ptr_dual[in_ptr] ] [ dual_ptr() ] ]; | |
731 } | |
732 | |
733 // Tests for relation to centerline of type lattice: | |
734 static bool above_centerline(PTR ptr) { return (ptr <= AnyNull); } | |
735 static bool below_centerline(PTR ptr) { return (ptr >= NotNull); } | |
736 // Convenience common pre-built types. | |
737 static const TypePtr *NULL_PTR; | |
738 static const TypePtr *NOTNULL; | |
739 static const TypePtr *BOTTOM; | |
740 #ifndef PRODUCT | |
741 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
742 #endif | |
743 }; | |
744 | |
745 //------------------------------TypeRawPtr------------------------------------- | |
746 // Class of raw pointers, pointers to things other than Oops. Examples | |
747 // include the stack pointer, top of heap, card-marking area, handles, etc. | |
748 class TypeRawPtr : public TypePtr { | |
749 protected: | |
750 TypeRawPtr( PTR ptr, address bits ) : TypePtr(RawPtr,ptr,0), _bits(bits){} | |
751 public: | |
752 virtual bool eq( const Type *t ) const; | |
753 virtual int hash() const; // Type specific hashing | |
754 | |
755 const address _bits; // Constant value, if applicable | |
756 | |
757 static const TypeRawPtr *make( PTR ptr ); | |
758 static const TypeRawPtr *make( address bits ); | |
759 | |
760 // Return a 'ptr' version of this type | |
761 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
762 | |
763 virtual intptr_t get_con() const; | |
764 | |
306
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
765 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 766 |
767 virtual const Type *xmeet( const Type *t ) const; | |
768 virtual const Type *xdual() const; // Compute dual right now. | |
769 // Convenience common pre-built types. | |
770 static const TypeRawPtr *BOTTOM; | |
771 static const TypeRawPtr *NOTNULL; | |
772 #ifndef PRODUCT | |
773 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
774 #endif | |
775 }; | |
776 | |
777 //------------------------------TypeOopPtr------------------------------------- | |
778 // Some kind of oop (Java pointer), either klass or instance or array. | |
779 class TypeOopPtr : public TypePtr { | |
780 protected: | |
163 | 781 TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id ); |
0 | 782 public: |
783 virtual bool eq( const Type *t ) const; | |
784 virtual int hash() const; // Type specific hashing | |
785 virtual bool singleton(void) const; // TRUE if type is a singleton | |
786 enum { | |
223 | 787 InstanceTop = -1, // undefined instance |
788 InstanceBot = 0 // any possible instance | |
0 | 789 }; |
790 protected: | |
791 | |
792 // Oop is NULL, unless this is a constant oop. | |
793 ciObject* _const_oop; // Constant oop | |
794 // If _klass is NULL, then so is _sig. This is an unloaded klass. | |
795 ciKlass* _klass; // Klass object | |
796 // Does the type exclude subclasses of the klass? (Inexact == polymorphic.) | |
797 bool _klass_is_exact; | |
163 | 798 bool _is_ptr_to_narrowoop; |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
799 bool _is_ptr_to_narrowklass; |
10278 | 800 bool _is_ptr_to_boxed_value; |
0 | 801 |
223 | 802 // If not InstanceTop or InstanceBot, indicates that this is |
803 // a particular instance of this type which is distinct. | |
804 // This is the the node index of the allocation node creating this instance. | |
805 int _instance_id; | |
0 | 806 |
807 static const TypeOopPtr* make_from_klass_common(ciKlass* klass, bool klass_change, bool try_for_exact); | |
808 | |
223 | 809 int dual_instance_id() const; |
810 int meet_instance_id(int uid) const; | |
0 | 811 |
812 public: | |
813 // Creates a type given a klass. Correctly handles multi-dimensional arrays | |
814 // Respects UseUniqueSubclasses. | |
815 // If the klass is final, the resulting type will be exact. | |
816 static const TypeOopPtr* make_from_klass(ciKlass* klass) { | |
817 return make_from_klass_common(klass, true, false); | |
818 } | |
819 // Same as before, but will produce an exact type, even if | |
820 // the klass is not final, as long as it has exactly one implementation. | |
821 static const TypeOopPtr* make_from_klass_unique(ciKlass* klass) { | |
822 return make_from_klass_common(klass, true, true); | |
823 } | |
824 // Same as before, but does not respects UseUniqueSubclasses. | |
825 // Use this only for creating array element types. | |
826 static const TypeOopPtr* make_from_klass_raw(ciKlass* klass) { | |
827 return make_from_klass_common(klass, false, false); | |
828 } | |
829 // Creates a singleton type given an object. | |
989
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
958
diff
changeset
|
830 // If the object cannot be rendered as a constant, |
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
958
diff
changeset
|
831 // may return a non-singleton type. |
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
958
diff
changeset
|
832 // If require_constant, produce a NULL if a singleton is not possible. |
10278 | 833 static const TypeOopPtr* make_from_constant(ciObject* o, |
834 bool require_constant = false, | |
835 bool not_null_elements = false); | |
0 | 836 |
837 // Make a generic (unclassed) pointer to an oop. | |
992 | 838 static const TypeOopPtr* make(PTR ptr, int offset, int instance_id); |
0 | 839 |
840 ciObject* const_oop() const { return _const_oop; } | |
841 virtual ciKlass* klass() const { return _klass; } | |
842 bool klass_is_exact() const { return _klass_is_exact; } | |
163 | 843 |
844 // Returns true if this pointer points at memory which contains a | |
845 // compressed oop references. | |
846 bool is_ptr_to_narrowoop_nv() const { return _is_ptr_to_narrowoop; } | |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
847 bool is_ptr_to_narrowklass_nv() const { return _is_ptr_to_narrowklass; } |
10278 | 848 bool is_ptr_to_boxed_value() const { return _is_ptr_to_boxed_value; } |
223 | 849 bool is_known_instance() const { return _instance_id > 0; } |
850 int instance_id() const { return _instance_id; } | |
851 bool is_known_instance_field() const { return is_known_instance() && _offset >= 0; } | |
0 | 852 |
853 virtual intptr_t get_con() const; | |
854 | |
855 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
856 | |
857 virtual const Type *cast_to_exactness(bool klass_is_exact) const; | |
858 | |
223 | 859 virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; |
0 | 860 |
861 // corresponding pointer to klass, for a given instance | |
862 const TypeKlassPtr* as_klass_type() const; | |
863 | |
306
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
864 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 865 |
866 virtual const Type *xmeet( const Type *t ) const; | |
867 virtual const Type *xdual() const; // Compute dual right now. | |
868 | |
869 // Do not allow interface-vs.-noninterface joins to collapse to top. | |
870 virtual const Type *filter( const Type *kills ) const; | |
871 | |
872 // Convenience common pre-built type. | |
873 static const TypeOopPtr *BOTTOM; | |
874 #ifndef PRODUCT | |
875 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
876 #endif | |
877 }; | |
878 | |
879 //------------------------------TypeInstPtr------------------------------------ | |
880 // Class of Java object pointers, pointing either to non-array Java instances | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
881 // or to a Klass* (including array klasses). |
0 | 882 class TypeInstPtr : public TypeOopPtr { |
883 TypeInstPtr( PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id ); | |
884 virtual bool eq( const Type *t ) const; | |
885 virtual int hash() const; // Type specific hashing | |
886 | |
887 ciSymbol* _name; // class name | |
888 | |
889 public: | |
890 ciSymbol* name() const { return _name; } | |
891 | |
892 bool is_loaded() const { return _klass->is_loaded(); } | |
893 | |
894 // Make a pointer to a constant oop. | |
895 static const TypeInstPtr *make(ciObject* o) { | |
896 return make(TypePtr::Constant, o->klass(), true, o, 0); | |
897 } | |
898 // Make a pointer to a constant oop with offset. | |
899 static const TypeInstPtr *make(ciObject* o, int offset) { | |
900 return make(TypePtr::Constant, o->klass(), true, o, offset); | |
901 } | |
902 | |
903 // Make a pointer to some value of type klass. | |
904 static const TypeInstPtr *make(PTR ptr, ciKlass* klass) { | |
905 return make(ptr, klass, false, NULL, 0); | |
906 } | |
907 | |
908 // Make a pointer to some non-polymorphic value of exactly type klass. | |
909 static const TypeInstPtr *make_exact(PTR ptr, ciKlass* klass) { | |
910 return make(ptr, klass, true, NULL, 0); | |
911 } | |
912 | |
913 // Make a pointer to some value of type klass with offset. | |
914 static const TypeInstPtr *make(PTR ptr, ciKlass* klass, int offset) { | |
915 return make(ptr, klass, false, NULL, offset); | |
916 } | |
917 | |
918 // Make a pointer to an oop. | |
223 | 919 static const TypeInstPtr *make(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id = InstanceBot ); |
0 | 920 |
10278 | 921 /** Create constant type for a constant boxed value */ |
922 const Type* get_const_boxed_value() const; | |
923 | |
0 | 924 // If this is a java.lang.Class constant, return the type for it or NULL. |
925 // Pass to Type::get_const_type to turn it to a type, which will usually | |
926 // be a TypeInstPtr, but may also be a TypeInt::INT for int.class, etc. | |
927 ciType* java_mirror_type() const; | |
928 | |
929 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
930 | |
931 virtual const Type *cast_to_exactness(bool klass_is_exact) const; | |
932 | |
223 | 933 virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; |
0 | 934 |
306
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
935 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 936 |
937 virtual const Type *xmeet( const Type *t ) const; | |
938 virtual const TypeInstPtr *xmeet_unloaded( const TypeInstPtr *t ) const; | |
939 virtual const Type *xdual() const; // Compute dual right now. | |
940 | |
941 // Convenience common pre-built types. | |
942 static const TypeInstPtr *NOTNULL; | |
943 static const TypeInstPtr *BOTTOM; | |
944 static const TypeInstPtr *MIRROR; | |
945 static const TypeInstPtr *MARK; | |
946 static const TypeInstPtr *KLASS; | |
947 #ifndef PRODUCT | |
948 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping | |
949 #endif | |
950 }; | |
951 | |
952 //------------------------------TypeAryPtr------------------------------------- | |
953 // Class of Java array pointers | |
954 class TypeAryPtr : public TypeOopPtr { | |
10278 | 955 TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, |
956 int offset, int instance_id, bool is_autobox_cache ) | |
957 : TypeOopPtr(AryPtr,ptr,k,xk,o,offset, instance_id), | |
958 _ary(ary), | |
959 _is_autobox_cache(is_autobox_cache) | |
960 { | |
1761 | 961 #ifdef ASSERT |
962 if (k != NULL) { | |
963 // Verify that specified klass and TypeAryPtr::klass() follow the same rules. | |
964 ciKlass* ck = compute_klass(true); | |
1792 | 965 if (k != ck) { |
1761 | 966 this->dump(); tty->cr(); |
967 tty->print(" k: "); | |
968 k->print(); tty->cr(); | |
969 tty->print("ck: "); | |
970 if (ck != NULL) ck->print(); | |
971 else tty->print("<NULL>"); | |
972 tty->cr(); | |
973 assert(false, "unexpected TypeAryPtr::_klass"); | |
974 } | |
975 } | |
976 #endif | |
977 } | |
0 | 978 virtual bool eq( const Type *t ) const; |
979 virtual int hash() const; // Type specific hashing | |
980 const TypeAry *_ary; // Array we point into | |
10278 | 981 const bool _is_autobox_cache; |
0 | 982 |
1761 | 983 ciKlass* compute_klass(DEBUG_ONLY(bool verify = false)) const; |
984 | |
0 | 985 public: |
986 // Accessors | |
987 ciKlass* klass() const; | |
988 const TypeAry* ary() const { return _ary; } | |
989 const Type* elem() const { return _ary->_elem; } | |
990 const TypeInt* size() const { return _ary->_size; } | |
991 | |
10278 | 992 bool is_autobox_cache() const { return _is_autobox_cache; } |
993 | |
223 | 994 static const TypeAryPtr *make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot); |
0 | 995 // Constant pointer to array |
10278 | 996 static const TypeAryPtr *make( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot, bool is_autobox_cache = false); |
0 | 997 |
998 // Return a 'ptr' version of this type | |
999 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
1000 | |
1001 virtual const Type *cast_to_exactness(bool klass_is_exact) const; | |
1002 | |
223 | 1003 virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; |
0 | 1004 |
1005 virtual const TypeAryPtr* cast_to_size(const TypeInt* size) const; | |
366
8261ee795323
6711100: 64bit fastdebug server vm crashes with assert(_base == Int,"Not an Int")
rasbold
parents:
306
diff
changeset
|
1006 virtual const TypeInt* narrow_size_type(const TypeInt* size) const; |
0 | 1007 |
1008 virtual bool empty(void) const; // TRUE if type is vacuous | |
306
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
1009 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 1010 |
1011 virtual const Type *xmeet( const Type *t ) const; | |
1012 virtual const Type *xdual() const; // Compute dual right now. | |
1013 | |
1014 // Convenience common pre-built types. | |
1015 static const TypeAryPtr *RANGE; | |
1016 static const TypeAryPtr *OOPS; | |
163 | 1017 static const TypeAryPtr *NARROWOOPS; |
0 | 1018 static const TypeAryPtr *BYTES; |
1019 static const TypeAryPtr *SHORTS; | |
1020 static const TypeAryPtr *CHARS; | |
1021 static const TypeAryPtr *INTS; | |
1022 static const TypeAryPtr *LONGS; | |
1023 static const TypeAryPtr *FLOATS; | |
1024 static const TypeAryPtr *DOUBLES; | |
1025 // selects one of the above: | |
1026 static const TypeAryPtr *get_array_body_type(BasicType elem) { | |
1027 assert((uint)elem <= T_CONFLICT && _array_body_type[elem] != NULL, "bad elem type"); | |
1028 return _array_body_type[elem]; | |
1029 } | |
1030 static const TypeAryPtr *_array_body_type[T_CONFLICT+1]; | |
1031 // sharpen the type of an int which is used as an array size | |
820
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
1032 #ifdef ASSERT |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
1033 // One type is interface, the other is oop |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
1034 virtual bool interface_vs_oop(const Type *t) const; |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
1035 #endif |
0 | 1036 #ifndef PRODUCT |
1037 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping | |
1038 #endif | |
1039 }; | |
1040 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1041 //------------------------------TypeMetadataPtr------------------------------------- |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1042 // Some kind of metadata, either Method*, MethodData* or CPCacheOop |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1043 class TypeMetadataPtr : public TypePtr { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1044 protected: |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1045 TypeMetadataPtr(PTR ptr, ciMetadata* metadata, int offset); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1046 public: |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1047 virtual bool eq( const Type *t ) const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1048 virtual int hash() const; // Type specific hashing |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1049 virtual bool singleton(void) const; // TRUE if type is a singleton |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1050 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1051 private: |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1052 ciMetadata* _metadata; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1053 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1054 public: |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1055 static const TypeMetadataPtr* make(PTR ptr, ciMetadata* m, int offset); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1056 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1057 static const TypeMetadataPtr* make(ciMethod* m); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1058 static const TypeMetadataPtr* make(ciMethodData* m); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1059 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1060 ciMetadata* metadata() const { return _metadata; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1061 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1062 virtual const Type *cast_to_ptr_type(PTR ptr) const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1063 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1064 virtual const TypePtr *add_offset( intptr_t offset ) const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1065 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1066 virtual const Type *xmeet( const Type *t ) const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1067 virtual const Type *xdual() const; // Compute dual right now. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1068 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1069 virtual intptr_t get_con() const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1070 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1071 // Do not allow interface-vs.-noninterface joins to collapse to top. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1072 virtual const Type *filter( const Type *kills ) const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1073 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1074 // Convenience common pre-built types. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1075 static const TypeMetadataPtr *BOTTOM; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1076 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1077 #ifndef PRODUCT |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1078 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1079 #endif |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1080 }; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1081 |
0 | 1082 //------------------------------TypeKlassPtr----------------------------------- |
1083 // Class of Java Klass pointers | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1084 class TypeKlassPtr : public TypePtr { |
0 | 1085 TypeKlassPtr( PTR ptr, ciKlass* klass, int offset ); |
1086 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1087 public: |
0 | 1088 virtual bool eq( const Type *t ) const; |
1089 virtual int hash() const; // Type specific hashing | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1090 virtual bool singleton(void) const; // TRUE if type is a singleton |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1091 private: |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1092 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1093 static const TypeKlassPtr* make_from_klass_common(ciKlass* klass, bool klass_change, bool try_for_exact); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1094 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1095 ciKlass* _klass; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1096 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1097 // Does the type exclude subclasses of the klass? (Inexact == polymorphic.) |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1098 bool _klass_is_exact; |
0 | 1099 |
1100 public: | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1101 ciSymbol* name() const { return klass()->name(); } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1102 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1103 ciKlass* klass() const { return _klass; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1104 bool klass_is_exact() const { return _klass_is_exact; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1105 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1106 bool is_loaded() const { return klass()->is_loaded(); } |
0 | 1107 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1108 // Creates a type given a klass. Correctly handles multi-dimensional arrays |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1109 // Respects UseUniqueSubclasses. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1110 // If the klass is final, the resulting type will be exact. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1111 static const TypeKlassPtr* make_from_klass(ciKlass* klass) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1112 return make_from_klass_common(klass, true, false); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1113 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1114 // Same as before, but will produce an exact type, even if |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1115 // the klass is not final, as long as it has exactly one implementation. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1116 static const TypeKlassPtr* make_from_klass_unique(ciKlass* klass) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1117 return make_from_klass_common(klass, true, true); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1118 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1119 // Same as before, but does not respects UseUniqueSubclasses. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1120 // Use this only for creating array element types. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1121 static const TypeKlassPtr* make_from_klass_raw(ciKlass* klass) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1122 return make_from_klass_common(klass, false, false); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1123 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1124 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1125 // Make a generic (unclassed) pointer to metadata. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1126 static const TypeKlassPtr* make(PTR ptr, int offset); |
555 | 1127 |
0 | 1128 // ptr to klass 'k' |
1129 static const TypeKlassPtr *make( ciKlass* k ) { return make( TypePtr::Constant, k, 0); } | |
1130 // ptr to klass 'k' with offset | |
1131 static const TypeKlassPtr *make( ciKlass* k, int offset ) { return make( TypePtr::Constant, k, offset); } | |
1132 // ptr to klass 'k' or sub-klass | |
1133 static const TypeKlassPtr *make( PTR ptr, ciKlass* k, int offset); | |
1134 | |
1135 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
1136 | |
1137 virtual const Type *cast_to_exactness(bool klass_is_exact) const; | |
1138 | |
1139 // corresponding pointer to instance, for a given class | |
1140 const TypeOopPtr* as_instance_type() const; | |
1141 | |
306
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
1142 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 1143 virtual const Type *xmeet( const Type *t ) const; |
1144 virtual const Type *xdual() const; // Compute dual right now. | |
1145 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1146 virtual intptr_t get_con() const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1147 |
0 | 1148 // Convenience common pre-built types. |
1149 static const TypeKlassPtr* OBJECT; // Not-null object klass or below | |
1150 static const TypeKlassPtr* OBJECT_OR_NULL; // Maybe-null version of same | |
1151 #ifndef PRODUCT | |
1152 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping | |
1153 #endif | |
1154 }; | |
1155 | |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1156 class TypeNarrowPtr : public Type { |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1157 protected: |
827
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1158 const TypePtr* _ptrtype; // Could be TypePtr::NULL_PTR |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1159 |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1160 TypeNarrowPtr(TYPES t, const TypePtr* ptrtype): _ptrtype(ptrtype), |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1161 Type(t) { |
827
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1162 assert(ptrtype->offset() == 0 || |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1163 ptrtype->offset() == OffsetBot || |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1164 ptrtype->offset() == OffsetTop, "no real offsets"); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1165 } |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1166 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1167 virtual const TypeNarrowPtr *isa_same_narrowptr(const Type *t) const = 0; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1168 virtual const TypeNarrowPtr *is_same_narrowptr(const Type *t) const = 0; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1169 virtual const TypeNarrowPtr *make_same_narrowptr(const TypePtr *t) const = 0; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1170 virtual const TypeNarrowPtr *make_hash_same_narrowptr(const TypePtr *t) const = 0; |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1171 public: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1172 virtual bool eq( const Type *t ) const; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1173 virtual int hash() const; // Type specific hashing |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1174 virtual bool singleton(void) const; // TRUE if type is a singleton |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1175 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1176 virtual const Type *xmeet( const Type *t ) const; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1177 virtual const Type *xdual() const; // Compute dual right now. |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1178 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1179 virtual intptr_t get_con() const; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1180 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1181 // Do not allow interface-vs.-noninterface joins to collapse to top. |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1182 virtual const Type *filter( const Type *kills ) const; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1183 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1184 virtual bool empty(void) const; // TRUE if type is vacuous |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1185 |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1186 // returns the equivalent ptr type for this compressed pointer |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1187 const TypePtr *get_ptrtype() const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1188 return _ptrtype; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1189 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1190 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1191 #ifndef PRODUCT |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1192 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1193 #endif |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1194 }; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1195 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1196 //------------------------------TypeNarrowOop---------------------------------- |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1197 // A compressed reference to some kind of Oop. This type wraps around |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1198 // a preexisting TypeOopPtr and forwards most of it's operations to |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1199 // the underlying type. It's only real purpose is to track the |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1200 // oopness of the compressed oop value when we expose the conversion |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1201 // between the normal and the compressed form. |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1202 class TypeNarrowOop : public TypeNarrowPtr { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1203 protected: |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1204 TypeNarrowOop( const TypePtr* ptrtype): TypeNarrowPtr(NarrowOop, ptrtype) { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1205 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1206 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1207 virtual const TypeNarrowPtr *isa_same_narrowptr(const Type *t) const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1208 return t->isa_narrowoop(); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1209 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1210 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1211 virtual const TypeNarrowPtr *is_same_narrowptr(const Type *t) const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1212 return t->is_narrowoop(); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1213 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1214 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1215 virtual const TypeNarrowPtr *make_same_narrowptr(const TypePtr *t) const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1216 return new TypeNarrowOop(t); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1217 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1218 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1219 virtual const TypeNarrowPtr *make_hash_same_narrowptr(const TypePtr *t) const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1220 return (const TypeNarrowPtr*)((new TypeNarrowOop(t))->hashcons()); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1221 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1222 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1223 public: |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1224 |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1225 static const TypeNarrowOop *make( const TypePtr* type); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1226 |
2379
b099aaf51bf8
6962931: move interned strings out of the perm gen
jcoomes
parents:
1972
diff
changeset
|
1227 static const TypeNarrowOop* make_from_constant(ciObject* con, bool require_constant = false) { |
b099aaf51bf8
6962931: move interned strings out of the perm gen
jcoomes
parents:
1972
diff
changeset
|
1228 return make(TypeOopPtr::make_from_constant(con, require_constant)); |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1229 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1230 |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1231 static const TypeNarrowOop *BOTTOM; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1232 static const TypeNarrowOop *NULL_PTR; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1233 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1234 #ifndef PRODUCT |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1235 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1236 #endif |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1237 }; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1238 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1239 //------------------------------TypeNarrowKlass---------------------------------- |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1240 // A compressed reference to klass pointer. This type wraps around a |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1241 // preexisting TypeKlassPtr and forwards most of it's operations to |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1242 // the underlying type. |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1243 class TypeNarrowKlass : public TypeNarrowPtr { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1244 protected: |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1245 TypeNarrowKlass( const TypePtr* ptrtype): TypeNarrowPtr(NarrowKlass, ptrtype) { |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1246 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1247 |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1248 virtual const TypeNarrowPtr *isa_same_narrowptr(const Type *t) const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1249 return t->isa_narrowklass(); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1250 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1251 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1252 virtual const TypeNarrowPtr *is_same_narrowptr(const Type *t) const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1253 return t->is_narrowklass(); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1254 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1255 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1256 virtual const TypeNarrowPtr *make_same_narrowptr(const TypePtr *t) const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1257 return new TypeNarrowKlass(t); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1258 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1259 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1260 virtual const TypeNarrowPtr *make_hash_same_narrowptr(const TypePtr *t) const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1261 return (const TypeNarrowPtr*)((new TypeNarrowKlass(t))->hashcons()); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1262 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1263 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1264 public: |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1265 static const TypeNarrowKlass *make( const TypePtr* type); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1266 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1267 // static const TypeNarrowKlass *BOTTOM; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1268 static const TypeNarrowKlass *NULL_PTR; |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1269 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1270 #ifndef PRODUCT |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1271 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1272 #endif |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1273 }; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1274 |
0 | 1275 //------------------------------TypeFunc--------------------------------------- |
1276 // Class of Array Types | |
1277 class TypeFunc : public Type { | |
1278 TypeFunc( const TypeTuple *domain, const TypeTuple *range ) : Type(Function), _domain(domain), _range(range) {} | |
1279 virtual bool eq( const Type *t ) const; | |
1280 virtual int hash() const; // Type specific hashing | |
1281 virtual bool singleton(void) const; // TRUE if type is a singleton | |
1282 virtual bool empty(void) const; // TRUE if type is vacuous | |
1283 public: | |
1284 // Constants are shared among ADLC and VM | |
1285 enum { Control = AdlcVMDeps::Control, | |
1286 I_O = AdlcVMDeps::I_O, | |
1287 Memory = AdlcVMDeps::Memory, | |
1288 FramePtr = AdlcVMDeps::FramePtr, | |
1289 ReturnAdr = AdlcVMDeps::ReturnAdr, | |
1290 Parms = AdlcVMDeps::Parms | |
1291 }; | |
1292 | |
1293 const TypeTuple* const _domain; // Domain of inputs | |
1294 const TypeTuple* const _range; // Range of results | |
1295 | |
1296 // Accessors: | |
1297 const TypeTuple* domain() const { return _domain; } | |
1298 const TypeTuple* range() const { return _range; } | |
1299 | |
1300 static const TypeFunc *make(ciMethod* method); | |
1301 static const TypeFunc *make(ciSignature signature, const Type* extra); | |
1302 static const TypeFunc *make(const TypeTuple* domain, const TypeTuple* range); | |
1303 | |
1304 virtual const Type *xmeet( const Type *t ) const; | |
1305 virtual const Type *xdual() const; // Compute dual right now. | |
1306 | |
1307 BasicType return_type() const; | |
1308 | |
1309 #ifndef PRODUCT | |
1310 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping | |
1311 #endif | |
1312 // Convenience common pre-built types. | |
1313 }; | |
1314 | |
1315 //------------------------------accessors-------------------------------------- | |
163 | 1316 inline bool Type::is_ptr_to_narrowoop() const { |
1317 #ifdef _LP64 | |
1318 return (isa_oopptr() != NULL && is_oopptr()->is_ptr_to_narrowoop_nv()); | |
1319 #else | |
1320 return false; | |
1321 #endif | |
1322 } | |
1323 | |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1324 inline bool Type::is_ptr_to_narrowklass() const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1325 #ifdef _LP64 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1326 return (isa_oopptr() != NULL && is_oopptr()->is_ptr_to_narrowklass_nv()); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1327 #else |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1328 return false; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1329 #endif |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1330 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1331 |
0 | 1332 inline float Type::getf() const { |
1333 assert( _base == FloatCon, "Not a FloatCon" ); | |
1334 return ((TypeF*)this)->_f; | |
1335 } | |
1336 | |
1337 inline double Type::getd() const { | |
1338 assert( _base == DoubleCon, "Not a DoubleCon" ); | |
1339 return ((TypeD*)this)->_d; | |
1340 } | |
1341 | |
1342 inline const TypeInt *Type::is_int() const { | |
1343 assert( _base == Int, "Not an Int" ); | |
1344 return (TypeInt*)this; | |
1345 } | |
1346 | |
1347 inline const TypeInt *Type::isa_int() const { | |
1348 return ( _base == Int ? (TypeInt*)this : NULL); | |
1349 } | |
1350 | |
1351 inline const TypeLong *Type::is_long() const { | |
1352 assert( _base == Long, "Not a Long" ); | |
1353 return (TypeLong*)this; | |
1354 } | |
1355 | |
1356 inline const TypeLong *Type::isa_long() const { | |
1357 return ( _base == Long ? (TypeLong*)this : NULL); | |
1358 } | |
1359 | |
7194
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1360 inline const TypeF *Type::isa_float() const { |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1361 return ((_base == FloatTop || |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1362 _base == FloatCon || |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1363 _base == FloatBot) ? (TypeF*)this : NULL); |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1364 } |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1365 |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1366 inline const TypeF *Type::is_float_constant() const { |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1367 assert( _base == FloatCon, "Not a Float" ); |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1368 return (TypeF*)this; |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1369 } |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1370 |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1371 inline const TypeF *Type::isa_float_constant() const { |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1372 return ( _base == FloatCon ? (TypeF*)this : NULL); |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1373 } |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1374 |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1375 inline const TypeD *Type::isa_double() const { |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1376 return ((_base == DoubleTop || |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1377 _base == DoubleCon || |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1378 _base == DoubleBot) ? (TypeD*)this : NULL); |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1379 } |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1380 |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1381 inline const TypeD *Type::is_double_constant() const { |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1382 assert( _base == DoubleCon, "Not a Double" ); |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1383 return (TypeD*)this; |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1384 } |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1385 |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1386 inline const TypeD *Type::isa_double_constant() const { |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1387 return ( _base == DoubleCon ? (TypeD*)this : NULL); |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1388 } |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1389 |
0 | 1390 inline const TypeTuple *Type::is_tuple() const { |
1391 assert( _base == Tuple, "Not a Tuple" ); | |
1392 return (TypeTuple*)this; | |
1393 } | |
1394 | |
1395 inline const TypeAry *Type::is_ary() const { | |
1396 assert( _base == Array , "Not an Array" ); | |
1397 return (TypeAry*)this; | |
1398 } | |
1399 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1400 inline const TypeVect *Type::is_vect() const { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1401 assert( _base >= VectorS && _base <= VectorY, "Not a Vector" ); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1402 return (TypeVect*)this; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1403 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1404 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1405 inline const TypeVect *Type::isa_vect() const { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1406 return (_base >= VectorS && _base <= VectorY) ? (TypeVect*)this : NULL; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1407 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1408 |
0 | 1409 inline const TypePtr *Type::is_ptr() const { |
1410 // AnyPtr is the first Ptr and KlassPtr the last, with no non-ptrs between. | |
1411 assert(_base >= AnyPtr && _base <= KlassPtr, "Not a pointer"); | |
1412 return (TypePtr*)this; | |
1413 } | |
1414 | |
1415 inline const TypePtr *Type::isa_ptr() const { | |
1416 // AnyPtr is the first Ptr and KlassPtr the last, with no non-ptrs between. | |
1417 return (_base >= AnyPtr && _base <= KlassPtr) ? (TypePtr*)this : NULL; | |
1418 } | |
1419 | |
1420 inline const TypeOopPtr *Type::is_oopptr() const { | |
1421 // OopPtr is the first and KlassPtr the last, with no non-oops between. | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1422 assert(_base >= OopPtr && _base <= AryPtr, "Not a Java pointer" ) ; |
0 | 1423 return (TypeOopPtr*)this; |
1424 } | |
1425 | |
1426 inline const TypeOopPtr *Type::isa_oopptr() const { | |
1427 // OopPtr is the first and KlassPtr the last, with no non-oops between. | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1428 return (_base >= OopPtr && _base <= AryPtr) ? (TypeOopPtr*)this : NULL; |
0 | 1429 } |
1430 | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1431 inline const TypeRawPtr *Type::isa_rawptr() const { |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1432 return (_base == RawPtr) ? (TypeRawPtr*)this : NULL; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1433 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1434 |
0 | 1435 inline const TypeRawPtr *Type::is_rawptr() const { |
1436 assert( _base == RawPtr, "Not a raw pointer" ); | |
1437 return (TypeRawPtr*)this; | |
1438 } | |
1439 | |
1440 inline const TypeInstPtr *Type::isa_instptr() const { | |
1441 return (_base == InstPtr) ? (TypeInstPtr*)this : NULL; | |
1442 } | |
1443 | |
1444 inline const TypeInstPtr *Type::is_instptr() const { | |
1445 assert( _base == InstPtr, "Not an object pointer" ); | |
1446 return (TypeInstPtr*)this; | |
1447 } | |
1448 | |
1449 inline const TypeAryPtr *Type::isa_aryptr() const { | |
1450 return (_base == AryPtr) ? (TypeAryPtr*)this : NULL; | |
1451 } | |
1452 | |
1453 inline const TypeAryPtr *Type::is_aryptr() const { | |
1454 assert( _base == AryPtr, "Not an array pointer" ); | |
1455 return (TypeAryPtr*)this; | |
1456 } | |
1457 | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1458 inline const TypeNarrowOop *Type::is_narrowoop() const { |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1459 // OopPtr is the first and KlassPtr the last, with no non-oops between. |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1460 assert(_base == NarrowOop, "Not a narrow oop" ) ; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1461 return (TypeNarrowOop*)this; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1462 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1463 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1464 inline const TypeNarrowOop *Type::isa_narrowoop() const { |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1465 // OopPtr is the first and KlassPtr the last, with no non-oops between. |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1466 return (_base == NarrowOop) ? (TypeNarrowOop*)this : NULL; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1467 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1468 |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1469 inline const TypeNarrowKlass *Type::is_narrowklass() const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1470 assert(_base == NarrowKlass, "Not a narrow oop" ) ; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1471 return (TypeNarrowKlass*)this; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1472 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1473 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1474 inline const TypeNarrowKlass *Type::isa_narrowklass() const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1475 return (_base == NarrowKlass) ? (TypeNarrowKlass*)this : NULL; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1476 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1477 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1478 inline const TypeMetadataPtr *Type::is_metadataptr() const { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1479 // MetadataPtr is the first and CPCachePtr the last |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1480 assert(_base == MetadataPtr, "Not a metadata pointer" ) ; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1481 return (TypeMetadataPtr*)this; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1482 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1483 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1484 inline const TypeMetadataPtr *Type::isa_metadataptr() const { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1485 return (_base == MetadataPtr) ? (TypeMetadataPtr*)this : NULL; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1486 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1487 |
0 | 1488 inline const TypeKlassPtr *Type::isa_klassptr() const { |
1489 return (_base == KlassPtr) ? (TypeKlassPtr*)this : NULL; | |
1490 } | |
1491 | |
1492 inline const TypeKlassPtr *Type::is_klassptr() const { | |
1493 assert( _base == KlassPtr, "Not a klass pointer" ); | |
1494 return (TypeKlassPtr*)this; | |
1495 } | |
1496 | |
221
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1497 inline const TypePtr* Type::make_ptr() const { |
827
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1498 return (_base == NarrowOop) ? is_narrowoop()->get_ptrtype() : |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1499 ((_base == NarrowKlass) ? is_narrowklass()->get_ptrtype() : |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1500 (isa_ptr() ? is_ptr() : NULL)); |
221
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1501 } |
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1502 |
827
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1503 inline const TypeOopPtr* Type::make_oopptr() const { |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1504 return (_base == NarrowOop) ? is_narrowoop()->get_ptrtype()->is_oopptr() : is_oopptr(); |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1505 } |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1506 |
221
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1507 inline const TypeNarrowOop* Type::make_narrowoop() const { |
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1508 return (_base == NarrowOop) ? is_narrowoop() : |
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1509 (isa_ptr() ? TypeNarrowOop::make(is_ptr()) : NULL); |
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1510 } |
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1511 |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1512 inline const TypeNarrowKlass* Type::make_narrowklass() const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1513 return (_base == NarrowKlass) ? is_narrowklass() : |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1514 (isa_ptr() ? TypeNarrowKlass::make(is_ptr()) : NULL); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1515 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1516 |
0 | 1517 inline bool Type::is_floatingpoint() const { |
1518 if( (_base == FloatCon) || (_base == FloatBot) || | |
1519 (_base == DoubleCon) || (_base == DoubleBot) ) | |
1520 return true; | |
1521 return false; | |
1522 } | |
1523 | |
10278 | 1524 inline bool Type::is_ptr_to_boxing_obj() const { |
1525 const TypeInstPtr* tp = isa_instptr(); | |
1526 return (tp != NULL) && (tp->offset() == 0) && | |
1527 tp->klass()->is_instance_klass() && | |
1528 tp->klass()->as_instance_klass()->is_box_klass(); | |
1529 } | |
1530 | |
0 | 1531 |
1532 // =============================================================== | |
1533 // Things that need to be 64-bits in the 64-bit build but | |
1534 // 32-bits in the 32-bit build. Done this way to get full | |
1535 // optimization AND strong typing. | |
1536 #ifdef _LP64 | |
1537 | |
1538 // For type queries and asserts | |
1539 #define is_intptr_t is_long | |
1540 #define isa_intptr_t isa_long | |
1541 #define find_intptr_t_type find_long_type | |
1542 #define find_intptr_t_con find_long_con | |
1543 #define TypeX TypeLong | |
1544 #define Type_X Type::Long | |
1545 #define TypeX_X TypeLong::LONG | |
1546 #define TypeX_ZERO TypeLong::ZERO | |
1547 // For 'ideal_reg' machine registers | |
1548 #define Op_RegX Op_RegL | |
1549 // For phase->intcon variants | |
1550 #define MakeConX longcon | |
1551 #define ConXNode ConLNode | |
1552 // For array index arithmetic | |
1553 #define MulXNode MulLNode | |
1554 #define AndXNode AndLNode | |
1555 #define OrXNode OrLNode | |
1556 #define CmpXNode CmpLNode | |
1557 #define SubXNode SubLNode | |
1558 #define LShiftXNode LShiftLNode | |
1559 // For object size computation: | |
1560 #define AddXNode AddLNode | |
17
ff5961f4c095
6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents:
0
diff
changeset
|
1561 #define RShiftXNode RShiftLNode |
0 | 1562 // For card marks and hashcodes |
1563 #define URShiftXNode URShiftLNode | |
420
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1564 // UseOptoBiasInlining |
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1565 #define XorXNode XorLNode |
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1566 #define StoreXConditionalNode StoreLConditionalNode |
0 | 1567 // Opcodes |
1568 #define Op_LShiftX Op_LShiftL | |
1569 #define Op_AndX Op_AndL | |
1570 #define Op_AddX Op_AddL | |
1571 #define Op_SubX Op_SubL | |
851
fc4be448891f
6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents:
827
diff
changeset
|
1572 #define Op_XorX Op_XorL |
fc4be448891f
6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents:
827
diff
changeset
|
1573 #define Op_URShiftX Op_URShiftL |
0 | 1574 // conversions |
1575 #define ConvI2X(x) ConvI2L(x) | |
1576 #define ConvL2X(x) (x) | |
1577 #define ConvX2I(x) ConvL2I(x) | |
1578 #define ConvX2L(x) (x) | |
1579 | |
1580 #else | |
1581 | |
1582 // For type queries and asserts | |
1583 #define is_intptr_t is_int | |
1584 #define isa_intptr_t isa_int | |
1585 #define find_intptr_t_type find_int_type | |
1586 #define find_intptr_t_con find_int_con | |
1587 #define TypeX TypeInt | |
1588 #define Type_X Type::Int | |
1589 #define TypeX_X TypeInt::INT | |
1590 #define TypeX_ZERO TypeInt::ZERO | |
1591 // For 'ideal_reg' machine registers | |
1592 #define Op_RegX Op_RegI | |
1593 // For phase->intcon variants | |
1594 #define MakeConX intcon | |
1595 #define ConXNode ConINode | |
1596 // For array index arithmetic | |
1597 #define MulXNode MulINode | |
1598 #define AndXNode AndINode | |
1599 #define OrXNode OrINode | |
1600 #define CmpXNode CmpINode | |
1601 #define SubXNode SubINode | |
1602 #define LShiftXNode LShiftINode | |
1603 // For object size computation: | |
1604 #define AddXNode AddINode | |
17
ff5961f4c095
6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents:
0
diff
changeset
|
1605 #define RShiftXNode RShiftINode |
0 | 1606 // For card marks and hashcodes |
1607 #define URShiftXNode URShiftINode | |
420
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1608 // UseOptoBiasInlining |
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1609 #define XorXNode XorINode |
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1610 #define StoreXConditionalNode StoreIConditionalNode |
0 | 1611 // Opcodes |
1612 #define Op_LShiftX Op_LShiftI | |
1613 #define Op_AndX Op_AndI | |
1614 #define Op_AddX Op_AddI | |
1615 #define Op_SubX Op_SubI | |
851
fc4be448891f
6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents:
827
diff
changeset
|
1616 #define Op_XorX Op_XorI |
fc4be448891f
6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents:
827
diff
changeset
|
1617 #define Op_URShiftX Op_URShiftI |
0 | 1618 // conversions |
1619 #define ConvI2X(x) (x) | |
1620 #define ConvL2X(x) ConvL2I(x) | |
1621 #define ConvX2I(x) (x) | |
1622 #define ConvX2L(x) ConvI2L(x) | |
1623 | |
1624 #endif | |
1972 | 1625 |
1626 #endif // SHARE_VM_OPTO_TYPE_HPP |