175 // is assignable to type. |
175 // is assignable to type. |
176 inline VerificationType pop_stack(VerificationType type, TRAPS) { |
176 inline VerificationType pop_stack(VerificationType type, TRAPS) { |
177 if (_stack_size != 0) { |
177 if (_stack_size != 0) { |
178 VerificationType top = _stack[_stack_size - 1]; |
178 VerificationType top = _stack[_stack_size - 1]; |
179 bool subtype = type.is_assignable_from( |
179 bool subtype = type.is_assignable_from( |
180 top, verifier()->current_class(), |
180 top, verifier(), CHECK_(VerificationType::bogus_type())); |
181 CHECK_(VerificationType::bogus_type())); |
|
182 if (subtype) { |
181 if (subtype) { |
183 _stack_size --; |
182 _stack_size --; |
184 NOT_PRODUCT( _stack[_stack_size] = VerificationType::bogus_type(); ) |
183 NOT_PRODUCT( _stack[_stack_size] = VerificationType::bogus_type(); ) |
185 return top; |
184 return top; |
186 } |
185 } |
192 VerificationType type1, VerificationType type2, TRAPS) { |
191 VerificationType type1, VerificationType type2, TRAPS) { |
193 assert(type1.is_long2() || type1.is_double2(), "must be long/double"); |
192 assert(type1.is_long2() || type1.is_double2(), "must be long/double"); |
194 assert(type2.is_long() || type2.is_double(), "must be long/double_2"); |
193 assert(type2.is_long() || type2.is_double(), "must be long/double_2"); |
195 if (_stack_size >= 2) { |
194 if (_stack_size >= 2) { |
196 VerificationType top1 = _stack[_stack_size - 1]; |
195 VerificationType top1 = _stack[_stack_size - 1]; |
197 bool subtype1 = type1.is_assignable_from( |
196 bool subtype1 = type1.is_assignable_from(top1, verifier(), CHECK); |
198 top1, verifier()->current_class(), CHECK); |
|
199 VerificationType top2 = _stack[_stack_size - 2]; |
197 VerificationType top2 = _stack[_stack_size - 2]; |
200 bool subtype2 = type2.is_assignable_from( |
198 bool subtype2 = type2.is_assignable_from(top2, verifier(), CHECK); |
201 top2, verifier()->current_class(), CHECK); |
|
202 if (subtype1 && subtype2) { |
199 if (subtype1 && subtype2) { |
203 _stack_size -= 2; |
200 _stack_size -= 2; |
204 NOT_PRODUCT( _stack[_stack_size] = VerificationType::bogus_type(); ) |
201 NOT_PRODUCT( _stack[_stack_size] = VerificationType::bogus_type(); ) |
205 NOT_PRODUCT( _stack[_stack_size+1] = VerificationType::bogus_type(); ) |
202 NOT_PRODUCT( _stack[_stack_size+1] = VerificationType::bogus_type(); ) |
206 return; |
203 return; |