1 /* |
1 /* |
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
128 WidenMax = 3 |
128 WidenMax = 3 |
129 }; |
129 }; |
130 |
130 |
131 private: |
131 private: |
132 typedef struct { |
132 typedef struct { |
133 const TYPES dual_type; |
133 TYPES dual_type; |
134 const BasicType basic_type; |
134 BasicType basic_type; |
135 const char* msg; |
135 const char* msg; |
136 const bool isa_oop; |
136 bool isa_oop; |
137 const int ideal_reg; |
137 uint ideal_reg; |
138 const relocInfo::relocType reloc; |
138 relocInfo::relocType reloc; |
139 } TypeInfo; |
139 } TypeInfo; |
140 |
140 |
141 // Dictionary of types shared among compilations. |
141 // Dictionary of types shared among compilations. |
142 static Dict* _shared_type_dict; |
142 static Dict* _shared_type_dict; |
143 static TypeInfo _type_info[]; |
143 static const TypeInfo _type_info[]; |
144 |
144 |
145 static int uhash( const Type *const t ); |
145 static int uhash( const Type *const t ); |
146 // Structural equality check. Assumes that cmp() has already compared |
146 // Structural equality check. Assumes that cmp() has already compared |
147 // the _base types and thus knows it can cast 't' appropriately. |
147 // the _base types and thus knows it can cast 't' appropriately. |
148 virtual bool eq( const Type *t ) const; |
148 virtual bool eq( const Type *t ) const; |
405 static const Type *RETURN_ADDRESS; |
405 static const Type *RETURN_ADDRESS; |
406 static const Type *TOP; |
406 static const Type *TOP; |
407 |
407 |
408 // Mapping from compiler type to VM BasicType |
408 // Mapping from compiler type to VM BasicType |
409 BasicType basic_type() const { return _type_info[_base].basic_type; } |
409 BasicType basic_type() const { return _type_info[_base].basic_type; } |
410 int ideal_reg() const { return _type_info[_base].ideal_reg; } |
410 uint ideal_reg() const { return _type_info[_base].ideal_reg; } |
411 const char* msg() const { return _type_info[_base].msg; } |
411 const char* msg() const { return _type_info[_base].msg; } |
412 bool isa_oop_ptr() const { return _type_info[_base].isa_oop; } |
412 bool isa_oop_ptr() const { return _type_info[_base].isa_oop; } |
413 relocInfo::relocType reloc() const { return _type_info[_base].reloc; } |
413 relocInfo::relocType reloc() const { return _type_info[_base].reloc; } |
414 |
414 |
415 // Mapping from CI type system to compiler type: |
415 // Mapping from CI type system to compiler type: |