Mercurial > hg > graal-jvmci-8
comparison src/share/vm/oops/generateOopMap.cpp @ 6725:da91efe96a93
6964458: Reimplement class meta-data storage to use native memory
Summary: Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
Contributed-by: jmasa <jon.masamitsu@oracle.com>, stefank <stefan.karlsson@oracle.com>, mgerdin <mikael.gerdin@oracle.com>, never <tom.rodriguez@oracle.com>
author | coleenp |
---|---|
date | Sat, 01 Sep 2012 13:25:18 -0400 |
parents | 1d7922586cf6 |
children | f16e75e0cf11 |
comparison
equal
deleted
inserted
replaced
6724:36d1d483d5d6 | 6725:da91efe96a93 |
---|---|
1270 case Bytecodes::_invokespecial: | 1270 case Bytecodes::_invokespecial: |
1271 case Bytecodes::_invokestatic: | 1271 case Bytecodes::_invokestatic: |
1272 case Bytecodes::_invokedynamic: | 1272 case Bytecodes::_invokedynamic: |
1273 case Bytecodes::_invokeinterface: | 1273 case Bytecodes::_invokeinterface: |
1274 int idx = currentBC->has_index_u4() ? currentBC->get_index_u4() : currentBC->get_index_u2_cpcache(); | 1274 int idx = currentBC->has_index_u4() ? currentBC->get_index_u4() : currentBC->get_index_u2_cpcache(); |
1275 constantPoolOop cp = method()->constants(); | 1275 ConstantPool* cp = method()->constants(); |
1276 int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx); | 1276 int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx); |
1277 int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx); | 1277 int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx); |
1278 Symbol* signature = cp->symbol_at(signatureIdx); | 1278 Symbol* signature = cp->symbol_at(signatureIdx); |
1279 os->print("%s", signature->as_C_string()); | 1279 os->print("%s", signature->as_C_string()); |
1280 } | 1280 } |
1302 case Bytecodes::_invokespecial: | 1302 case Bytecodes::_invokespecial: |
1303 case Bytecodes::_invokestatic: | 1303 case Bytecodes::_invokestatic: |
1304 case Bytecodes::_invokedynamic: | 1304 case Bytecodes::_invokedynamic: |
1305 case Bytecodes::_invokeinterface: | 1305 case Bytecodes::_invokeinterface: |
1306 int idx = currentBC->has_index_u4() ? currentBC->get_index_u4() : currentBC->get_index_u2_cpcache(); | 1306 int idx = currentBC->has_index_u4() ? currentBC->get_index_u4() : currentBC->get_index_u2_cpcache(); |
1307 constantPoolOop cp = method()->constants(); | 1307 ConstantPool* cp = method()->constants(); |
1308 int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx); | 1308 int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx); |
1309 int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx); | 1309 int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx); |
1310 Symbol* signature = cp->symbol_at(signatureIdx); | 1310 Symbol* signature = cp->symbol_at(signatureIdx); |
1311 os->print("%s", signature->as_C_string()); | 1311 os->print("%s", signature->as_C_string()); |
1312 } | 1312 } |
1844 | 1844 |
1845 | 1845 |
1846 | 1846 |
1847 void GenerateOopMap::do_ldc(int bci) { | 1847 void GenerateOopMap::do_ldc(int bci) { |
1848 Bytecode_loadconstant ldc(method(), bci); | 1848 Bytecode_loadconstant ldc(method(), bci); |
1849 constantPoolOop cp = method()->constants(); | 1849 ConstantPool* cp = method()->constants(); |
1850 constantTag tag = cp->tag_at(ldc.pool_index()); // idx is index in resolved_references | |
1850 BasicType bt = ldc.result_type(); | 1851 BasicType bt = ldc.result_type(); |
1851 CellTypeState cts = (bt == T_OBJECT) ? CellTypeState::make_line_ref(bci) : valCTS; | 1852 CellTypeState cts; |
1852 // Make sure bt==T_OBJECT is the same as old code (is_pointer_entry). | 1853 if (tag.is_klass() || |
1853 // Note that CONSTANT_MethodHandle entries are u2 index pairs, not pointer-entries, | 1854 tag.is_unresolved_klass() || |
1854 // and they are processed by _fast_aldc and the CP cache. | 1855 tag.is_string() || |
1855 assert((ldc.has_cache_index() || cp->is_object_entry(ldc.pool_index())) | 1856 tag.is_object() || |
1856 ? (bt == T_OBJECT) : true, "expected object type"); | 1857 tag.is_method_handle() || |
1858 tag.is_method_type()) { | |
1859 assert(bt == T_OBJECT, "Guard is incorrect"); | |
1860 cts = CellTypeState::make_line_ref(bci); | |
1861 } else { | |
1862 assert(bt != T_OBJECT, "Guard is incorrect"); | |
1863 cts = valCTS; | |
1864 } | |
1857 ppush1(cts); | 1865 ppush1(cts); |
1858 } | 1866 } |
1859 | 1867 |
1860 void GenerateOopMap::do_multianewarray(int dims, int bci) { | 1868 void GenerateOopMap::do_multianewarray(int dims, int bci) { |
1861 assert(dims >= 1, "sanity check"); | 1869 assert(dims >= 1, "sanity check"); |
1887 return idx; | 1895 return idx; |
1888 } | 1896 } |
1889 | 1897 |
1890 void GenerateOopMap::do_field(int is_get, int is_static, int idx, int bci) { | 1898 void GenerateOopMap::do_field(int is_get, int is_static, int idx, int bci) { |
1891 // Dig up signature for field in constant pool | 1899 // Dig up signature for field in constant pool |
1892 constantPoolOop cp = method()->constants(); | 1900 ConstantPool* cp = method()->constants(); |
1893 int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx); | 1901 int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx); |
1894 int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx); | 1902 int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx); |
1895 Symbol* signature = cp->symbol_at(signatureIdx); | 1903 Symbol* signature = cp->symbol_at(signatureIdx); |
1896 | 1904 |
1897 // Parse signature (espcially simple for fields) | 1905 // Parse signature (espcially simple for fields) |
1917 pp(in, out); | 1925 pp(in, out); |
1918 } | 1926 } |
1919 | 1927 |
1920 void GenerateOopMap::do_method(int is_static, int is_interface, int idx, int bci) { | 1928 void GenerateOopMap::do_method(int is_static, int is_interface, int idx, int bci) { |
1921 // Dig up signature for field in constant pool | 1929 // Dig up signature for field in constant pool |
1922 constantPoolOop cp = _method->constants(); | 1930 ConstantPool* cp = _method->constants(); |
1923 Symbol* signature = cp->signature_ref_at(idx); | 1931 Symbol* signature = cp->signature_ref_at(idx); |
1924 | 1932 |
1925 // Parse method signature | 1933 // Parse method signature |
1926 CellTypeState out[4]; | 1934 CellTypeState out[4]; |
1927 CellTypeState in[MAXARGSIZE+1]; // Includes result | 1935 CellTypeState in[MAXARGSIZE+1]; // Includes result |
2300 // during rewriting a new method oop is going to be used, and the next time | 2308 // during rewriting a new method oop is going to be used, and the next time |
2301 // around we want to use that. | 2309 // around we want to use that. |
2302 BytecodeStream bcs(_method); | 2310 BytecodeStream bcs(_method); |
2303 startOver = false; | 2311 startOver = false; |
2304 | 2312 |
2305 while( bcs.next() >=0 && !startOver && !_got_error) { | 2313 while( !startOver && !_got_error && |
2314 // test bcs in case method changed and it became invalid | |
2315 bcs.next() >=0) { | |
2306 startOver = rewrite_refval_conflict_inst(&bcs, from, to); | 2316 startOver = rewrite_refval_conflict_inst(&bcs, from, to); |
2307 } | 2317 } |
2308 } while (startOver && !_got_error); | 2318 } while (startOver && !_got_error); |
2309 } | 2319 } |
2310 | 2320 |
2381 bcp = (address)inst_buffer; | 2391 bcp = (address)inst_buffer; |
2382 } else { | 2392 } else { |
2383 bcp = _method->bcp_from(bcs->bci()); | 2393 bcp = _method->bcp_from(bcs->bci()); |
2384 } | 2394 } |
2385 | 2395 |
2386 // Patch either directly in methodOop or in temp. buffer | 2396 // Patch either directly in Method* or in temp. buffer |
2387 if (newIlen == 1) { | 2397 if (newIlen == 1) { |
2388 assert(varNo < 4, "varNo too large"); | 2398 assert(varNo < 4, "varNo too large"); |
2389 *bcp = bc0 + varNo; | 2399 *bcp = bc0 + varNo; |
2390 } else if (newIlen == 2) { | 2400 } else if (newIlen == 2) { |
2391 assert(varNo < 256, "2-byte index needed!"); | 2401 assert(varNo < 256, "2-byte index needed!"); |