equal
deleted
inserted
replaced
27 |
27 |
28 #include "ci/ciMetadata.hpp" |
28 #include "ci/ciMetadata.hpp" |
29 |
29 |
30 // ciType |
30 // ciType |
31 // |
31 // |
32 // This class represents either a class (T_OBJECT), array (T_ARRAY), |
32 // This class represents a Java reference or primitive type. |
33 // or one of the primitive types such as T_INT. |
33 |
34 class ciType : public ciMetadata { |
34 class ciType : public ciMetadata { |
35 CI_PACKAGE_ACCESS |
35 CI_PACKAGE_ACCESS |
36 friend class ciKlass; |
36 friend class ciKlass; |
37 friend class ciReturnAddress; |
37 friend class ciReturnAddress; |
38 |
38 |
65 // Returns self if it is a reference type. |
65 // Returns self if it is a reference type. |
66 // Returns NULL for void, since null is used in such cases. |
66 // Returns NULL for void, since null is used in such cases. |
67 ciKlass* box_klass(); |
67 ciKlass* box_klass(); |
68 |
68 |
69 // Returns true if this is not a klass or array (i.e., not a reference type). |
69 // Returns true if this is not a klass or array (i.e., not a reference type). |
70 bool is_primitive_type() const { return basic_type() != T_OBJECT && basic_type() != T_ARRAY; } |
70 bool is_primitive_type() const { return !is_reference_type(basic_type()); } |
71 int size() const { return type2size[basic_type()]; } |
71 int size() const { return type2size[basic_type()]; } |
72 bool is_void() const { return basic_type() == T_VOID; } |
72 bool is_void() const { return basic_type() == T_VOID; } |
73 bool is_one_word() const { return size() == 1; } |
73 bool is_one_word() const { return size() == 1; } |
74 bool is_two_word() const { return size() == 2; } |
74 bool is_two_word() const { return size() == 2; } |
75 |
75 |