< prev index next >

src/hotspot/share/classfile/verificationType.cpp

Print this page




  93     // We need check the class hierarchy to check assignability
  94     if (name() == vmSymbols::java_lang_Object()) {
  95       // any object or array is assignable to java.lang.Object
  96       return true;
  97     }
  98 
  99     if (DumpSharedSpaces && SystemDictionaryShared::add_verification_constraint(klass,
 100               name(), from.name(), from_field_is_protected, from.is_array(),
 101               from.is_object())) {
 102       // If add_verification_constraint() returns true, the resolution/check should be
 103       // delayed until runtime.
 104       return true;
 105     }
 106 
 107     return resolve_and_check_assignability(klass, name(), from.name(),
 108           from_field_is_protected, from.is_array(), from.is_object(), THREAD);
 109   } else if (is_array() && from.is_array()) {
 110     VerificationType comp_this = get_component(context, CHECK_false);
 111     VerificationType comp_from = from.get_component(context, CHECK_false);
 112     if (!comp_this.is_bogus() && !comp_from.is_bogus()) {
 113       return comp_this.is_component_assignable_from(comp_from, context,
 114                                           from_field_is_protected, CHECK_false);

 115     }
 116   }
 117   return false;
 118 }
 119 
 120 VerificationType VerificationType::get_component(ClassVerifier *context, TRAPS) const {
 121   assert(is_array() && name()->utf8_length() >= 2, "Must be a valid array");
 122   Symbol* component;
 123   switch (name()->char_at(1)) {
 124     case 'Z': return VerificationType(Boolean);
 125     case 'B': return VerificationType(Byte);
 126     case 'C': return VerificationType(Char);
 127     case 'S': return VerificationType(Short);
 128     case 'I': return VerificationType(Integer);
 129     case 'J': return VerificationType(Long);
 130     case 'F': return VerificationType(Float);
 131     case 'D': return VerificationType(Double);
 132     case '[':
 133       component = context->create_temporary_symbol(
 134         name(), 1, name()->utf8_length(),




  93     // We need check the class hierarchy to check assignability
  94     if (name() == vmSymbols::java_lang_Object()) {
  95       // any object or array is assignable to java.lang.Object
  96       return true;
  97     }
  98 
  99     if (DumpSharedSpaces && SystemDictionaryShared::add_verification_constraint(klass,
 100               name(), from.name(), from_field_is_protected, from.is_array(),
 101               from.is_object())) {
 102       // If add_verification_constraint() returns true, the resolution/check should be
 103       // delayed until runtime.
 104       return true;
 105     }
 106 
 107     return resolve_and_check_assignability(klass, name(), from.name(),
 108           from_field_is_protected, from.is_array(), from.is_object(), THREAD);
 109   } else if (is_array() && from.is_array()) {
 110     VerificationType comp_this = get_component(context, CHECK_false);
 111     VerificationType comp_from = from.get_component(context, CHECK_false);
 112     if (!comp_this.is_bogus() && !comp_from.is_bogus()) {
 113       bool ret = comp_this.is_component_assignable_from(comp_from, context,
 114                                                         from_field_is_protected, CHECK_false);
 115       return ret;
 116     }
 117   }
 118   return false;
 119 }
 120 
 121 VerificationType VerificationType::get_component(ClassVerifier *context, TRAPS) const {
 122   assert(is_array() && name()->utf8_length() >= 2, "Must be a valid array");
 123   Symbol* component;
 124   switch (name()->char_at(1)) {
 125     case 'Z': return VerificationType(Boolean);
 126     case 'B': return VerificationType(Byte);
 127     case 'C': return VerificationType(Char);
 128     case 'S': return VerificationType(Short);
 129     case 'I': return VerificationType(Integer);
 130     case 'J': return VerificationType(Long);
 131     case 'F': return VerificationType(Float);
 132     case 'D': return VerificationType(Double);
 133     case '[':
 134       component = context->create_temporary_symbol(
 135         name(), 1, name()->utf8_length(),


< prev index next >