< prev index next >

src/hotspot/share/oops/generateOopMap.cpp

Print this page

        

*** 120,129 **** --- 120,130 ---- virtual void do_byte () { set(CellTypeState::value); }; virtual void do_short () { set(CellTypeState::value); }; virtual void do_int () { set(CellTypeState::value); }; virtual void do_void () { set(CellTypeState::bottom);}; virtual void do_object(int begin, int end) { set(CellTypeState::ref); }; + virtual void do_valuetype(int begin, int end) { set(CellTypeState::ref); }; virtual void do_array (int begin, int end) { set(CellTypeState::ref); }; void do_double() { set(CellTypeState::value); set(CellTypeState::value); } void do_long () { set(CellTypeState::value);
*** 135,146 **** // Compute methods int compute_for_parameters(bool is_static, CellTypeState *effect) { _idx = 0; _effect = effect; ! if (!is_static) effect[_idx++] = CellTypeState::ref; iterate_parameters(); return length(); }; --- 136,148 ---- // Compute methods int compute_for_parameters(bool is_static, CellTypeState *effect) { _idx = 0; _effect = effect; ! if (!is_static) { effect[_idx++] = CellTypeState::ref; + } iterate_parameters(); return length(); };
*** 174,183 **** --- 176,186 ---- virtual void do_byte () { set(CellTypeState::value); }; virtual void do_short () { set(CellTypeState::value); }; virtual void do_int () { set(CellTypeState::value); }; virtual void do_void () { set(CellTypeState::bottom);}; virtual void do_object(int begin, int end) { set(CellTypeState::make_slot_ref(_idx)); } + virtual void do_valuetype(int begin, int end) { set(CellTypeState::make_slot_ref(_idx)); } virtual void do_array (int begin, int end) { set(CellTypeState::make_slot_ref(_idx)); } void do_double() { set(CellTypeState::value); set(CellTypeState::value); } void do_long () { set(CellTypeState::value);
*** 1374,1383 **** --- 1377,1389 ---- case Bytecodes::_aconst_null: case Bytecodes::_new: ppush1(CellTypeState::make_line_ref(itr->bci())); break; + case Bytecodes::_defaultvalue: ppush1(CellTypeState::make_line_ref(itr->bci())); break; + case Bytecodes::_withfield: do_withfield(itr->get_index_u2_cpcache(), itr->bci()); break; + case Bytecodes::_iconst_m1: case Bytecodes::_iconst_0: case Bytecodes::_iconst_1: case Bytecodes::_iconst_2: case Bytecodes::_iconst_3:
*** 1587,1606 **** case Bytecodes::_if_acmpne: ppop(rrCTS); break; case Bytecodes::_jsr: do_jsr(itr->dest()); break; case Bytecodes::_jsr_w: do_jsr(itr->dest_w()); break; ! case Bytecodes::_getstatic: do_field(true, true, itr->get_index_u2_cpcache(), itr->bci()); break; ! case Bytecodes::_putstatic: do_field(false, true, itr->get_index_u2_cpcache(), itr->bci()); break; case Bytecodes::_getfield: do_field(true, false, itr->get_index_u2_cpcache(), itr->bci()); break; case Bytecodes::_putfield: do_field(false, false, itr->get_index_u2_cpcache(), itr->bci()); break; case Bytecodes::_invokevirtual: ! case Bytecodes::_invokespecial: do_method(false, false, itr->get_index_u2_cpcache(), itr->bci()); break; ! case Bytecodes::_invokestatic: do_method(true, false, itr->get_index_u2_cpcache(), itr->bci()); break; ! case Bytecodes::_invokedynamic: do_method(true, false, itr->get_index_u4(), itr->bci()); break; ! case Bytecodes::_invokeinterface: do_method(false, true, itr->get_index_u2_cpcache(), itr->bci()); break; case Bytecodes::_newarray: case Bytecodes::_anewarray: pp_new_ref(vCTS, itr->bci()); break; case Bytecodes::_checkcast: do_checkcast(); break; case Bytecodes::_arraylength: case Bytecodes::_instanceof: pp(rCTS, vCTS); break; --- 1593,1612 ---- case Bytecodes::_if_acmpne: ppop(rrCTS); break; case Bytecodes::_jsr: do_jsr(itr->dest()); break; case Bytecodes::_jsr_w: do_jsr(itr->dest_w()); break; ! case Bytecodes::_getstatic: do_field(true, true, itr->get_index_u2_cpcache(), itr->bci()); break; ! case Bytecodes::_putstatic: do_field(false, true, itr->get_index_u2_cpcache(), itr->bci()); break; case Bytecodes::_getfield: do_field(true, false, itr->get_index_u2_cpcache(), itr->bci()); break; case Bytecodes::_putfield: do_field(false, false, itr->get_index_u2_cpcache(), itr->bci()); break; + case Bytecodes::_invokeinterface: case Bytecodes::_invokevirtual: ! case Bytecodes::_invokespecial: do_method(false, itr->get_index_u2_cpcache(), itr->bci()); break; ! case Bytecodes::_invokestatic: do_method(true , itr->get_index_u2_cpcache(), itr->bci()); break; ! case Bytecodes::_invokedynamic: do_method(true , itr->get_index_u4(), itr->bci()); break; case Bytecodes::_newarray: case Bytecodes::_anewarray: pp_new_ref(vCTS, itr->bci()); break; case Bytecodes::_checkcast: do_checkcast(); break; case Bytecodes::_arraylength: case Bytecodes::_instanceof: pp(rCTS, vCTS); break;
*** 1616,1625 **** --- 1622,1632 ---- break; case Bytecodes::_areturn: do_return_monitor_check(); ppop1(refCTS); break; + case Bytecodes::_ifnull: case Bytecodes::_ifnonnull: ppop1(refCTS); break; case Bytecodes::_multianewarray: do_multianewarray(*(itr->bcp()+3), itr->bci()); break; case Bytecodes::_wide: fatal("Iterator should skip this bytecode"); break;
*** 1722,1732 **** ppop1(*out++); } } void GenerateOopMap::ppush1(CellTypeState in) { ! assert(in.is_reference() | in.is_value(), "sanity check"); push(in); } void GenerateOopMap::ppush(CellTypeState *in) { while (!(*in).is_bottom()) { --- 1729,1739 ---- ppop1(*out++); } } void GenerateOopMap::ppush1(CellTypeState in) { ! assert(in.is_reference() || in.is_value(), "sanity check"); push(in); } void GenerateOopMap::ppush(CellTypeState *in) { while (!(*in).is_bottom()) {
*** 1945,1961 **** out = eff; } else { out = epsilonCTS; i = copy_cts(in, eff); } ! if (!is_static) in[i++] = CellTypeState::ref; in[i] = CellTypeState::bottom; assert(i<=3, "sanity check"); pp(in, out); } ! void GenerateOopMap::do_method(int is_static, int is_interface, int idx, int bci) { // Dig up signature for field in constant pool ConstantPool* cp = _method->constants(); Symbol* signature = cp->signature_ref_at(idx); // Parse method signature --- 1952,1970 ---- out = eff; } else { out = epsilonCTS; i = copy_cts(in, eff); } ! if (!is_static) { ! in[i++] = CellTypeState::ref; ! } in[i] = CellTypeState::bottom; assert(i<=3, "sanity check"); pp(in, out); } ! void GenerateOopMap::do_method(int is_static, int idx, int bci) { // Dig up signature for field in constant pool ConstantPool* cp = _method->constants(); Symbol* signature = cp->signature_ref_at(idx); // Parse method signature
*** 1988,2001 **** // Push return address ppush(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); out[1] = CellTypeState::bottom; return out; } if (sigch == 'J' || sigch == 'D' ) return vvCTS; // Long and Double --- 1997,2038 ---- // Push return address ppush(out); } + void GenerateOopMap::do_withfield(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::ref; + in[i] = CellTypeState::bottom; + assert(i <= 3, "sanity check"); + + CellTypeState out[2]; + out[0] = CellTypeState::ref; + 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=='[' || sigch=='Q') { out[0] = CellTypeState::make_line_ref(bci); out[1] = CellTypeState::bottom; return out; } if (sigch == 'J' || sigch == 'D' ) return vvCTS; // Long and Double
< prev index next >