--- a/hotspot/src/share/vm/interpreter/interpreter.cpp Mon Jun 07 14:17:01 2010 -0700
+++ b/hotspot/src/share/vm/interpreter/interpreter.cpp Wed Jun 09 18:50:45 2010 -0700
@@ -267,20 +267,6 @@
}
#endif // PRODUCT
-static BasicType constant_pool_type(methodOop method, int index) {
- constantTag tag = method->constants()->tag_at(index);
- if (tag.is_int ()) return T_INT;
- else if (tag.is_float ()) return T_FLOAT;
- else if (tag.is_long ()) return T_LONG;
- else if (tag.is_double ()) return T_DOUBLE;
- else if (tag.is_string ()) return T_OBJECT;
- else if (tag.is_unresolved_string()) return T_OBJECT;
- else if (tag.is_klass ()) return T_OBJECT;
- else if (tag.is_unresolved_klass ()) return T_OBJECT;
- ShouldNotReachHere();
- return T_ILLEGAL;
-}
-
//------------------------------------------------------------------------------------------------------------------------
// Deoptimization support
@@ -330,13 +316,15 @@
}
case Bytecodes::_ldc :
- type = constant_pool_type( method, *(bcp+1) );
- break;
-
case Bytecodes::_ldc_w : // fall through
case Bytecodes::_ldc2_w:
- type = constant_pool_type( method, Bytes::get_Java_u2(bcp+1) );
- break;
+ {
+ Thread *thread = Thread::current();
+ ResourceMark rm(thread);
+ methodHandle mh(thread, method);
+ type = Bytecode_loadconstant_at(mh, bci)->result_type();
+ break;
+ }
default:
type = Bytecodes::result_type(code);