1374 break; 1375 default: 1376 fill_stackmap_for_opcodes(itr, vars(), stack(), _stack_top); 1377 break; 1378 } 1379 } 1380 1381 // abstract interpretation of current opcode 1382 switch(itr->code()) { 1383 case Bytecodes::_nop: break; 1384 case Bytecodes::_goto: break; 1385 case Bytecodes::_goto_w: break; 1386 case Bytecodes::_iinc: break; 1387 case Bytecodes::_return: do_return_monitor_check(); 1388 break; 1389 1390 case Bytecodes::_aconst_null: 1391 case Bytecodes::_new: ppush1(CellTypeState::make_line_ref(itr->bci())); 1392 break; 1393 1394 case Bytecodes::_vnew: 1395 case Bytecodes::_vdefault: 1396 case Bytecodes::_vwithfield: ppush1(CellTypeState::make_line_valuetype(itr->bci())); 1397 break; 1398 1399 case Bytecodes::_iconst_m1: 1400 case Bytecodes::_iconst_0: 1401 case Bytecodes::_iconst_1: 1402 case Bytecodes::_iconst_2: 1403 case Bytecodes::_iconst_3: 1404 case Bytecodes::_iconst_4: 1405 case Bytecodes::_iconst_5: 1406 case Bytecodes::_fconst_0: 1407 case Bytecodes::_fconst_1: 1408 case Bytecodes::_fconst_2: 1409 case Bytecodes::_bipush: 1410 case Bytecodes::_sipush: ppush1(valCTS); break; 1411 1412 case Bytecodes::_lconst_0: 1413 case Bytecodes::_lconst_1: 1414 case Bytecodes::_dconst_0: 1415 case Bytecodes::_dconst_1: ppush(vvCTS); break; 1416 1417 case Bytecodes::_ldc2_w: ppush(vvCTS); break; 2019 out[0] = CellTypeState::make_line_ref(bci); 2020 } 2021 2022 assert(res_length<=4, "max value should be vv"); 2023 2024 // Compute arguments 2025 int arg_length = cse.compute_for_parameters(is_static != 0, is_direct != 0, in); 2026 assert(arg_length<=MAXARGSIZE, "too many locals"); 2027 2028 // Pop arguments 2029 for (int i = arg_length - 1; i >= 0; i--) ppop1(in[i]);// Do args in reverse order. 2030 2031 // Report results 2032 if (_report_result_for_send == true) { 2033 fill_stackmap_for_opcodes(_itr_send, vars(), stack(), _stack_top); 2034 _report_result_for_send = false; 2035 } 2036 2037 // Push return address 2038 ppush(out); 2039 } 2040 2041 // This is used to parse the signature for fields, since they are very simple... 2042 CellTypeState *GenerateOopMap::sigchar_to_effect(char sigch, int bci, CellTypeState *out) { 2043 // Object and array 2044 if (sigch=='L' || sigch=='[') { 2045 out[0] = CellTypeState::make_line_ref(bci); 2046 out[1] = CellTypeState::bottom; 2047 return out; 2048 } 2049 if (sigch == 'Q') { 2050 out[0] = CellTypeState::make_line_valuetype(bci); 2051 out[1] = CellTypeState::bottom; 2052 return out; 2053 } 2054 if (sigch == 'J' || sigch == 'D' ) return vvCTS; // Long and Double 2055 if (sigch == 'V' ) return epsilonCTS; // Void 2056 return vCTS; // Otherwise 2057 } 2058 | 1374 break; 1375 default: 1376 fill_stackmap_for_opcodes(itr, vars(), stack(), _stack_top); 1377 break; 1378 } 1379 } 1380 1381 // abstract interpretation of current opcode 1382 switch(itr->code()) { 1383 case Bytecodes::_nop: break; 1384 case Bytecodes::_goto: break; 1385 case Bytecodes::_goto_w: break; 1386 case Bytecodes::_iinc: break; 1387 case Bytecodes::_return: do_return_monitor_check(); 1388 break; 1389 1390 case Bytecodes::_aconst_null: 1391 case Bytecodes::_new: ppush1(CellTypeState::make_line_ref(itr->bci())); 1392 break; 1393 1394 case Bytecodes::_vdefault: ppush1(CellTypeState::make_line_valuetype(itr->bci())); break; 1395 case Bytecodes::_vnew: do_vnew(itr->get_index_u2(), itr->bci()); break; 1396 case Bytecodes::_vwithfield: do_vwithfield(itr->get_index_u2_cpcache(), itr->bci()); break; 1397 1398 case Bytecodes::_iconst_m1: 1399 case Bytecodes::_iconst_0: 1400 case Bytecodes::_iconst_1: 1401 case Bytecodes::_iconst_2: 1402 case Bytecodes::_iconst_3: 1403 case Bytecodes::_iconst_4: 1404 case Bytecodes::_iconst_5: 1405 case Bytecodes::_fconst_0: 1406 case Bytecodes::_fconst_1: 1407 case Bytecodes::_fconst_2: 1408 case Bytecodes::_bipush: 1409 case Bytecodes::_sipush: ppush1(valCTS); break; 1410 1411 case Bytecodes::_lconst_0: 1412 case Bytecodes::_lconst_1: 1413 case Bytecodes::_dconst_0: 1414 case Bytecodes::_dconst_1: ppush(vvCTS); break; 1415 1416 case Bytecodes::_ldc2_w: ppush(vvCTS); break; 2018 out[0] = CellTypeState::make_line_ref(bci); 2019 } 2020 2021 assert(res_length<=4, "max value should be vv"); 2022 2023 // Compute arguments 2024 int arg_length = cse.compute_for_parameters(is_static != 0, is_direct != 0, in); 2025 assert(arg_length<=MAXARGSIZE, "too many locals"); 2026 2027 // Pop arguments 2028 for (int i = arg_length - 1; i >= 0; i--) ppop1(in[i]);// Do args in reverse order. 2029 2030 // Report results 2031 if (_report_result_for_send == true) { 2032 fill_stackmap_for_opcodes(_itr_send, vars(), stack(), _stack_top); 2033 _report_result_for_send = false; 2034 } 2035 2036 // Push return address 2037 ppush(out); 2038 } 2039 2040 void GenerateOopMap::do_vnew(int idx, int bci) { 2041 // Dig up signature for field in constant pool 2042 ConstantPool* cp = _method->constants(); 2043 int method_index = cp->uncached_name_and_type_ref_index_at(idx); 2044 Symbol* signature = cp->uncached_signature_ref_at(idx); 2045 2046 CellTypeState in[MAXARGSIZE+1]; // Includes result 2047 ComputeCallStack cse(signature); 2048 2049 // Compute arguments 2050 int arg_length = cse.compute_for_parameters(true, false, in); 2051 assert(arg_length<=MAXARGSIZE, "too many locals"); 2052 2053 // Pop arguments 2054 for (int i = arg_length - 1; i >= 0; i--) ppop1(in[i]);// Do args in reverse order. 2055 2056 CellTypeState out[2]; 2057 out[0] = CellTypeState::valuetype; 2058 out[1] = CellTypeState::bottom; 2059 2060 ppush(out); 2061 } 2062 2063 void GenerateOopMap::do_vwithfield(int idx, int bci) { 2064 // Dig up signature for field in constant pool 2065 ConstantPool* cp = method()->constants(); 2066 int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx); 2067 int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx); 2068 Symbol* signature = cp->symbol_at(signatureIdx); 2069 2070 // Parse signature (especially simple for fields) 2071 assert(signature->utf8_length() > 0, 2072 "field signatures cannot have zero length"); 2073 // The signature is UFT8 encoded, but the first char is always ASCII for signatures. 2074 char sigch = (char) *(signature->base()); 2075 CellTypeState temp[4]; 2076 CellTypeState *eff = sigchar_to_effect(sigch, bci, temp); 2077 2078 CellTypeState in[4]; 2079 int i = copy_cts(in, eff); 2080 in[i++] = CellTypeState::valuetype; 2081 in[i] = CellTypeState::bottom; 2082 assert(i <= 3, "sanity check"); 2083 2084 CellTypeState out[2]; 2085 out[0] = CellTypeState::valuetype; 2086 out[1] = CellTypeState::bottom; 2087 2088 pp(in, out); 2089 } 2090 2091 // This is used to parse the signature for fields, since they are very simple... 2092 CellTypeState *GenerateOopMap::sigchar_to_effect(char sigch, int bci, CellTypeState *out) { 2093 // Object and array 2094 if (sigch=='L' || sigch=='[') { 2095 out[0] = CellTypeState::make_line_ref(bci); 2096 out[1] = CellTypeState::bottom; 2097 return out; 2098 } 2099 if (sigch == 'Q') { 2100 out[0] = CellTypeState::make_line_valuetype(bci); 2101 out[1] = CellTypeState::bottom; 2102 return out; 2103 } 2104 if (sigch == 'J' || sigch == 'D' ) return vvCTS; // Long and Double 2105 if (sigch == 'V' ) return epsilonCTS; // Void 2106 return vCTS; // Otherwise 2107 } 2108 |