< prev index next >

src/hotspot/share/oops/generateOopMap.cpp

Print this page

 122       set(CellTypeState::bottom);
 123     } else if (is_reference_type(type)) {
 124       set(CellTypeState::ref);
 125     } else {
 126       assert(is_java_primitive(type), "");
 127       set(CellTypeState::value);
 128       if (is_double_word_type(type)) {
 129         set(CellTypeState::value);
 130       }
 131     }
 132   }
 133 
 134  public:
 135   ComputeCallStack(Symbol* signature) : SignatureIterator(signature) {};
 136 
 137   // Compute methods
 138   int compute_for_parameters(bool is_static, CellTypeState *effect) {
 139     _idx    = 0;
 140     _effect = effect;
 141 
 142     if (!is_static)
 143       effect[_idx++] = CellTypeState::ref;

 144 
 145     do_parameters_on(this);
 146 
 147     return length();
 148   };
 149 
 150   int compute_for_returntype(CellTypeState *effect) {
 151     _idx    = 0;
 152     _effect = effect;
 153     do_type(return_type(), true);
 154     set(CellTypeState::bottom);  // Always terminate with a bottom state, so ppush works
 155 
 156     return length();
 157   }
 158 };
 159 
 160 //=========================================================================================
 161 // ComputeEntryStack
 162 //
 163 // Specialization of SignatureIterator - in order to set up first stack frame

 820       bb->_monitor_top = bad_monitors;
 821       bb->set_changed(true);
 822       _monitor_safe = false;
 823     }
 824   } else if (!bb->is_reachable()) {
 825     // First time we look at this  BB
 826     copy_state(bb->_state, _state);
 827     bb->_stack_top = _stack_top;
 828     bb->_monitor_top = _monitor_top;
 829     bb->set_changed(true);
 830   } else {
 831     verify_error("stack height conflict: %d vs. %d",  _stack_top, bb->_stack_top);
 832   }
 833 }
 834 
 835 void GenerateOopMap::merge_state(GenerateOopMap *gom, int bci, int* data) {
 836    gom->merge_state_into_bb(gom->get_basic_block_at(bci));
 837 }
 838 
 839 void GenerateOopMap::set_var(int localNo, CellTypeState cts) {
 840   assert(cts.is_reference() || cts.is_value() || cts.is_address(),
 841          "wrong celltypestate");
 842   if (localNo < 0 || localNo > _max_locals) {
 843     verify_error("variable write error: r%d", localNo);
 844     return;
 845   }
 846   vars()[localNo] = cts;
 847 }
 848 
 849 CellTypeState GenerateOopMap::get_var(int localNo) {
 850   assert(localNo < _max_locals + _nof_refval_conflicts, "variable read error");
 851   if (localNo < 0 || localNo > _max_locals) {
 852     verify_error("variable read error: r%d", localNo);
 853     return valCTS; // just to pick something;
 854   }
 855   return vars()[localNo];
 856 }
 857 
 858 CellTypeState GenerateOopMap::pop() {
 859   if ( _stack_top <= 0) {
 860     verify_error("stack underflow");

1361         break;
1362       default:
1363        fill_stackmap_for_opcodes(itr, vars(), stack(), _stack_top);
1364        break;
1365     }
1366   }
1367 
1368   // abstract interpretation of current opcode
1369   switch(itr->code()) {
1370     case Bytecodes::_nop:                                           break;
1371     case Bytecodes::_goto:                                          break;
1372     case Bytecodes::_goto_w:                                        break;
1373     case Bytecodes::_iinc:                                          break;
1374     case Bytecodes::_return:            do_return_monitor_check();
1375                                         break;
1376 
1377     case Bytecodes::_aconst_null:
1378     case Bytecodes::_new:               ppush1(CellTypeState::make_line_ref(itr->bci()));
1379                                         break;
1380 



1381     case Bytecodes::_iconst_m1:
1382     case Bytecodes::_iconst_0:
1383     case Bytecodes::_iconst_1:
1384     case Bytecodes::_iconst_2:
1385     case Bytecodes::_iconst_3:
1386     case Bytecodes::_iconst_4:
1387     case Bytecodes::_iconst_5:
1388     case Bytecodes::_fconst_0:
1389     case Bytecodes::_fconst_1:
1390     case Bytecodes::_fconst_2:
1391     case Bytecodes::_bipush:
1392     case Bytecodes::_sipush:            ppush1(valCTS);             break;
1393 
1394     case Bytecodes::_lconst_0:
1395     case Bytecodes::_lconst_1:
1396     case Bytecodes::_dconst_0:
1397     case Bytecodes::_dconst_1:          ppush(vvCTS);               break;
1398 
1399     case Bytecodes::_ldc2_w:            ppush(vvCTS);               break;
1400 

1574     case Bytecodes::_if_icmplt:
1575     case Bytecodes::_if_icmpge:
1576     case Bytecodes::_if_icmpgt:
1577     case Bytecodes::_if_icmple:         ppop(vvCTS);
1578                                         break;
1579 
1580     case Bytecodes::_lreturn:           do_return_monitor_check();
1581                                         ppop(vvCTS);
1582                                         break;
1583 
1584     case Bytecodes::_dreturn:           do_return_monitor_check();
1585                                         ppop(vvCTS);
1586                                         break;
1587 
1588     case Bytecodes::_if_acmpeq:
1589     case Bytecodes::_if_acmpne:         ppop(rrCTS);                 break;
1590 
1591     case Bytecodes::_jsr:               do_jsr(itr->dest());         break;
1592     case Bytecodes::_jsr_w:             do_jsr(itr->dest_w());       break;
1593 
1594     case Bytecodes::_getstatic:         do_field(true,  true,  itr->get_index_u2_cpcache(), itr->bci()); break;
1595     case Bytecodes::_putstatic:         do_field(false, true,  itr->get_index_u2_cpcache(), itr->bci()); break;
1596     case Bytecodes::_getfield:          do_field(true,  false, itr->get_index_u2_cpcache(), itr->bci()); break;
1597     case Bytecodes::_putfield:          do_field(false, false, itr->get_index_u2_cpcache(), itr->bci()); break;
1598 

1599     case Bytecodes::_invokevirtual:
1600     case Bytecodes::_invokespecial:     do_method(false, false, itr->get_index_u2_cpcache(), itr->bci()); break;
1601     case Bytecodes::_invokestatic:      do_method(true,  false, itr->get_index_u2_cpcache(), itr->bci()); break;
1602     case Bytecodes::_invokedynamic:     do_method(true,  false, itr->get_index_u4(),         itr->bci()); break;
1603     case Bytecodes::_invokeinterface:   do_method(false, true,  itr->get_index_u2_cpcache(), itr->bci()); break;
1604     case Bytecodes::_newarray:
1605     case Bytecodes::_anewarray:         pp_new_ref(vCTS, itr->bci()); break;
1606     case Bytecodes::_checkcast:         do_checkcast(); break;
1607     case Bytecodes::_arraylength:
1608     case Bytecodes::_instanceof:        pp(rCTS, vCTS); break;
1609     case Bytecodes::_monitorenter:      do_monitorenter(itr->bci()); break;
1610     case Bytecodes::_monitorexit:       do_monitorexit(itr->bci()); break;
1611 
1612     case Bytecodes::_athrow:            // handled by do_exception_edge() BUT ...
1613                                         // vlh(apple): do_exception_edge() does not get
1614                                         // called if method has no exception handlers
1615                                         if ((!_has_exceptions) && (_monitor_top > 0)) {
1616                                           _monitor_safe = false;
1617                                         }
1618                                         break;
1619 
1620     case Bytecodes::_areturn:           do_return_monitor_check();
1621                                         ppop1(refCTS);
1622                                         break;

1623     case Bytecodes::_ifnull:
1624     case Bytecodes::_ifnonnull:         ppop1(refCTS); break;
1625     case Bytecodes::_multianewarray:    do_multianewarray(*(itr->bcp()+3), itr->bci()); break;
1626 
1627     case Bytecodes::_wide:              fatal("Iterator should skip this bytecode"); break;
1628     case Bytecodes::_ret:                                           break;
1629 
1630     // Java opcodes
1631     case Bytecodes::_lookupswitch:      ppop1(valCTS);             break;
1632 
1633     default:
1634          tty->print("unexpected opcode: %d\n", itr->code());
1635          ShouldNotReachHere();
1636     break;
1637   }
1638 }
1639 
1640 void GenerateOopMap::check_type(CellTypeState expected, CellTypeState actual) {
1641   if (!expected.equal_kind(actual)) {
1642     verify_error("wrong type on stack (found: %c expected: %c)", actual.to_char(), expected.to_char());

1709   while (push_ch != '\0') {
1710     int idx = push_ch - '1';
1711     assert(idx >= 0 && idx < poplen, "wrong arguments");
1712     push(actual[idx]);
1713     push_ch = *out++;
1714   }
1715 }
1716 
1717 void GenerateOopMap::ppop1(CellTypeState out) {
1718   CellTypeState actual = pop();
1719   check_type(out, actual);
1720 }
1721 
1722 void GenerateOopMap::ppop(CellTypeState *out) {
1723   while (!(*out).is_bottom()) {
1724     ppop1(*out++);
1725   }
1726 }
1727 
1728 void GenerateOopMap::ppush1(CellTypeState in) {
1729   assert(in.is_reference() | in.is_value(), "sanity check");
1730   push(in);
1731 }
1732 
1733 void GenerateOopMap::ppush(CellTypeState *in) {
1734   while (!(*in).is_bottom()) {
1735     ppush1(*in++);
1736   }
1737 }
1738 
1739 void GenerateOopMap::pp(CellTypeState *in, CellTypeState *out) {
1740   ppop(in);
1741   ppush(out);
1742 }
1743 
1744 void GenerateOopMap::pp_new_ref(CellTypeState *in, int bci) {
1745   ppop(in);
1746   ppush1(CellTypeState::make_line_ref(bci));
1747 }
1748 
1749 void GenerateOopMap::ppop_any(int poplen) {

1928 void GenerateOopMap::do_field(int is_get, int is_static, int idx, int bci) {
1929   // Dig up signature for field in constant pool
1930   ConstantPool* cp     = method()->constants();
1931   int nameAndTypeIdx     = cp->name_and_type_ref_index_at(idx);
1932   int signatureIdx       = cp->signature_ref_index_at(nameAndTypeIdx);
1933   Symbol* signature      = cp->symbol_at(signatureIdx);
1934 
1935   CellTypeState temp[4];
1936   CellTypeState *eff  = signature_to_effect(signature, bci, temp);
1937 
1938   CellTypeState in[4];
1939   CellTypeState *out;
1940   int i =  0;
1941 
1942   if (is_get) {
1943     out = eff;
1944   } else {
1945     out = epsilonCTS;
1946     i   = copy_cts(in, eff);
1947   }
1948   if (!is_static) in[i++] = CellTypeState::ref;


1949   in[i] = CellTypeState::bottom;
1950   assert(i<=3, "sanity check");
1951   pp(in, out);
1952 }
1953 
1954 void GenerateOopMap::do_method(int is_static, int is_interface, int idx, int bci) {
1955  // Dig up signature for field in constant pool
1956   ConstantPool* cp  = _method->constants();
1957   Symbol* signature   = cp->signature_ref_at(idx);
1958 
1959   // Parse method signature
1960   CellTypeState out[4];
1961   CellTypeState in[MAXARGSIZE+1];   // Includes result
1962   ComputeCallStack cse(signature);
1963 
1964   // Compute return type
1965   int res_length=  cse.compute_for_returntype(out);
1966 
1967   // Temporary hack.
1968   if (out[0].equal(CellTypeState::ref) && out[1].equal(CellTypeState::bottom)) {
1969     out[0] = CellTypeState::make_line_ref(bci);
1970   }
1971 
1972   assert(res_length<=4, "max value should be vv");
1973 
1974   // Compute arguments
1975   int arg_length = cse.compute_for_parameters(is_static != 0, in);
1976   assert(arg_length<=MAXARGSIZE, "too many locals");
1977 
1978   // Pop arguments
1979   for (int i = arg_length - 1; i >= 0; i--) ppop1(in[i]);// Do args in reverse order.
1980 
1981   // Report results
1982   if (_report_result_for_send == true) {
1983      fill_stackmap_for_opcodes(_itr_send, vars(), stack(), _stack_top);
1984      _report_result_for_send = false;
1985   }
1986 
1987   // Push return address
1988   ppush(out);
1989 }
1990 



























1991 // This is used to parse the signature for fields, since they are very simple...
1992 CellTypeState *GenerateOopMap::signature_to_effect(const Symbol* sig, int bci, CellTypeState *out) {
1993   // Object and array
1994   BasicType bt = Signature::basic_type(sig);
1995   if (is_reference_type(bt)) {
1996     out[0] = CellTypeState::make_line_ref(bci);
1997     out[1] = CellTypeState::bottom;
1998     return out;
1999   }
2000   if (is_double_word_type(bt)) return vvCTS; // Long and Double
2001   if (bt == T_VOID) return epsilonCTS;       // Void
2002   return vCTS;                               // Otherwise
2003 }
2004 
2005 uint64_t GenerateOopMap::_total_byte_count = 0;
2006 elapsedTimer GenerateOopMap::_total_oopmap_time;
2007 
2008 // This function assumes "bcs" is at a "ret" instruction and that the vars
2009 // state is valid for that instruction. Furthermore, the ret instruction
2010 // must be the last instruction in "bb" (we store information about the

 122       set(CellTypeState::bottom);
 123     } else if (is_reference_type(type)) {
 124       set(CellTypeState::ref);
 125     } else {
 126       assert(is_java_primitive(type), "");
 127       set(CellTypeState::value);
 128       if (is_double_word_type(type)) {
 129         set(CellTypeState::value);
 130       }
 131     }
 132   }
 133 
 134  public:
 135   ComputeCallStack(Symbol* signature) : SignatureIterator(signature) {};
 136 
 137   // Compute methods
 138   int compute_for_parameters(bool is_static, CellTypeState *effect) {
 139     _idx    = 0;
 140     _effect = effect;
 141 
 142     if (!is_static) {
 143       effect[_idx++] = CellTypeState::ref;
 144     }
 145 
 146     do_parameters_on(this);
 147 
 148     return length();
 149   };
 150 
 151   int compute_for_returntype(CellTypeState *effect) {
 152     _idx    = 0;
 153     _effect = effect;
 154     do_type(return_type(), true);
 155     set(CellTypeState::bottom);  // Always terminate with a bottom state, so ppush works
 156 
 157     return length();
 158   }
 159 };
 160 
 161 //=========================================================================================
 162 // ComputeEntryStack
 163 //
 164 // Specialization of SignatureIterator - in order to set up first stack frame

 821       bb->_monitor_top = bad_monitors;
 822       bb->set_changed(true);
 823       _monitor_safe = false;
 824     }
 825   } else if (!bb->is_reachable()) {
 826     // First time we look at this  BB
 827     copy_state(bb->_state, _state);
 828     bb->_stack_top = _stack_top;
 829     bb->_monitor_top = _monitor_top;
 830     bb->set_changed(true);
 831   } else {
 832     verify_error("stack height conflict: %d vs. %d",  _stack_top, bb->_stack_top);
 833   }
 834 }
 835 
 836 void GenerateOopMap::merge_state(GenerateOopMap *gom, int bci, int* data) {
 837    gom->merge_state_into_bb(gom->get_basic_block_at(bci));
 838 }
 839 
 840 void GenerateOopMap::set_var(int localNo, CellTypeState cts) {
 841   assert(cts.is_reference() || cts.is_inline_type() || cts.is_address(),
 842          "wrong celltypestate");
 843   if (localNo < 0 || localNo > _max_locals) {
 844     verify_error("variable write error: r%d", localNo);
 845     return;
 846   }
 847   vars()[localNo] = cts;
 848 }
 849 
 850 CellTypeState GenerateOopMap::get_var(int localNo) {
 851   assert(localNo < _max_locals + _nof_refval_conflicts, "variable read error");
 852   if (localNo < 0 || localNo > _max_locals) {
 853     verify_error("variable read error: r%d", localNo);
 854     return valCTS; // just to pick something;
 855   }
 856   return vars()[localNo];
 857 }
 858 
 859 CellTypeState GenerateOopMap::pop() {
 860   if ( _stack_top <= 0) {
 861     verify_error("stack underflow");

1362         break;
1363       default:
1364        fill_stackmap_for_opcodes(itr, vars(), stack(), _stack_top);
1365        break;
1366     }
1367   }
1368 
1369   // abstract interpretation of current opcode
1370   switch(itr->code()) {
1371     case Bytecodes::_nop:                                           break;
1372     case Bytecodes::_goto:                                          break;
1373     case Bytecodes::_goto_w:                                        break;
1374     case Bytecodes::_iinc:                                          break;
1375     case Bytecodes::_return:            do_return_monitor_check();
1376                                         break;
1377 
1378     case Bytecodes::_aconst_null:
1379     case Bytecodes::_new:               ppush1(CellTypeState::make_line_ref(itr->bci()));
1380                                         break;
1381 
1382     case Bytecodes::_defaultvalue:      ppush1(CellTypeState::make_line_ref(itr->bci())); break;
1383     case Bytecodes::_withfield:         do_withfield(itr->get_index_u2_cpcache(), itr->bci()); break;
1384 
1385     case Bytecodes::_iconst_m1:
1386     case Bytecodes::_iconst_0:
1387     case Bytecodes::_iconst_1:
1388     case Bytecodes::_iconst_2:
1389     case Bytecodes::_iconst_3:
1390     case Bytecodes::_iconst_4:
1391     case Bytecodes::_iconst_5:
1392     case Bytecodes::_fconst_0:
1393     case Bytecodes::_fconst_1:
1394     case Bytecodes::_fconst_2:
1395     case Bytecodes::_bipush:
1396     case Bytecodes::_sipush:            ppush1(valCTS);             break;
1397 
1398     case Bytecodes::_lconst_0:
1399     case Bytecodes::_lconst_1:
1400     case Bytecodes::_dconst_0:
1401     case Bytecodes::_dconst_1:          ppush(vvCTS);               break;
1402 
1403     case Bytecodes::_ldc2_w:            ppush(vvCTS);               break;
1404 

1578     case Bytecodes::_if_icmplt:
1579     case Bytecodes::_if_icmpge:
1580     case Bytecodes::_if_icmpgt:
1581     case Bytecodes::_if_icmple:         ppop(vvCTS);
1582                                         break;
1583 
1584     case Bytecodes::_lreturn:           do_return_monitor_check();
1585                                         ppop(vvCTS);
1586                                         break;
1587 
1588     case Bytecodes::_dreturn:           do_return_monitor_check();
1589                                         ppop(vvCTS);
1590                                         break;
1591 
1592     case Bytecodes::_if_acmpeq:
1593     case Bytecodes::_if_acmpne:         ppop(rrCTS);                 break;
1594 
1595     case Bytecodes::_jsr:               do_jsr(itr->dest());         break;
1596     case Bytecodes::_jsr_w:             do_jsr(itr->dest_w());       break;
1597 
1598     case Bytecodes::_getstatic:         do_field(true,  true, itr->get_index_u2_cpcache(), itr->bci()); break;
1599     case Bytecodes::_putstatic:         do_field(false, true, itr->get_index_u2_cpcache(), itr->bci()); break;
1600     case Bytecodes::_getfield:          do_field(true,  false, itr->get_index_u2_cpcache(), itr->bci()); break;
1601     case Bytecodes::_putfield:          do_field(false, false, itr->get_index_u2_cpcache(), itr->bci()); break;
1602 
1603     case Bytecodes::_invokeinterface:
1604     case Bytecodes::_invokevirtual:
1605     case Bytecodes::_invokespecial:     do_method(false, itr->get_index_u2_cpcache(), itr->bci()); break;
1606     case Bytecodes::_invokestatic:      do_method(true , itr->get_index_u2_cpcache(), itr->bci()); break;
1607     case Bytecodes::_invokedynamic:     do_method(true , itr->get_index_u4(),         itr->bci()); break;

1608     case Bytecodes::_newarray:
1609     case Bytecodes::_anewarray:         pp_new_ref(vCTS, itr->bci()); break;
1610     case Bytecodes::_checkcast:         do_checkcast(); break;
1611     case Bytecodes::_arraylength:
1612     case Bytecodes::_instanceof:        pp(rCTS, vCTS); break;
1613     case Bytecodes::_monitorenter:      do_monitorenter(itr->bci()); break;
1614     case Bytecodes::_monitorexit:       do_monitorexit(itr->bci()); break;
1615 
1616     case Bytecodes::_athrow:            // handled by do_exception_edge() BUT ...
1617                                         // vlh(apple): do_exception_edge() does not get
1618                                         // called if method has no exception handlers
1619                                         if ((!_has_exceptions) && (_monitor_top > 0)) {
1620                                           _monitor_safe = false;
1621                                         }
1622                                         break;
1623 
1624     case Bytecodes::_areturn:           do_return_monitor_check();
1625                                         ppop1(refCTS);
1626                                         break;
1627 
1628     case Bytecodes::_ifnull:
1629     case Bytecodes::_ifnonnull:         ppop1(refCTS); break;
1630     case Bytecodes::_multianewarray:    do_multianewarray(*(itr->bcp()+3), itr->bci()); break;
1631 
1632     case Bytecodes::_wide:              fatal("Iterator should skip this bytecode"); break;
1633     case Bytecodes::_ret:                                           break;
1634 
1635     // Java opcodes
1636     case Bytecodes::_lookupswitch:      ppop1(valCTS);             break;
1637 
1638     default:
1639          tty->print("unexpected opcode: %d\n", itr->code());
1640          ShouldNotReachHere();
1641     break;
1642   }
1643 }
1644 
1645 void GenerateOopMap::check_type(CellTypeState expected, CellTypeState actual) {
1646   if (!expected.equal_kind(actual)) {
1647     verify_error("wrong type on stack (found: %c expected: %c)", actual.to_char(), expected.to_char());

1714   while (push_ch != '\0') {
1715     int idx = push_ch - '1';
1716     assert(idx >= 0 && idx < poplen, "wrong arguments");
1717     push(actual[idx]);
1718     push_ch = *out++;
1719   }
1720 }
1721 
1722 void GenerateOopMap::ppop1(CellTypeState out) {
1723   CellTypeState actual = pop();
1724   check_type(out, actual);
1725 }
1726 
1727 void GenerateOopMap::ppop(CellTypeState *out) {
1728   while (!(*out).is_bottom()) {
1729     ppop1(*out++);
1730   }
1731 }
1732 
1733 void GenerateOopMap::ppush1(CellTypeState in) {
1734   assert(in.is_reference() || in.is_inline_type(), "sanity check");
1735   push(in);
1736 }
1737 
1738 void GenerateOopMap::ppush(CellTypeState *in) {
1739   while (!(*in).is_bottom()) {
1740     ppush1(*in++);
1741   }
1742 }
1743 
1744 void GenerateOopMap::pp(CellTypeState *in, CellTypeState *out) {
1745   ppop(in);
1746   ppush(out);
1747 }
1748 
1749 void GenerateOopMap::pp_new_ref(CellTypeState *in, int bci) {
1750   ppop(in);
1751   ppush1(CellTypeState::make_line_ref(bci));
1752 }
1753 
1754 void GenerateOopMap::ppop_any(int poplen) {

1933 void GenerateOopMap::do_field(int is_get, int is_static, int idx, int bci) {
1934   // Dig up signature for field in constant pool
1935   ConstantPool* cp     = method()->constants();
1936   int nameAndTypeIdx     = cp->name_and_type_ref_index_at(idx);
1937   int signatureIdx       = cp->signature_ref_index_at(nameAndTypeIdx);
1938   Symbol* signature      = cp->symbol_at(signatureIdx);
1939 
1940   CellTypeState temp[4];
1941   CellTypeState *eff  = signature_to_effect(signature, bci, temp);
1942 
1943   CellTypeState in[4];
1944   CellTypeState *out;
1945   int i =  0;
1946 
1947   if (is_get) {
1948     out = eff;
1949   } else {
1950     out = epsilonCTS;
1951     i   = copy_cts(in, eff);
1952   }
1953   if (!is_static) {
1954     in[i++] = CellTypeState::ref;
1955   }
1956   in[i] = CellTypeState::bottom;
1957   assert(i<=3, "sanity check");
1958   pp(in, out);
1959 }
1960 
1961 void GenerateOopMap::do_method(int is_static, int idx, int bci) {
1962  // Dig up signature for field in constant pool
1963   ConstantPool* cp  = _method->constants();
1964   Symbol* signature   = cp->signature_ref_at(idx);
1965 
1966   // Parse method signature
1967   CellTypeState out[4];
1968   CellTypeState in[MAXARGSIZE+1];   // Includes result
1969   ComputeCallStack cse(signature);
1970 
1971   // Compute return type
1972   int res_length=  cse.compute_for_returntype(out);
1973 
1974   // Temporary hack.
1975   if (out[0].equal(CellTypeState::ref) && out[1].equal(CellTypeState::bottom)) {
1976     out[0] = CellTypeState::make_line_ref(bci);
1977   }
1978 
1979   assert(res_length<=4, "max value should be vv");
1980 
1981   // Compute arguments
1982   int arg_length = cse.compute_for_parameters(is_static != 0, in);
1983   assert(arg_length<=MAXARGSIZE, "too many locals");
1984 
1985   // Pop arguments
1986   for (int i = arg_length - 1; i >= 0; i--) ppop1(in[i]);// Do args in reverse order.
1987 
1988   // Report results
1989   if (_report_result_for_send == true) {
1990      fill_stackmap_for_opcodes(_itr_send, vars(), stack(), _stack_top);
1991      _report_result_for_send = false;
1992   }
1993 
1994   // Push return address
1995   ppush(out);
1996 }
1997 
1998 void GenerateOopMap::do_withfield(int idx, int bci) {
1999   // Dig up signature for field in constant pool
2000   ConstantPool* cp = method()->constants();
2001   int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx);
2002   int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx);
2003   Symbol* signature = cp->symbol_at(signatureIdx);
2004 
2005   // Parse signature (especially simple for fields)
2006   assert(signature->utf8_length() > 0,
2007       "field signatures cannot have zero length");
2008   // The signature is UFT8 encoded, but the first char is always ASCII for signatures.
2009   CellTypeState temp[4];
2010   CellTypeState *eff = signature_to_effect(signature, bci, temp);
2011 
2012   CellTypeState in[4];
2013   int i = copy_cts(in, eff);
2014   in[i++] = CellTypeState::ref;
2015   in[i] = CellTypeState::bottom;
2016   assert(i <= 3, "sanity check");
2017 
2018   CellTypeState out[2];
2019   out[0] = CellTypeState::ref;
2020   out[1] = CellTypeState::bottom;
2021 
2022   pp(in, out);
2023 }
2024 
2025 // This is used to parse the signature for fields, since they are very simple...
2026 CellTypeState *GenerateOopMap::signature_to_effect(const Symbol* sig, int bci, CellTypeState *out) {
2027   // Object and array
2028   BasicType bt = Signature::basic_type(sig);
2029   if (is_reference_type(bt)) {
2030     out[0] = CellTypeState::make_line_ref(bci);
2031     out[1] = CellTypeState::bottom;
2032     return out;
2033   }
2034   if (is_double_word_type(bt)) return vvCTS; // Long and Double
2035   if (bt == T_VOID) return epsilonCTS;       // Void
2036   return vCTS;                               // Otherwise
2037 }
2038 
2039 uint64_t GenerateOopMap::_total_byte_count = 0;
2040 elapsedTimer GenerateOopMap::_total_oopmap_time;
2041 
2042 // This function assumes "bcs" is at a "ret" instruction and that the vars
2043 // state is valid for that instruction. Furthermore, the ret instruction
2044 // must be the last instruction in "bb" (we store information about the
< prev index next >