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