< prev index next >

src/hotspot/share/classfile/verificationType.hpp

Print this page




 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()->char_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;


 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, THREAD);
 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()->char_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;
< prev index next >