110
111 if (o == NULL) {
112 return ciConstant(field_btype, ciNullObject::make());
113 } else {
114 return ciConstant(field_btype, CURRENT_ENV->get_object(o));
115 }
116 }
117 }
118 ShouldNotReachHere();
119 // to shut up the compiler
120 return ciConstant();
121 }
122
123 // ------------------------------------------------------------------
124 // ciInstance::field_value_by_offset
125 //
126 // Constant value of a field at the specified offset.
127 ciConstant ciInstance::field_value_by_offset(int field_offset) {
128 ciInstanceKlass* ik = klass()->as_instance_klass();
129 ciField* field = ik->get_field_by_offset(field_offset, false);
130 return field_value(field);
131 }
132
133 // ------------------------------------------------------------------
134 // ciInstance::print_impl
135 //
136 // Implementation of the print method.
137 void ciInstance::print_impl(outputStream* st) {
138 st->print(" type=");
139 klass()->print(st);
140 }
141
142
143 ciKlass* ciInstance::java_lang_Class_klass() {
144 VM_ENTRY_MARK;
145 return CURRENT_ENV->get_metadata(java_lang_Class::as_Klass(get_oop()))->as_klass();
146 }
|
110
111 if (o == NULL) {
112 return ciConstant(field_btype, ciNullObject::make());
113 } else {
114 return ciConstant(field_btype, CURRENT_ENV->get_object(o));
115 }
116 }
117 }
118 ShouldNotReachHere();
119 // to shut up the compiler
120 return ciConstant();
121 }
122
123 // ------------------------------------------------------------------
124 // ciInstance::field_value_by_offset
125 //
126 // Constant value of a field at the specified offset.
127 ciConstant ciInstance::field_value_by_offset(int field_offset) {
128 ciInstanceKlass* ik = klass()->as_instance_klass();
129 ciField* field = ik->get_field_by_offset(field_offset, false);
130 if (field == NULL)
131 return ciConstant(); // T_ILLEGAL
132 return field_value(field);
133 }
134
135 // ------------------------------------------------------------------
136 // ciInstance::print_impl
137 //
138 // Implementation of the print method.
139 void ciInstance::print_impl(outputStream* st) {
140 st->print(" type=");
141 klass()->print(st);
142 }
143
144
145 ciKlass* ciInstance::java_lang_Class_klass() {
146 VM_ENTRY_MARK;
147 return CURRENT_ENV->get_metadata(java_lang_Class::as_Klass(get_oop()))->as_klass();
148 }
|