< prev index next >

src/hotspot/share/classfile/stackMapTable.cpp

Print this page




 152     if (locals[pos].is_category2_2nd()) {
 153       pos -= 2;
 154     } else {
 155       pos --;
 156     }
 157     if (pos<0 && i<(chops-1)) return -1;
 158   }
 159   return pos+1;
 160 }
 161 
 162 VerificationType StackMapReader::parse_verification_type(u1* flags, TRAPS) {
 163   u1 tag = _stream->get_u1(THREAD);
 164   if (tag < (u1)ITEM_UninitializedThis) {
 165     return VerificationType::from_tag(tag);
 166   }
 167   if (tag == ITEM_Object) {
 168     u2 class_index = _stream->get_u2(THREAD);
 169     int nconstants = _cp->length();
 170     if ((class_index <= 0 || class_index >= nconstants) ||
 171         (!_cp->tag_at(class_index).is_klass() &&
 172          !_cp->tag_at(class_index).is_unresolved_klass() &&
 173          !_cp->tag_at(class_index).is_value_type() &&
 174          !_cp->tag_at(class_index).is_unresolved_value_type())) {
 175       _stream->stackmap_format_error("bad class index", THREAD);
 176       return VerificationType::bogus_type();
 177     }
 178     if (_cp->tag_at(class_index).is_value_type() ||
 179         _cp->tag_at(class_index).is_unresolved_value_type()) {
 180       return VerificationType::valuetype_type(_cp->klass_name_at(class_index));
 181     }
 182     return VerificationType::reference_type(_cp->klass_name_at(class_index));
 183   }
 184   if (tag == ITEM_UninitializedThis) {
 185     if (flags != NULL) {
 186       *flags |= FLAG_THIS_UNINIT;
 187     }
 188     return VerificationType::uninitialized_this_type();
 189   }
 190   if (tag == ITEM_Uninitialized) {
 191     u2 offset = _stream->get_u2(THREAD);
 192     if (offset >= _code_length ||
 193         _code_data[offset] != ClassVerifier::NEW_OFFSET) {
 194       _verifier->class_format_error(
 195         "StackMapTable format error: bad offset for Uninitialized");
 196       return VerificationType::bogus_type();
 197     }
 198     return VerificationType::uninitialized_type(offset);
 199   }
 200   _stream->stackmap_format_error("bad verification type", THREAD);




 152     if (locals[pos].is_category2_2nd()) {
 153       pos -= 2;
 154     } else {
 155       pos --;
 156     }
 157     if (pos<0 && i<(chops-1)) return -1;
 158   }
 159   return pos+1;
 160 }
 161 
 162 VerificationType StackMapReader::parse_verification_type(u1* flags, TRAPS) {
 163   u1 tag = _stream->get_u1(THREAD);
 164   if (tag < (u1)ITEM_UninitializedThis) {
 165     return VerificationType::from_tag(tag);
 166   }
 167   if (tag == ITEM_Object) {
 168     u2 class_index = _stream->get_u2(THREAD);
 169     int nconstants = _cp->length();
 170     if ((class_index <= 0 || class_index >= nconstants) ||
 171         (!_cp->tag_at(class_index).is_klass() &&
 172          !_cp->tag_at(class_index).is_unresolved_klass())) {


 173       _stream->stackmap_format_error("bad class index", THREAD);
 174       return VerificationType::bogus_type();




 175     }
 176     return VerificationType::reference_type(_cp->klass_name_at(class_index));
 177   }
 178   if (tag == ITEM_UninitializedThis) {
 179     if (flags != NULL) {
 180       *flags |= FLAG_THIS_UNINIT;
 181     }
 182     return VerificationType::uninitialized_this_type();
 183   }
 184   if (tag == ITEM_Uninitialized) {
 185     u2 offset = _stream->get_u2(THREAD);
 186     if (offset >= _code_length ||
 187         _code_data[offset] != ClassVerifier::NEW_OFFSET) {
 188       _verifier->class_format_error(
 189         "StackMapTable format error: bad offset for Uninitialized");
 190       return VerificationType::bogus_type();
 191     }
 192     return VerificationType::uninitialized_type(offset);
 193   }
 194   _stream->stackmap_format_error("bad verification type", THREAD);


< prev index next >