205 return index; |
205 return index; |
206 } |
206 } |
207 |
207 |
208 BasicType Bytecode_loadconstant::result_type() const { |
208 BasicType Bytecode_loadconstant::result_type() const { |
209 int index = pool_index(); |
209 int index = pool_index(); |
210 constantTag tag = _method->constants()->tag_at(index); |
210 return _method->constants()->basic_type_for_constant_at(index); |
211 return tag.basic_type(); |
|
212 } |
211 } |
213 |
212 |
214 oop Bytecode_loadconstant::resolve_constant(TRAPS) const { |
213 oop Bytecode_loadconstant::resolve_constant(TRAPS) const { |
215 assert(_method != NULL, "must supply method to resolve constant"); |
214 assert(_method != NULL, "must supply method to resolve constant"); |
216 int index = raw_index(); |
215 int index = raw_index(); |
217 ConstantPool* constants = _method->constants(); |
216 ConstantPool* constants = _method->constants(); |
218 if (has_cache_index()) { |
217 if (has_cache_index()) { |
219 return constants->resolve_cached_constant_at(index, THREAD); |
218 return constants->resolve_cached_constant_at(index, THREAD); |
|
219 } else if (_method->constants()->tag_at(index).is_dynamic_constant()) { |
|
220 return constants->resolve_possibly_cached_constant_at(index, THREAD); |
220 } else { |
221 } else { |
221 return constants->resolve_constant_at(index, THREAD); |
222 return constants->resolve_constant_at(index, THREAD); |
222 } |
223 } |
223 } |
224 } |
224 |
225 |