< prev index next >

src/hotspot/share/ci/ciType.cpp

Print this page

 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  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "ci/ciEnv.hpp"
 26 #include "ci/ciType.hpp"
 27 #include "ci/ciUtilities.inline.hpp"
 28 #include "memory/resourceArea.hpp"
 29 #include "memory/universe.hpp"
 30 #include "oops/oop.inline.hpp"
 31 
 32 ciType* ciType::_basic_types[T_CONFLICT+1];
 33 
 34 // ciType
 35 //
 36 // This class represents a Java reference or primitive type.
 37 
 38 // ------------------------------------------------------------------
 39 // ciType::ciType
 40 //
 41 ciType::ciType(BasicType basic_type) : ciMetadata() {
 42   assert(basic_type >= T_BOOLEAN && basic_type <= T_CONFLICT, "range check");
 43   _basic_type = basic_type;
 44 }
 45 
 46 ciType::ciType(Klass* k) : ciMetadata(k) {
 47   _basic_type = k->is_array_klass() ? T_ARRAY : T_OBJECT;
 48 }
 49 
 50 
 51 // ------------------------------------------------------------------
 52 // ciType::is_subtype_of
 53 //
 54 bool ciType::is_subtype_of(ciType* type) {
 55   if (this == type)  return true;
 56   if (is_klass() && type->is_klass())

 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  *
 19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 20  * or visit www.oracle.com if you need additional information or have any
 21  * questions.
 22  *
 23  */
 24 
 25 #include "ci/ciEnv.hpp"
 26 #include "ci/ciType.hpp"
 27 #include "ci/ciUtilities.inline.hpp"
 28 #include "memory/resourceArea.hpp"
 29 #include "memory/universe.hpp"
 30 #include "oops/oop.inline.hpp"
 31 
 32 ciType* ciType::_basic_types[T_CONFLICT+1];
 33 
 34 // ciType
 35 //
 36 // This class represents a Java reference, inline type or primitive type.
 37 
 38 // ------------------------------------------------------------------
 39 // ciType::ciType
 40 //
 41 ciType::ciType(BasicType basic_type) : ciMetadata() {
 42   assert(basic_type >= T_BOOLEAN && basic_type <= T_CONFLICT, "range check");
 43   _basic_type = basic_type;
 44 }
 45 
 46 ciType::ciType(Klass* k) : ciMetadata(k) {
 47   _basic_type = k->is_array_klass() ? T_ARRAY : T_OBJECT;
 48 }
 49 
 50 
 51 // ------------------------------------------------------------------
 52 // ciType::is_subtype_of
 53 //
 54 bool ciType::is_subtype_of(ciType* type) {
 55   if (this == type)  return true;
 56   if (is_klass() && type->is_klass())
< prev index next >