Mercurial > hg > graal-jvmci-8
annotate src/share/vm/opto/type.hpp @ 12242:884ed7a10f09
Merge
author | tschatzl |
---|---|
date | Mon, 16 Sep 2013 09:41:03 +0200 |
parents | edb5ab0f3fe5 |
children | c9ccd7b85f20 |
rev | line source |
---|---|
0 | 1 /* |
12146
9758d9f36299
8021954: VM SIGSEGV during classloading on MacOS; hs_err_pid file produced
coleenp
parents:
10278
diff
changeset
|
2 * Copyright (c) 1997, 2013, 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 | |
12146
9758d9f36299
8021954: VM SIGSEGV during classloading on MacOS; hs_err_pid file produced
coleenp
parents:
10278
diff
changeset
|
172 inline void* operator new( size_t x ) throw() { |
0 | 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 | |
12190
edb5ab0f3fe5
8001107: @Stable annotation for constant folding of lazily evaluated variables
vlivanov
parents:
12146
diff
changeset
|
375 static const Type* make_from_constant(ciConstant constant, |
edb5ab0f3fe5
8001107: @Stable annotation for constant folding of lazily evaluated variables
vlivanov
parents:
12146
diff
changeset
|
376 bool require_constant = false, |
edb5ab0f3fe5
8001107: @Stable annotation for constant folding of lazily evaluated variables
vlivanov
parents:
12146
diff
changeset
|
377 bool is_autobox_cache = false); |
edb5ab0f3fe5
8001107: @Stable annotation for constant folding of lazily evaluated variables
vlivanov
parents:
12146
diff
changeset
|
378 |
0 | 379 private: |
380 // support arrays | |
381 static const BasicType _basic_type[]; | |
382 static const Type* _zero_type[T_CONFLICT+1]; | |
383 static const Type* _const_basic_type[T_CONFLICT+1]; | |
384 }; | |
385 | |
386 //------------------------------TypeF------------------------------------------ | |
387 // Class of Float-Constant Types. | |
388 class TypeF : public Type { | |
389 TypeF( float f ) : Type(FloatCon), _f(f) {}; | |
390 public: | |
391 virtual bool eq( const Type *t ) const; | |
392 virtual int hash() const; // Type specific hashing | |
393 virtual bool singleton(void) const; // TRUE if type is a singleton | |
394 virtual bool empty(void) const; // TRUE if type is vacuous | |
395 public: | |
396 const float _f; // Float constant | |
397 | |
398 static const TypeF *make(float f); | |
399 | |
400 virtual bool is_finite() const; // Has a finite value | |
401 virtual bool is_nan() const; // Is not a number (NaN) | |
402 | |
403 virtual const Type *xmeet( const Type *t ) const; | |
404 virtual const Type *xdual() const; // Compute dual right now. | |
405 // Convenience common pre-built types. | |
406 static const TypeF *ZERO; // positive zero only | |
407 static const TypeF *ONE; | |
408 #ifndef PRODUCT | |
409 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
410 #endif | |
411 }; | |
412 | |
413 //------------------------------TypeD------------------------------------------ | |
414 // Class of Double-Constant Types. | |
415 class TypeD : public Type { | |
416 TypeD( double d ) : Type(DoubleCon), _d(d) {}; | |
417 public: | |
418 virtual bool eq( const Type *t ) const; | |
419 virtual int hash() const; // Type specific hashing | |
420 virtual bool singleton(void) const; // TRUE if type is a singleton | |
421 virtual bool empty(void) const; // TRUE if type is vacuous | |
422 public: | |
423 const double _d; // Double constant | |
424 | |
425 static const TypeD *make(double d); | |
426 | |
427 virtual bool is_finite() const; // Has a finite value | |
428 virtual bool is_nan() const; // Is not a number (NaN) | |
429 | |
430 virtual const Type *xmeet( const Type *t ) const; | |
431 virtual const Type *xdual() const; // Compute dual right now. | |
432 // Convenience common pre-built types. | |
433 static const TypeD *ZERO; // positive zero only | |
434 static const TypeD *ONE; | |
435 #ifndef PRODUCT | |
436 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
437 #endif | |
438 }; | |
439 | |
440 //------------------------------TypeInt---------------------------------------- | |
441 // Class of integer ranges, the set of integers between a lower bound and an | |
442 // upper bound, inclusive. | |
443 class TypeInt : public Type { | |
444 TypeInt( jint lo, jint hi, int w ); | |
445 public: | |
446 virtual bool eq( const Type *t ) const; | |
447 virtual int hash() const; // Type specific hashing | |
448 virtual bool singleton(void) const; // TRUE if type is a singleton | |
449 virtual bool empty(void) const; // TRUE if type is vacuous | |
450 public: | |
451 const jint _lo, _hi; // Lower bound, upper bound | |
452 const short _widen; // Limit on times we widen this sucker | |
453 | |
454 static const TypeInt *make(jint lo); | |
455 // must always specify w | |
456 static const TypeInt *make(jint lo, jint hi, int w); | |
457 | |
458 // Check for single integer | |
459 int is_con() const { return _lo==_hi; } | |
460 bool is_con(int i) const { return is_con() && _lo == i; } | |
461 jint get_con() const { assert( is_con(), "" ); return _lo; } | |
462 | |
463 virtual bool is_finite() const; // Has a finite value | |
464 | |
465 virtual const Type *xmeet( const Type *t ) const; | |
466 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
|
467 virtual const Type *widen( const Type *t, const Type* limit_type ) const; |
0 | 468 virtual const Type *narrow( const Type *t ) const; |
469 // Do not kill _widen bits. | |
470 virtual const Type *filter( const Type *kills ) const; | |
471 // Convenience common pre-built types. | |
472 static const TypeInt *MINUS_1; | |
473 static const TypeInt *ZERO; | |
474 static const TypeInt *ONE; | |
475 static const TypeInt *BOOL; | |
476 static const TypeInt *CC; | |
477 static const TypeInt *CC_LT; // [-1] == MINUS_1 | |
478 static const TypeInt *CC_GT; // [1] == ONE | |
479 static const TypeInt *CC_EQ; // [0] == ZERO | |
480 static const TypeInt *CC_LE; // [-1,0] | |
481 static const TypeInt *CC_GE; // [0,1] == BOOL (!) | |
482 static const TypeInt *BYTE; | |
624 | 483 static const TypeInt *UBYTE; |
0 | 484 static const TypeInt *CHAR; |
485 static const TypeInt *SHORT; | |
486 static const TypeInt *POS; | |
487 static const TypeInt *POS1; | |
488 static const TypeInt *INT; | |
489 static const TypeInt *SYMINT; // symmetric range [-max_jint..max_jint] | |
490 #ifndef PRODUCT | |
491 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
492 #endif | |
493 }; | |
494 | |
495 | |
496 //------------------------------TypeLong--------------------------------------- | |
497 // Class of long integer ranges, the set of integers between a lower bound and | |
498 // an upper bound, inclusive. | |
499 class TypeLong : public Type { | |
500 TypeLong( jlong lo, jlong hi, int w ); | |
501 public: | |
502 virtual bool eq( const Type *t ) const; | |
503 virtual int hash() const; // Type specific hashing | |
504 virtual bool singleton(void) const; // TRUE if type is a singleton | |
505 virtual bool empty(void) const; // TRUE if type is vacuous | |
506 public: | |
507 const jlong _lo, _hi; // Lower bound, upper bound | |
508 const short _widen; // Limit on times we widen this sucker | |
509 | |
510 static const TypeLong *make(jlong lo); | |
511 // must always specify w | |
512 static const TypeLong *make(jlong lo, jlong hi, int w); | |
513 | |
514 // Check for single integer | |
515 int is_con() const { return _lo==_hi; } | |
145 | 516 bool is_con(int i) const { return is_con() && _lo == i; } |
0 | 517 jlong get_con() const { assert( is_con(), "" ); return _lo; } |
518 | |
519 virtual bool is_finite() const; // Has a finite value | |
520 | |
521 virtual const Type *xmeet( const Type *t ) const; | |
522 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
|
523 virtual const Type *widen( const Type *t, const Type* limit_type ) const; |
0 | 524 virtual const Type *narrow( const Type *t ) const; |
525 // Do not kill _widen bits. | |
526 virtual const Type *filter( const Type *kills ) const; | |
527 // Convenience common pre-built types. | |
528 static const TypeLong *MINUS_1; | |
529 static const TypeLong *ZERO; | |
530 static const TypeLong *ONE; | |
531 static const TypeLong *POS; | |
532 static const TypeLong *LONG; | |
533 static const TypeLong *INT; // 32-bit subrange [min_jint..max_jint] | |
534 static const TypeLong *UINT; // 32-bit unsigned [0..max_juint] | |
535 #ifndef PRODUCT | |
536 virtual void dump2( Dict &d, uint, outputStream *st ) const;// Specialized per-Type dumping | |
537 #endif | |
538 }; | |
539 | |
540 //------------------------------TypeTuple-------------------------------------- | |
541 // Class of Tuple Types, essentially type collections for function signatures | |
542 // and class layouts. It happens to also be a fast cache for the HotSpot | |
543 // signature types. | |
544 class TypeTuple : public Type { | |
545 TypeTuple( uint cnt, const Type **fields ) : Type(Tuple), _cnt(cnt), _fields(fields) { } | |
546 public: | |
547 virtual bool eq( const Type *t ) const; | |
548 virtual int hash() const; // Type specific hashing | |
549 virtual bool singleton(void) const; // TRUE if type is a singleton | |
550 virtual bool empty(void) const; // TRUE if type is vacuous | |
551 | |
552 public: | |
553 const uint _cnt; // Count of fields | |
554 const Type ** const _fields; // Array of field types | |
555 | |
556 // Accessors: | |
557 uint cnt() const { return _cnt; } | |
558 const Type* field_at(uint i) const { | |
559 assert(i < _cnt, "oob"); | |
560 return _fields[i]; | |
561 } | |
562 void set_field_at(uint i, const Type* t) { | |
563 assert(i < _cnt, "oob"); | |
564 _fields[i] = t; | |
565 } | |
566 | |
567 static const TypeTuple *make( uint cnt, const Type **fields ); | |
568 static const TypeTuple *make_range(ciSignature *sig); | |
569 static const TypeTuple *make_domain(ciInstanceKlass* recv, ciSignature *sig); | |
570 | |
571 // Subroutine call type with space allocated for argument types | |
572 static const Type **fields( uint arg_cnt ); | |
573 | |
574 virtual const Type *xmeet( const Type *t ) const; | |
575 virtual const Type *xdual() const; // Compute dual right now. | |
576 // Convenience common pre-built types. | |
577 static const TypeTuple *IFBOTH; | |
578 static const TypeTuple *IFFALSE; | |
579 static const TypeTuple *IFTRUE; | |
580 static const TypeTuple *IFNEITHER; | |
581 static const TypeTuple *LOOPBODY; | |
582 static const TypeTuple *MEMBAR; | |
583 static const TypeTuple *STORECONDITIONAL; | |
584 static const TypeTuple *START_I2C; | |
585 static const TypeTuple *INT_PAIR; | |
586 static const TypeTuple *LONG_PAIR; | |
587 #ifndef PRODUCT | |
588 virtual void dump2( Dict &d, uint, outputStream *st ) const; // Specialized per-Type dumping | |
589 #endif | |
590 }; | |
591 | |
592 //------------------------------TypeAry---------------------------------------- | |
593 // Class of Array Types | |
594 class TypeAry : public Type { | |
12190
edb5ab0f3fe5
8001107: @Stable annotation for constant folding of lazily evaluated variables
vlivanov
parents:
12146
diff
changeset
|
595 TypeAry(const Type* elem, const TypeInt* size, bool stable) : Type(Array), |
edb5ab0f3fe5
8001107: @Stable annotation for constant folding of lazily evaluated variables
vlivanov
parents:
12146
diff
changeset
|
596 _elem(elem), _size(size), _stable(stable) {} |
0 | 597 public: |
598 virtual bool eq( const Type *t ) const; | |
599 virtual int hash() const; // Type specific hashing | |
600 virtual bool singleton(void) const; // TRUE if type is a singleton | |
601 virtual bool empty(void) const; // TRUE if type is vacuous | |
602 | |
603 private: | |
604 const Type *_elem; // Element type of array | |
605 const TypeInt *_size; // Elements in array | |
12190
edb5ab0f3fe5
8001107: @Stable annotation for constant folding of lazily evaluated variables
vlivanov
parents:
12146
diff
changeset
|
606 const bool _stable; // Are elements @Stable? |
0 | 607 friend class TypeAryPtr; |
608 | |
609 public: | |
12190
edb5ab0f3fe5
8001107: @Stable annotation for constant folding of lazily evaluated variables
vlivanov
parents:
12146
diff
changeset
|
610 static const TypeAry* make(const Type* elem, const TypeInt* size, bool stable = false); |
0 | 611 |
612 virtual const Type *xmeet( const Type *t ) const; | |
613 virtual const Type *xdual() const; // Compute dual right now. | |
614 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
|
615 #ifdef ASSERT |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
616 // One type is interface, the other is oop |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
617 virtual bool interface_vs_oop(const Type *t) const; |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
618 #endif |
0 | 619 #ifndef PRODUCT |
620 virtual void dump2( Dict &d, uint, outputStream *st ) const; // Specialized per-Type dumping | |
621 #endif | |
622 }; | |
623 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
624 //------------------------------TypeVect--------------------------------------- |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
625 // Class of Vector Types |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
626 class TypeVect : public Type { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
627 const Type* _elem; // Vector's element type |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
628 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
|
629 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
630 protected: |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
631 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
|
632 _elem(elem), _length(length) {} |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
633 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
634 public: |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
635 const Type* element_type() const { return _elem; } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
636 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
|
637 uint length() const { return _length; } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
638 uint length_in_bytes() const { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
639 return _length * type2aelembytes(element_basic_type()); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
640 } |
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 virtual bool eq(const Type *t) const; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
643 virtual int hash() const; // Type specific hashing |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
644 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
|
645 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
|
646 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
647 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
|
648 // Use bottom primitive type. |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
649 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
|
650 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
651 // 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
|
652 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
|
653 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
654 virtual const Type *xmeet( const Type *t) const; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
655 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
|
656 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
657 static const TypeVect *VECTS; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
658 static const TypeVect *VECTD; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
659 static const TypeVect *VECTX; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
660 static const TypeVect *VECTY; |
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 #ifndef PRODUCT |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
663 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
|
664 #endif |
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 TypeVectS : 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 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
|
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 TypeVectD : 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 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
|
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 TypeVectX : 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 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
|
680 }; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
681 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
682 class TypeVectY : public TypeVect { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
683 friend class TypeVect; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
684 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
|
685 }; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
686 |
0 | 687 //------------------------------TypePtr---------------------------------------- |
688 // Class of machine Pointer Types: raw data, instances or arrays. | |
689 // If the _base enum is AnyPtr, then this refers to all of the above. | |
690 // Otherwise the _base will indicate which subset of pointers is affected, | |
691 // and the class will be inherited from. | |
692 class TypePtr : public Type { | |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
693 friend class TypeNarrowPtr; |
0 | 694 public: |
695 enum PTR { TopPTR, AnyNull, Constant, Null, NotNull, BotPTR, lastPTR }; | |
696 protected: | |
697 TypePtr( TYPES t, PTR ptr, int offset ) : Type(t), _ptr(ptr), _offset(offset) {} | |
698 virtual bool eq( const Type *t ) const; | |
699 virtual int hash() const; // Type specific hashing | |
700 static const PTR ptr_meet[lastPTR][lastPTR]; | |
701 static const PTR ptr_dual[lastPTR]; | |
702 static const char * const ptr_msg[lastPTR]; | |
703 | |
704 public: | |
705 const int _offset; // Offset into oop, with TOP & BOT | |
706 const PTR _ptr; // Pointer equivalence class | |
707 | |
708 const int offset() const { return _offset; } | |
709 const PTR ptr() const { return _ptr; } | |
710 | |
711 static const TypePtr *make( TYPES t, PTR ptr, int offset ); | |
712 | |
713 // Return a 'ptr' version of this type | |
714 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
715 | |
716 virtual intptr_t get_con() const; | |
717 | |
306
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
718 int xadd_offset( intptr_t offset ) const; |
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
719 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 720 |
721 virtual bool singleton(void) const; // TRUE if type is a singleton | |
722 virtual bool empty(void) const; // TRUE if type is vacuous | |
723 virtual const Type *xmeet( const Type *t ) const; | |
724 int meet_offset( int offset ) const; | |
725 int dual_offset( ) const; | |
726 virtual const Type *xdual() const; // Compute dual right now. | |
727 | |
728 // meet, dual and join over pointer equivalence sets | |
729 PTR meet_ptr( const PTR in_ptr ) const { return ptr_meet[in_ptr][ptr()]; } | |
730 PTR dual_ptr() const { return ptr_dual[ptr()]; } | |
731 | |
732 // This is textually confusing unless one recalls that | |
733 // join(t) == dual()->meet(t->dual())->dual(). | |
734 PTR join_ptr( const PTR in_ptr ) const { | |
735 return ptr_dual[ ptr_meet[ ptr_dual[in_ptr] ] [ dual_ptr() ] ]; | |
736 } | |
737 | |
738 // Tests for relation to centerline of type lattice: | |
739 static bool above_centerline(PTR ptr) { return (ptr <= AnyNull); } | |
740 static bool below_centerline(PTR ptr) { return (ptr >= NotNull); } | |
741 // Convenience common pre-built types. | |
742 static const TypePtr *NULL_PTR; | |
743 static const TypePtr *NOTNULL; | |
744 static const TypePtr *BOTTOM; | |
745 #ifndef PRODUCT | |
746 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
747 #endif | |
748 }; | |
749 | |
750 //------------------------------TypeRawPtr------------------------------------- | |
751 // Class of raw pointers, pointers to things other than Oops. Examples | |
752 // include the stack pointer, top of heap, card-marking area, handles, etc. | |
753 class TypeRawPtr : public TypePtr { | |
754 protected: | |
755 TypeRawPtr( PTR ptr, address bits ) : TypePtr(RawPtr,ptr,0), _bits(bits){} | |
756 public: | |
757 virtual bool eq( const Type *t ) const; | |
758 virtual int hash() const; // Type specific hashing | |
759 | |
760 const address _bits; // Constant value, if applicable | |
761 | |
762 static const TypeRawPtr *make( PTR ptr ); | |
763 static const TypeRawPtr *make( address bits ); | |
764 | |
765 // Return a 'ptr' version of this type | |
766 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
767 | |
768 virtual intptr_t get_con() const; | |
769 | |
306
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
770 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 771 |
772 virtual const Type *xmeet( const Type *t ) const; | |
773 virtual const Type *xdual() const; // Compute dual right now. | |
774 // Convenience common pre-built types. | |
775 static const TypeRawPtr *BOTTOM; | |
776 static const TypeRawPtr *NOTNULL; | |
777 #ifndef PRODUCT | |
778 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
779 #endif | |
780 }; | |
781 | |
782 //------------------------------TypeOopPtr------------------------------------- | |
783 // Some kind of oop (Java pointer), either klass or instance or array. | |
784 class TypeOopPtr : public TypePtr { | |
785 protected: | |
163 | 786 TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id ); |
0 | 787 public: |
788 virtual bool eq( const Type *t ) const; | |
789 virtual int hash() const; // Type specific hashing | |
790 virtual bool singleton(void) const; // TRUE if type is a singleton | |
791 enum { | |
223 | 792 InstanceTop = -1, // undefined instance |
793 InstanceBot = 0 // any possible instance | |
0 | 794 }; |
795 protected: | |
796 | |
797 // Oop is NULL, unless this is a constant oop. | |
798 ciObject* _const_oop; // Constant oop | |
799 // If _klass is NULL, then so is _sig. This is an unloaded klass. | |
800 ciKlass* _klass; // Klass object | |
801 // Does the type exclude subclasses of the klass? (Inexact == polymorphic.) | |
802 bool _klass_is_exact; | |
163 | 803 bool _is_ptr_to_narrowoop; |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
804 bool _is_ptr_to_narrowklass; |
10278 | 805 bool _is_ptr_to_boxed_value; |
0 | 806 |
223 | 807 // If not InstanceTop or InstanceBot, indicates that this is |
808 // a particular instance of this type which is distinct. | |
809 // This is the the node index of the allocation node creating this instance. | |
810 int _instance_id; | |
0 | 811 |
812 static const TypeOopPtr* make_from_klass_common(ciKlass* klass, bool klass_change, bool try_for_exact); | |
813 | |
223 | 814 int dual_instance_id() const; |
815 int meet_instance_id(int uid) const; | |
0 | 816 |
817 public: | |
818 // Creates a type given a klass. Correctly handles multi-dimensional arrays | |
819 // Respects UseUniqueSubclasses. | |
820 // If the klass is final, the resulting type will be exact. | |
821 static const TypeOopPtr* make_from_klass(ciKlass* klass) { | |
822 return make_from_klass_common(klass, true, false); | |
823 } | |
824 // Same as before, but will produce an exact type, even if | |
825 // the klass is not final, as long as it has exactly one implementation. | |
826 static const TypeOopPtr* make_from_klass_unique(ciKlass* klass) { | |
827 return make_from_klass_common(klass, true, true); | |
828 } | |
829 // Same as before, but does not respects UseUniqueSubclasses. | |
830 // Use this only for creating array element types. | |
831 static const TypeOopPtr* make_from_klass_raw(ciKlass* klass) { | |
832 return make_from_klass_common(klass, false, false); | |
833 } | |
834 // 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
|
835 // 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
|
836 // may return a non-singleton type. |
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
958
diff
changeset
|
837 // If require_constant, produce a NULL if a singleton is not possible. |
10278 | 838 static const TypeOopPtr* make_from_constant(ciObject* o, |
839 bool require_constant = false, | |
840 bool not_null_elements = false); | |
0 | 841 |
842 // Make a generic (unclassed) pointer to an oop. | |
992 | 843 static const TypeOopPtr* make(PTR ptr, int offset, int instance_id); |
0 | 844 |
845 ciObject* const_oop() const { return _const_oop; } | |
846 virtual ciKlass* klass() const { return _klass; } | |
847 bool klass_is_exact() const { return _klass_is_exact; } | |
163 | 848 |
849 // Returns true if this pointer points at memory which contains a | |
850 // compressed oop references. | |
851 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
|
852 bool is_ptr_to_narrowklass_nv() const { return _is_ptr_to_narrowklass; } |
10278 | 853 bool is_ptr_to_boxed_value() const { return _is_ptr_to_boxed_value; } |
223 | 854 bool is_known_instance() const { return _instance_id > 0; } |
855 int instance_id() const { return _instance_id; } | |
856 bool is_known_instance_field() const { return is_known_instance() && _offset >= 0; } | |
0 | 857 |
858 virtual intptr_t get_con() const; | |
859 | |
860 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
861 | |
862 virtual const Type *cast_to_exactness(bool klass_is_exact) const; | |
863 | |
223 | 864 virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; |
0 | 865 |
866 // corresponding pointer to klass, for a given instance | |
867 const TypeKlassPtr* as_klass_type() const; | |
868 | |
306
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
869 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 870 |
871 virtual const Type *xmeet( const Type *t ) const; | |
872 virtual const Type *xdual() const; // Compute dual right now. | |
873 | |
874 // Do not allow interface-vs.-noninterface joins to collapse to top. | |
875 virtual const Type *filter( const Type *kills ) const; | |
876 | |
877 // Convenience common pre-built type. | |
878 static const TypeOopPtr *BOTTOM; | |
879 #ifndef PRODUCT | |
880 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
881 #endif | |
882 }; | |
883 | |
884 //------------------------------TypeInstPtr------------------------------------ | |
885 // 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
|
886 // or to a Klass* (including array klasses). |
0 | 887 class TypeInstPtr : public TypeOopPtr { |
888 TypeInstPtr( PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id ); | |
889 virtual bool eq( const Type *t ) const; | |
890 virtual int hash() const; // Type specific hashing | |
891 | |
892 ciSymbol* _name; // class name | |
893 | |
894 public: | |
895 ciSymbol* name() const { return _name; } | |
896 | |
897 bool is_loaded() const { return _klass->is_loaded(); } | |
898 | |
899 // Make a pointer to a constant oop. | |
900 static const TypeInstPtr *make(ciObject* o) { | |
901 return make(TypePtr::Constant, o->klass(), true, o, 0); | |
902 } | |
903 // Make a pointer to a constant oop with offset. | |
904 static const TypeInstPtr *make(ciObject* o, int offset) { | |
905 return make(TypePtr::Constant, o->klass(), true, o, offset); | |
906 } | |
907 | |
908 // Make a pointer to some value of type klass. | |
909 static const TypeInstPtr *make(PTR ptr, ciKlass* klass) { | |
910 return make(ptr, klass, false, NULL, 0); | |
911 } | |
912 | |
913 // Make a pointer to some non-polymorphic value of exactly type klass. | |
914 static const TypeInstPtr *make_exact(PTR ptr, ciKlass* klass) { | |
915 return make(ptr, klass, true, NULL, 0); | |
916 } | |
917 | |
918 // Make a pointer to some value of type klass with offset. | |
919 static const TypeInstPtr *make(PTR ptr, ciKlass* klass, int offset) { | |
920 return make(ptr, klass, false, NULL, offset); | |
921 } | |
922 | |
923 // Make a pointer to an oop. | |
223 | 924 static const TypeInstPtr *make(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id = InstanceBot ); |
0 | 925 |
10278 | 926 /** Create constant type for a constant boxed value */ |
927 const Type* get_const_boxed_value() const; | |
928 | |
0 | 929 // If this is a java.lang.Class constant, return the type for it or NULL. |
930 // Pass to Type::get_const_type to turn it to a type, which will usually | |
931 // be a TypeInstPtr, but may also be a TypeInt::INT for int.class, etc. | |
932 ciType* java_mirror_type() const; | |
933 | |
934 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
935 | |
936 virtual const Type *cast_to_exactness(bool klass_is_exact) const; | |
937 | |
223 | 938 virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; |
0 | 939 |
306
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
940 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 941 |
942 virtual const Type *xmeet( const Type *t ) const; | |
943 virtual const TypeInstPtr *xmeet_unloaded( const TypeInstPtr *t ) const; | |
944 virtual const Type *xdual() const; // Compute dual right now. | |
945 | |
946 // Convenience common pre-built types. | |
947 static const TypeInstPtr *NOTNULL; | |
948 static const TypeInstPtr *BOTTOM; | |
949 static const TypeInstPtr *MIRROR; | |
950 static const TypeInstPtr *MARK; | |
951 static const TypeInstPtr *KLASS; | |
952 #ifndef PRODUCT | |
953 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping | |
954 #endif | |
955 }; | |
956 | |
957 //------------------------------TypeAryPtr------------------------------------- | |
958 // Class of Java array pointers | |
959 class TypeAryPtr : public TypeOopPtr { | |
10278 | 960 TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, |
961 int offset, int instance_id, bool is_autobox_cache ) | |
962 : TypeOopPtr(AryPtr,ptr,k,xk,o,offset, instance_id), | |
963 _ary(ary), | |
964 _is_autobox_cache(is_autobox_cache) | |
965 { | |
1761 | 966 #ifdef ASSERT |
967 if (k != NULL) { | |
968 // Verify that specified klass and TypeAryPtr::klass() follow the same rules. | |
969 ciKlass* ck = compute_klass(true); | |
1792 | 970 if (k != ck) { |
1761 | 971 this->dump(); tty->cr(); |
972 tty->print(" k: "); | |
973 k->print(); tty->cr(); | |
974 tty->print("ck: "); | |
975 if (ck != NULL) ck->print(); | |
976 else tty->print("<NULL>"); | |
977 tty->cr(); | |
978 assert(false, "unexpected TypeAryPtr::_klass"); | |
979 } | |
980 } | |
981 #endif | |
982 } | |
0 | 983 virtual bool eq( const Type *t ) const; |
984 virtual int hash() const; // Type specific hashing | |
985 const TypeAry *_ary; // Array we point into | |
10278 | 986 const bool _is_autobox_cache; |
0 | 987 |
1761 | 988 ciKlass* compute_klass(DEBUG_ONLY(bool verify = false)) const; |
989 | |
0 | 990 public: |
991 // Accessors | |
992 ciKlass* klass() const; | |
993 const TypeAry* ary() const { return _ary; } | |
994 const Type* elem() const { return _ary->_elem; } | |
995 const TypeInt* size() const { return _ary->_size; } | |
12190
edb5ab0f3fe5
8001107: @Stable annotation for constant folding of lazily evaluated variables
vlivanov
parents:
12146
diff
changeset
|
996 bool is_stable() const { return _ary->_stable; } |
0 | 997 |
10278 | 998 bool is_autobox_cache() const { return _is_autobox_cache; } |
999 | |
223 | 1000 static const TypeAryPtr *make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot); |
0 | 1001 // Constant pointer to array |
10278 | 1002 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 | 1003 |
1004 // Return a 'ptr' version of this type | |
1005 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
1006 | |
1007 virtual const Type *cast_to_exactness(bool klass_is_exact) const; | |
1008 | |
223 | 1009 virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; |
0 | 1010 |
1011 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
|
1012 virtual const TypeInt* narrow_size_type(const TypeInt* size) const; |
0 | 1013 |
1014 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
|
1015 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 1016 |
1017 virtual const Type *xmeet( const Type *t ) const; | |
1018 virtual const Type *xdual() const; // Compute dual right now. | |
1019 | |
12190
edb5ab0f3fe5
8001107: @Stable annotation for constant folding of lazily evaluated variables
vlivanov
parents:
12146
diff
changeset
|
1020 const TypeAryPtr* cast_to_stable(bool stable, int stable_dimension = 1) const; |
edb5ab0f3fe5
8001107: @Stable annotation for constant folding of lazily evaluated variables
vlivanov
parents:
12146
diff
changeset
|
1021 int stable_dimension() const; |
edb5ab0f3fe5
8001107: @Stable annotation for constant folding of lazily evaluated variables
vlivanov
parents:
12146
diff
changeset
|
1022 |
0 | 1023 // Convenience common pre-built types. |
1024 static const TypeAryPtr *RANGE; | |
1025 static const TypeAryPtr *OOPS; | |
163 | 1026 static const TypeAryPtr *NARROWOOPS; |
0 | 1027 static const TypeAryPtr *BYTES; |
1028 static const TypeAryPtr *SHORTS; | |
1029 static const TypeAryPtr *CHARS; | |
1030 static const TypeAryPtr *INTS; | |
1031 static const TypeAryPtr *LONGS; | |
1032 static const TypeAryPtr *FLOATS; | |
1033 static const TypeAryPtr *DOUBLES; | |
1034 // selects one of the above: | |
1035 static const TypeAryPtr *get_array_body_type(BasicType elem) { | |
1036 assert((uint)elem <= T_CONFLICT && _array_body_type[elem] != NULL, "bad elem type"); | |
1037 return _array_body_type[elem]; | |
1038 } | |
1039 static const TypeAryPtr *_array_body_type[T_CONFLICT+1]; | |
1040 // 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
|
1041 #ifdef ASSERT |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
1042 // One type is interface, the other is oop |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
1043 virtual bool interface_vs_oop(const Type *t) const; |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
1044 #endif |
0 | 1045 #ifndef PRODUCT |
1046 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping | |
1047 #endif | |
1048 }; | |
1049 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1050 //------------------------------TypeMetadataPtr------------------------------------- |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1051 // 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
|
1052 class TypeMetadataPtr : public TypePtr { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1053 protected: |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1054 TypeMetadataPtr(PTR ptr, ciMetadata* metadata, int offset); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1055 public: |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1056 virtual bool eq( const Type *t ) const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1057 virtual int hash() const; // Type specific hashing |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1058 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
|
1059 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1060 private: |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1061 ciMetadata* _metadata; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1062 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1063 public: |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1064 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
|
1065 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1066 static const TypeMetadataPtr* make(ciMethod* m); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1067 static const TypeMetadataPtr* make(ciMethodData* m); |
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 ciMetadata* metadata() const { return _metadata; } |
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 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
|
1072 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1073 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
|
1074 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1075 virtual const Type *xmeet( const Type *t ) const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1076 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
|
1077 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1078 virtual intptr_t get_con() const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1079 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1080 // 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
|
1081 virtual const Type *filter( const Type *kills ) const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1082 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1083 // Convenience common pre-built types. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1084 static const TypeMetadataPtr *BOTTOM; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1085 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1086 #ifndef PRODUCT |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1087 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
|
1088 #endif |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1089 }; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1090 |
0 | 1091 //------------------------------TypeKlassPtr----------------------------------- |
1092 // Class of Java Klass pointers | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1093 class TypeKlassPtr : public TypePtr { |
0 | 1094 TypeKlassPtr( PTR ptr, ciKlass* klass, int offset ); |
1095 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1096 public: |
0 | 1097 virtual bool eq( const Type *t ) const; |
1098 virtual int hash() const; // Type specific hashing | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1099 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
|
1100 private: |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1101 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1102 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
|
1103 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1104 ciKlass* _klass; |
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 // 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
|
1107 bool _klass_is_exact; |
0 | 1108 |
1109 public: | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1110 ciSymbol* name() const { return klass()->name(); } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1111 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1112 ciKlass* klass() const { return _klass; } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1113 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
|
1114 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1115 bool is_loaded() const { return klass()->is_loaded(); } |
0 | 1116 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1117 // 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
|
1118 // Respects UseUniqueSubclasses. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1119 // 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
|
1120 static const TypeKlassPtr* make_from_klass(ciKlass* klass) { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1121 return make_from_klass_common(klass, true, false); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1122 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1123 // 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
|
1124 // 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
|
1125 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
|
1126 return make_from_klass_common(klass, true, true); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1127 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1128 // Same as before, but does not respects UseUniqueSubclasses. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1129 // Use this only for creating array element types. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1130 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
|
1131 return make_from_klass_common(klass, false, false); |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1132 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1133 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1134 // Make a generic (unclassed) pointer to metadata. |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1135 static const TypeKlassPtr* make(PTR ptr, int offset); |
555 | 1136 |
0 | 1137 // ptr to klass 'k' |
1138 static const TypeKlassPtr *make( ciKlass* k ) { return make( TypePtr::Constant, k, 0); } | |
1139 // ptr to klass 'k' with offset | |
1140 static const TypeKlassPtr *make( ciKlass* k, int offset ) { return make( TypePtr::Constant, k, offset); } | |
1141 // ptr to klass 'k' or sub-klass | |
1142 static const TypeKlassPtr *make( PTR ptr, ciKlass* k, int offset); | |
1143 | |
1144 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
1145 | |
1146 virtual const Type *cast_to_exactness(bool klass_is_exact) const; | |
1147 | |
1148 // corresponding pointer to instance, for a given class | |
1149 const TypeOopPtr* as_instance_type() const; | |
1150 | |
306
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
1151 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 1152 virtual const Type *xmeet( const Type *t ) const; |
1153 virtual const Type *xdual() const; // Compute dual right now. | |
1154 | |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1155 virtual intptr_t get_con() const; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1156 |
0 | 1157 // Convenience common pre-built types. |
1158 static const TypeKlassPtr* OBJECT; // Not-null object klass or below | |
1159 static const TypeKlassPtr* OBJECT_OR_NULL; // Maybe-null version of same | |
1160 #ifndef PRODUCT | |
1161 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping | |
1162 #endif | |
1163 }; | |
1164 | |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1165 class TypeNarrowPtr : public Type { |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1166 protected: |
827
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1167 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
|
1168 |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1169 TypeNarrowPtr(TYPES t, const TypePtr* ptrtype): _ptrtype(ptrtype), |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1170 Type(t) { |
827
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1171 assert(ptrtype->offset() == 0 || |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1172 ptrtype->offset() == OffsetBot || |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1173 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
|
1174 } |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1175 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1176 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
|
1177 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
|
1178 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
|
1179 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
|
1180 public: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1181 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
|
1182 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
|
1183 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
|
1184 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1185 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
|
1186 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
|
1187 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1188 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
|
1189 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1190 // 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
|
1191 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
|
1192 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1193 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
|
1194 |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1195 // returns the equivalent ptr type for this compressed pointer |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1196 const TypePtr *get_ptrtype() const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1197 return _ptrtype; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1198 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1199 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1200 #ifndef PRODUCT |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1201 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1202 #endif |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1203 }; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1204 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1205 //------------------------------TypeNarrowOop---------------------------------- |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1206 // 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
|
1207 // 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
|
1208 // 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
|
1209 // 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
|
1210 // between the normal and the compressed form. |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1211 class TypeNarrowOop : public TypeNarrowPtr { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1212 protected: |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1213 TypeNarrowOop( const TypePtr* ptrtype): TypeNarrowPtr(NarrowOop, ptrtype) { |
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 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1216 virtual const TypeNarrowPtr *isa_same_narrowptr(const Type *t) const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1217 return t->isa_narrowoop(); |
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 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1220 virtual const TypeNarrowPtr *is_same_narrowptr(const Type *t) const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1221 return t->is_narrowoop(); |
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 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1224 virtual const TypeNarrowPtr *make_same_narrowptr(const TypePtr *t) const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1225 return new TypeNarrowOop(t); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1226 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1227 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1228 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
|
1229 return (const TypeNarrowPtr*)((new TypeNarrowOop(t))->hashcons()); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1230 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1231 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1232 public: |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1233 |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1234 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
|
1235 |
2379
b099aaf51bf8
6962931: move interned strings out of the perm gen
jcoomes
parents:
1972
diff
changeset
|
1236 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
|
1237 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
|
1238 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1239 |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1240 static const TypeNarrowOop *BOTTOM; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1241 static const TypeNarrowOop *NULL_PTR; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1242 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1243 #ifndef PRODUCT |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1244 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1245 #endif |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1246 }; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1247 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1248 //------------------------------TypeNarrowKlass---------------------------------- |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1249 // 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
|
1250 // preexisting TypeKlassPtr and forwards most of it's operations to |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1251 // the underlying type. |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1252 class TypeNarrowKlass : public TypeNarrowPtr { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1253 protected: |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1254 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
|
1255 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1256 |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1257 virtual const TypeNarrowPtr *isa_same_narrowptr(const Type *t) const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1258 return t->isa_narrowklass(); |
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 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1261 virtual const TypeNarrowPtr *is_same_narrowptr(const Type *t) const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1262 return t->is_narrowklass(); |
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 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1265 virtual const TypeNarrowPtr *make_same_narrowptr(const TypePtr *t) const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1266 return new TypeNarrowKlass(t); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1267 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1268 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1269 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
|
1270 return (const TypeNarrowPtr*)((new TypeNarrowKlass(t))->hashcons()); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1271 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1272 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1273 public: |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1274 static const TypeNarrowKlass *make( const TypePtr* type); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1275 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1276 // static const TypeNarrowKlass *BOTTOM; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1277 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
|
1278 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1279 #ifndef PRODUCT |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1280 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
|
1281 #endif |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1282 }; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1283 |
0 | 1284 //------------------------------TypeFunc--------------------------------------- |
1285 // Class of Array Types | |
1286 class TypeFunc : public Type { | |
1287 TypeFunc( const TypeTuple *domain, const TypeTuple *range ) : Type(Function), _domain(domain), _range(range) {} | |
1288 virtual bool eq( const Type *t ) const; | |
1289 virtual int hash() const; // Type specific hashing | |
1290 virtual bool singleton(void) const; // TRUE if type is a singleton | |
1291 virtual bool empty(void) const; // TRUE if type is vacuous | |
1292 public: | |
1293 // Constants are shared among ADLC and VM | |
1294 enum { Control = AdlcVMDeps::Control, | |
1295 I_O = AdlcVMDeps::I_O, | |
1296 Memory = AdlcVMDeps::Memory, | |
1297 FramePtr = AdlcVMDeps::FramePtr, | |
1298 ReturnAdr = AdlcVMDeps::ReturnAdr, | |
1299 Parms = AdlcVMDeps::Parms | |
1300 }; | |
1301 | |
1302 const TypeTuple* const _domain; // Domain of inputs | |
1303 const TypeTuple* const _range; // Range of results | |
1304 | |
1305 // Accessors: | |
1306 const TypeTuple* domain() const { return _domain; } | |
1307 const TypeTuple* range() const { return _range; } | |
1308 | |
1309 static const TypeFunc *make(ciMethod* method); | |
1310 static const TypeFunc *make(ciSignature signature, const Type* extra); | |
1311 static const TypeFunc *make(const TypeTuple* domain, const TypeTuple* range); | |
1312 | |
1313 virtual const Type *xmeet( const Type *t ) const; | |
1314 virtual const Type *xdual() const; // Compute dual right now. | |
1315 | |
1316 BasicType return_type() const; | |
1317 | |
1318 #ifndef PRODUCT | |
1319 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping | |
1320 #endif | |
1321 // Convenience common pre-built types. | |
1322 }; | |
1323 | |
1324 //------------------------------accessors-------------------------------------- | |
163 | 1325 inline bool Type::is_ptr_to_narrowoop() const { |
1326 #ifdef _LP64 | |
1327 return (isa_oopptr() != NULL && is_oopptr()->is_ptr_to_narrowoop_nv()); | |
1328 #else | |
1329 return false; | |
1330 #endif | |
1331 } | |
1332 | |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1333 inline bool Type::is_ptr_to_narrowklass() const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1334 #ifdef _LP64 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1335 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
|
1336 #else |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1337 return false; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1338 #endif |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1339 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1340 |
0 | 1341 inline float Type::getf() const { |
1342 assert( _base == FloatCon, "Not a FloatCon" ); | |
1343 return ((TypeF*)this)->_f; | |
1344 } | |
1345 | |
1346 inline double Type::getd() const { | |
1347 assert( _base == DoubleCon, "Not a DoubleCon" ); | |
1348 return ((TypeD*)this)->_d; | |
1349 } | |
1350 | |
1351 inline const TypeInt *Type::is_int() const { | |
1352 assert( _base == Int, "Not an Int" ); | |
1353 return (TypeInt*)this; | |
1354 } | |
1355 | |
1356 inline const TypeInt *Type::isa_int() const { | |
1357 return ( _base == Int ? (TypeInt*)this : NULL); | |
1358 } | |
1359 | |
1360 inline const TypeLong *Type::is_long() const { | |
1361 assert( _base == Long, "Not a Long" ); | |
1362 return (TypeLong*)this; | |
1363 } | |
1364 | |
1365 inline const TypeLong *Type::isa_long() const { | |
1366 return ( _base == Long ? (TypeLong*)this : NULL); | |
1367 } | |
1368 | |
7194
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1369 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
|
1370 return ((_base == FloatTop || |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1371 _base == FloatCon || |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1372 _base == FloatBot) ? (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 TypeF *Type::is_float_constant() const { |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1376 assert( _base == FloatCon, "Not a Float" ); |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1377 return (TypeF*)this; |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1378 } |
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 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
|
1381 return ( _base == FloatCon ? (TypeF*)this : NULL); |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1382 } |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1383 |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1384 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
|
1385 return ((_base == DoubleTop || |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1386 _base == DoubleCon || |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1387 _base == DoubleBot) ? (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 |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1390 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
|
1391 assert( _base == DoubleCon, "Not a Double" ); |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1392 return (TypeD*)this; |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1393 } |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1394 |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1395 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
|
1396 return ( _base == DoubleCon ? (TypeD*)this : NULL); |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1397 } |
beebba0acc11
7172640: C2: instrinsic implementations in LibraryCallKit should use argument() instead of pop()
twisti
parents:
6848
diff
changeset
|
1398 |
0 | 1399 inline const TypeTuple *Type::is_tuple() const { |
1400 assert( _base == Tuple, "Not a Tuple" ); | |
1401 return (TypeTuple*)this; | |
1402 } | |
1403 | |
1404 inline const TypeAry *Type::is_ary() const { | |
1405 assert( _base == Array , "Not an Array" ); | |
1406 return (TypeAry*)this; | |
1407 } | |
1408 | |
6179
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1409 inline const TypeVect *Type::is_vect() const { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1410 assert( _base >= VectorS && _base <= VectorY, "Not a Vector" ); |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1411 return (TypeVect*)this; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1412 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1413 |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1414 inline const TypeVect *Type::isa_vect() const { |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1415 return (_base >= VectorS && _base <= VectorY) ? (TypeVect*)this : NULL; |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1416 } |
8c92982cbbc4
7119644: Increase superword's vector size up to 256 bits
kvn
parents:
3939
diff
changeset
|
1417 |
0 | 1418 inline const TypePtr *Type::is_ptr() const { |
1419 // AnyPtr is the first Ptr and KlassPtr the last, with no non-ptrs between. | |
1420 assert(_base >= AnyPtr && _base <= KlassPtr, "Not a pointer"); | |
1421 return (TypePtr*)this; | |
1422 } | |
1423 | |
1424 inline const TypePtr *Type::isa_ptr() const { | |
1425 // AnyPtr is the first Ptr and KlassPtr the last, with no non-ptrs between. | |
1426 return (_base >= AnyPtr && _base <= KlassPtr) ? (TypePtr*)this : NULL; | |
1427 } | |
1428 | |
1429 inline const TypeOopPtr *Type::is_oopptr() const { | |
1430 // 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
|
1431 assert(_base >= OopPtr && _base <= AryPtr, "Not a Java pointer" ) ; |
0 | 1432 return (TypeOopPtr*)this; |
1433 } | |
1434 | |
1435 inline const TypeOopPtr *Type::isa_oopptr() const { | |
1436 // 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
|
1437 return (_base >= OopPtr && _base <= AryPtr) ? (TypeOopPtr*)this : NULL; |
0 | 1438 } |
1439 | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1440 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
|
1441 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
|
1442 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1443 |
0 | 1444 inline const TypeRawPtr *Type::is_rawptr() const { |
1445 assert( _base == RawPtr, "Not a raw pointer" ); | |
1446 return (TypeRawPtr*)this; | |
1447 } | |
1448 | |
1449 inline const TypeInstPtr *Type::isa_instptr() const { | |
1450 return (_base == InstPtr) ? (TypeInstPtr*)this : NULL; | |
1451 } | |
1452 | |
1453 inline const TypeInstPtr *Type::is_instptr() const { | |
1454 assert( _base == InstPtr, "Not an object pointer" ); | |
1455 return (TypeInstPtr*)this; | |
1456 } | |
1457 | |
1458 inline const TypeAryPtr *Type::isa_aryptr() const { | |
1459 return (_base == AryPtr) ? (TypeAryPtr*)this : NULL; | |
1460 } | |
1461 | |
1462 inline const TypeAryPtr *Type::is_aryptr() const { | |
1463 assert( _base == AryPtr, "Not an array pointer" ); | |
1464 return (TypeAryPtr*)this; | |
1465 } | |
1466 | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1467 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
|
1468 // 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
|
1469 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
|
1470 return (TypeNarrowOop*)this; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1471 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1472 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1473 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
|
1474 // 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
|
1475 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
|
1476 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1477 |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1478 inline const TypeNarrowKlass *Type::is_narrowklass() const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1479 assert(_base == NarrowKlass, "Not a narrow oop" ) ; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1480 return (TypeNarrowKlass*)this; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1481 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1482 |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1483 inline const TypeNarrowKlass *Type::isa_narrowklass() const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1484 return (_base == NarrowKlass) ? (TypeNarrowKlass*)this : NULL; |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1485 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1486 |
6725
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1487 inline const TypeMetadataPtr *Type::is_metadataptr() const { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1488 // MetadataPtr is the first and CPCachePtr the last |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1489 assert(_base == MetadataPtr, "Not a metadata pointer" ) ; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1490 return (TypeMetadataPtr*)this; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1491 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1492 |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1493 inline const TypeMetadataPtr *Type::isa_metadataptr() const { |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1494 return (_base == MetadataPtr) ? (TypeMetadataPtr*)this : NULL; |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1495 } |
da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
coleenp
parents:
6179
diff
changeset
|
1496 |
0 | 1497 inline const TypeKlassPtr *Type::isa_klassptr() const { |
1498 return (_base == KlassPtr) ? (TypeKlassPtr*)this : NULL; | |
1499 } | |
1500 | |
1501 inline const TypeKlassPtr *Type::is_klassptr() const { | |
1502 assert( _base == KlassPtr, "Not a klass pointer" ); | |
1503 return (TypeKlassPtr*)this; | |
1504 } | |
1505 | |
221
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1506 inline const TypePtr* Type::make_ptr() const { |
827
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1507 return (_base == NarrowOop) ? is_narrowoop()->get_ptrtype() : |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1508 ((_base == NarrowKlass) ? is_narrowklass()->get_ptrtype() : |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1509 (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
|
1510 } |
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1511 |
827
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1512 inline const TypeOopPtr* Type::make_oopptr() const { |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1513 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
|
1514 } |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1515 |
221
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1516 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
|
1517 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
|
1518 (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
|
1519 } |
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1520 |
6848
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1521 inline const TypeNarrowKlass* Type::make_narrowklass() const { |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1522 return (_base == NarrowKlass) ? is_narrowklass() : |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1523 (isa_ptr() ? TypeNarrowKlass::make(is_ptr()) : NULL); |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1524 } |
8e47bac5643a
7054512: Compress class pointers after perm gen removal
roland
parents:
6725
diff
changeset
|
1525 |
0 | 1526 inline bool Type::is_floatingpoint() const { |
1527 if( (_base == FloatCon) || (_base == FloatBot) || | |
1528 (_base == DoubleCon) || (_base == DoubleBot) ) | |
1529 return true; | |
1530 return false; | |
1531 } | |
1532 | |
10278 | 1533 inline bool Type::is_ptr_to_boxing_obj() const { |
1534 const TypeInstPtr* tp = isa_instptr(); | |
1535 return (tp != NULL) && (tp->offset() == 0) && | |
1536 tp->klass()->is_instance_klass() && | |
1537 tp->klass()->as_instance_klass()->is_box_klass(); | |
1538 } | |
1539 | |
0 | 1540 |
1541 // =============================================================== | |
1542 // Things that need to be 64-bits in the 64-bit build but | |
1543 // 32-bits in the 32-bit build. Done this way to get full | |
1544 // optimization AND strong typing. | |
1545 #ifdef _LP64 | |
1546 | |
1547 // For type queries and asserts | |
1548 #define is_intptr_t is_long | |
1549 #define isa_intptr_t isa_long | |
1550 #define find_intptr_t_type find_long_type | |
1551 #define find_intptr_t_con find_long_con | |
1552 #define TypeX TypeLong | |
1553 #define Type_X Type::Long | |
1554 #define TypeX_X TypeLong::LONG | |
1555 #define TypeX_ZERO TypeLong::ZERO | |
1556 // For 'ideal_reg' machine registers | |
1557 #define Op_RegX Op_RegL | |
1558 // For phase->intcon variants | |
1559 #define MakeConX longcon | |
1560 #define ConXNode ConLNode | |
1561 // For array index arithmetic | |
1562 #define MulXNode MulLNode | |
1563 #define AndXNode AndLNode | |
1564 #define OrXNode OrLNode | |
1565 #define CmpXNode CmpLNode | |
1566 #define SubXNode SubLNode | |
1567 #define LShiftXNode LShiftLNode | |
1568 // For object size computation: | |
1569 #define AddXNode AddLNode | |
17
ff5961f4c095
6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents:
0
diff
changeset
|
1570 #define RShiftXNode RShiftLNode |
0 | 1571 // For card marks and hashcodes |
1572 #define URShiftXNode URShiftLNode | |
420
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1573 // UseOptoBiasInlining |
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1574 #define XorXNode XorLNode |
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1575 #define StoreXConditionalNode StoreLConditionalNode |
0 | 1576 // Opcodes |
1577 #define Op_LShiftX Op_LShiftL | |
1578 #define Op_AndX Op_AndL | |
1579 #define Op_AddX Op_AddL | |
1580 #define Op_SubX Op_SubL | |
851
fc4be448891f
6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents:
827
diff
changeset
|
1581 #define Op_XorX Op_XorL |
fc4be448891f
6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents:
827
diff
changeset
|
1582 #define Op_URShiftX Op_URShiftL |
0 | 1583 // conversions |
1584 #define ConvI2X(x) ConvI2L(x) | |
1585 #define ConvL2X(x) (x) | |
1586 #define ConvX2I(x) ConvL2I(x) | |
1587 #define ConvX2L(x) (x) | |
1588 | |
1589 #else | |
1590 | |
1591 // For type queries and asserts | |
1592 #define is_intptr_t is_int | |
1593 #define isa_intptr_t isa_int | |
1594 #define find_intptr_t_type find_int_type | |
1595 #define find_intptr_t_con find_int_con | |
1596 #define TypeX TypeInt | |
1597 #define Type_X Type::Int | |
1598 #define TypeX_X TypeInt::INT | |
1599 #define TypeX_ZERO TypeInt::ZERO | |
1600 // For 'ideal_reg' machine registers | |
1601 #define Op_RegX Op_RegI | |
1602 // For phase->intcon variants | |
1603 #define MakeConX intcon | |
1604 #define ConXNode ConINode | |
1605 // For array index arithmetic | |
1606 #define MulXNode MulINode | |
1607 #define AndXNode AndINode | |
1608 #define OrXNode OrINode | |
1609 #define CmpXNode CmpINode | |
1610 #define SubXNode SubINode | |
1611 #define LShiftXNode LShiftINode | |
1612 // For object size computation: | |
1613 #define AddXNode AddINode | |
17
ff5961f4c095
6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents:
0
diff
changeset
|
1614 #define RShiftXNode RShiftINode |
0 | 1615 // For card marks and hashcodes |
1616 #define URShiftXNode URShiftINode | |
420
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1617 // UseOptoBiasInlining |
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1618 #define XorXNode XorINode |
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1619 #define StoreXConditionalNode StoreIConditionalNode |
0 | 1620 // Opcodes |
1621 #define Op_LShiftX Op_LShiftI | |
1622 #define Op_AndX Op_AndI | |
1623 #define Op_AddX Op_AddI | |
1624 #define Op_SubX Op_SubI | |
851
fc4be448891f
6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents:
827
diff
changeset
|
1625 #define Op_XorX Op_XorI |
fc4be448891f
6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents:
827
diff
changeset
|
1626 #define Op_URShiftX Op_URShiftI |
0 | 1627 // conversions |
1628 #define ConvI2X(x) (x) | |
1629 #define ConvL2X(x) ConvL2I(x) | |
1630 #define ConvX2I(x) (x) | |
1631 #define ConvX2L(x) ConvI2L(x) | |
1632 | |
1633 #endif | |
1972 | 1634 |
1635 #endif // SHARE_VM_OPTO_TYPE_HPP |