Mercurial > hg > truffle
annotate src/share/vm/opto/type.hpp @ 1552:c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
Summary: Change all the Sun copyrights to Oracle copyright
Reviewed-by: ohair
author | trims |
---|---|
date | Thu, 27 May 2010 19:08:38 -0700 |
parents | 7c57aead6d3e |
children | 14b92b91f460 |
rev | line source |
---|---|
0 | 1 /* |
1552
c18cbe5936b8
6941466: Oracle rebranding changes for Hotspot repositories
trims
parents:
1080
diff
changeset
|
2 * Copyright (c) 1997, 2009, 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 | |
25 // Portions of code courtesy of Clifford Click | |
26 | |
27 // Optimization - Graph Style | |
28 | |
29 | |
30 // This class defines a Type lattice. The lattice is used in the constant | |
31 // propagation algorithms, and for some type-checking of the iloc code. | |
32 // Basic types include RSD's (lower bound, upper bound, stride for integers), | |
33 // float & double precision constants, sets of data-labels and code-labels. | |
34 // The complete lattice is described below. Subtypes have no relationship to | |
35 // up or down in the lattice; that is entirely determined by the behavior of | |
36 // the MEET/JOIN functions. | |
37 | |
38 class Dict; | |
39 class Type; | |
40 class TypeD; | |
41 class TypeF; | |
42 class TypeInt; | |
43 class TypeLong; | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
44 class TypeNarrowOop; |
0 | 45 class TypeAry; |
46 class TypeTuple; | |
47 class TypePtr; | |
48 class TypeRawPtr; | |
49 class TypeOopPtr; | |
50 class TypeInstPtr; | |
51 class TypeAryPtr; | |
52 class TypeKlassPtr; | |
53 | |
54 //------------------------------Type------------------------------------------- | |
55 // Basic Type object, represents a set of primitive Values. | |
56 // Types are hash-cons'd into a private class dictionary, so only one of each | |
57 // different kind of Type exists. Types are never modified after creation, so | |
58 // all their interesting fields are constant. | |
59 class Type { | |
60 public: | |
61 enum TYPES { | |
62 Bad=0, // Type check | |
63 Control, // Control of code (not in lattice) | |
64 Top, // Top of the lattice | |
65 Int, // Integer range (lo-hi) | |
66 Long, // Long integer range (lo-hi) | |
67 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
|
68 NarrowOop, // Compressed oop pointer |
0 | 69 |
70 Tuple, // Method signature or object layout | |
71 Array, // Array types | |
72 | |
73 AnyPtr, // Any old raw, klass, inst, or array pointer | |
74 RawPtr, // Raw (non-oop) pointers | |
75 OopPtr, // Any and all Java heap entities | |
76 InstPtr, // Instance pointers (non-array objects) | |
77 AryPtr, // Array pointers | |
78 KlassPtr, // Klass pointers | |
79 // (Ptr order matters: See is_ptr, isa_ptr, is_oopptr, isa_oopptr.) | |
80 | |
81 Function, // Function signature | |
82 Abio, // Abstract I/O | |
83 Return_Address, // Subroutine return address | |
84 Memory, // Abstract store | |
85 FloatTop, // No float value | |
86 FloatCon, // Floating point constant | |
87 FloatBot, // Any float value | |
88 DoubleTop, // No double value | |
89 DoubleCon, // Double precision constant | |
90 DoubleBot, // Any double value | |
91 Bottom, // Bottom of lattice | |
92 lastype // Bogus ending type (not in lattice) | |
93 }; | |
94 | |
95 // Signal values for offsets from a base pointer | |
96 enum OFFSET_SIGNALS { | |
97 OffsetTop = -2000000000, // undefined offset | |
98 OffsetBot = -2000000001 // any possible offset | |
99 }; | |
100 | |
101 // Min and max WIDEN values. | |
102 enum WIDEN { | |
103 WidenMin = 0, | |
104 WidenMax = 3 | |
105 }; | |
106 | |
107 private: | |
108 // Dictionary of types shared among compilations. | |
109 static Dict* _shared_type_dict; | |
110 | |
111 static int uhash( const Type *const t ); | |
112 // Structural equality check. Assumes that cmp() has already compared | |
113 // the _base types and thus knows it can cast 't' appropriately. | |
114 virtual bool eq( const Type *t ) const; | |
115 | |
116 // Top-level hash-table of types | |
117 static Dict *type_dict() { | |
118 return Compile::current()->type_dict(); | |
119 } | |
120 | |
121 // DUAL operation: reflect around lattice centerline. Used instead of | |
122 // join to ensure my lattice is symmetric up and down. Dual is computed | |
123 // lazily, on demand, and cached in _dual. | |
124 const Type *_dual; // Cached dual value | |
125 // Table for efficient dualing of base types | |
126 static const TYPES dual_type[lastype]; | |
127 | |
128 protected: | |
129 // Each class of type is also identified by its base. | |
130 const TYPES _base; // Enum of Types type | |
131 | |
132 Type( TYPES t ) : _dual(NULL), _base(t) {} // Simple types | |
133 // ~Type(); // Use fast deallocation | |
134 const Type *hashcons(); // Hash-cons the type | |
135 | |
136 public: | |
137 | |
138 inline void* operator new( size_t x ) { | |
139 Compile* compile = Compile::current(); | |
140 compile->set_type_last_size(x); | |
141 void *temp = compile->type_arena()->Amalloc_D(x); | |
142 compile->set_type_hwm(temp); | |
143 return temp; | |
144 } | |
145 inline void operator delete( void* ptr ) { | |
146 Compile* compile = Compile::current(); | |
147 compile->type_arena()->Afree(ptr,compile->type_last_size()); | |
148 } | |
149 | |
150 // Initialize the type system for a particular compilation. | |
151 static void Initialize(Compile* compile); | |
152 | |
153 // Initialize the types shared by all compilations. | |
154 static void Initialize_shared(Compile* compile); | |
155 | |
156 TYPES base() const { | |
157 assert(_base > Bad && _base < lastype, "sanity"); | |
158 return _base; | |
159 } | |
160 | |
161 // Create a new hash-consd type | |
162 static const Type *make(enum TYPES); | |
163 // Test for equivalence of types | |
164 static int cmp( const Type *const t1, const Type *const t2 ); | |
165 // Test for higher or equal in lattice | |
166 int higher_equal( const Type *t ) const { return !cmp(meet(t),t); } | |
167 | |
168 // MEET operation; lower in lattice. | |
169 const Type *meet( const Type *t ) const; | |
170 // 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
|
171 virtual const Type *widen( const Type *old, const Type* limit ) const { return this; } |
0 | 172 // NARROW: complement for widen, used by pessimistic phases |
173 virtual const Type *narrow( const Type *old ) const { return this; } | |
174 | |
175 // DUAL operation: reflect around lattice centerline. Used instead of | |
176 // join to ensure my lattice is symmetric up and down. | |
177 const Type *dual() const { return _dual; } | |
178 | |
179 // Compute meet dependent on base type | |
180 virtual const Type *xmeet( const Type *t ) const; | |
181 virtual const Type *xdual() const; // Compute dual right now. | |
182 | |
183 // JOIN operation; higher in lattice. Done by finding the dual of the | |
184 // meet of the dual of the 2 inputs. | |
185 const Type *join( const Type *t ) const { | |
186 return dual()->meet(t->dual())->dual(); } | |
187 | |
188 // Modified version of JOIN adapted to the needs Node::Value. | |
189 // Normalizes all empty values to TOP. Does not kill _widen bits. | |
190 // Currently, it also works around limitations involving interface types. | |
191 virtual const Type *filter( const Type *kills ) const; | |
192 | |
820
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
193 #ifdef ASSERT |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
194 // One type is interface, the other is oop |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
195 virtual bool interface_vs_oop(const Type *t) const; |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
196 #endif |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
197 |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
198 // Returns true if this pointer points at memory which contains a |
163 | 199 // compressed oop references. |
200 bool is_ptr_to_narrowoop() const; | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
201 |
0 | 202 // Convenience access |
203 float getf() const; | |
204 double getd() const; | |
205 | |
206 const TypeInt *is_int() const; | |
207 const TypeInt *isa_int() const; // Returns NULL if not an Int | |
208 const TypeLong *is_long() const; | |
209 const TypeLong *isa_long() const; // Returns NULL if not a Long | |
210 const TypeD *is_double_constant() const; // Asserts it is a DoubleCon | |
211 const TypeD *isa_double_constant() const; // Returns NULL if not a DoubleCon | |
212 const TypeF *is_float_constant() const; // Asserts it is a FloatCon | |
213 const TypeF *isa_float_constant() const; // Returns NULL if not a FloatCon | |
214 const TypeTuple *is_tuple() const; // Collection of fields, NOT a pointer | |
215 const TypeAry *is_ary() const; // Array, NOT array pointer | |
216 const TypePtr *is_ptr() const; // Asserts it is a ptr type | |
217 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
|
218 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
|
219 const TypeRawPtr *is_rawptr() const; // Asserts is rawptr |
163 | 220 const TypeNarrowOop *is_narrowoop() const; // Java-style GC'd pointer |
221 const TypeNarrowOop *isa_narrowoop() 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
|
222 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
|
223 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
|
224 const TypeKlassPtr *isa_klassptr() const; // Returns NULL if not KlassPtr |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
225 const TypeKlassPtr *is_klassptr() const; // assert if not KlassPtr |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
226 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
|
227 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
|
228 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
|
229 const TypeAryPtr *is_aryptr() const; // Array oop |
0 | 230 virtual bool is_finite() const; // Has a finite value |
231 virtual bool is_nan() const; // Is not a number (NaN) | |
232 | |
221
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
233 // 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
|
234 const TypePtr* make_ptr() const; |
827
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
235 |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
236 // 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
|
237 // 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
|
238 const TypeOopPtr* make_oopptr() const; |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
239 |
221
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
240 // 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
|
241 // of this pointer type. |
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
242 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
|
243 |
0 | 244 // Special test for register pressure heuristic |
245 bool is_floatingpoint() const; // True if Float or Double base type | |
246 | |
247 // Do you have memory, directly or through a tuple? | |
248 bool has_memory( ) const; | |
249 | |
250 // Are you a pointer type or not? | |
251 bool isa_oop_ptr() const; | |
252 | |
253 // TRUE if type is a singleton | |
254 virtual bool singleton(void) const; | |
255 | |
256 // TRUE if type is above the lattice centerline, and is therefore vacuous | |
257 virtual bool empty(void) const; | |
258 | |
259 // Return a hash for this type. The hash function is public so ConNode | |
260 // (constants) can hash on their constant, which is represented by a Type. | |
261 virtual int hash() const; | |
262 | |
263 // Map ideal registers (machine types) to ideal types | |
264 static const Type *mreg2type[]; | |
265 | |
266 // Printing, statistics | |
267 static const char * const msg[lastype]; // Printable strings | |
268 #ifndef PRODUCT | |
269 void dump_on(outputStream *st) const; | |
270 void dump() const { | |
271 dump_on(tty); | |
272 } | |
273 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
274 static void dump_stats(); | |
275 static void verify_lastype(); // Check that arrays match type enum | |
276 #endif | |
277 void typerr(const Type *t) const; // Mixing types error | |
278 | |
279 // Create basic type | |
280 static const Type* get_const_basic_type(BasicType type) { | |
281 assert((uint)type <= T_CONFLICT && _const_basic_type[type] != NULL, "bad type"); | |
282 return _const_basic_type[type]; | |
283 } | |
284 | |
285 // Mapping to the array element's basic type. | |
286 BasicType array_element_basic_type() const; | |
287 | |
288 // Create standard type for a ciType: | |
289 static const Type* get_const_type(ciType* type); | |
290 | |
291 // Create standard zero value: | |
292 static const Type* get_zero_type(BasicType type) { | |
293 assert((uint)type <= T_CONFLICT && _zero_type[type] != NULL, "bad type"); | |
294 return _zero_type[type]; | |
295 } | |
296 | |
297 // Report if this is a zero value (not top). | |
298 bool is_zero_type() const { | |
299 BasicType type = basic_type(); | |
300 if (type == T_VOID || type >= T_CONFLICT) | |
301 return false; | |
302 else | |
303 return (this == _zero_type[type]); | |
304 } | |
305 | |
306 // Convenience common pre-built types. | |
307 static const Type *ABIO; | |
308 static const Type *BOTTOM; | |
309 static const Type *CONTROL; | |
310 static const Type *DOUBLE; | |
311 static const Type *FLOAT; | |
312 static const Type *HALF; | |
313 static const Type *MEMORY; | |
314 static const Type *MULTI; | |
315 static const Type *RETURN_ADDRESS; | |
316 static const Type *TOP; | |
317 | |
318 // Mapping from compiler type to VM BasicType | |
319 BasicType basic_type() const { return _basic_type[_base]; } | |
320 | |
321 // Mapping from CI type system to compiler type: | |
322 static const Type* get_typeflow_type(ciType* type); | |
323 | |
324 private: | |
325 // support arrays | |
326 static const BasicType _basic_type[]; | |
327 static const Type* _zero_type[T_CONFLICT+1]; | |
328 static const Type* _const_basic_type[T_CONFLICT+1]; | |
329 }; | |
330 | |
331 //------------------------------TypeF------------------------------------------ | |
332 // Class of Float-Constant Types. | |
333 class TypeF : public Type { | |
334 TypeF( float f ) : Type(FloatCon), _f(f) {}; | |
335 public: | |
336 virtual bool eq( const Type *t ) const; | |
337 virtual int hash() const; // Type specific hashing | |
338 virtual bool singleton(void) const; // TRUE if type is a singleton | |
339 virtual bool empty(void) const; // TRUE if type is vacuous | |
340 public: | |
341 const float _f; // Float constant | |
342 | |
343 static const TypeF *make(float f); | |
344 | |
345 virtual bool is_finite() const; // Has a finite value | |
346 virtual bool is_nan() const; // Is not a number (NaN) | |
347 | |
348 virtual const Type *xmeet( const Type *t ) const; | |
349 virtual const Type *xdual() const; // Compute dual right now. | |
350 // Convenience common pre-built types. | |
351 static const TypeF *ZERO; // positive zero only | |
352 static const TypeF *ONE; | |
353 #ifndef PRODUCT | |
354 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
355 #endif | |
356 }; | |
357 | |
358 //------------------------------TypeD------------------------------------------ | |
359 // Class of Double-Constant Types. | |
360 class TypeD : public Type { | |
361 TypeD( double d ) : Type(DoubleCon), _d(d) {}; | |
362 public: | |
363 virtual bool eq( const Type *t ) const; | |
364 virtual int hash() const; // Type specific hashing | |
365 virtual bool singleton(void) const; // TRUE if type is a singleton | |
366 virtual bool empty(void) const; // TRUE if type is vacuous | |
367 public: | |
368 const double _d; // Double constant | |
369 | |
370 static const TypeD *make(double d); | |
371 | |
372 virtual bool is_finite() const; // Has a finite value | |
373 virtual bool is_nan() const; // Is not a number (NaN) | |
374 | |
375 virtual const Type *xmeet( const Type *t ) const; | |
376 virtual const Type *xdual() const; // Compute dual right now. | |
377 // Convenience common pre-built types. | |
378 static const TypeD *ZERO; // positive zero only | |
379 static const TypeD *ONE; | |
380 #ifndef PRODUCT | |
381 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
382 #endif | |
383 }; | |
384 | |
385 //------------------------------TypeInt---------------------------------------- | |
386 // Class of integer ranges, the set of integers between a lower bound and an | |
387 // upper bound, inclusive. | |
388 class TypeInt : public Type { | |
389 TypeInt( jint lo, jint hi, int w ); | |
390 public: | |
391 virtual bool eq( const Type *t ) const; | |
392 virtual int hash() const; // Type specific hashing | |
393 virtual bool singleton(void) const; // TRUE if type is a singleton | |
394 virtual bool empty(void) const; // TRUE if type is vacuous | |
395 public: | |
396 const jint _lo, _hi; // Lower bound, upper bound | |
397 const short _widen; // Limit on times we widen this sucker | |
398 | |
399 static const TypeInt *make(jint lo); | |
400 // must always specify w | |
401 static const TypeInt *make(jint lo, jint hi, int w); | |
402 | |
403 // Check for single integer | |
404 int is_con() const { return _lo==_hi; } | |
405 bool is_con(int i) const { return is_con() && _lo == i; } | |
406 jint get_con() const { assert( is_con(), "" ); return _lo; } | |
407 | |
408 virtual bool is_finite() const; // Has a finite value | |
409 | |
410 virtual const Type *xmeet( const Type *t ) const; | |
411 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
|
412 virtual const Type *widen( const Type *t, const Type* limit_type ) const; |
0 | 413 virtual const Type *narrow( const Type *t ) const; |
414 // Do not kill _widen bits. | |
415 virtual const Type *filter( const Type *kills ) const; | |
416 // Convenience common pre-built types. | |
417 static const TypeInt *MINUS_1; | |
418 static const TypeInt *ZERO; | |
419 static const TypeInt *ONE; | |
420 static const TypeInt *BOOL; | |
421 static const TypeInt *CC; | |
422 static const TypeInt *CC_LT; // [-1] == MINUS_1 | |
423 static const TypeInt *CC_GT; // [1] == ONE | |
424 static const TypeInt *CC_EQ; // [0] == ZERO | |
425 static const TypeInt *CC_LE; // [-1,0] | |
426 static const TypeInt *CC_GE; // [0,1] == BOOL (!) | |
427 static const TypeInt *BYTE; | |
624 | 428 static const TypeInt *UBYTE; |
0 | 429 static const TypeInt *CHAR; |
430 static const TypeInt *SHORT; | |
431 static const TypeInt *POS; | |
432 static const TypeInt *POS1; | |
433 static const TypeInt *INT; | |
434 static const TypeInt *SYMINT; // symmetric range [-max_jint..max_jint] | |
435 #ifndef PRODUCT | |
436 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
437 #endif | |
438 }; | |
439 | |
440 | |
441 //------------------------------TypeLong--------------------------------------- | |
442 // Class of long integer ranges, the set of integers between a lower bound and | |
443 // an upper bound, inclusive. | |
444 class TypeLong : public Type { | |
445 TypeLong( jlong lo, jlong hi, int w ); | |
446 public: | |
447 virtual bool eq( const Type *t ) const; | |
448 virtual int hash() const; // Type specific hashing | |
449 virtual bool singleton(void) const; // TRUE if type is a singleton | |
450 virtual bool empty(void) const; // TRUE if type is vacuous | |
451 public: | |
452 const jlong _lo, _hi; // Lower bound, upper bound | |
453 const short _widen; // Limit on times we widen this sucker | |
454 | |
455 static const TypeLong *make(jlong lo); | |
456 // must always specify w | |
457 static const TypeLong *make(jlong lo, jlong hi, int w); | |
458 | |
459 // Check for single integer | |
460 int is_con() const { return _lo==_hi; } | |
145 | 461 bool is_con(int i) const { return is_con() && _lo == i; } |
0 | 462 jlong get_con() const { assert( is_con(), "" ); return _lo; } |
463 | |
464 virtual bool is_finite() const; // Has a finite value | |
465 | |
466 virtual const Type *xmeet( const Type *t ) const; | |
467 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
|
468 virtual const Type *widen( const Type *t, const Type* limit_type ) const; |
0 | 469 virtual const Type *narrow( const Type *t ) const; |
470 // Do not kill _widen bits. | |
471 virtual const Type *filter( const Type *kills ) const; | |
472 // Convenience common pre-built types. | |
473 static const TypeLong *MINUS_1; | |
474 static const TypeLong *ZERO; | |
475 static const TypeLong *ONE; | |
476 static const TypeLong *POS; | |
477 static const TypeLong *LONG; | |
478 static const TypeLong *INT; // 32-bit subrange [min_jint..max_jint] | |
479 static const TypeLong *UINT; // 32-bit unsigned [0..max_juint] | |
480 #ifndef PRODUCT | |
481 virtual void dump2( Dict &d, uint, outputStream *st ) const;// Specialized per-Type dumping | |
482 #endif | |
483 }; | |
484 | |
485 //------------------------------TypeTuple-------------------------------------- | |
486 // Class of Tuple Types, essentially type collections for function signatures | |
487 // and class layouts. It happens to also be a fast cache for the HotSpot | |
488 // signature types. | |
489 class TypeTuple : public Type { | |
490 TypeTuple( uint cnt, const Type **fields ) : Type(Tuple), _cnt(cnt), _fields(fields) { } | |
491 public: | |
492 virtual bool eq( const Type *t ) const; | |
493 virtual int hash() const; // Type specific hashing | |
494 virtual bool singleton(void) const; // TRUE if type is a singleton | |
495 virtual bool empty(void) const; // TRUE if type is vacuous | |
496 | |
497 public: | |
498 const uint _cnt; // Count of fields | |
499 const Type ** const _fields; // Array of field types | |
500 | |
501 // Accessors: | |
502 uint cnt() const { return _cnt; } | |
503 const Type* field_at(uint i) const { | |
504 assert(i < _cnt, "oob"); | |
505 return _fields[i]; | |
506 } | |
507 void set_field_at(uint i, const Type* t) { | |
508 assert(i < _cnt, "oob"); | |
509 _fields[i] = t; | |
510 } | |
511 | |
512 static const TypeTuple *make( uint cnt, const Type **fields ); | |
513 static const TypeTuple *make_range(ciSignature *sig); | |
514 static const TypeTuple *make_domain(ciInstanceKlass* recv, ciSignature *sig); | |
515 | |
516 // Subroutine call type with space allocated for argument types | |
517 static const Type **fields( uint arg_cnt ); | |
518 | |
519 virtual const Type *xmeet( const Type *t ) const; | |
520 virtual const Type *xdual() const; // Compute dual right now. | |
521 // Convenience common pre-built types. | |
522 static const TypeTuple *IFBOTH; | |
523 static const TypeTuple *IFFALSE; | |
524 static const TypeTuple *IFTRUE; | |
525 static const TypeTuple *IFNEITHER; | |
526 static const TypeTuple *LOOPBODY; | |
527 static const TypeTuple *MEMBAR; | |
528 static const TypeTuple *STORECONDITIONAL; | |
529 static const TypeTuple *START_I2C; | |
530 static const TypeTuple *INT_PAIR; | |
531 static const TypeTuple *LONG_PAIR; | |
532 #ifndef PRODUCT | |
533 virtual void dump2( Dict &d, uint, outputStream *st ) const; // Specialized per-Type dumping | |
534 #endif | |
535 }; | |
536 | |
537 //------------------------------TypeAry---------------------------------------- | |
538 // Class of Array Types | |
539 class TypeAry : public Type { | |
540 TypeAry( const Type *elem, const TypeInt *size) : Type(Array), | |
541 _elem(elem), _size(size) {} | |
542 public: | |
543 virtual bool eq( const Type *t ) const; | |
544 virtual int hash() const; // Type specific hashing | |
545 virtual bool singleton(void) const; // TRUE if type is a singleton | |
546 virtual bool empty(void) const; // TRUE if type is vacuous | |
547 | |
548 private: | |
549 const Type *_elem; // Element type of array | |
550 const TypeInt *_size; // Elements in array | |
551 friend class TypeAryPtr; | |
552 | |
553 public: | |
554 static const TypeAry *make( const Type *elem, const TypeInt *size); | |
555 | |
556 virtual const Type *xmeet( const Type *t ) const; | |
557 virtual const Type *xdual() const; // Compute dual right now. | |
558 bool ary_must_be_exact() const; // true if arrays of such are never generic | |
820
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
559 #ifdef ASSERT |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
560 // One type is interface, the other is oop |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
561 virtual bool interface_vs_oop(const Type *t) const; |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
562 #endif |
0 | 563 #ifndef PRODUCT |
564 virtual void dump2( Dict &d, uint, outputStream *st ) const; // Specialized per-Type dumping | |
565 #endif | |
566 }; | |
567 | |
568 //------------------------------TypePtr---------------------------------------- | |
569 // Class of machine Pointer Types: raw data, instances or arrays. | |
570 // If the _base enum is AnyPtr, then this refers to all of the above. | |
571 // Otherwise the _base will indicate which subset of pointers is affected, | |
572 // and the class will be inherited from. | |
573 class TypePtr : public Type { | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
574 friend class TypeNarrowOop; |
0 | 575 public: |
576 enum PTR { TopPTR, AnyNull, Constant, Null, NotNull, BotPTR, lastPTR }; | |
577 protected: | |
578 TypePtr( TYPES t, PTR ptr, int offset ) : Type(t), _ptr(ptr), _offset(offset) {} | |
579 virtual bool eq( const Type *t ) const; | |
580 virtual int hash() const; // Type specific hashing | |
581 static const PTR ptr_meet[lastPTR][lastPTR]; | |
582 static const PTR ptr_dual[lastPTR]; | |
583 static const char * const ptr_msg[lastPTR]; | |
584 | |
585 public: | |
586 const int _offset; // Offset into oop, with TOP & BOT | |
587 const PTR _ptr; // Pointer equivalence class | |
588 | |
589 const int offset() const { return _offset; } | |
590 const PTR ptr() const { return _ptr; } | |
591 | |
592 static const TypePtr *make( TYPES t, PTR ptr, int offset ); | |
593 | |
594 // Return a 'ptr' version of this type | |
595 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
596 | |
597 virtual intptr_t get_con() const; | |
598 | |
306
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
599 int xadd_offset( intptr_t offset ) const; |
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
600 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 601 |
602 virtual bool singleton(void) const; // TRUE if type is a singleton | |
603 virtual bool empty(void) const; // TRUE if type is vacuous | |
604 virtual const Type *xmeet( const Type *t ) const; | |
605 int meet_offset( int offset ) const; | |
606 int dual_offset( ) const; | |
607 virtual const Type *xdual() const; // Compute dual right now. | |
608 | |
609 // meet, dual and join over pointer equivalence sets | |
610 PTR meet_ptr( const PTR in_ptr ) const { return ptr_meet[in_ptr][ptr()]; } | |
611 PTR dual_ptr() const { return ptr_dual[ptr()]; } | |
612 | |
613 // This is textually confusing unless one recalls that | |
614 // join(t) == dual()->meet(t->dual())->dual(). | |
615 PTR join_ptr( const PTR in_ptr ) const { | |
616 return ptr_dual[ ptr_meet[ ptr_dual[in_ptr] ] [ dual_ptr() ] ]; | |
617 } | |
618 | |
619 // Tests for relation to centerline of type lattice: | |
620 static bool above_centerline(PTR ptr) { return (ptr <= AnyNull); } | |
621 static bool below_centerline(PTR ptr) { return (ptr >= NotNull); } | |
622 // Convenience common pre-built types. | |
623 static const TypePtr *NULL_PTR; | |
624 static const TypePtr *NOTNULL; | |
625 static const TypePtr *BOTTOM; | |
626 #ifndef PRODUCT | |
627 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
628 #endif | |
629 }; | |
630 | |
631 //------------------------------TypeRawPtr------------------------------------- | |
632 // Class of raw pointers, pointers to things other than Oops. Examples | |
633 // include the stack pointer, top of heap, card-marking area, handles, etc. | |
634 class TypeRawPtr : public TypePtr { | |
635 protected: | |
636 TypeRawPtr( PTR ptr, address bits ) : TypePtr(RawPtr,ptr,0), _bits(bits){} | |
637 public: | |
638 virtual bool eq( const Type *t ) const; | |
639 virtual int hash() const; // Type specific hashing | |
640 | |
641 const address _bits; // Constant value, if applicable | |
642 | |
643 static const TypeRawPtr *make( PTR ptr ); | |
644 static const TypeRawPtr *make( address bits ); | |
645 | |
646 // Return a 'ptr' version of this type | |
647 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
648 | |
649 virtual intptr_t get_con() const; | |
650 | |
306
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
651 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 652 |
653 virtual const Type *xmeet( const Type *t ) const; | |
654 virtual const Type *xdual() const; // Compute dual right now. | |
655 // Convenience common pre-built types. | |
656 static const TypeRawPtr *BOTTOM; | |
657 static const TypeRawPtr *NOTNULL; | |
658 #ifndef PRODUCT | |
659 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
660 #endif | |
661 }; | |
662 | |
663 //------------------------------TypeOopPtr------------------------------------- | |
664 // Some kind of oop (Java pointer), either klass or instance or array. | |
665 class TypeOopPtr : public TypePtr { | |
666 protected: | |
163 | 667 TypeOopPtr( TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id ); |
0 | 668 public: |
669 virtual bool eq( const Type *t ) const; | |
670 virtual int hash() const; // Type specific hashing | |
671 virtual bool singleton(void) const; // TRUE if type is a singleton | |
672 enum { | |
223 | 673 InstanceTop = -1, // undefined instance |
674 InstanceBot = 0 // any possible instance | |
0 | 675 }; |
676 protected: | |
677 | |
678 // Oop is NULL, unless this is a constant oop. | |
679 ciObject* _const_oop; // Constant oop | |
680 // If _klass is NULL, then so is _sig. This is an unloaded klass. | |
681 ciKlass* _klass; // Klass object | |
682 // Does the type exclude subclasses of the klass? (Inexact == polymorphic.) | |
683 bool _klass_is_exact; | |
163 | 684 bool _is_ptr_to_narrowoop; |
0 | 685 |
223 | 686 // If not InstanceTop or InstanceBot, indicates that this is |
687 // a particular instance of this type which is distinct. | |
688 // This is the the node index of the allocation node creating this instance. | |
689 int _instance_id; | |
0 | 690 |
691 static const TypeOopPtr* make_from_klass_common(ciKlass* klass, bool klass_change, bool try_for_exact); | |
692 | |
223 | 693 int dual_instance_id() const; |
694 int meet_instance_id(int uid) const; | |
0 | 695 |
696 public: | |
697 // Creates a type given a klass. Correctly handles multi-dimensional arrays | |
698 // Respects UseUniqueSubclasses. | |
699 // If the klass is final, the resulting type will be exact. | |
700 static const TypeOopPtr* make_from_klass(ciKlass* klass) { | |
701 return make_from_klass_common(klass, true, false); | |
702 } | |
703 // Same as before, but will produce an exact type, even if | |
704 // the klass is not final, as long as it has exactly one implementation. | |
705 static const TypeOopPtr* make_from_klass_unique(ciKlass* klass) { | |
706 return make_from_klass_common(klass, true, true); | |
707 } | |
708 // Same as before, but does not respects UseUniqueSubclasses. | |
709 // Use this only for creating array element types. | |
710 static const TypeOopPtr* make_from_klass_raw(ciKlass* klass) { | |
711 return make_from_klass_common(klass, false, false); | |
712 } | |
713 // 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
|
714 // 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
|
715 // may return a non-singleton type. |
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
958
diff
changeset
|
716 // If require_constant, produce a NULL if a singleton is not possible. |
148e5441d916
6863023: need non-perm oops in code cache for JSR 292
jrose
parents:
958
diff
changeset
|
717 static const TypeOopPtr* make_from_constant(ciObject* o, bool require_constant = false); |
0 | 718 |
719 // Make a generic (unclassed) pointer to an oop. | |
992 | 720 static const TypeOopPtr* make(PTR ptr, int offset, int instance_id); |
0 | 721 |
722 ciObject* const_oop() const { return _const_oop; } | |
723 virtual ciKlass* klass() const { return _klass; } | |
724 bool klass_is_exact() const { return _klass_is_exact; } | |
163 | 725 |
726 // Returns true if this pointer points at memory which contains a | |
727 // compressed oop references. | |
728 bool is_ptr_to_narrowoop_nv() const { return _is_ptr_to_narrowoop; } | |
729 | |
223 | 730 bool is_known_instance() const { return _instance_id > 0; } |
731 int instance_id() const { return _instance_id; } | |
732 bool is_known_instance_field() const { return is_known_instance() && _offset >= 0; } | |
0 | 733 |
734 virtual intptr_t get_con() const; | |
735 | |
736 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
737 | |
738 virtual const Type *cast_to_exactness(bool klass_is_exact) const; | |
739 | |
223 | 740 virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; |
0 | 741 |
742 // corresponding pointer to klass, for a given instance | |
743 const TypeKlassPtr* as_klass_type() const; | |
744 | |
306
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
745 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 746 |
747 virtual const Type *xmeet( const Type *t ) const; | |
748 virtual const Type *xdual() const; // Compute dual right now. | |
749 | |
750 // Do not allow interface-vs.-noninterface joins to collapse to top. | |
751 virtual const Type *filter( const Type *kills ) const; | |
752 | |
753 // Convenience common pre-built type. | |
754 static const TypeOopPtr *BOTTOM; | |
755 #ifndef PRODUCT | |
756 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; | |
757 #endif | |
758 }; | |
759 | |
760 //------------------------------TypeInstPtr------------------------------------ | |
761 // Class of Java object pointers, pointing either to non-array Java instances | |
762 // or to a klassOop (including array klasses). | |
763 class TypeInstPtr : public TypeOopPtr { | |
764 TypeInstPtr( PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id ); | |
765 virtual bool eq( const Type *t ) const; | |
766 virtual int hash() const; // Type specific hashing | |
767 | |
768 ciSymbol* _name; // class name | |
769 | |
770 public: | |
771 ciSymbol* name() const { return _name; } | |
772 | |
773 bool is_loaded() const { return _klass->is_loaded(); } | |
774 | |
775 // Make a pointer to a constant oop. | |
776 static const TypeInstPtr *make(ciObject* o) { | |
777 return make(TypePtr::Constant, o->klass(), true, o, 0); | |
778 } | |
779 | |
780 // Make a pointer to a constant oop with offset. | |
781 static const TypeInstPtr *make(ciObject* o, int offset) { | |
782 return make(TypePtr::Constant, o->klass(), true, o, offset); | |
783 } | |
784 | |
785 // Make a pointer to some value of type klass. | |
786 static const TypeInstPtr *make(PTR ptr, ciKlass* klass) { | |
787 return make(ptr, klass, false, NULL, 0); | |
788 } | |
789 | |
790 // Make a pointer to some non-polymorphic value of exactly type klass. | |
791 static const TypeInstPtr *make_exact(PTR ptr, ciKlass* klass) { | |
792 return make(ptr, klass, true, NULL, 0); | |
793 } | |
794 | |
795 // Make a pointer to some value of type klass with offset. | |
796 static const TypeInstPtr *make(PTR ptr, ciKlass* klass, int offset) { | |
797 return make(ptr, klass, false, NULL, offset); | |
798 } | |
799 | |
800 // Make a pointer to an oop. | |
223 | 801 static const TypeInstPtr *make(PTR ptr, ciKlass* k, bool xk, ciObject* o, int offset, int instance_id = InstanceBot ); |
0 | 802 |
803 // If this is a java.lang.Class constant, return the type for it or NULL. | |
804 // Pass to Type::get_const_type to turn it to a type, which will usually | |
805 // be a TypeInstPtr, but may also be a TypeInt::INT for int.class, etc. | |
806 ciType* java_mirror_type() const; | |
807 | |
808 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
809 | |
810 virtual const Type *cast_to_exactness(bool klass_is_exact) const; | |
811 | |
223 | 812 virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; |
0 | 813 |
306
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
814 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 815 |
816 virtual const Type *xmeet( const Type *t ) const; | |
817 virtual const TypeInstPtr *xmeet_unloaded( const TypeInstPtr *t ) const; | |
818 virtual const Type *xdual() const; // Compute dual right now. | |
819 | |
820 // Convenience common pre-built types. | |
821 static const TypeInstPtr *NOTNULL; | |
822 static const TypeInstPtr *BOTTOM; | |
823 static const TypeInstPtr *MIRROR; | |
824 static const TypeInstPtr *MARK; | |
825 static const TypeInstPtr *KLASS; | |
826 #ifndef PRODUCT | |
827 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping | |
828 #endif | |
829 }; | |
830 | |
831 //------------------------------TypeAryPtr------------------------------------- | |
832 // Class of Java array pointers | |
833 class TypeAryPtr : public TypeOopPtr { | |
834 TypeAryPtr( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id ) : TypeOopPtr(AryPtr,ptr,k,xk,o,offset, instance_id), _ary(ary) {}; | |
835 virtual bool eq( const Type *t ) const; | |
836 virtual int hash() const; // Type specific hashing | |
837 const TypeAry *_ary; // Array we point into | |
838 | |
839 public: | |
840 // Accessors | |
841 ciKlass* klass() const; | |
842 const TypeAry* ary() const { return _ary; } | |
843 const Type* elem() const { return _ary->_elem; } | |
844 const TypeInt* size() const { return _ary->_size; } | |
845 | |
223 | 846 static const TypeAryPtr *make( PTR ptr, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot); |
0 | 847 // Constant pointer to array |
223 | 848 static const TypeAryPtr *make( PTR ptr, ciObject* o, const TypeAry *ary, ciKlass* k, bool xk, int offset, int instance_id = InstanceBot); |
0 | 849 |
850 // Return a 'ptr' version of this type | |
851 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
852 | |
853 virtual const Type *cast_to_exactness(bool klass_is_exact) const; | |
854 | |
223 | 855 virtual const TypeOopPtr *cast_to_instance_id(int instance_id) const; |
0 | 856 |
857 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
|
858 virtual const TypeInt* narrow_size_type(const TypeInt* size) const; |
0 | 859 |
860 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
|
861 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 862 |
863 virtual const Type *xmeet( const Type *t ) const; | |
864 virtual const Type *xdual() const; // Compute dual right now. | |
865 | |
866 // Convenience common pre-built types. | |
867 static const TypeAryPtr *RANGE; | |
868 static const TypeAryPtr *OOPS; | |
163 | 869 static const TypeAryPtr *NARROWOOPS; |
0 | 870 static const TypeAryPtr *BYTES; |
871 static const TypeAryPtr *SHORTS; | |
872 static const TypeAryPtr *CHARS; | |
873 static const TypeAryPtr *INTS; | |
874 static const TypeAryPtr *LONGS; | |
875 static const TypeAryPtr *FLOATS; | |
876 static const TypeAryPtr *DOUBLES; | |
877 // selects one of the above: | |
878 static const TypeAryPtr *get_array_body_type(BasicType elem) { | |
879 assert((uint)elem <= T_CONFLICT && _array_body_type[elem] != NULL, "bad elem type"); | |
880 return _array_body_type[elem]; | |
881 } | |
882 static const TypeAryPtr *_array_body_type[T_CONFLICT+1]; | |
883 // 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
|
884 #ifdef ASSERT |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
885 // One type is interface, the other is oop |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
886 virtual bool interface_vs_oop(const Type *t) const; |
915cc9c5ebc6
6837094: False positive for "meet not symmetric" failure
kvn
parents:
628
diff
changeset
|
887 #endif |
0 | 888 #ifndef PRODUCT |
889 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping | |
890 #endif | |
891 }; | |
892 | |
893 //------------------------------TypeKlassPtr----------------------------------- | |
894 // Class of Java Klass pointers | |
895 class TypeKlassPtr : public TypeOopPtr { | |
896 TypeKlassPtr( PTR ptr, ciKlass* klass, int offset ); | |
897 | |
898 virtual bool eq( const Type *t ) const; | |
899 virtual int hash() const; // Type specific hashing | |
900 | |
901 public: | |
902 ciSymbol* name() const { return _klass->name(); } | |
903 | |
555 | 904 bool is_loaded() const { return _klass->is_loaded(); } |
905 | |
0 | 906 // ptr to klass 'k' |
907 static const TypeKlassPtr *make( ciKlass* k ) { return make( TypePtr::Constant, k, 0); } | |
908 // ptr to klass 'k' with offset | |
909 static const TypeKlassPtr *make( ciKlass* k, int offset ) { return make( TypePtr::Constant, k, offset); } | |
910 // ptr to klass 'k' or sub-klass | |
911 static const TypeKlassPtr *make( PTR ptr, ciKlass* k, int offset); | |
912 | |
913 virtual const Type *cast_to_ptr_type(PTR ptr) const; | |
914 | |
915 virtual const Type *cast_to_exactness(bool klass_is_exact) const; | |
916 | |
917 // corresponding pointer to instance, for a given class | |
918 const TypeOopPtr* as_instance_type() const; | |
919 | |
306
af945ba2e739
6741738: TypePtr::add_offset() set incorrect offset when the add overflows
kvn
parents:
235
diff
changeset
|
920 virtual const TypePtr *add_offset( intptr_t offset ) const; |
0 | 921 virtual const Type *xmeet( const Type *t ) const; |
922 virtual const Type *xdual() const; // Compute dual right now. | |
923 | |
924 // Convenience common pre-built types. | |
925 static const TypeKlassPtr* OBJECT; // Not-null object klass or below | |
926 static const TypeKlassPtr* OBJECT_OR_NULL; // Maybe-null version of same | |
927 #ifndef PRODUCT | |
928 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping | |
929 #endif | |
930 }; | |
931 | |
163 | 932 //------------------------------TypeNarrowOop---------------------------------- |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
933 // A compressed reference to some kind of Oop. This type wraps around |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
934 // a preexisting TypeOopPtr and forwards most of it's operations to |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
935 // the underlying type. It's only real purpose is to track the |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
936 // oopness of the compressed oop value when we expose the conversion |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
937 // between the normal and the compressed form. |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
938 class TypeNarrowOop : public Type { |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
939 protected: |
827
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
940 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
|
941 |
827
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
942 TypeNarrowOop( const TypePtr* ptrtype): Type(NarrowOop), |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
943 _ptrtype(ptrtype) { |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
944 assert(ptrtype->offset() == 0 || |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
945 ptrtype->offset() == OffsetBot || |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
946 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
|
947 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
948 public: |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
949 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
|
950 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
|
951 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
|
952 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
953 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
|
954 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
|
955 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
956 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
|
957 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
958 // Do not allow interface-vs.-noninterface joins to collapse to top. |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
959 virtual const Type *filter( const Type *kills ) const; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
960 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
961 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
|
962 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
963 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
|
964 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
965 static const TypeNarrowOop* make_from_constant(ciObject* con) { |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
966 return make(TypeOopPtr::make_from_constant(con)); |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
967 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
968 |
221
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
969 // returns the equivalent ptr type for this compressed pointer |
827
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
970 const TypePtr *get_ptrtype() const { |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
971 return _ptrtype; |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
972 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
973 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
974 static const TypeNarrowOop *BOTTOM; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
975 static const TypeNarrowOop *NULL_PTR; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
976 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
977 #ifndef PRODUCT |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
978 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
|
979 #endif |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
980 }; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
981 |
0 | 982 //------------------------------TypeFunc--------------------------------------- |
983 // Class of Array Types | |
984 class TypeFunc : public Type { | |
985 TypeFunc( const TypeTuple *domain, const TypeTuple *range ) : Type(Function), _domain(domain), _range(range) {} | |
986 virtual bool eq( const Type *t ) const; | |
987 virtual int hash() const; // Type specific hashing | |
988 virtual bool singleton(void) const; // TRUE if type is a singleton | |
989 virtual bool empty(void) const; // TRUE if type is vacuous | |
990 public: | |
991 // Constants are shared among ADLC and VM | |
992 enum { Control = AdlcVMDeps::Control, | |
993 I_O = AdlcVMDeps::I_O, | |
994 Memory = AdlcVMDeps::Memory, | |
995 FramePtr = AdlcVMDeps::FramePtr, | |
996 ReturnAdr = AdlcVMDeps::ReturnAdr, | |
997 Parms = AdlcVMDeps::Parms | |
998 }; | |
999 | |
1000 const TypeTuple* const _domain; // Domain of inputs | |
1001 const TypeTuple* const _range; // Range of results | |
1002 | |
1003 // Accessors: | |
1004 const TypeTuple* domain() const { return _domain; } | |
1005 const TypeTuple* range() const { return _range; } | |
1006 | |
1007 static const TypeFunc *make(ciMethod* method); | |
1008 static const TypeFunc *make(ciSignature signature, const Type* extra); | |
1009 static const TypeFunc *make(const TypeTuple* domain, const TypeTuple* range); | |
1010 | |
1011 virtual const Type *xmeet( const Type *t ) const; | |
1012 virtual const Type *xdual() const; // Compute dual right now. | |
1013 | |
1014 BasicType return_type() const; | |
1015 | |
1016 #ifndef PRODUCT | |
1017 virtual void dump2( Dict &d, uint depth, outputStream *st ) const; // Specialized per-Type dumping | |
1018 void print_flattened() const; // Print a 'flattened' signature | |
1019 #endif | |
1020 // Convenience common pre-built types. | |
1021 }; | |
1022 | |
1023 //------------------------------accessors-------------------------------------- | |
163 | 1024 inline bool Type::is_ptr_to_narrowoop() const { |
1025 #ifdef _LP64 | |
1026 return (isa_oopptr() != NULL && is_oopptr()->is_ptr_to_narrowoop_nv()); | |
1027 #else | |
1028 return false; | |
1029 #endif | |
1030 } | |
1031 | |
0 | 1032 inline float Type::getf() const { |
1033 assert( _base == FloatCon, "Not a FloatCon" ); | |
1034 return ((TypeF*)this)->_f; | |
1035 } | |
1036 | |
1037 inline double Type::getd() const { | |
1038 assert( _base == DoubleCon, "Not a DoubleCon" ); | |
1039 return ((TypeD*)this)->_d; | |
1040 } | |
1041 | |
1042 inline const TypeF *Type::is_float_constant() const { | |
1043 assert( _base == FloatCon, "Not a Float" ); | |
1044 return (TypeF*)this; | |
1045 } | |
1046 | |
1047 inline const TypeF *Type::isa_float_constant() const { | |
1048 return ( _base == FloatCon ? (TypeF*)this : NULL); | |
1049 } | |
1050 | |
1051 inline const TypeD *Type::is_double_constant() const { | |
1052 assert( _base == DoubleCon, "Not a Double" ); | |
1053 return (TypeD*)this; | |
1054 } | |
1055 | |
1056 inline const TypeD *Type::isa_double_constant() const { | |
1057 return ( _base == DoubleCon ? (TypeD*)this : NULL); | |
1058 } | |
1059 | |
1060 inline const TypeInt *Type::is_int() const { | |
1061 assert( _base == Int, "Not an Int" ); | |
1062 return (TypeInt*)this; | |
1063 } | |
1064 | |
1065 inline const TypeInt *Type::isa_int() const { | |
1066 return ( _base == Int ? (TypeInt*)this : NULL); | |
1067 } | |
1068 | |
1069 inline const TypeLong *Type::is_long() const { | |
1070 assert( _base == Long, "Not a Long" ); | |
1071 return (TypeLong*)this; | |
1072 } | |
1073 | |
1074 inline const TypeLong *Type::isa_long() const { | |
1075 return ( _base == Long ? (TypeLong*)this : NULL); | |
1076 } | |
1077 | |
1078 inline const TypeTuple *Type::is_tuple() const { | |
1079 assert( _base == Tuple, "Not a Tuple" ); | |
1080 return (TypeTuple*)this; | |
1081 } | |
1082 | |
1083 inline const TypeAry *Type::is_ary() const { | |
1084 assert( _base == Array , "Not an Array" ); | |
1085 return (TypeAry*)this; | |
1086 } | |
1087 | |
1088 inline const TypePtr *Type::is_ptr() const { | |
1089 // AnyPtr is the first Ptr and KlassPtr the last, with no non-ptrs between. | |
1090 assert(_base >= AnyPtr && _base <= KlassPtr, "Not a pointer"); | |
1091 return (TypePtr*)this; | |
1092 } | |
1093 | |
1094 inline const TypePtr *Type::isa_ptr() const { | |
1095 // AnyPtr is the first Ptr and KlassPtr the last, with no non-ptrs between. | |
1096 return (_base >= AnyPtr && _base <= KlassPtr) ? (TypePtr*)this : NULL; | |
1097 } | |
1098 | |
1099 inline const TypeOopPtr *Type::is_oopptr() const { | |
1100 // OopPtr is the first and KlassPtr the last, with no non-oops between. | |
1101 assert(_base >= OopPtr && _base <= KlassPtr, "Not a Java pointer" ) ; | |
1102 return (TypeOopPtr*)this; | |
1103 } | |
1104 | |
1105 inline const TypeOopPtr *Type::isa_oopptr() const { | |
1106 // OopPtr is the first and KlassPtr the last, with no non-oops between. | |
1107 return (_base >= OopPtr && _base <= KlassPtr) ? (TypeOopPtr*)this : NULL; | |
1108 } | |
1109 | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1110 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
|
1111 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
|
1112 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1113 |
0 | 1114 inline const TypeRawPtr *Type::is_rawptr() const { |
1115 assert( _base == RawPtr, "Not a raw pointer" ); | |
1116 return (TypeRawPtr*)this; | |
1117 } | |
1118 | |
1119 inline const TypeInstPtr *Type::isa_instptr() const { | |
1120 return (_base == InstPtr) ? (TypeInstPtr*)this : NULL; | |
1121 } | |
1122 | |
1123 inline const TypeInstPtr *Type::is_instptr() const { | |
1124 assert( _base == InstPtr, "Not an object pointer" ); | |
1125 return (TypeInstPtr*)this; | |
1126 } | |
1127 | |
1128 inline const TypeAryPtr *Type::isa_aryptr() const { | |
1129 return (_base == AryPtr) ? (TypeAryPtr*)this : NULL; | |
1130 } | |
1131 | |
1132 inline const TypeAryPtr *Type::is_aryptr() const { | |
1133 assert( _base == AryPtr, "Not an array pointer" ); | |
1134 return (TypeAryPtr*)this; | |
1135 } | |
1136 | |
113
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1137 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
|
1138 // 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
|
1139 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
|
1140 return (TypeNarrowOop*)this; |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1141 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1142 |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1143 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
|
1144 // 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
|
1145 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
|
1146 } |
ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
coleenp
parents:
64
diff
changeset
|
1147 |
0 | 1148 inline const TypeKlassPtr *Type::isa_klassptr() const { |
1149 return (_base == KlassPtr) ? (TypeKlassPtr*)this : NULL; | |
1150 } | |
1151 | |
1152 inline const TypeKlassPtr *Type::is_klassptr() const { | |
1153 assert( _base == KlassPtr, "Not a klass pointer" ); | |
1154 return (TypeKlassPtr*)this; | |
1155 } | |
1156 | |
221
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1157 inline const TypePtr* Type::make_ptr() const { |
827
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1158 return (_base == NarrowOop) ? is_narrowoop()->get_ptrtype() : |
221
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1159 (isa_ptr() ? is_ptr() : NULL); |
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1160 } |
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1161 |
827
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1162 inline const TypeOopPtr* Type::make_oopptr() const { |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1163 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
|
1164 } |
bf3489cc0aa0
6856025: assert(_base >= OopPtr && _base <= KlassPtr,"Not a Java pointer")
never
parents:
820
diff
changeset
|
1165 |
221
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1166 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
|
1167 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
|
1168 (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
|
1169 } |
1e026f8da827
6710487: More than half of JDI Regression tests hang with COOPs in -Xcomp mode
kvn
parents:
163
diff
changeset
|
1170 |
0 | 1171 inline bool Type::is_floatingpoint() const { |
1172 if( (_base == FloatCon) || (_base == FloatBot) || | |
1173 (_base == DoubleCon) || (_base == DoubleBot) ) | |
1174 return true; | |
1175 return false; | |
1176 } | |
1177 | |
1178 | |
1179 // =============================================================== | |
1180 // Things that need to be 64-bits in the 64-bit build but | |
1181 // 32-bits in the 32-bit build. Done this way to get full | |
1182 // optimization AND strong typing. | |
1183 #ifdef _LP64 | |
1184 | |
1185 // For type queries and asserts | |
1186 #define is_intptr_t is_long | |
1187 #define isa_intptr_t isa_long | |
1188 #define find_intptr_t_type find_long_type | |
1189 #define find_intptr_t_con find_long_con | |
1190 #define TypeX TypeLong | |
1191 #define Type_X Type::Long | |
1192 #define TypeX_X TypeLong::LONG | |
1193 #define TypeX_ZERO TypeLong::ZERO | |
1194 // For 'ideal_reg' machine registers | |
1195 #define Op_RegX Op_RegL | |
1196 // For phase->intcon variants | |
1197 #define MakeConX longcon | |
1198 #define ConXNode ConLNode | |
1199 // For array index arithmetic | |
1200 #define MulXNode MulLNode | |
1201 #define AndXNode AndLNode | |
1202 #define OrXNode OrLNode | |
1203 #define CmpXNode CmpLNode | |
1204 #define SubXNode SubLNode | |
1205 #define LShiftXNode LShiftLNode | |
1206 // For object size computation: | |
1207 #define AddXNode AddLNode | |
17
ff5961f4c095
6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents:
0
diff
changeset
|
1208 #define RShiftXNode RShiftLNode |
0 | 1209 // For card marks and hashcodes |
1210 #define URShiftXNode URShiftLNode | |
420
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1211 // UseOptoBiasInlining |
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1212 #define XorXNode XorLNode |
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1213 #define StoreXConditionalNode StoreLConditionalNode |
0 | 1214 // Opcodes |
1215 #define Op_LShiftX Op_LShiftL | |
1216 #define Op_AndX Op_AndL | |
1217 #define Op_AddX Op_AddL | |
1218 #define Op_SubX Op_SubL | |
851
fc4be448891f
6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents:
827
diff
changeset
|
1219 #define Op_XorX Op_XorL |
fc4be448891f
6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents:
827
diff
changeset
|
1220 #define Op_URShiftX Op_URShiftL |
0 | 1221 // conversions |
1222 #define ConvI2X(x) ConvI2L(x) | |
1223 #define ConvL2X(x) (x) | |
1224 #define ConvX2I(x) ConvL2I(x) | |
1225 #define ConvX2L(x) (x) | |
1226 | |
1227 #else | |
1228 | |
1229 // For type queries and asserts | |
1230 #define is_intptr_t is_int | |
1231 #define isa_intptr_t isa_int | |
1232 #define find_intptr_t_type find_int_type | |
1233 #define find_intptr_t_con find_int_con | |
1234 #define TypeX TypeInt | |
1235 #define Type_X Type::Int | |
1236 #define TypeX_X TypeInt::INT | |
1237 #define TypeX_ZERO TypeInt::ZERO | |
1238 // For 'ideal_reg' machine registers | |
1239 #define Op_RegX Op_RegI | |
1240 // For phase->intcon variants | |
1241 #define MakeConX intcon | |
1242 #define ConXNode ConINode | |
1243 // For array index arithmetic | |
1244 #define MulXNode MulINode | |
1245 #define AndXNode AndINode | |
1246 #define OrXNode OrINode | |
1247 #define CmpXNode CmpINode | |
1248 #define SubXNode SubINode | |
1249 #define LShiftXNode LShiftINode | |
1250 // For object size computation: | |
1251 #define AddXNode AddINode | |
17
ff5961f4c095
6395208: Elide autoboxing for calls to HashMap.get(int) and HashMap.get(long)
never
parents:
0
diff
changeset
|
1252 #define RShiftXNode RShiftINode |
0 | 1253 // For card marks and hashcodes |
1254 #define URShiftXNode URShiftINode | |
420
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1255 // UseOptoBiasInlining |
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1256 #define XorXNode XorINode |
a1980da045cc
6462850: generate biased locking code in C2 ideal graph
kvn
parents:
366
diff
changeset
|
1257 #define StoreXConditionalNode StoreIConditionalNode |
0 | 1258 // Opcodes |
1259 #define Op_LShiftX Op_LShiftI | |
1260 #define Op_AndX Op_AndI | |
1261 #define Op_AddX Op_AddI | |
1262 #define Op_SubX Op_SubI | |
851
fc4be448891f
6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents:
827
diff
changeset
|
1263 #define Op_XorX Op_XorI |
fc4be448891f
6851742: (EA) allocation elimination doesn't work with UseG1GC
kvn
parents:
827
diff
changeset
|
1264 #define Op_URShiftX Op_URShiftI |
0 | 1265 // conversions |
1266 #define ConvI2X(x) (x) | |
1267 #define ConvL2X(x) ConvL2I(x) | |
1268 #define ConvX2I(x) (x) | |
1269 #define ConvX2L(x) ConvI2L(x) | |
1270 | |
1271 #endif |