< prev index next >

src/hotspot/share/classfile/stackMapFrame.cpp

Print this page

 64     }
 65   }
 66   for (i = 0; i < _stack_size; i++) {
 67     if (_stack[i].equals(old_object)) {
 68       _stack[i] = new_object;
 69     }
 70   }
 71   if (old_object == VerificationType::uninitialized_this_type()) {
 72     // "this" has been initialized - reset flags
 73     _flags = 0;
 74   }
 75 }
 76 
 77 VerificationType StackMapFrame::set_locals_from_arg(
 78     const methodHandle& m, VerificationType thisKlass) {
 79   SignatureStream ss(m->signature());
 80   int init_local_num = 0;
 81   if (!m->is_static()) {
 82     init_local_num++;
 83     // add one extra argument for instance method
 84     if (m->name() == vmSymbols::object_initializer_name() &&
 85        thisKlass.name() != vmSymbols::java_lang_Object()) {
 86       _locals[0] = VerificationType::uninitialized_this_type();
 87       _flags |= FLAG_THIS_UNINIT;
 88     } else {
 89       _locals[0] = thisKlass;
 90     }
 91   }
 92 
 93   // local num may be greater than size of parameters because long/double occupies two slots
 94   while(!ss.at_return_type()) {
 95     init_local_num += _verifier->change_sig_to_verificationType(
 96       &ss, &_locals[init_local_num]);
 97     ss.next();
 98   }
 99   _locals_size = init_local_num;
100 
101   switch (ss.type()) {
102     case T_OBJECT:
103     case T_ARRAY:

104     {
105       Symbol* sig = ss.as_symbol();
106       if (!sig->is_permanent()) {
107         // Create another symbol to save as signature stream unreferences
108         // this symbol.
109         Symbol *sig_copy =
110           verifier()->create_temporary_symbol(sig);
111         assert(sig_copy == sig, "symbols don't match");
112         sig = sig_copy;
113       }



114       return VerificationType::reference_type(sig);
115     }
116     case T_INT:     return VerificationType::integer_type();
117     case T_BYTE:    return VerificationType::byte_type();
118     case T_CHAR:    return VerificationType::char_type();
119     case T_SHORT:   return VerificationType::short_type();
120     case T_BOOLEAN: return VerificationType::boolean_type();
121     case T_FLOAT:   return VerificationType::float_type();
122     case T_DOUBLE:  return VerificationType::double_type();
123     case T_LONG:    return VerificationType::long_type();
124     case T_VOID:    return VerificationType::bogus_type();
125     default:
126       ShouldNotReachHere();
127   }
128   return VerificationType::bogus_type();
129 }
130 
131 void StackMapFrame::copy_locals(const StackMapFrame* src) {
132   int32_t len = src->locals_size() < _locals_size ?
133     src->locals_size() : _locals_size;

 64     }
 65   }
 66   for (i = 0; i < _stack_size; i++) {
 67     if (_stack[i].equals(old_object)) {
 68       _stack[i] = new_object;
 69     }
 70   }
 71   if (old_object == VerificationType::uninitialized_this_type()) {
 72     // "this" has been initialized - reset flags
 73     _flags = 0;
 74   }
 75 }
 76 
 77 VerificationType StackMapFrame::set_locals_from_arg(
 78     const methodHandle& m, VerificationType thisKlass) {
 79   SignatureStream ss(m->signature());
 80   int init_local_num = 0;
 81   if (!m->is_static()) {
 82     init_local_num++;
 83     // add one extra argument for instance method
 84     if (m->is_object_constructor() &&
 85        thisKlass.name() != vmSymbols::java_lang_Object()) {
 86       _locals[0] = VerificationType::uninitialized_this_type();
 87       _flags |= FLAG_THIS_UNINIT;
 88     } else {
 89       _locals[0] = thisKlass;
 90     }
 91   }
 92 
 93   // local num may be greater than size of parameters because long/double occupies two slots
 94   while(!ss.at_return_type()) {
 95     init_local_num += _verifier->change_sig_to_verificationType(
 96       &ss, &_locals[init_local_num]);
 97     ss.next();
 98   }
 99   _locals_size = init_local_num;
100 
101   switch (ss.type()) {
102     case T_OBJECT:
103     case T_ARRAY:
104     case T_INLINE_TYPE:
105     {
106       Symbol* sig = ss.as_symbol();
107       if (!sig->is_permanent()) {
108         // Create another symbol to save as signature stream unreferences
109         // this symbol.
110         Symbol *sig_copy =
111           verifier()->create_temporary_symbol(sig);
112         assert(sig_copy == sig, "symbols don't match");
113         sig = sig_copy;
114       }
115       if (ss.type() == T_INLINE_TYPE) {
116         return VerificationType::inline_type(sig);
117       }
118       return VerificationType::reference_type(sig);
119     }
120     case T_INT:     return VerificationType::integer_type();
121     case T_BYTE:    return VerificationType::byte_type();
122     case T_CHAR:    return VerificationType::char_type();
123     case T_SHORT:   return VerificationType::short_type();
124     case T_BOOLEAN: return VerificationType::boolean_type();
125     case T_FLOAT:   return VerificationType::float_type();
126     case T_DOUBLE:  return VerificationType::double_type();
127     case T_LONG:    return VerificationType::long_type();
128     case T_VOID:    return VerificationType::bogus_type();
129     default:
130       ShouldNotReachHere();
131   }
132   return VerificationType::bogus_type();
133 }
134 
135 void StackMapFrame::copy_locals(const StackMapFrame* src) {
136   int32_t len = src->locals_size() < _locals_size ?
137     src->locals_size() : _locals_size;
< prev index next >