--- old/src/share/vm/oops/generateOopMap.cpp 2017-02-07 13:22:25.523805651 -0500 +++ new/src/share/vm/oops/generateOopMap.cpp 2017-02-07 13:22:24.963802874 -0500 @@ -1391,10 +1391,9 @@ 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::_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: @@ -2038,6 +2037,57 @@ 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