1 11 package org.eclipse.jdt.internal.core.util; 12 13 import org.eclipse.jdt.core.Signature; 14 import org.eclipse.jdt.core.compiler.CharOperation; 15 import org.eclipse.jdt.core.util.ClassFileBytesDisassembler; 16 import org.eclipse.jdt.core.util.IBytecodeVisitor; 17 import org.eclipse.jdt.core.util.ICodeAttribute; 18 import org.eclipse.jdt.core.util.IConstantPoolConstant; 19 import org.eclipse.jdt.core.util.IConstantPoolEntry; 20 import org.eclipse.jdt.core.util.ILocalVariableAttribute; 21 import org.eclipse.jdt.core.util.ILocalVariableTableEntry; 22 import org.eclipse.jdt.core.util.IOpcodeMnemonics; 23 import org.eclipse.jdt.core.util.OpcodeStringValues; 24 25 28 public class DefaultBytecodeVisitor implements IBytecodeVisitor { 29 private static final String EMPTY_CLASS_NAME = "\"\""; private static final String EMPTY_LOCAL_NAME = ""; private static final int T_BOOLEAN = 4; 32 private static final int T_CHAR = 5; 33 private static final int T_FLOAT = 6; 34 private static final int T_DOUBLE = 7; 35 private static final int T_BYTE = 8; 36 private static final int T_SHORT = 9; 37 private static final int T_INT = 10; 38 private static final int T_LONG = 11; 39 40 private StringBuffer buffer; 41 private String lineSeparator; 42 private int tabNumber; 43 private int digitNumberForPC; 44 private ILocalVariableTableEntry[] localVariableTableEntries; 45 private int localVariableAttributeLength; 46 private int mode; 47 48 public DefaultBytecodeVisitor(ICodeAttribute codeAttribute, StringBuffer buffer, String lineSeparator, int tabNumber, int mode) { 49 ILocalVariableAttribute localVariableAttribute = codeAttribute.getLocalVariableAttribute(); 50 this.localVariableAttributeLength = localVariableAttribute == null ? 0 : localVariableAttribute.getLocalVariableTableLength(); 51 if (this.localVariableAttributeLength != 0) { 52 this.localVariableTableEntries = localVariableAttribute.getLocalVariableTable(); 53 } else { 54 this.localVariableTableEntries = null; 55 } 56 this.buffer = buffer; 57 this.lineSeparator = lineSeparator; 58 this.tabNumber = tabNumber + 1; 59 long codeLength = codeAttribute.getCodeLength(); 60 this.digitNumberForPC = Long.toString(codeLength).length(); 61 this.mode = mode; 62 } 63 66 public void _aaload(int pc) { 67 dumpPcNumber(pc); 68 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.AALOAD]); 69 writeNewLine(); 70 } 71 private void dumpPcNumber(int pc) { 72 writeTabs(); 73 int digitForPC = 1; 74 if (pc != 0) { 75 digitForPC = Integer.toString(pc).length(); 76 } 77 for (int i = 0, max = this.digitNumberForPC - digitForPC; i < max; i++) { 78 buffer.append(' '); 79 } 80 buffer.append(pc); 81 buffer.append(Messages.disassembler_indentation); 82 } 83 84 87 public void _aastore(int pc) { 88 dumpPcNumber(pc); 89 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.AASTORE]); 90 writeNewLine(); 91 } 92 93 96 public void _aconst_null(int pc) { 97 dumpPcNumber(pc); 98 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ACONST_NULL]); 99 writeNewLine(); 100 } 101 102 105 public void _aload_0(int pc) { 106 dumpPcNumber(pc); 107 buffer.append(Messages.bind(Messages.classformat_load, 108 new String [] { 109 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ALOAD_0], 110 getLocalVariableName(pc, 0) 111 })); 112 writeNewLine(); 113 } 114 115 118 public void _aload_1(int pc) { 119 dumpPcNumber(pc); 120 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 121 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ALOAD_1], 122 getLocalVariableName(pc, 1) 123 })); 124 writeNewLine(); 125 } 126 127 130 public void _aload_2(int pc) { 131 dumpPcNumber(pc); 132 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 133 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ALOAD_2], 134 getLocalVariableName(pc, 2) 135 })); 136 writeNewLine(); 137 } 138 139 142 public void _aload_3(int pc) { 143 dumpPcNumber(pc); 144 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 145 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ALOAD_3], 146 getLocalVariableName(pc, 3) 147 })); 148 writeNewLine(); 149 } 150 151 154 public void _aload(int pc, int index) { 155 dumpPcNumber(pc); 156 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 157 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ALOAD], 158 getLocalVariableName(pc, index, true) 159 })); 160 writeNewLine(); 161 } 162 163 166 public void _anewarray(int pc, int index, IConstantPoolEntry constantClass) { 167 dumpPcNumber(pc); 168 buffer 169 .append(Messages.bind(Messages.classformat_anewarray, new String [] { 170 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ANEWARRAY], 171 Integer.toString(index), 172 returnConstantClassName(constantClass) 173 })); 174 writeNewLine(); 175 } 176 177 180 public void _areturn(int pc) { 181 dumpPcNumber(pc); 182 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ARETURN]); 183 writeNewLine(); 184 } 185 186 189 public void _arraylength(int pc) { 190 dumpPcNumber(pc); 191 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ARRAYLENGTH]); 192 writeNewLine(); 193 } 194 195 198 public void _astore_0(int pc) { 199 dumpPcNumber(pc); 200 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 201 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ASTORE_0], 202 getLocalVariableName(pc, 0) 203 })); 204 writeNewLine(); 205 } 206 207 210 public void _astore_1(int pc) { 211 dumpPcNumber(pc); 212 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 213 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ASTORE_1], 214 getLocalVariableName(pc, 1) 215 })); 216 writeNewLine(); 217 } 218 private String getLocalVariableName(int pc, int index) { 219 return getLocalVariableName(pc, index, false); 220 } 221 222 private String getLocalVariableName(int pc, int index, boolean showIndex) { 223 int nextPC = pc + 1; 224 switch(index) { 225 case 0 : 226 case 1 : 227 case 2 : 228 case 3 : 229 break; 230 default : 231 nextPC = index <= 255 ? pc + 2 : pc + 3; 232 } 233 234 for (int i = 0, max = this.localVariableAttributeLength; i < max; i++) { 235 final ILocalVariableTableEntry entry = this.localVariableTableEntries[i]; 236 final int startPC = entry.getStartPC(); 237 if (entry.getIndex() == index && (startPC <= nextPC) && ((startPC + entry.getLength()) > nextPC)) { 238 final StringBuffer stringBuffer = new StringBuffer (); 239 if (showIndex) { 240 stringBuffer.append(' ').append(index); 241 } 242 stringBuffer.append(' ').append('[').append(entry.getName()).append(']'); 243 return String.valueOf(stringBuffer); 244 } 245 } 246 if (showIndex) { 247 final StringBuffer stringBuffer = new StringBuffer (); 248 stringBuffer.append(' ').append(index); 249 return String.valueOf(stringBuffer); 250 } 251 return EMPTY_LOCAL_NAME; 252 } 253 254 257 public void _astore_2(int pc) { 258 dumpPcNumber(pc); 259 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 260 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ASTORE_2], 261 getLocalVariableName(pc, 2) 262 })); 263 writeNewLine(); 264 } 265 266 269 public void _astore_3(int pc) { 270 dumpPcNumber(pc); 271 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 272 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ASTORE_3], 273 getLocalVariableName(pc, 3) 274 })); 275 writeNewLine(); 276 } 277 278 281 public void _astore(int pc, int index) { 282 dumpPcNumber(pc); 283 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 284 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ASTORE], 285 getLocalVariableName(pc, index, true) 286 })); 287 writeNewLine(); 288 } 289 290 293 public void _athrow(int pc) { 294 dumpPcNumber(pc); 295 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ATHROW]); 296 writeNewLine(); 297 } 298 299 302 public void _baload(int pc) { 303 dumpPcNumber(pc); 304 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.BALOAD]); 305 writeNewLine(); 306 } 307 308 311 public void _bastore(int pc) { 312 dumpPcNumber(pc); 313 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.BASTORE]); 314 writeNewLine(); 315 } 316 317 320 public void _bipush(int pc, byte _byte) { 321 dumpPcNumber(pc); 322 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.BIPUSH]) 323 .append(Messages.disassembler_space) 324 .append(_byte); 325 writeNewLine(); 326 } 327 328 331 public void _caload(int pc) { 332 dumpPcNumber(pc); 333 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.CALOAD]); 334 writeNewLine(); 335 } 336 337 340 public void _castore(int pc) { 341 dumpPcNumber(pc); 342 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.CASTORE]); 343 writeNewLine(); 344 } 345 346 349 public void _checkcast(int pc, int index, IConstantPoolEntry constantClass) { 350 dumpPcNumber(pc); 351 buffer 352 .append(Messages.bind(Messages.classformat_checkcast, new String [] { 353 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.CHECKCAST], 354 Integer.toString(index), 355 returnConstantClassName(constantClass) 356 })); 357 writeNewLine(); 358 } 359 360 363 public void _d2f(int pc) { 364 dumpPcNumber(pc); 365 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.D2F]); 366 writeNewLine(); 367 } 368 369 372 public void _d2i(int pc) { 373 dumpPcNumber(pc); 374 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.D2I]); 375 writeNewLine(); 376 } 377 378 381 public void _d2l(int pc) { 382 dumpPcNumber(pc); 383 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.D2L]); 384 writeNewLine(); 385 } 386 387 390 public void _dadd(int pc) { 391 dumpPcNumber(pc); 392 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DADD]); 393 writeNewLine(); 394 } 395 396 399 public void _daload(int pc) { 400 dumpPcNumber(pc); 401 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DALOAD]); 402 writeNewLine(); 403 } 404 405 408 public void _dastore(int pc) { 409 dumpPcNumber(pc); 410 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DASTORE]); 411 writeNewLine(); 412 } 413 414 417 public void _dcmpg(int pc) { 418 dumpPcNumber(pc); 419 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DCMPG]); 420 writeNewLine(); 421 } 422 423 426 public void _dcmpl(int pc) { 427 dumpPcNumber(pc); 428 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DCMPL]); 429 writeNewLine(); 430 } 431 432 435 public void _dconst_0(int pc) { 436 dumpPcNumber(pc); 437 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DCONST_0]); 438 writeNewLine(); 439 } 440 441 444 public void _dconst_1(int pc) { 445 dumpPcNumber(pc); 446 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DCONST_1]); 447 writeNewLine(); 448 } 449 450 453 public void _ddiv(int pc) { 454 dumpPcNumber(pc); 455 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DDIV]); 456 writeNewLine(); 457 } 458 459 462 public void _dload_0(int pc) { 463 dumpPcNumber(pc); 464 buffer.append(Messages.bind(Messages.classformat_load,new String [] { 465 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DLOAD_0], 466 getLocalVariableName(pc, 0) 467 })); 468 writeNewLine(); 469 } 470 471 474 public void _dload_1(int pc) { 475 dumpPcNumber(pc); 476 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 477 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DLOAD_1], 478 getLocalVariableName(pc, 1) 479 })); 480 writeNewLine(); 481 } 482 483 486 public void _dload_2(int pc) { 487 dumpPcNumber(pc); 488 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 489 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DLOAD_2], 490 getLocalVariableName(pc, 2) 491 })); 492 writeNewLine(); 493 } 494 495 498 public void _dload_3(int pc) { 499 dumpPcNumber(pc); 500 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 501 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DLOAD_3], 502 getLocalVariableName(pc, 3) 503 })); 504 writeNewLine(); 505 } 506 507 510 public void _dload(int pc, int index) { 511 dumpPcNumber(pc); 512 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 513 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DLOAD], 514 getLocalVariableName(pc, index, true) 515 })); 516 writeNewLine(); 517 } 518 519 522 public void _dmul(int pc) { 523 dumpPcNumber(pc); 524 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DMUL]); 525 writeNewLine(); 526 } 527 528 531 public void _dneg(int pc) { 532 dumpPcNumber(pc); 533 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DNEG]); 534 writeNewLine(); 535 } 536 537 540 public void _drem(int pc) { 541 dumpPcNumber(pc); 542 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DREM]); 543 writeNewLine(); 544 } 545 546 549 public void _dreturn(int pc) { 550 dumpPcNumber(pc); 551 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DRETURN]); 552 writeNewLine(); 553 } 554 555 558 public void _dstore_0(int pc) { 559 dumpPcNumber(pc); 560 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 561 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DSTORE_0], 562 getLocalVariableName(pc, 0) 563 })); 564 writeNewLine(); 565 } 566 567 570 public void _dstore_1(int pc) { 571 dumpPcNumber(pc); 572 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 573 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DSTORE_1], 574 getLocalVariableName(pc, 1) 575 })); 576 writeNewLine(); 577 } 578 579 582 public void _dstore_2(int pc) { 583 dumpPcNumber(pc); 584 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 585 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DSTORE_2], 586 getLocalVariableName(pc, 2) 587 })); 588 writeNewLine(); 589 } 590 591 594 public void _dstore_3(int pc) { 595 dumpPcNumber(pc); 596 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 597 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DSTORE_3], 598 getLocalVariableName(pc, 3) 599 })); 600 writeNewLine(); 601 } 602 603 606 public void _dstore(int pc, int index) { 607 dumpPcNumber(pc); 608 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 609 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DSTORE], 610 getLocalVariableName(pc, index, true) 611 })); 612 writeNewLine(); 613 } 614 615 618 public void _dsub(int pc) { 619 dumpPcNumber(pc); 620 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DSUB]); 621 writeNewLine(); 622 } 623 624 627 public void _dup_x1(int pc) { 628 dumpPcNumber(pc); 629 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DUP_X1]); 630 writeNewLine(); 631 } 632 633 636 public void _dup_x2(int pc) { 637 dumpPcNumber(pc); 638 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DUP_X2]); 639 writeNewLine(); 640 } 641 642 645 public void _dup(int pc) { 646 dumpPcNumber(pc); 647 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DUP]); 648 writeNewLine(); 649 } 650 651 654 public void _dup2_x1(int pc) { 655 dumpPcNumber(pc); 656 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DUP2_X1]); 657 writeNewLine(); 658 } 659 660 663 public void _dup2_x2(int pc) { 664 dumpPcNumber(pc); 665 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DUP2_X2]); 666 writeNewLine(); 667 } 668 669 672 public void _dup2(int pc) { 673 dumpPcNumber(pc); 674 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.DUP2]); 675 writeNewLine(); 676 } 677 678 681 public void _f2d(int pc) { 682 dumpPcNumber(pc); 683 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.F2D]); 684 writeNewLine(); 685 } 686 687 690 public void _f2i(int pc) { 691 dumpPcNumber(pc); 692 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.F2I]); 693 writeNewLine(); 694 } 695 696 699 public void _f2l(int pc) { 700 dumpPcNumber(pc); 701 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.F2L]); 702 writeNewLine(); 703 } 704 705 708 public void _fadd(int pc) { 709 dumpPcNumber(pc); 710 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FADD]); 711 writeNewLine(); 712 } 713 714 717 public void _faload(int pc) { 718 dumpPcNumber(pc); 719 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FALOAD]); 720 writeNewLine(); 721 } 722 723 726 public void _fastore(int pc) { 727 dumpPcNumber(pc); 728 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FASTORE]); 729 writeNewLine(); 730 } 731 732 735 public void _fcmpg(int pc) { 736 dumpPcNumber(pc); 737 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FCMPG]); 738 writeNewLine(); 739 } 740 741 744 public void _fcmpl(int pc) { 745 dumpPcNumber(pc); 746 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FCMPL]); 747 writeNewLine(); 748 } 749 750 753 public void _fconst_0(int pc) { 754 dumpPcNumber(pc); 755 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FCONST_0]); 756 writeNewLine(); 757 } 758 759 762 public void _fconst_1(int pc) { 763 dumpPcNumber(pc); 764 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FCONST_1]); 765 writeNewLine(); 766 } 767 768 771 public void _fconst_2(int pc) { 772 dumpPcNumber(pc); 773 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FCONST_2]); 774 writeNewLine(); 775 } 776 777 780 public void _fdiv(int pc) { 781 dumpPcNumber(pc); 782 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FDIV]); 783 writeNewLine(); 784 } 785 786 789 public void _fload_0(int pc) { 790 dumpPcNumber(pc); 791 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 792 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FLOAD_0], 793 getLocalVariableName(pc, 0) 794 })); 795 writeNewLine(); 796 } 797 798 801 public void _fload_1(int pc) { 802 dumpPcNumber(pc); 803 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 804 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FLOAD_1], 805 getLocalVariableName(pc, 1) 806 })); 807 writeNewLine(); 808 } 809 810 813 public void _fload_2(int pc) { 814 dumpPcNumber(pc); 815 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 816 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FLOAD_2], 817 getLocalVariableName(pc, 2) 818 })); 819 writeNewLine(); 820 } 821 822 825 public void _fload_3(int pc) { 826 dumpPcNumber(pc); 827 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 828 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FLOAD_3], 829 getLocalVariableName(pc, 3) 830 })); 831 writeNewLine(); 832 } 833 834 837 public void _fload(int pc, int index) { 838 dumpPcNumber(pc); 839 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 840 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FLOAD], 841 getLocalVariableName(pc, index, true) 842 })); 843 writeNewLine(); 844 } 845 846 849 public void _fmul(int pc) { 850 dumpPcNumber(pc); 851 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FMUL]); 852 writeNewLine(); 853 } 854 855 858 public void _fneg(int pc) { 859 dumpPcNumber(pc); 860 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FNEG]); 861 writeNewLine(); 862 } 863 864 867 public void _frem(int pc) { 868 dumpPcNumber(pc); 869 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FREM]); 870 writeNewLine(); 871 } 872 873 876 public void _freturn(int pc) { 877 dumpPcNumber(pc); 878 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FRETURN]); 879 writeNewLine(); 880 } 881 882 885 public void _fstore_0(int pc) { 886 dumpPcNumber(pc); 887 buffer.append(Messages.bind(Messages.classformat_store,new String [] { 888 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FSTORE_0], 889 getLocalVariableName(pc, 0) 890 })); 891 writeNewLine(); 892 } 893 894 897 public void _fstore_1(int pc) { 898 dumpPcNumber(pc); 899 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 900 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FSTORE_1], 901 getLocalVariableName(pc, 1) 902 })); 903 writeNewLine(); 904 } 905 906 909 public void _fstore_2(int pc) { 910 dumpPcNumber(pc); 911 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 912 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FSTORE_2], 913 getLocalVariableName(pc, 2) 914 })); 915 writeNewLine(); 916 } 917 918 921 public void _fstore_3(int pc) { 922 dumpPcNumber(pc); 923 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 924 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FSTORE_3], 925 getLocalVariableName(pc, 3) 926 })); 927 writeNewLine(); 928 } 929 930 933 public void _fstore(int pc, int index) { 934 dumpPcNumber(pc); 935 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 936 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FSTORE], 937 getLocalVariableName(pc, index, true) 938 })); 939 writeNewLine(); 940 } 941 942 945 public void _fsub(int pc) { 946 dumpPcNumber(pc); 947 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.FSUB]); 948 writeNewLine(); 949 } 950 951 954 public void _getfield(int pc, int index, IConstantPoolEntry constantFieldref) { 955 dumpPcNumber(pc); 956 buffer.append(Messages.bind(Messages.classformat_getfield, new String [] { 957 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.GETFIELD], 958 Integer.toString(index), 959 returnDeclaringClassName(constantFieldref), 960 new String (constantFieldref.getFieldName()), 961 returnClassName(Signature.toCharArray(constantFieldref.getFieldDescriptor())) 962 })); 963 writeNewLine(); 964 } 965 966 969 public void _getstatic(int pc, int index, IConstantPoolEntry constantFieldref) { 970 dumpPcNumber(pc); 971 buffer.append(Messages.bind(Messages.classformat_getstatic, new String [] { 972 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.GETSTATIC], 973 Integer.toString(index), 974 returnDeclaringClassName(constantFieldref), 975 new String (constantFieldref.getFieldName()), 976 returnClassName(Signature.toCharArray(constantFieldref.getFieldDescriptor())) 977 })); 978 writeNewLine(); 979 } 980 981 984 public void _goto_w(int pc, int branchOffset) { 985 dumpPcNumber(pc); 986 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.GOTO_W]) 987 .append(Messages.disassembler_space) 988 .append(branchOffset + pc); 989 writeNewLine(); 990 } 991 992 995 public void _goto(int pc, int branchOffset) { 996 dumpPcNumber(pc); 997 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.GOTO]) 998 .append(Messages.disassembler_space) 999 .append(branchOffset + pc); 1000 writeNewLine(); 1001 } 1002 1003 1006 public void _i2b(int pc) { 1007 dumpPcNumber(pc); 1008 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.I2B]); 1009 writeNewLine(); 1010 } 1011 1012 1015 public void _i2c(int pc) { 1016 dumpPcNumber(pc); 1017 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.I2C]); 1018 writeNewLine(); 1019 } 1020 1021 1024 public void _i2d(int pc) { 1025 dumpPcNumber(pc); 1026 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.I2D]); 1027 writeNewLine(); 1028 } 1029 1030 1033 public void _i2f(int pc) { 1034 dumpPcNumber(pc); 1035 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.I2F]); 1036 writeNewLine(); 1037 } 1038 1039 1042 public void _i2l(int pc) { 1043 dumpPcNumber(pc); 1044 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.I2L]); 1045 writeNewLine(); 1046 } 1047 1048 1051 public void _i2s(int pc) { 1052 dumpPcNumber(pc); 1053 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.I2S]); 1054 writeNewLine(); 1055 } 1056 1057 1060 public void _iadd(int pc) { 1061 dumpPcNumber(pc); 1062 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IADD]); 1063 writeNewLine(); 1064 } 1065 1066 1069 public void _iaload(int pc) { 1070 dumpPcNumber(pc); 1071 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IALOAD]); 1072 writeNewLine(); 1073 } 1074 1075 1078 public void _iand(int pc) { 1079 dumpPcNumber(pc); 1080 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IAND]); 1081 writeNewLine(); 1082 } 1083 1084 1087 public void _iastore(int pc) { 1088 dumpPcNumber(pc); 1089 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IASTORE]); 1090 writeNewLine(); 1091 } 1092 1093 1096 public void _if_acmpeq(int pc, int branchOffset) { 1097 dumpPcNumber(pc); 1098 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IF_ACMPEQ]) 1099 .append(Messages.disassembler_space) 1100 .append(branchOffset + pc); 1101 writeNewLine(); 1102 } 1103 1104 1107 public void _if_acmpne(int pc, int branchOffset) { 1108 dumpPcNumber(pc); 1109 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IF_ACMPNE]) 1110 .append(Messages.disassembler_space) 1111 .append(branchOffset + pc); 1112 writeNewLine(); 1113 } 1114 1115 1118 public void _if_icmpeq(int pc, int branchOffset) { 1119 dumpPcNumber(pc); 1120 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IF_ICMPEQ]) 1121 .append(Messages.disassembler_space) 1122 .append(branchOffset + pc); 1123 writeNewLine(); 1124 } 1125 1126 1129 public void _if_icmpge(int pc, int branchOffset) { 1130 dumpPcNumber(pc); 1131 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IF_ICMPGE]) 1132 .append(Messages.disassembler_space) 1133 .append(branchOffset + pc); 1134 writeNewLine(); 1135 } 1136 1137 1140 public void _if_icmpgt(int pc, int branchOffset) { 1141 dumpPcNumber(pc); 1142 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IF_ICMPGT]) 1143 .append(Messages.disassembler_space) 1144 .append(branchOffset + pc); 1145 writeNewLine(); 1146 } 1147 1148 1151 public void _if_icmple(int pc, int branchOffset) { 1152 dumpPcNumber(pc); 1153 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IF_ICMPLE]) 1154 .append(Messages.disassembler_space) 1155 .append(branchOffset + pc); 1156 writeNewLine(); 1157 } 1158 1159 1162 public void _if_icmplt(int pc, int branchOffset) { 1163 dumpPcNumber(pc); 1164 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IF_ICMPLT]) 1165 .append(Messages.disassembler_space) 1166 .append(branchOffset + pc); 1167 writeNewLine(); 1168 } 1169 1170 1173 public void _if_icmpne(int pc, int branchOffset) { 1174 dumpPcNumber(pc); 1175 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IF_ICMPNE]) 1176 .append(Messages.disassembler_space) 1177 .append(branchOffset + pc); 1178 writeNewLine(); 1179 } 1180 1181 1184 public void _iconst_0(int pc) { 1185 dumpPcNumber(pc); 1186 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ICONST_0]); 1187 writeNewLine(); 1188 } 1189 1190 1193 public void _iconst_1(int pc) { 1194 dumpPcNumber(pc); 1195 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ICONST_1]); 1196 writeNewLine(); 1197 } 1198 1199 1202 public void _iconst_2(int pc) { 1203 dumpPcNumber(pc); 1204 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ICONST_2]); 1205 writeNewLine(); 1206 } 1207 1208 1211 public void _iconst_3(int pc) { 1212 dumpPcNumber(pc); 1213 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ICONST_3]); 1214 writeNewLine(); 1215 } 1216 1217 1220 public void _iconst_4(int pc) { 1221 dumpPcNumber(pc); 1222 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ICONST_4]); 1223 writeNewLine(); 1224 } 1225 1226 1229 public void _iconst_5(int pc) { 1230 dumpPcNumber(pc); 1231 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ICONST_5]); 1232 writeNewLine(); 1233 } 1234 1235 1238 public void _iconst_m1(int pc) { 1239 dumpPcNumber(pc); 1240 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ICONST_M1]); 1241 writeNewLine(); 1242 } 1243 1244 1247 public void _idiv(int pc) { 1248 dumpPcNumber(pc); 1249 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IDIV]); 1250 writeNewLine(); 1251 } 1252 1253 1256 public void _ifeq(int pc, int branchOffset) { 1257 dumpPcNumber(pc); 1258 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IFEQ]) 1259 .append(Messages.disassembler_space) 1260 .append(branchOffset + pc); 1261 writeNewLine(); 1262 } 1263 1264 1267 public void _ifge(int pc, int branchOffset) { 1268 dumpPcNumber(pc); 1269 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IFGE]) 1270 .append(Messages.disassembler_space) 1271 .append(branchOffset + pc); 1272 writeNewLine(); 1273 } 1274 1275 1278 public void _ifgt(int pc, int branchOffset) { 1279 dumpPcNumber(pc); 1280 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IFGT]) 1281 .append(Messages.disassembler_space) 1282 .append(branchOffset + pc); 1283 writeNewLine(); 1284 } 1285 1286 1289 public void _ifle(int pc, int branchOffset) { 1290 dumpPcNumber(pc); 1291 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IFLE]) 1292 .append(Messages.disassembler_space) 1293 .append(branchOffset + pc); 1294 writeNewLine(); 1295 } 1296 1297 1300 public void _iflt(int pc, int branchOffset) { 1301 dumpPcNumber(pc); 1302 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IFLT]) 1303 .append(Messages.disassembler_space) 1304 .append(branchOffset + pc); 1305 writeNewLine(); 1306 } 1307 1308 1311 public void _ifne(int pc, int branchOffset) { 1312 dumpPcNumber(pc); 1313 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IFNE]) 1314 .append(Messages.disassembler_space) 1315 .append(branchOffset + pc); 1316 writeNewLine(); 1317 } 1318 1319 1322 public void _ifnonnull(int pc, int branchOffset) { 1323 dumpPcNumber(pc); 1324 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IFNONNULL]) 1325 .append(Messages.disassembler_space) 1326 .append(branchOffset + pc); 1327 writeNewLine(); 1328 } 1329 1330 1333 public void _ifnull(int pc, int branchOffset) { 1334 dumpPcNumber(pc); 1335 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IFNULL]) 1336 .append(Messages.disassembler_space) 1337 .append(branchOffset + pc); 1338 writeNewLine(); 1339 } 1340 1341 1344 public void _iinc(int pc, int index, int _const) { 1345 dumpPcNumber(pc); 1346 buffer.append(Messages.bind(Messages.classformat_iinc, new String [] { 1347 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IINC], 1348 Integer.toString(index), 1349 Integer.toString(_const), 1350 getLocalVariableName(pc, index, false) 1351 })); 1352 writeNewLine(); 1353 } 1354 1355 1358 public void _iload_0(int pc) { 1359 dumpPcNumber(pc); 1360 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 1361 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ILOAD_0], 1362 getLocalVariableName(pc, 0) 1363 })); 1364 writeNewLine(); 1365 } 1366 1367 1370 public void _iload_1(int pc) { 1371 dumpPcNumber(pc); 1372 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 1373 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ILOAD_1], 1374 getLocalVariableName(pc, 1) 1375 })); 1376 writeNewLine(); 1377 } 1378 1379 1382 public void _iload_2(int pc) { 1383 dumpPcNumber(pc); 1384 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 1385 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ILOAD_2], 1386 getLocalVariableName(pc, 2) 1387 })); 1388 writeNewLine(); 1389 } 1390 1391 1394 public void _iload_3(int pc) { 1395 dumpPcNumber(pc); 1396 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 1397 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ILOAD_3], 1398 getLocalVariableName(pc, 3) 1399 })); 1400 writeNewLine(); 1401 } 1402 1403 1406 public void _iload(int pc, int index) { 1407 dumpPcNumber(pc); 1408 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 1409 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ILOAD], 1410 getLocalVariableName(pc, index, true) 1411 })); 1412 writeNewLine(); 1413 } 1414 1415 1418 public void _imul(int pc) { 1419 dumpPcNumber(pc); 1420 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IMUL]); 1421 writeNewLine(); 1422 } 1423 1424 1427 public void _ineg(int pc) { 1428 dumpPcNumber(pc); 1429 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INEG]); 1430 writeNewLine(); 1431 } 1432 1433 1436 public void _instanceof(int pc, int index, IConstantPoolEntry constantClass) { 1437 dumpPcNumber(pc); 1438 buffer.append(Messages.bind(Messages.classformat_instanceof, new String [] { 1439 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INSTANCEOF], 1440 Integer.toString(index), 1441 returnConstantClassName(constantClass) 1442 })); 1443 writeNewLine(); 1444 } 1445 1446 1449 public void _invokeinterface( 1450 int pc, 1451 int index, 1452 byte nargs, 1453 IConstantPoolEntry constantInterfaceMethodref) { 1454 1455 dumpPcNumber(pc); 1456 buffer.append(Messages.bind(Messages.classformat_invokeinterface, new String [] { 1457 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKEINTERFACE], 1458 Integer.toString(index), 1459 Integer.toString(nargs), 1460 Util.toString( 1461 constantInterfaceMethodref.getClassName(), 1462 constantInterfaceMethodref.getMethodName(), 1463 constantInterfaceMethodref.getMethodDescriptor(), 1464 true, 1465 isCompact()) 1466 })); 1467 writeNewLine(); 1468 } 1469 1470 1473 public void _invokespecial(int pc, int index, IConstantPoolEntry constantMethodref) { 1474 dumpPcNumber(pc); 1475 final String signature = returnMethodSignature(constantMethodref); 1476 buffer.append(Messages.bind(Messages.classformat_invokespecial, new String [] { 1477 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKESPECIAL], 1478 Integer.toString(index), 1479 signature 1480 })); 1481 writeNewLine(); 1482 } 1483 1486 public void _invokestatic(int pc, int index, IConstantPoolEntry constantMethodref) { 1487 dumpPcNumber(pc); 1488 final String signature = returnMethodSignature(constantMethodref); 1489 buffer.append(Messages.bind(Messages.classformat_invokestatic, new String [] { 1490 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKESTATIC], 1491 Integer.toString(index), 1492 signature 1493 })); 1494 writeNewLine(); 1495 } 1496 1497 1500 public void _invokevirtual(int pc, int index, IConstantPoolEntry constantMethodref) { 1501 dumpPcNumber(pc); 1502 final String signature = returnMethodSignature(constantMethodref); 1503 buffer.append(Messages.bind(Messages.classformat_invokevirtual,new String [] { 1504 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.INVOKEVIRTUAL], 1505 Integer.toString(index), 1506 signature 1507 })); 1508 writeNewLine(); 1509 } 1510 1511 1514 public void _ior(int pc) { 1515 dumpPcNumber(pc); 1516 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IOR]); 1517 writeNewLine(); 1518 } 1519 1520 1523 public void _irem(int pc) { 1524 dumpPcNumber(pc); 1525 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IREM]); 1526 writeNewLine(); 1527 } 1528 1529 1532 public void _ireturn(int pc) { 1533 dumpPcNumber(pc); 1534 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IRETURN]); 1535 writeNewLine(); 1536 } 1537 1538 1541 public void _ishl(int pc) { 1542 dumpPcNumber(pc); 1543 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ISHL]); 1544 writeNewLine(); 1545 } 1546 1547 1550 public void _ishr(int pc) { 1551 dumpPcNumber(pc); 1552 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ISHR]); 1553 writeNewLine(); 1554 } 1555 1556 1559 public void _istore_0(int pc) { 1560 dumpPcNumber(pc); 1561 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 1562 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ISTORE_0], 1563 getLocalVariableName(pc, 0) 1564 })); 1565 writeNewLine(); 1566 } 1567 1568 1571 public void _istore_1(int pc) { 1572 dumpPcNumber(pc); 1573 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 1574 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ISTORE_1], 1575 getLocalVariableName(pc, 1) 1576 })); 1577 writeNewLine(); 1578 } 1579 1580 1583 public void _istore_2(int pc) { 1584 dumpPcNumber(pc); 1585 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 1586 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ISTORE_2], 1587 getLocalVariableName(pc, 2) 1588 })); 1589 writeNewLine(); 1590 } 1591 1592 1595 public void _istore_3(int pc) { 1596 dumpPcNumber(pc); 1597 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 1598 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ISTORE_3], 1599 getLocalVariableName(pc, 3) 1600 })); 1601 writeNewLine(); 1602 } 1603 1604 1607 public void _istore(int pc, int index) { 1608 dumpPcNumber(pc); 1609 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 1610 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ISTORE], 1611 getLocalVariableName(pc, index, true) 1612 })); 1613 writeNewLine(); 1614 } 1615 1616 1619 public void _isub(int pc) { 1620 dumpPcNumber(pc); 1621 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.ISUB]); 1622 writeNewLine(); 1623 } 1624 1625 1628 public void _iushr(int pc) { 1629 dumpPcNumber(pc); 1630 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IUSHR]); 1631 writeNewLine(); 1632 } 1633 1634 1637 public void _ixor(int pc) { 1638 dumpPcNumber(pc); 1639 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IXOR]); 1640 writeNewLine(); 1641 } 1642 1643 1646 public void _jsr_w(int pc, int branchOffset) { 1647 dumpPcNumber(pc); 1648 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.JSR_W]) 1649 .append(Messages.disassembler_space) 1650 .append(branchOffset + pc); 1651 writeNewLine(); 1652 } 1653 1654 1657 public void _jsr(int pc, int branchOffset) { 1658 dumpPcNumber(pc); 1659 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.JSR]) 1660 .append(Messages.disassembler_space) 1661 .append(branchOffset + pc); 1662 writeNewLine(); 1663 } 1664 1665 1668 public void _l2d(int pc) { 1669 dumpPcNumber(pc); 1670 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.L2D]); 1671 writeNewLine(); 1672 } 1673 1674 1677 public void _l2f(int pc) { 1678 dumpPcNumber(pc); 1679 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.L2F]); 1680 writeNewLine(); 1681 } 1682 1683 1686 public void _l2i(int pc) { 1687 dumpPcNumber(pc); 1688 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.L2I]); 1689 writeNewLine(); 1690 } 1691 1692 1695 public void _ladd(int pc) { 1696 dumpPcNumber(pc); 1697 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LADD]); 1698 writeNewLine(); 1699 } 1700 1701 1704 public void _laload(int pc) { 1705 dumpPcNumber(pc); 1706 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LALOAD]); 1707 writeNewLine(); 1708 } 1709 1710 1713 public void _land(int pc) { 1714 dumpPcNumber(pc); 1715 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LAND]); 1716 writeNewLine(); 1717 } 1718 1719 1722 public void _lastore(int pc) { 1723 dumpPcNumber(pc); 1724 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LASTORE]); 1725 writeNewLine(); 1726 } 1727 1728 1731 public void _lcmp(int pc) { 1732 dumpPcNumber(pc); 1733 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LCMP]); 1734 writeNewLine(); 1735 } 1736 1737 1740 public void _lconst_0(int pc) { 1741 dumpPcNumber(pc); 1742 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LCONST_0]); 1743 writeNewLine(); 1744 } 1745 1746 1749 public void _lconst_1(int pc) { 1750 dumpPcNumber(pc); 1751 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LCONST_1]); 1752 writeNewLine(); 1753 } 1754 1755 1758 public void _ldc_w(int pc, int index, IConstantPoolEntry constantPoolEntry) { 1759 dumpPcNumber(pc); 1760 switch (constantPoolEntry.getKind()) { 1761 case IConstantPoolConstant.CONSTANT_Float : 1762 buffer.append(Messages.bind(Messages.classformat_ldc_w_float, new String [] { 1763 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LDC_W], 1764 Integer.toString(index), 1765 Float.toString(constantPoolEntry.getFloatValue()) 1766 })); 1767 break; 1768 case IConstantPoolConstant.CONSTANT_Integer : 1769 buffer.append(Messages.bind(Messages.classformat_ldc_w_integer, new String [] { 1770 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LDC_W], 1771 Integer.toString(index), 1772 Integer.toString(constantPoolEntry.getIntegerValue()) 1773 })); 1774 break; 1775 case IConstantPoolConstant.CONSTANT_String : 1776 buffer.append(Messages.bind(Messages.classformat_ldc_w_string, new String [] { 1777 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LDC_W], 1778 Integer.toString(index), 1779 Disassembler.escapeString(constantPoolEntry.getStringValue()) 1780 })); 1781 break; 1782 case IConstantPoolConstant.CONSTANT_Class : 1783 buffer.append(Messages.bind(Messages.classformat_ldc_w_class, new String [] { 1784 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LDC_W], 1785 Integer.toString(index), 1786 returnConstantClassName(constantPoolEntry) 1787 })); 1788 } 1789 writeNewLine(); 1790 } 1791 1792 1795 public void _ldc(int pc, int index, IConstantPoolEntry constantPoolEntry) { 1796 dumpPcNumber(pc); 1797 switch (constantPoolEntry.getKind()) { 1798 case IConstantPoolConstant.CONSTANT_Float : 1799 buffer.append(Messages.bind(Messages.classformat_ldc_w_float, new String [] { 1800 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LDC], 1801 Integer.toString(index), 1802 Float.toString(constantPoolEntry.getFloatValue()) 1803 })); 1804 break; 1805 case IConstantPoolConstant.CONSTANT_Integer : 1806 buffer.append(Messages.bind(Messages.classformat_ldc_w_integer, new String [] { 1807 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LDC], 1808 Integer.toString(index), 1809 Integer.toString(constantPoolEntry.getIntegerValue()) 1810 })); 1811 break; 1812 case IConstantPoolConstant.CONSTANT_String : 1813 buffer.append(Messages.bind(Messages.classformat_ldc_w_string, new String [] { 1814 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LDC], 1815 Integer.toString(index), 1816 Disassembler.escapeString(constantPoolEntry.getStringValue()) 1817 })); 1818 break; 1819 case IConstantPoolConstant.CONSTANT_Class : 1820 buffer.append(Messages.bind(Messages.classformat_ldc_w_class, new String [] { 1821 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LDC], 1822 Integer.toString(index), 1823 returnConstantClassName(constantPoolEntry) 1824 })); 1825 } 1826 writeNewLine(); 1827 } 1828 1829 1832 public void _ldc2_w(int pc, int index, IConstantPoolEntry constantPoolEntry) { 1833 dumpPcNumber(pc); 1834 switch (constantPoolEntry.getKind()) { 1835 case IConstantPoolConstant.CONSTANT_Long : 1836 buffer.append(Messages.bind(Messages.classformat_ldc2_w_long, new String [] { 1837 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LDC2_W], 1838 Integer.toString(index), 1839 Long.toString(constantPoolEntry.getLongValue()) 1840 })); 1841 break; 1842 case IConstantPoolConstant.CONSTANT_Double : 1843 buffer.append(Messages.bind(Messages.classformat_ldc2_w_double, new String [] { 1844 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LDC2_W], 1845 Integer.toString(index), 1846 Double.toString(constantPoolEntry.getDoubleValue()) 1847 })); 1848 } 1849 writeNewLine(); 1850 } 1851 1852 1855 public void _ldiv(int pc) { 1856 dumpPcNumber(pc); 1857 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LDIV]); 1858 writeNewLine(); 1859 } 1860 1861 1864 public void _lload_0(int pc) { 1865 dumpPcNumber(pc); 1866 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 1867 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LLOAD_0], 1868 getLocalVariableName(pc, 0) 1869 })); 1870 writeNewLine(); 1871 } 1872 1873 1876 public void _lload_1(int pc) { 1877 dumpPcNumber(pc); 1878 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 1879 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LLOAD_1], 1880 getLocalVariableName(pc, 1) 1881 })); 1882 writeNewLine(); 1883 } 1884 1885 1888 public void _lload_2(int pc) { 1889 dumpPcNumber(pc); 1890 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 1891 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LLOAD_2], 1892 getLocalVariableName(pc, 2) 1893 })); 1894 writeNewLine(); 1895 } 1896 1897 1900 public void _lload_3(int pc) { 1901 dumpPcNumber(pc); 1902 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 1903 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LLOAD_3], 1904 getLocalVariableName(pc, 3) 1905 })); 1906 writeNewLine(); 1907 } 1908 1909 1912 public void _lload(int pc, int index) { 1913 dumpPcNumber(pc); 1914 buffer.append(Messages.bind(Messages.classformat_load, new String [] { 1915 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LLOAD], 1916 getLocalVariableName(pc, index, true) 1917 })); 1918 writeNewLine(); 1919 } 1920 1921 1924 public void _lmul(int pc) { 1925 dumpPcNumber(pc); 1926 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LMUL]); 1927 writeNewLine(); 1928 } 1929 1930 1933 public void _lneg(int pc) { 1934 dumpPcNumber(pc); 1935 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LNEG]); 1936 writeNewLine(); 1937 } 1938 1939 1942 public void _lookupswitch(int pc, int defaultoffset, int npairs, int[][] offset_pairs) { 1943 dumpPcNumber(pc); 1944 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LOOKUPSWITCH]) 1945 .append(" default: ") .append(defaultoffset + pc); 1947 writeNewLine(); 1948 for (int i = 0; i < npairs; i++) { 1949 writeExtraTabs(3); 1950 buffer 1951 .append("case ") .append(offset_pairs[i][0]) 1953 .append(": ") .append(offset_pairs[i][1] + pc); 1955 writeNewLine(); 1956 } 1957 } 1958 1959 1962 public void _lor(int pc) { 1963 dumpPcNumber(pc); 1964 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LOR]); 1965 writeNewLine(); 1966 } 1967 1968 1971 public void _lrem(int pc) { 1972 dumpPcNumber(pc); 1973 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LREM]); 1974 writeNewLine(); 1975 } 1976 1977 1980 public void _lreturn(int pc) { 1981 dumpPcNumber(pc); 1982 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LRETURN]); 1983 writeNewLine(); 1984 } 1985 1986 1989 public void _lshl(int pc) { 1990 dumpPcNumber(pc); 1991 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LSHL]); 1992 writeNewLine(); 1993 } 1994 1995 1998 public void _lshr(int pc) { 1999 dumpPcNumber(pc); 2000 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LSHR]); 2001 writeNewLine(); 2002 } 2003 2004 2007 public void _lstore_0(int pc) { 2008 dumpPcNumber(pc); 2009 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 2010 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LSTORE_0], 2011 getLocalVariableName(pc, 0) 2012 })); 2013 writeNewLine(); 2014 } 2015 2016 2019 public void _lstore_1(int pc) { 2020 dumpPcNumber(pc); 2021 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 2022 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LSTORE_1], 2023 getLocalVariableName(pc, 1) 2024 })); 2025 writeNewLine(); 2026 } 2027 2028 2031 public void _lstore_2(int pc) { 2032 dumpPcNumber(pc); 2033 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 2034 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LSTORE_2], 2035 getLocalVariableName(pc, 2) 2036 })); 2037 writeNewLine(); 2038 } 2039 2040 2043 public void _lstore_3(int pc) { 2044 dumpPcNumber(pc); 2045 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 2046 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LSTORE_3], 2047 getLocalVariableName(pc, 3) 2048 })); 2049 writeNewLine(); 2050 } 2051 2052 2055 public void _lstore(int pc, int index) { 2056 dumpPcNumber(pc); 2057 buffer.append(Messages.bind(Messages.classformat_store, new String [] { 2058 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LSTORE], 2059 getLocalVariableName(pc, index, true) 2060 })); 2061 writeNewLine(); 2062 } 2063 2064 2067 public void _lsub(int pc) { 2068 dumpPcNumber(pc); 2069 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LSUB]); 2070 writeNewLine(); 2071 } 2072 2073 2076 public void _lushr(int pc) { 2077 dumpPcNumber(pc); 2078 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LUSHR]); 2079 writeNewLine(); 2080 } 2081 2082 2085 public void _lxor(int pc) { 2086 dumpPcNumber(pc); 2087 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.LXOR]); 2088 writeNewLine(); 2089 } 2090 2091 2094 public void _monitorenter(int pc) { 2095 dumpPcNumber(pc); 2096 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.MONITORENTER]); 2097 writeNewLine(); 2098 } 2099 2100 2103 public void _monitorexit(int pc) { 2104 dumpPcNumber(pc); 2105 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.MONITOREXIT]); 2106 writeNewLine(); 2107 } 2108 2109 2112 public void _multianewarray( 2113 int pc, 2114 int index, 2115 int dimensions, 2116 IConstantPoolEntry constantClass) { 2117 dumpPcNumber(pc); 2118 buffer.append(Messages.bind(Messages.classformat_multianewarray, new String [] { 2119 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.MULTIANEWARRAY], 2120 Integer.toString(index), 2121 returnConstantClassName(constantClass) 2122 })); 2123 writeNewLine(); 2124 } 2125 2126 2129 public void _new(int pc, int index, IConstantPoolEntry constantClass) { 2130 dumpPcNumber(pc); 2131 buffer.append(Messages.bind(Messages.classformat_new, new String [] { 2132 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.NEW], 2133 Integer.toString(index), 2134 returnConstantClassName(constantClass) 2135 })); 2136 writeNewLine(); 2137 } 2138 2139 2142 public void _newarray(int pc, int atype) { 2143 dumpPcNumber(pc); 2144 switch(atype) { 2145 case T_BOOLEAN : 2146 this.buffer.append(Messages.bind(Messages.classformat_newarray_boolean, new String [] { 2147 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.NEWARRAY], 2148 Integer.toString(atype) 2149 })); 2150 break; 2151 case T_CHAR : 2152 this.buffer.append(Messages.bind(Messages.classformat_newarray_char, new String [] { 2153 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.NEWARRAY], 2154 Integer.toString(atype) 2155 })); 2156 break; 2157 case T_FLOAT : 2158 this.buffer.append(Messages.bind(Messages.classformat_newarray_float, new String [] { 2159 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.NEWARRAY], 2160 Integer.toString(atype) 2161 })); 2162 break; 2163 case T_DOUBLE : 2164 this.buffer.append(Messages.bind(Messages.classformat_newarray_double, new String [] { 2165 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.NEWARRAY], 2166 Integer.toString(atype) 2167 })); 2168 break; 2169 case T_BYTE : 2170 this.buffer.append(Messages.bind(Messages.classformat_newarray_byte, new String [] { 2171 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.NEWARRAY], 2172 Integer.toString(atype) 2173 })); 2174 break; 2175 case T_SHORT : 2176 this.buffer.append(Messages.bind(Messages.classformat_newarray_short, new String [] { 2177 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.NEWARRAY], 2178 Integer.toString(atype) 2179 })); 2180 break; 2181 case T_INT : 2182 this.buffer.append(Messages.bind(Messages.classformat_newarray_int, new String [] { 2183 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.NEWARRAY], 2184 Integer.toString(atype) 2185 })); 2186 break; 2187 case T_LONG : 2188 this.buffer.append(Messages.bind(Messages.classformat_newarray_long, new String [] { 2189 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.NEWARRAY], 2190 Integer.toString(atype) 2191 })); 2192 } 2193 writeNewLine(); 2194 } 2195 2196 2199 public void _nop(int pc) { 2200 dumpPcNumber(pc); 2201 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.NOP]); 2202 writeNewLine(); 2203 } 2204 2205 2208 public void _pop(int pc) { 2209 dumpPcNumber(pc); 2210 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.POP]); 2211 writeNewLine(); 2212 } 2213 2214 2217 public void _pop2(int pc) { 2218 dumpPcNumber(pc); 2219 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.POP2]); 2220 writeNewLine(); 2221 } 2222 2223 2226 public void _putfield(int pc, int index, IConstantPoolEntry constantFieldref) { 2227 dumpPcNumber(pc); 2228 buffer.append(Messages.bind(Messages.classformat_putfield, new String [] { 2229 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.PUTFIELD], 2230 Integer.toString(index), 2231 returnDeclaringClassName(constantFieldref), 2232 new String (constantFieldref.getFieldName()), 2233 returnClassName(Signature.toCharArray(constantFieldref.getFieldDescriptor())) 2234 })); 2235 writeNewLine(); 2236 } 2237 2238 2241 public void _putstatic(int pc, int index, IConstantPoolEntry constantFieldref) { 2242 dumpPcNumber(pc); 2243 buffer.append(Messages.bind(Messages.classformat_putstatic, new String [] { 2244 OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.PUTSTATIC], 2245 Integer.toString(index), 2246 returnDeclaringClassName(constantFieldref), 2247 new String (constantFieldref.getFieldName()), 2248 returnClassName(Signature.toCharArray(constantFieldref.getFieldDescriptor())) 2249 })); 2250 writeNewLine(); 2251 } 2252 2253 2256 public void _ret(int pc, int index) { 2257 dumpPcNumber(pc); 2258 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.RET]) 2259 .append(Messages.disassembler_space) 2260 .append(index); 2261 writeNewLine(); 2262 } 2263 2264 2267 public void _return(int pc) { 2268 dumpPcNumber(pc); 2269 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.RETURN]); 2270 writeNewLine(); 2271 } 2272 2273 2276 public void _saload(int pc) { 2277 dumpPcNumber(pc); 2278 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.SALOAD]); 2279 writeNewLine(); 2280 } 2281 2282 2285 public void _sastore(int pc) { 2286 dumpPcNumber(pc); 2287 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.SASTORE]); 2288 writeNewLine(); 2289 } 2290 2291 2294 public void _sipush(int pc, short value) { 2295 dumpPcNumber(pc); 2296 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.SIPUSH]) 2297 .append(Messages.disassembler_space) 2298 .append(value); 2299 writeNewLine(); 2300 } 2301 2302 2305 public void _swap(int pc) { 2306 dumpPcNumber(pc); 2307 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.SWAP]); 2308 writeNewLine(); 2309 } 2310 2311 2314 public void _tableswitch( 2315 int pc, 2316 int defaultoffset, 2317 int low, 2318 int high, 2319 int[] jump_offsets) { 2320 2321 dumpPcNumber(pc); 2322 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.TABLESWITCH]) 2323 .append(" default: ") .append(defaultoffset + pc); 2325 writeNewLine(); 2326 for (int i = low; i < high + 1; i++) { 2327 writeExtraTabs(3); 2328 buffer 2329 .append("case ") .append(i) 2331 .append(": ") .append(jump_offsets[i - low] + pc); 2333 writeNewLine(); 2334 } 2335 } 2336 2337 2340 public void _wide(int pc, int iincopcode, int index, int _const) { 2341 dumpPcNumber(pc); 2342 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.WIDE]); 2343 writeNewLine(); 2344 _iinc(pc + 1, index, _const); 2345 } 2346 2347 2350 public void _wide(int pc, int opcode, int index) { 2351 dumpPcNumber(pc); 2352 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.WIDE]); 2353 writeNewLine(); 2354 switch(opcode) { 2355 case IOpcodeMnemonics.ILOAD : 2356 _iload(pc + 1, index); 2357 break; 2358 case IOpcodeMnemonics.FLOAD : 2359 _fload(pc + 1, index); 2360 break; 2361 case IOpcodeMnemonics.ALOAD : 2362 _aload(pc + 1, index); 2363 break; 2364 case IOpcodeMnemonics.LLOAD : 2365 _lload(pc + 1, index); 2366 break; 2367 case IOpcodeMnemonics.DLOAD : 2368 _dload(pc + 1, index); 2369 break; 2370 case IOpcodeMnemonics.ISTORE : 2371 _istore(pc + 1, index); 2372 break; 2373 case IOpcodeMnemonics.FSTORE : 2374 _fstore(pc + 1, index); 2375 break; 2376 case IOpcodeMnemonics.ASTORE : 2377 _astore(pc + 1, index); 2378 break; 2379 case IOpcodeMnemonics.LSTORE : 2380 _lstore(pc + 1, index); 2381 break; 2382 case IOpcodeMnemonics.DSTORE : 2383 _dstore(pc + 1, index); 2384 break; 2385 case IOpcodeMnemonics.RET : 2386 _ret(pc + 1, index); 2387 } 2388 } 2389 2390 2393 public void _breakpoint(int pc) { 2394 dumpPcNumber(pc); 2395 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.BREAKPOINT]); 2396 writeNewLine(); 2397 } 2398 2399 2402 public void _impdep1(int pc) { 2403 dumpPcNumber(pc); 2404 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IMPDEP1]); 2405 writeNewLine(); 2406 } 2407 2408 2411 public void _impdep2(int pc) { 2412 dumpPcNumber(pc); 2413 buffer.append(OpcodeStringValues.BYTECODE_NAMES[IOpcodeMnemonics.IMPDEP2]); 2414 writeNewLine(); 2415 } 2416 2417 private boolean isCompact() { 2418 return (this.mode & ClassFileBytesDisassembler.COMPACT) != 0; 2419 } 2420 2421 private String returnConstantClassName(IConstantPoolEntry constantClass) { 2422 char[] className = constantClass.getClassInfoName(); 2423 if (className.length == 0) { 2424 return EMPTY_CLASS_NAME; 2425 } 2426 switch(className[0]) { 2427 case '[' : 2428 StringBuffer classNameBuffer = new StringBuffer (); 2429 Util.appendTypeSignature(className, 0, classNameBuffer, isCompact()); 2430 return classNameBuffer.toString(); 2431 default: 2432 return returnClassName(className); 2433 } 2434 } 2435 private String returnClassName(char[] classInfoName) { 2436 if (classInfoName.length == 0) { 2437 return EMPTY_CLASS_NAME; 2438 } else if (isCompact()) { 2439 int lastIndexOfSlash = CharOperation.lastIndexOf('/', classInfoName); 2440 if (lastIndexOfSlash != -1) { 2441 return new String (classInfoName, lastIndexOfSlash + 1, classInfoName.length - lastIndexOfSlash - 1); 2442 } 2443 } 2444 CharOperation.replace(classInfoName, '/', '.'); 2445 return new String (classInfoName); 2446 } 2447 2448 private String returnDeclaringClassName(IConstantPoolEntry constantRef) { 2449 final char[] className = constantRef.getClassName(); 2450 return returnClassName(className); 2451 } 2452 2453 private String returnMethodSignature(IConstantPoolEntry constantMethodref) { 2454 final char[] methodDescriptor = constantMethodref.getMethodDescriptor(); 2455 CharOperation.replace(methodDescriptor, '$', '#'); 2456 final char[] signature = Util.toString( 2457 constantMethodref.getClassName(), 2458 constantMethodref.getMethodName(), 2459 methodDescriptor, 2460 true, 2461 isCompact()).toCharArray(); 2462 CharOperation.replace(signature, '#', '$'); 2463 return String.valueOf(signature); 2464 } 2465 2466 private void writeNewLine() { 2467 this.buffer.append(lineSeparator); 2468 } 2469 2470 private void writeTabs() { 2471 for (int i = 0, max = this.tabNumber; i < max; i++) { 2472 this.buffer.append(Messages.disassembler_indentation); 2473 } 2474 } 2475 2476 private void writeExtraTabs(int extraTabs) { 2477 for (int i = 0, max = this.tabNumber + extraTabs; i < max; i++) { 2478 this.buffer.append(Messages.disassembler_indentation); 2479 } 2480 } 2481 2482} 2483 | Popular Tags |