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