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