1588 case Bytecodes::_if_icmpgt: 1589 case Bytecodes::_if_icmple: ppop(vvCTS); 1590 break; 1591 1592 case Bytecodes::_lreturn: do_return_monitor_check(); 1593 ppop(vvCTS); 1594 break; 1595 1596 case Bytecodes::_dreturn: do_return_monitor_check(); 1597 ppop(vvCTS); 1598 break; 1599 1600 case Bytecodes::_if_acmpeq: 1601 case Bytecodes::_if_acmpne: ppop(rrCTS); break; 1602 1603 case Bytecodes::_jsr: do_jsr(itr->dest()); break; 1604 case Bytecodes::_jsr_w: do_jsr(itr->dest_w()); break; 1605 1606 1607 1608 case Bytecodes::_getstatic: do_field(true, true, false, itr->get_index_u2_cpcache(), itr->bci()); break; 1609 case Bytecodes::_putstatic: do_field(false, true, false, itr->get_index_u2_cpcache(), itr->bci()); break; 1610 case Bytecodes::_getfield: do_field(true, false, false, itr->get_index_u2_cpcache(), itr->bci()); break; 1611 case Bytecodes::_putfield: do_field(false, false, false, itr->get_index_u2_cpcache(), itr->bci()); break; 1612 case Bytecodes::_vgetfield: do_field(true, false, true , itr->get_index_u2_cpcache(), itr->bci()); break; 1613 1614 case Bytecodes::_invokeinterface: 1615 case Bytecodes::_invokevirtual: 1616 case Bytecodes::_invokespecial: do_method(false, itr->get_index_u2_cpcache(), itr->bci()); break; 1617 case Bytecodes::_invokestatic: do_method(true , itr->get_index_u2_cpcache(), itr->bci()); break; 1618 case Bytecodes::_invokedynamic: do_method(true , itr->get_index_u4(), itr->bci()); break; 1619 case Bytecodes::_newarray: 1620 case Bytecodes::_anewarray: pp_new_ref(vCTS, itr->bci()); break; 1621 case Bytecodes::_checkcast: do_checkcast(); break; 1622 case Bytecodes::_arraylength: 1623 case Bytecodes::_instanceof: pp(rCTS, vCTS); break; 1624 case Bytecodes::_monitorenter: do_monitorenter(itr->bci()); break; 1625 case Bytecodes::_monitorexit: do_monitorexit(itr->bci()); break; 1626 1627 case Bytecodes::_athrow: // handled by do_exception_edge() BUT ... 1628 // vlh(apple): do_exception_edge() does not get 1629 // called if method has no exception handlers 1630 if ((!_has_exceptions) && (_monitor_top > 0)) { 1631 _monitor_safe = false; 1632 } 1946 void GenerateOopMap::do_vstore(int idx) { 1947 CellTypeState q = pop(); 1948 if (!q.is_valuetype()) { 1949 verify_error("wrong type on stack (found: %c, expected: {q})", q.to_char()); 1950 return; 1951 } 1952 set_var(idx, q); 1953 } 1954 1955 // Copies bottom/zero terminated CTS string from "src" into "dst". 1956 // Does NOT terminate with a bottom. Returns the number of cells copied. 1957 int GenerateOopMap::copy_cts(CellTypeState *dst, CellTypeState *src) { 1958 int idx = 0; 1959 while (!src[idx].is_bottom()) { 1960 dst[idx] = src[idx]; 1961 idx++; 1962 } 1963 return idx; 1964 } 1965 1966 void GenerateOopMap::do_field(int is_get, int is_static, int is_valuetype, int idx, int bci) { 1967 assert(!(!is_get && is_valuetype), "Invalid configuration: vputfield doesn't exist"); 1968 // Dig up signature for field in constant pool 1969 ConstantPool* cp = method()->constants(); 1970 int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx); 1971 int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx); 1972 Symbol* signature = cp->symbol_at(signatureIdx); 1973 1974 // Parse signature (espcially simple for fields) 1975 assert(signature->utf8_length() > 0, "field signatures cannot have zero length"); 1976 // The signature is UFT8 encoded, but the first char is always ASCII for signatures. 1977 char sigch = (char)*(signature->base()); 1978 CellTypeState temp[4]; 1979 CellTypeState *eff = sigchar_to_effect(sigch, bci, temp); 1980 1981 CellTypeState in[4]; 1982 CellTypeState *out; 1983 int i = 0; 1984 1985 if (is_get) { 1986 out = eff; 1987 } else { 1988 out = epsilonCTS; 1989 i = copy_cts(in, eff); 1990 } 1991 if (!is_static) { 1992 if (is_valuetype) { 1993 in[i++] = CellTypeState::valuetype; 1994 } else { 1995 in[i++] = CellTypeState::ref; 1996 } 1997 } 1998 in[i] = CellTypeState::bottom; 1999 assert(i<=3, "sanity check"); 2000 pp(in, out); 2001 } 2002 2003 void GenerateOopMap::do_method(int is_static, int idx, int bci) { 2004 // Dig up signature for field in constant pool 2005 ConstantPool* cp = _method->constants(); 2006 Symbol* signature = cp->signature_ref_at(idx); 2007 2008 // Parse method signature 2009 CellTypeState out[4]; 2010 CellTypeState in[MAXARGSIZE+1]; // Includes result 2011 ComputeCallStack cse(signature); 2012 2013 // Compute return type 2014 int res_length= cse.compute_for_returntype(out); 2015 2016 // Temporary hack. | 1588 case Bytecodes::_if_icmpgt: 1589 case Bytecodes::_if_icmple: ppop(vvCTS); 1590 break; 1591 1592 case Bytecodes::_lreturn: do_return_monitor_check(); 1593 ppop(vvCTS); 1594 break; 1595 1596 case Bytecodes::_dreturn: do_return_monitor_check(); 1597 ppop(vvCTS); 1598 break; 1599 1600 case Bytecodes::_if_acmpeq: 1601 case Bytecodes::_if_acmpne: ppop(rrCTS); break; 1602 1603 case Bytecodes::_jsr: do_jsr(itr->dest()); break; 1604 case Bytecodes::_jsr_w: do_jsr(itr->dest_w()); break; 1605 1606 1607 1608 case Bytecodes::_getstatic: do_field(true, true, itr->get_index_u2_cpcache(), itr->bci()); break; 1609 case Bytecodes::_putstatic: do_field(false, true, itr->get_index_u2_cpcache(), itr->bci()); break; 1610 case Bytecodes::_getfield: do_field(true, false, itr->get_index_u2_cpcache(), itr->bci()); break; 1611 case Bytecodes::_putfield: do_field(false, false, itr->get_index_u2_cpcache(), itr->bci()); break; 1612 1613 case Bytecodes::_invokeinterface: 1614 case Bytecodes::_invokevirtual: 1615 case Bytecodes::_invokespecial: do_method(false, itr->get_index_u2_cpcache(), itr->bci()); break; 1616 case Bytecodes::_invokestatic: do_method(true , itr->get_index_u2_cpcache(), itr->bci()); break; 1617 case Bytecodes::_invokedynamic: do_method(true , itr->get_index_u4(), itr->bci()); break; 1618 case Bytecodes::_newarray: 1619 case Bytecodes::_anewarray: pp_new_ref(vCTS, itr->bci()); break; 1620 case Bytecodes::_checkcast: do_checkcast(); break; 1621 case Bytecodes::_arraylength: 1622 case Bytecodes::_instanceof: pp(rCTS, vCTS); break; 1623 case Bytecodes::_monitorenter: do_monitorenter(itr->bci()); break; 1624 case Bytecodes::_monitorexit: do_monitorexit(itr->bci()); break; 1625 1626 case Bytecodes::_athrow: // handled by do_exception_edge() BUT ... 1627 // vlh(apple): do_exception_edge() does not get 1628 // called if method has no exception handlers 1629 if ((!_has_exceptions) && (_monitor_top > 0)) { 1630 _monitor_safe = false; 1631 } 1945 void GenerateOopMap::do_vstore(int idx) { 1946 CellTypeState q = pop(); 1947 if (!q.is_valuetype()) { 1948 verify_error("wrong type on stack (found: %c, expected: {q})", q.to_char()); 1949 return; 1950 } 1951 set_var(idx, q); 1952 } 1953 1954 // Copies bottom/zero terminated CTS string from "src" into "dst". 1955 // Does NOT terminate with a bottom. Returns the number of cells copied. 1956 int GenerateOopMap::copy_cts(CellTypeState *dst, CellTypeState *src) { 1957 int idx = 0; 1958 while (!src[idx].is_bottom()) { 1959 dst[idx] = src[idx]; 1960 idx++; 1961 } 1962 return idx; 1963 } 1964 1965 void GenerateOopMap::do_field(int is_get, int is_static, int idx, int bci) { 1966 // Dig up signature for field in constant pool 1967 ConstantPool* cp = method()->constants(); 1968 int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx); 1969 int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx); 1970 Symbol* signature = cp->symbol_at(signatureIdx); 1971 1972 // Parse signature (espcially simple for fields) 1973 assert(signature->utf8_length() > 0, "field signatures cannot have zero length"); 1974 // The signature is UFT8 encoded, but the first char is always ASCII for signatures. 1975 char sigch = (char)*(signature->base()); 1976 CellTypeState temp[4]; 1977 CellTypeState *eff = sigchar_to_effect(sigch, bci, temp); 1978 1979 CellTypeState in[4]; 1980 CellTypeState *out; 1981 int i = 0; 1982 1983 if (is_get) { 1984 out = eff; 1985 } else { 1986 out = epsilonCTS; 1987 i = copy_cts(in, eff); 1988 } 1989 if (!is_static) { 1990 in[i++] = CellTypeState::refOrValueType; 1991 } 1992 in[i] = CellTypeState::bottom; 1993 assert(i<=3, "sanity check"); 1994 pp(in, out); 1995 } 1996 1997 void GenerateOopMap::do_method(int is_static, int idx, int bci) { 1998 // Dig up signature for field in constant pool 1999 ConstantPool* cp = _method->constants(); 2000 Symbol* signature = cp->signature_ref_at(idx); 2001 2002 // Parse method signature 2003 CellTypeState out[4]; 2004 CellTypeState in[MAXARGSIZE+1]; // Includes result 2005 ComputeCallStack cse(signature); 2006 2007 // Compute return type 2008 int res_length= cse.compute_for_returntype(out); 2009 2010 // Temporary hack. |