comparison src/share/vm/oops/generateOopMap.cpp @ 1565:ab102d5d923e

6939207: refactor constant pool index processing Summary: Factored cleanup of instruction decode which prepares for enhanced ldc semantics. Reviewed-by: twisti
author jrose
date Sun, 23 May 2010 01:38:26 -0700
parents cff162798819
children e9ff18c4ace7
comparison
equal deleted inserted replaced
1564:61b2245abf36 1565:ab102d5d923e
1 /* 1 /*
2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved. 2 * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
1252 case Bytecodes::_invokevirtual: 1252 case Bytecodes::_invokevirtual:
1253 case Bytecodes::_invokespecial: 1253 case Bytecodes::_invokespecial:
1254 case Bytecodes::_invokestatic: 1254 case Bytecodes::_invokestatic:
1255 case Bytecodes::_invokedynamic: 1255 case Bytecodes::_invokedynamic:
1256 case Bytecodes::_invokeinterface: 1256 case Bytecodes::_invokeinterface:
1257 int idx = currentBC->get_index_int(); 1257 int idx = currentBC->has_index_u4() ? currentBC->get_index_u4() : currentBC->get_index_u2();
1258 constantPoolOop cp = method()->constants(); 1258 constantPoolOop cp = method()->constants();
1259 int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx); 1259 int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx);
1260 int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx); 1260 int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx);
1261 symbolOop signature = cp->symbol_at(signatureIdx); 1261 symbolOop signature = cp->symbol_at(signatureIdx);
1262 os->print("%s", signature->as_C_string()); 1262 os->print("%s", signature->as_C_string());
1284 case Bytecodes::_invokevirtual: 1284 case Bytecodes::_invokevirtual:
1285 case Bytecodes::_invokespecial: 1285 case Bytecodes::_invokespecial:
1286 case Bytecodes::_invokestatic: 1286 case Bytecodes::_invokestatic:
1287 case Bytecodes::_invokedynamic: 1287 case Bytecodes::_invokedynamic:
1288 case Bytecodes::_invokeinterface: 1288 case Bytecodes::_invokeinterface:
1289 int idx = currentBC->get_index_int(); 1289 int idx = currentBC->has_index_u4() ? currentBC->get_index_u4() : currentBC->get_index_u2();
1290 constantPoolOop cp = method()->constants(); 1290 constantPoolOop cp = method()->constants();
1291 int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx); 1291 int nameAndTypeIdx = cp->name_and_type_ref_index_at(idx);
1292 int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx); 1292 int signatureIdx = cp->signature_ref_index_at(nameAndTypeIdx);
1293 symbolOop signature = cp->symbol_at(signatureIdx); 1293 symbolOop signature = cp->symbol_at(signatureIdx);
1294 os->print("%s", signature->as_C_string()); 1294 os->print("%s", signature->as_C_string());
1354 case Bytecodes::_dconst_0: 1354 case Bytecodes::_dconst_0:
1355 case Bytecodes::_dconst_1: ppush(vvCTS); break; 1355 case Bytecodes::_dconst_1: ppush(vvCTS); break;
1356 1356
1357 case Bytecodes::_ldc2_w: ppush(vvCTS); break; 1357 case Bytecodes::_ldc2_w: ppush(vvCTS); break;
1358 1358
1359 case Bytecodes::_ldc: do_ldc(itr->get_index(), itr->bci()); break; 1359 case Bytecodes::_ldc: do_ldc(itr->get_index(), itr->bci()); break;
1360 case Bytecodes::_ldc_w: do_ldc(itr->get_index_big(), itr->bci());break; 1360 case Bytecodes::_ldc_w: do_ldc(itr->get_index_u2(), itr->bci()); break;
1361 1361
1362 case Bytecodes::_iload: 1362 case Bytecodes::_iload:
1363 case Bytecodes::_fload: ppload(vCTS, itr->get_index()); break; 1363 case Bytecodes::_fload: ppload(vCTS, itr->get_index()); break;
1364 1364
1365 case Bytecodes::_lload: 1365 case Bytecodes::_lload:
1548 1548
1549 case Bytecodes::_jsr: do_jsr(itr->dest()); break; 1549 case Bytecodes::_jsr: do_jsr(itr->dest()); break;
1550 case Bytecodes::_jsr_w: do_jsr(itr->dest_w()); break; 1550 case Bytecodes::_jsr_w: do_jsr(itr->dest_w()); break;
1551 1551
1552 case Bytecodes::_getstatic: do_field(true, true, 1552 case Bytecodes::_getstatic: do_field(true, true,
1553 itr->get_index_big(), 1553 itr->get_index_u2_cpcache(),
1554 itr->bci()); break; 1554 itr->bci()); break;
1555 case Bytecodes::_putstatic: do_field(false, true, itr->get_index_big(), itr->bci()); break; 1555 case Bytecodes::_putstatic: do_field(false, true, itr->get_index_u2_cpcache(), itr->bci()); break;
1556 case Bytecodes::_getfield: do_field(true, false, itr->get_index_big(), itr->bci()); break; 1556 case Bytecodes::_getfield: do_field(true, false, itr->get_index_u2_cpcache(), itr->bci()); break;
1557 case Bytecodes::_putfield: do_field(false, false, itr->get_index_big(), itr->bci()); break; 1557 case Bytecodes::_putfield: do_field(false, false, itr->get_index_u2_cpcache(), itr->bci()); break;
1558 1558
1559 case Bytecodes::_invokevirtual: 1559 case Bytecodes::_invokevirtual:
1560 case Bytecodes::_invokespecial: do_method(false, false, itr->get_index_big(), itr->bci()); break; 1560 case Bytecodes::_invokespecial: do_method(false, false, itr->get_index_u2_cpcache(), itr->bci()); break;
1561 case Bytecodes::_invokestatic: do_method(true, false, itr->get_index_big(), itr->bci()); break; 1561 case Bytecodes::_invokestatic: do_method(true, false, itr->get_index_u2_cpcache(), itr->bci()); break;
1562 case Bytecodes::_invokedynamic: do_method(true, false, itr->get_index_int(), itr->bci()); break; 1562 case Bytecodes::_invokedynamic: do_method(true, false, itr->get_index_u4(), itr->bci()); break;
1563 case Bytecodes::_invokeinterface: do_method(false, true, itr->get_index_big(), itr->bci()); break; 1563 case Bytecodes::_invokeinterface: do_method(false, true, itr->get_index_u2_cpcache(), itr->bci()); break;
1564 case Bytecodes::_newarray: 1564 case Bytecodes::_newarray:
1565 case Bytecodes::_anewarray: pp_new_ref(vCTS, itr->bci()); break; 1565 case Bytecodes::_anewarray: pp_new_ref(vCTS, itr->bci()); break;
1566 case Bytecodes::_checkcast: do_checkcast(); break; 1566 case Bytecodes::_checkcast: do_checkcast(); break;
1567 case Bytecodes::_arraylength: 1567 case Bytecodes::_arraylength:
1568 case Bytecodes::_instanceof: pp(rCTS, vCTS); break; 1568 case Bytecodes::_instanceof: pp(rCTS, vCTS); break;