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