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())
123 // ciReturnAddress::ciReturnAddress
124 //
125 ciReturnAddress::ciReturnAddress(int bci) : ciType(T_ADDRESS) {
126 assert(0 <= bci, "bci cannot be negative");
127 _bci = bci;
128 }
129
130 // ------------------------------------------------------------------
131 // ciReturnAddress::print_impl
132 //
133 // Implementation of the print method.
134 void ciReturnAddress::print_impl(outputStream* st) {
135 st->print(" bci=%d", _bci);
136 }
137
138 // ------------------------------------------------------------------
139 // ciReturnAddress::make
140 ciReturnAddress* ciReturnAddress::make(int bci) {
141 GUARDED_VM_ENTRY(return CURRENT_ENV->get_return_address(bci);)
142 }
|
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())
123 // ciReturnAddress::ciReturnAddress
124 //
125 ciReturnAddress::ciReturnAddress(int bci) : ciType(T_ADDRESS) {
126 assert(0 <= bci, "bci cannot be negative");
127 _bci = bci;
128 }
129
130 // ------------------------------------------------------------------
131 // ciReturnAddress::print_impl
132 //
133 // Implementation of the print method.
134 void ciReturnAddress::print_impl(outputStream* st) {
135 st->print(" bci=%d", _bci);
136 }
137
138 // ------------------------------------------------------------------
139 // ciReturnAddress::make
140 ciReturnAddress* ciReturnAddress::make(int bci) {
141 GUARDED_VM_ENTRY(return CURRENT_ENV->get_return_address(bci);)
142 }
143
144 ciWrapper::ciWrapper(ciType* type, int properties)
145 : ciType(type->basic_type()),
146 _type(type),
147 _properties(properties) {
148 assert(!type->is_wrapper(), "Thou shall not double wrap!");
149 assert(type->is_inlinetype()
150 // An abstract value type is an instance_klass
151 || (type->is_instance_klass() && !type->as_instance_klass()->flags().is_identity())
152 // An unloaded inline type is an instance_klass (see ciEnv::get_klass_by_name_impl())
153 || (type->is_instance_klass() && !type->is_loaded()),
154 "should only be used for inline types");
155 }
|