< prev index next >
src/share/vm/oops/generateOopMap.cpp
Print this page
*** 1389,1402 ****
case Bytecodes::_aconst_null:
case Bytecodes::_new: ppush1(CellTypeState::make_line_ref(itr->bci()));
break;
! case Bytecodes::_vnew:
! case Bytecodes::_vdefault:
! case Bytecodes::_vwithfield: ppush1(CellTypeState::make_line_valuetype(itr->bci()));
! break;
case Bytecodes::_iconst_m1:
case Bytecodes::_iconst_0:
case Bytecodes::_iconst_1:
case Bytecodes::_iconst_2:
--- 1389,1401 ----
case Bytecodes::_aconst_null:
case Bytecodes::_new: ppush1(CellTypeState::make_line_ref(itr->bci()));
break;
! case Bytecodes::_vdefault: ppush1(CellTypeState::make_line_valuetype(itr->bci())); break;
! case Bytecodes::_vnew: do_vnew(itr->get_index_u2(), itr->bci()); break;
! case Bytecodes::_vwithfield: do_vwithfield(itr->get_index_u2_cpcache(), itr->bci()); break;
case Bytecodes::_iconst_m1:
case Bytecodes::_iconst_0:
case Bytecodes::_iconst_1:
case Bytecodes::_iconst_2:
*** 2036,2045 ****
--- 2035,2095 ----
// Push return address
ppush(out);
}
+ void GenerateOopMap::do_vnew(int idx, int bci) {
+ // Dig up signature for field in constant pool
+ ConstantPool* cp = _method->constants();
+ int method_index = cp->uncached_name_and_type_ref_index_at(idx);
+ Symbol* signature = cp->uncached_signature_ref_at(idx);
+
+ CellTypeState in[MAXARGSIZE+1]; // Includes result
+ ComputeCallStack cse(signature);
+
+ // Compute arguments
+ int arg_length = cse.compute_for_parameters(true, false, in);
+ assert(arg_length<=MAXARGSIZE, "too many locals");
+
+ // Pop arguments
+ for (int i = arg_length - 1; i >= 0; i--) ppop1(in[i]);// Do args in reverse order.
+
+ CellTypeState out[2];
+ out[0] = CellTypeState::valuetype;
+ out[1] = CellTypeState::bottom;
+
+ ppush(out);
+ }
+
+ void GenerateOopMap::do_vwithfield(int idx, int bci) {
+ // Dig up signature for field in constant pool
+ ConstantPool* cp = method()->constants();
+ int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx);
+ int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx);
+ Symbol* signature = cp->symbol_at(signatureIdx);
+
+ // Parse signature (especially simple for fields)
+ assert(signature->utf8_length() > 0,
+ "field signatures cannot have zero length");
+ // The signature is UFT8 encoded, but the first char is always ASCII for signatures.
+ char sigch = (char) *(signature->base());
+ CellTypeState temp[4];
+ CellTypeState *eff = sigchar_to_effect(sigch, bci, temp);
+
+ CellTypeState in[4];
+ int i = copy_cts(in, eff);
+ in[i++] = CellTypeState::valuetype;
+ in[i] = CellTypeState::bottom;
+ assert(i <= 3, "sanity check");
+
+ CellTypeState out[2];
+ out[0] = CellTypeState::valuetype;
+ out[1] = CellTypeState::bottom;
+
+ pp(in, out);
+ }
+
// This is used to parse the signature for fields, since they are very simple...
CellTypeState *GenerateOopMap::sigchar_to_effect(char sigch, int bci, CellTypeState *out) {
// Object and array
if (sigch=='L' || sigch=='[') {
out[0] = CellTypeState::make_line_ref(bci);
< prev index next >