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