< prev index next >

src/hotspot/share/classfile/verificationType.hpp

Print this page




 346   int dimensions() const {
 347     assert(is_array(), "Must be an array");
 348     int index = 0;
 349     while (name()->byte_at(index) == '[') index++;
 350     return index;
 351   }
 352 
 353   void print_on(outputStream* st) const;
 354 
 355  private:
 356 
 357   bool is_reference_assignable_from(
 358     const VerificationType&, ClassVerifier*, bool from_field_is_protected,
 359     TRAPS) const;
 360 
 361   bool is_valuetype_assignable_from(const VerificationType& from, ClassVerifier* context, TRAPS) const {
 362     // 1. Check names - two value types are assignable if they have the same name
 363     // 2. Check java/lang/__Value - from may be trying to be assigned to a __Value parameter
 364     assert(is_valuetype() && from.is_valuetype(), "Is value type assignable called with a non-value type");
 365     return (name() == from.name() ||
 366             name() == vmSymbols::java_lang____Value());
 367   }
 368 
 369  public:
 370   static bool resolve_and_check_assignability(InstanceKlass* klass, Symbol* name,
 371                                               Symbol* from_name, bool from_field_is_protected,
 372                                               bool from_is_array, bool from_is_object,
 373                                               TRAPS);
 374 };
 375 
 376 #endif // SHARE_VM_CLASSFILE_VERIFICATIONTYPE_HPP


 346   int dimensions() const {
 347     assert(is_array(), "Must be an array");
 348     int index = 0;
 349     while (name()->byte_at(index) == '[') index++;
 350     return index;
 351   }
 352 
 353   void print_on(outputStream* st) const;
 354 
 355  private:
 356 
 357   bool is_reference_assignable_from(
 358     const VerificationType&, ClassVerifier*, bool from_field_is_protected,
 359     TRAPS) const;
 360 
 361   bool is_valuetype_assignable_from(const VerificationType& from, ClassVerifier* context, TRAPS) const {
 362     // 1. Check names - two value types are assignable if they have the same name
 363     // 2. Check java/lang/__Value - from may be trying to be assigned to a __Value parameter
 364     assert(is_valuetype() && from.is_valuetype(), "Is value type assignable called with a non-value type");
 365     return (name() == from.name() ||
 366             name() == vmSymbols::java_lang_Object());
 367   }
 368 
 369  public:
 370   static bool resolve_and_check_assignability(InstanceKlass* klass, Symbol* name,
 371                                               Symbol* from_name, bool from_field_is_protected,
 372                                               bool from_is_array, bool from_is_object,
 373                                               TRAPS);
 374 };
 375 
 376 #endif // SHARE_VM_CLASSFILE_VERIFICATIONTYPE_HPP
< prev index next >