121 set(CellTypeState::bottom);
122 } else if (is_reference_type(type)) {
123 set(CellTypeState::ref);
124 } else {
125 assert(is_java_primitive(type), "");
126 set(CellTypeState::value);
127 if (is_double_word_type(type)) {
128 set(CellTypeState::value);
129 }
130 }
131 }
132
133 public:
134 ComputeCallStack(Symbol* signature) : SignatureIterator(signature) {};
135
136 // Compute methods
137 int compute_for_parameters(bool is_static, CellTypeState *effect) {
138 _idx = 0;
139 _effect = effect;
140
141 if (!is_static)
142 effect[_idx++] = CellTypeState::ref;
143
144 do_parameters_on(this);
145
146 return length();
147 };
148
149 int compute_for_returntype(CellTypeState *effect) {
150 _idx = 0;
151 _effect = effect;
152 do_type(return_type(), true);
153 set(CellTypeState::bottom); // Always terminate with a bottom state, so ppush works
154
155 return length();
156 }
157 };
158
159 //=========================================================================================
160 // ComputeEntryStack
161 //
162 // Specialization of SignatureIterator - in order to set up first stack frame
1581
1582 case Bytecodes::_lreturn: do_return_monitor_check();
1583 ppop(vvCTS);
1584 break;
1585
1586 case Bytecodes::_dreturn: do_return_monitor_check();
1587 ppop(vvCTS);
1588 break;
1589
1590 case Bytecodes::_if_acmpeq:
1591 case Bytecodes::_if_acmpne: ppop(rrCTS); break;
1592
1593 case Bytecodes::_jsr: do_jsr(itr->dest()); break;
1594 case Bytecodes::_jsr_w: do_jsr(itr->dest_w()); break;
1595
1596 case Bytecodes::_getstatic: do_field(true, true, itr->get_index_u2(), itr->bci(), itr->code()); break;
1597 case Bytecodes::_putstatic: do_field(false, true, itr->get_index_u2(), itr->bci(), itr->code()); break;
1598 case Bytecodes::_getfield: do_field(true, false, itr->get_index_u2(), itr->bci(), itr->code()); break;
1599 case Bytecodes::_putfield: do_field(false, false, itr->get_index_u2(), itr->bci(), itr->code()); break;
1600
1601 case Bytecodes::_invokevirtual:
1602 case Bytecodes::_invokespecial: do_method(false, false, itr->get_index_u2(), itr->bci(), itr->code()); break;
1603 case Bytecodes::_invokestatic: do_method(true, false, itr->get_index_u2(), itr->bci(), itr->code()); break;
1604 case Bytecodes::_invokedynamic: do_method(true, false, itr->get_index_u4(), itr->bci(), itr->code()); break;
1605 case Bytecodes::_invokeinterface: do_method(false, true, itr->get_index_u2(), itr->bci(), itr->code()); break;
1606 case Bytecodes::_newarray:
1607 case Bytecodes::_anewarray: pp_new_ref(vCTS, itr->bci()); break;
1608 case Bytecodes::_checkcast: do_checkcast(); break;
1609 case Bytecodes::_arraylength:
1610 case Bytecodes::_instanceof: pp(rCTS, vCTS); break;
1611 case Bytecodes::_monitorenter: do_monitorenter(itr->bci()); break;
1612 case Bytecodes::_monitorexit: do_monitorexit(itr->bci()); break;
1613
1614 case Bytecodes::_athrow: // handled by do_exception_edge() BUT ...
1615 // vlh(apple): do_exception_edge() does not get
1616 // called if method has no exception handlers
1617 if ((!_has_exceptions) && (_monitor_top > 0)) {
1618 _monitor_safe = false;
1619 }
1620 break;
1621
1622 case Bytecodes::_areturn: do_return_monitor_check();
1623 ppop1(refCTS);
1624 break;
1625 case Bytecodes::_ifnull:
1930 void GenerateOopMap::do_field(int is_get, int is_static, int idx, int bci, Bytecodes::Code bc) {
1931 // Dig up signature for field in constant pool
1932 ConstantPool* cp = method()->constants();
1933 int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx, bc);
1934 int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx);
1935 Symbol* signature = cp->symbol_at(signatureIdx);
1936
1937 CellTypeState temp[4];
1938 CellTypeState *eff = signature_to_effect(signature, bci, temp);
1939
1940 CellTypeState in[4];
1941 CellTypeState *out;
1942 int i = 0;
1943
1944 if (is_get) {
1945 out = eff;
1946 } else {
1947 out = epsilonCTS;
1948 i = copy_cts(in, eff);
1949 }
1950 if (!is_static) in[i++] = CellTypeState::ref;
1951 in[i] = CellTypeState::bottom;
1952 assert(i<=3, "sanity check");
1953 pp(in, out);
1954 }
1955
1956 void GenerateOopMap::do_method(int is_static, int is_interface, int idx, int bci, Bytecodes::Code bc) {
1957 // Dig up signature for field in constant pool
1958 ConstantPool* cp = _method->constants();
1959 Symbol* signature = cp->signature_ref_at(idx, bc);
1960
1961 // Parse method signature
1962 CellTypeState out[4];
1963 CellTypeState in[MAXARGSIZE+1]; // Includes result
1964 ComputeCallStack cse(signature);
1965
1966 // Compute return type
1967 int res_length= cse.compute_for_returntype(out);
1968
1969 // Temporary hack.
1970 if (out[0].equal(CellTypeState::ref) && out[1].equal(CellTypeState::bottom)) {
1971 out[0] = CellTypeState::make_line_ref(bci);
1972 }
1973
1974 assert(res_length<=4, "max value should be vv");
1975
1976 // Compute arguments
|
121 set(CellTypeState::bottom);
122 } else if (is_reference_type(type)) {
123 set(CellTypeState::ref);
124 } else {
125 assert(is_java_primitive(type), "");
126 set(CellTypeState::value);
127 if (is_double_word_type(type)) {
128 set(CellTypeState::value);
129 }
130 }
131 }
132
133 public:
134 ComputeCallStack(Symbol* signature) : SignatureIterator(signature) {};
135
136 // Compute methods
137 int compute_for_parameters(bool is_static, CellTypeState *effect) {
138 _idx = 0;
139 _effect = effect;
140
141 if (!is_static) {
142 effect[_idx++] = CellTypeState::ref;
143 }
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
1582
1583 case Bytecodes::_lreturn: do_return_monitor_check();
1584 ppop(vvCTS);
1585 break;
1586
1587 case Bytecodes::_dreturn: do_return_monitor_check();
1588 ppop(vvCTS);
1589 break;
1590
1591 case Bytecodes::_if_acmpeq:
1592 case Bytecodes::_if_acmpne: ppop(rrCTS); break;
1593
1594 case Bytecodes::_jsr: do_jsr(itr->dest()); break;
1595 case Bytecodes::_jsr_w: do_jsr(itr->dest_w()); break;
1596
1597 case Bytecodes::_getstatic: do_field(true, true, itr->get_index_u2(), itr->bci(), itr->code()); break;
1598 case Bytecodes::_putstatic: do_field(false, true, itr->get_index_u2(), itr->bci(), itr->code()); break;
1599 case Bytecodes::_getfield: do_field(true, false, itr->get_index_u2(), itr->bci(), itr->code()); break;
1600 case Bytecodes::_putfield: do_field(false, false, itr->get_index_u2(), itr->bci(), itr->code()); break;
1601
1602 case Bytecodes::_invokeinterface:
1603 case Bytecodes::_invokevirtual:
1604 case Bytecodes::_invokespecial: do_method(false, itr->get_index_u2(), itr->bci(), itr->code()); break;
1605 case Bytecodes::_invokestatic: do_method(true , itr->get_index_u2(), itr->bci(), itr->code()); break;
1606 case Bytecodes::_invokedynamic: do_method(true , itr->get_index_u4(), itr->bci(), itr->code()); break;
1607 case Bytecodes::_newarray:
1608 case Bytecodes::_anewarray: pp_new_ref(vCTS, itr->bci()); break;
1609 case Bytecodes::_checkcast: do_checkcast(); break;
1610 case Bytecodes::_arraylength:
1611 case Bytecodes::_instanceof: pp(rCTS, vCTS); break;
1612 case Bytecodes::_monitorenter: do_monitorenter(itr->bci()); break;
1613 case Bytecodes::_monitorexit: do_monitorexit(itr->bci()); break;
1614
1615 case Bytecodes::_athrow: // handled by do_exception_edge() BUT ...
1616 // vlh(apple): do_exception_edge() does not get
1617 // called if method has no exception handlers
1618 if ((!_has_exceptions) && (_monitor_top > 0)) {
1619 _monitor_safe = false;
1620 }
1621 break;
1622
1623 case Bytecodes::_areturn: do_return_monitor_check();
1624 ppop1(refCTS);
1625 break;
1626 case Bytecodes::_ifnull:
1931 void GenerateOopMap::do_field(int is_get, int is_static, int idx, int bci, Bytecodes::Code bc) {
1932 // Dig up signature for field in constant pool
1933 ConstantPool* cp = method()->constants();
1934 int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx, bc);
1935 int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx);
1936 Symbol* signature = cp->symbol_at(signatureIdx);
1937
1938 CellTypeState temp[4];
1939 CellTypeState *eff = signature_to_effect(signature, bci, temp);
1940
1941 CellTypeState in[4];
1942 CellTypeState *out;
1943 int i = 0;
1944
1945 if (is_get) {
1946 out = eff;
1947 } else {
1948 out = epsilonCTS;
1949 i = copy_cts(in, eff);
1950 }
1951 if (!is_static) {
1952 in[i++] = CellTypeState::ref;
1953 }
1954 in[i] = CellTypeState::bottom;
1955 assert(i<=3, "sanity check");
1956 pp(in, out);
1957 }
1958
1959 void GenerateOopMap::do_method(int is_static, int idx, int bci, Bytecodes::Code bc) {
1960 // Dig up signature for field in constant pool
1961 ConstantPool* cp = _method->constants();
1962 Symbol* signature = cp->signature_ref_at(idx, bc);
1963
1964 // Parse method signature
1965 CellTypeState out[4];
1966 CellTypeState in[MAXARGSIZE+1]; // Includes result
1967 ComputeCallStack cse(signature);
1968
1969 // Compute return type
1970 int res_length= cse.compute_for_returntype(out);
1971
1972 // Temporary hack.
1973 if (out[0].equal(CellTypeState::ref) && out[1].equal(CellTypeState::bottom)) {
1974 out[0] = CellTypeState::make_line_ref(bci);
1975 }
1976
1977 assert(res_length<=4, "max value should be vv");
1978
1979 // Compute arguments
|