< prev index next >

src/share/vm/classfile/stackMapTable.cpp

Print this page




 169     u2 class_index = _stream->get_u2(THREAD);
 170     int nconstants = _cp->length();
 171     if ((class_index <= 0 || class_index >= nconstants) ||
 172         (!_cp->tag_at(class_index).is_klass() &&
 173          !_cp->tag_at(class_index).is_unresolved_klass())) {
 174       _stream->stackmap_format_error("bad class index", THREAD);
 175       return VerificationType::bogus_type();
 176     }
 177     return VerificationType::reference_type(_cp->klass_name_at(class_index));
 178   }
 179   if (tag == ITEM_UninitializedThis) {
 180     if (flags != NULL) {
 181       *flags |= FLAG_THIS_UNINIT;
 182     }
 183     return VerificationType::uninitialized_this_type();
 184   }
 185   if (tag == ITEM_Uninitialized) {
 186     u2 offset = _stream->get_u2(THREAD);
 187     if (offset >= _code_length ||
 188         _code_data[offset] != ClassVerifier::NEW_OFFSET) {
 189       ResourceMark rm(THREAD);
 190       _verifier->class_format_error(
 191         "StackMapTable format error: bad offset for Uninitialized");
 192       return VerificationType::bogus_type();
 193     }
 194     return VerificationType::uninitialized_type(offset);
 195   }
 196   _stream->stackmap_format_error("bad verification type", THREAD);
 197   return VerificationType::bogus_type();
 198 }
 199 
 200 StackMapFrame* StackMapReader::next(
 201     StackMapFrame* pre_frame, bool first, u2 max_locals, u2 max_stack, TRAPS) {
 202   StackMapFrame* frame;
 203   int offset;
 204   VerificationType* locals = NULL;
 205   u1 frame_type = _stream->get_u1(THREAD);
 206   if (frame_type < 64) {
 207     // same_frame
 208     if (first) {
 209       offset = frame_type;




 169     u2 class_index = _stream->get_u2(THREAD);
 170     int nconstants = _cp->length();
 171     if ((class_index <= 0 || class_index >= nconstants) ||
 172         (!_cp->tag_at(class_index).is_klass() &&
 173          !_cp->tag_at(class_index).is_unresolved_klass())) {
 174       _stream->stackmap_format_error("bad class index", THREAD);
 175       return VerificationType::bogus_type();
 176     }
 177     return VerificationType::reference_type(_cp->klass_name_at(class_index));
 178   }
 179   if (tag == ITEM_UninitializedThis) {
 180     if (flags != NULL) {
 181       *flags |= FLAG_THIS_UNINIT;
 182     }
 183     return VerificationType::uninitialized_this_type();
 184   }
 185   if (tag == ITEM_Uninitialized) {
 186     u2 offset = _stream->get_u2(THREAD);
 187     if (offset >= _code_length ||
 188         _code_data[offset] != ClassVerifier::NEW_OFFSET) {

 189       _verifier->class_format_error(
 190         "StackMapTable format error: bad offset for Uninitialized");
 191       return VerificationType::bogus_type();
 192     }
 193     return VerificationType::uninitialized_type(offset);
 194   }
 195   _stream->stackmap_format_error("bad verification type", THREAD);
 196   return VerificationType::bogus_type();
 197 }
 198 
 199 StackMapFrame* StackMapReader::next(
 200     StackMapFrame* pre_frame, bool first, u2 max_locals, u2 max_stack, TRAPS) {
 201   StackMapFrame* frame;
 202   int offset;
 203   VerificationType* locals = NULL;
 204   u1 frame_type = _stream->get_u1(THREAD);
 205   if (frame_type < 64) {
 206     // same_frame
 207     if (first) {
 208       offset = frame_type;


< prev index next >