280 case ReferenceQuery: 281 return from.is_reference() || from.is_uninitialized(); 282 case Boolean: 283 case Byte: 284 case Char: 285 case Short: 286 // An int can be assigned to boolean, byte, char or short values. 287 return from.is_integer(); 288 default: 289 if (is_reference() && from.is_reference()) { 290 return is_reference_assignable_from(from, context, 291 from_field_is_protected, 292 THREAD); 293 } else { 294 return false; 295 } 296 } 297 } 298 } 299 300 VerificationType get_component(ClassVerifier* context, TRAPS) const; 301 302 int dimensions() const { 303 assert(is_array(), "Must be an array"); 304 int index = 0; 305 while (name()->byte_at(index) == '[') index++; 306 return index; 307 } 308 309 void print_on(outputStream* st) const; 310 311 private: 312 313 bool is_reference_assignable_from( 314 const VerificationType&, ClassVerifier*, bool from_field_is_protected, 315 TRAPS) const; 316 }; 317 318 #endif // SHARE_VM_CLASSFILE_VERIFICATIONTYPE_HPP | 280 case ReferenceQuery: 281 return from.is_reference() || from.is_uninitialized(); 282 case Boolean: 283 case Byte: 284 case Char: 285 case Short: 286 // An int can be assigned to boolean, byte, char or short values. 287 return from.is_integer(); 288 default: 289 if (is_reference() && from.is_reference()) { 290 return is_reference_assignable_from(from, context, 291 from_field_is_protected, 292 THREAD); 293 } else { 294 return false; 295 } 296 } 297 } 298 } 299 300 // Check to see if one array component type is assignable to another. 301 // Same as is_assignable_from() except int primitives must be identical. 302 bool is_component_assignable_from( 303 const VerificationType& from, ClassVerifier* context, 304 bool from_field_is_protected, TRAPS) const { 305 if (equals(from) || is_bogus()) { 306 return true; 307 } else { 308 switch(_u._data) { 309 case Boolean: 310 case Byte: 311 case Char: 312 case Short: 313 return false; 314 default: 315 return is_assignable_from(from, context, from_field_is_protected, CHECK_false); 316 } 317 } 318 } 319 320 VerificationType get_component(ClassVerifier* context, TRAPS) const; 321 322 int dimensions() const { 323 assert(is_array(), "Must be an array"); 324 int index = 0; 325 while (name()->byte_at(index) == '[') index++; 326 return index; 327 } 328 329 void print_on(outputStream* st) const; 330 331 private: 332 333 bool is_reference_assignable_from( 334 const VerificationType&, ClassVerifier*, bool from_field_is_protected, 335 TRAPS) const; 336 }; 337 338 #endif // SHARE_VM_CLASSFILE_VERIFICATIONTYPE_HPP |