< prev index next >

src/share/vm/interpreter/bytecode.cpp

Print this page




 195     return get_index_u1(rawc);
 196   else
 197     return get_index_u2(rawc, false);
 198 }
 199 
 200 int Bytecode_loadconstant::pool_index() const {
 201   int index = raw_index();
 202   if (has_cache_index()) {
 203     return _method->constants()->object_to_cp_index(index);
 204   }
 205   return index;
 206 }
 207 
 208 BasicType Bytecode_loadconstant::result_type() const {
 209   int index = pool_index();
 210   constantTag tag = _method->constants()->tag_at(index);
 211   return tag.basic_type();
 212 }
 213 
 214 oop Bytecode_loadconstant::resolve_constant(TRAPS) const {
 215   assert(_method.not_null(), "must supply method to resolve constant");
 216   int index = raw_index();
 217   ConstantPool* constants = _method->constants();
 218   if (has_cache_index()) {
 219     return constants->resolve_cached_constant_at(index, THREAD);
 220   } else {
 221     return constants->resolve_constant_at(index, THREAD);
 222   }
 223 }
 224 
 225 //------------------------------------------------------------------------------
 226 // Non-product code
 227 
 228 #ifndef PRODUCT
 229 
 230 void Bytecode_lookupswitch::verify() const {
 231   switch (Bytecodes::java_code(code())) {
 232     case Bytecodes::_lookupswitch:
 233       { int i = number_of_pairs() - 1;
 234         while (i-- > 0) {
 235           assert(pair_at(i).match() < pair_at(i+1).match(), "unsorted table entries");




 195     return get_index_u1(rawc);
 196   else
 197     return get_index_u2(rawc, false);
 198 }
 199 
 200 int Bytecode_loadconstant::pool_index() const {
 201   int index = raw_index();
 202   if (has_cache_index()) {
 203     return _method->constants()->object_to_cp_index(index);
 204   }
 205   return index;
 206 }
 207 
 208 BasicType Bytecode_loadconstant::result_type() const {
 209   int index = pool_index();
 210   constantTag tag = _method->constants()->tag_at(index);
 211   return tag.basic_type();
 212 }
 213 
 214 oop Bytecode_loadconstant::resolve_constant(TRAPS) const {
 215   assert(_method != NULL, "must supply method to resolve constant");
 216   int index = raw_index();
 217   ConstantPool* constants = _method->constants();
 218   if (has_cache_index()) {
 219     return constants->resolve_cached_constant_at(index, THREAD);
 220   } else {
 221     return constants->resolve_constant_at(index, THREAD);
 222   }
 223 }
 224 
 225 //------------------------------------------------------------------------------
 226 // Non-product code
 227 
 228 #ifndef PRODUCT
 229 
 230 void Bytecode_lookupswitch::verify() const {
 231   switch (Bytecodes::java_code(code())) {
 232     case Bytecodes::_lookupswitch:
 233       { int i = number_of_pairs() - 1;
 234         while (i-- > 0) {
 235           assert(pair_at(i).match() < pair_at(i+1).match(), "unsorted table entries");


< prev index next >