1 17 package org.apache.bcel.verifier.structurals; 18 19 20 import org.apache.bcel.Constants; 21 import org.apache.bcel.classfile.Constant; 22 import org.apache.bcel.classfile.ConstantDouble; 23 import org.apache.bcel.classfile.ConstantFloat; 24 import org.apache.bcel.classfile.ConstantInteger; 25 import org.apache.bcel.classfile.ConstantLong; 26 import org.apache.bcel.classfile.ConstantString; 27 import org.apache.bcel.generic.*; 28 29 57 public class ExecutionVisitor extends EmptyVisitor implements Visitor{ 58 59 62 private Frame frame = null; 63 64 68 private ConstantPoolGen cpg = null; 69 70 73 public ExecutionVisitor(){} 74 75 79 private OperandStack stack(){ 80 return frame.getStack(); 81 } 82 83 87 private LocalVariables locals(){ 88 return frame.getLocals(); 89 } 90 91 94 public void setConstantPoolGen(ConstantPoolGen cpg){ 95 this.cpg = cpg; 96 } 97 98 104 public void setFrame(Frame f){ 105 this.frame = f; 106 } 107 108 118 119 public void visitAALOAD(AALOAD o){ 120 stack().pop(); Type t = stack().pop(); if (t == Type.NULL){ 124 stack().push(Type.NULL); 125 } else{ 127 ArrayType at = (ArrayType) t; 128 stack().push(at.getElementType()); 129 } 130 } 131 132 public void visitAASTORE(AASTORE o){ 133 stack().pop(); 134 stack().pop(); 135 stack().pop(); 136 } 137 138 public void visitACONST_NULL(ACONST_NULL o){ 139 stack().push(Type.NULL); 140 } 141 142 public void visitALOAD(ALOAD o){ 143 stack().push(locals().get(o.getIndex())); 144 } 145 146 public void visitANEWARRAY(ANEWARRAY o){ 147 stack().pop(); stack().push( new ArrayType(o.getType(cpg), 1) ); 149 } 150 151 public void visitARETURN(ARETURN o){ 152 stack().pop(); 153 } 154 155 public void visitARRAYLENGTH(ARRAYLENGTH o){ 156 stack().pop(); 157 stack().push(Type.INT); 158 } 159 160 161 public void visitASTORE(ASTORE o){ 162 locals().set(o.getIndex(), stack().pop()); 163 } 165 166 167 public void visitATHROW(ATHROW o){ 168 Type t = stack().pop(); 169 stack().clear(); 170 if (t.equals(Type.NULL)) { 171 stack().push(Type.getType("Ljava/lang/NullPointerException;")); 172 } else { 173 stack().push(t); 174 } 175 } 176 177 178 public void visitBALOAD(BALOAD o){ 179 stack().pop(); 180 stack().pop(); 181 stack().push(Type.INT); 182 } 183 184 185 public void visitBASTORE(BASTORE o){ 186 stack().pop(); 187 stack().pop(); 188 stack().pop(); 189 } 190 191 192 public void visitBIPUSH(BIPUSH o){ 193 stack().push(Type.INT); 194 } 195 196 197 public void visitCALOAD(CALOAD o){ 198 stack().pop(); 199 stack().pop(); 200 stack().push(Type.INT); 201 } 202 203 public void visitCASTORE(CASTORE o){ 204 stack().pop(); 205 stack().pop(); 206 stack().pop(); 207 } 208 209 public void visitCHECKCAST(CHECKCAST o){ 210 stack().pop(); 216 stack().push(o.getType(cpg)); 217 } 218 219 220 public void visitD2F(D2F o){ 221 stack().pop(); 222 stack().push(Type.FLOAT); 223 } 224 225 public void visitD2I(D2I o){ 226 stack().pop(); 227 stack().push(Type.INT); 228 } 229 230 public void visitD2L(D2L o){ 231 stack().pop(); 232 stack().push(Type.LONG); 233 } 234 235 public void visitDADD(DADD o){ 236 stack().pop(); 237 stack().pop(); 238 stack().push(Type.DOUBLE); 239 } 240 241 public void visitDALOAD(DALOAD o){ 242 stack().pop(); 243 stack().pop(); 244 stack().push(Type.DOUBLE); 245 } 246 247 public void visitDASTORE(DASTORE o){ 248 stack().pop(); 249 stack().pop(); 250 stack().pop(); 251 } 252 253 public void visitDCMPG(DCMPG o){ 254 stack().pop(); 255 stack().pop(); 256 stack().push(Type.INT); 257 } 258 259 public void visitDCMPL(DCMPL o){ 260 stack().pop(); 261 stack().pop(); 262 stack().push(Type.INT); 263 } 264 265 public void visitDCONST(DCONST o){ 266 stack().push(Type.DOUBLE); 267 } 268 269 public void visitDDIV(DDIV o){ 270 stack().pop(); 271 stack().pop(); 272 stack().push(Type.DOUBLE); 273 } 274 275 public void visitDLOAD(DLOAD o){ 276 stack().push(Type.DOUBLE); 277 } 278 279 public void visitDMUL(DMUL o){ 280 stack().pop(); 281 stack().pop(); 282 stack().push(Type.DOUBLE); 283 } 284 285 public void visitDNEG(DNEG o){ 286 stack().pop(); 287 stack().push(Type.DOUBLE); 288 } 289 290 public void visitDREM(DREM o){ 291 stack().pop(); 292 stack().pop(); 293 stack().push(Type.DOUBLE); 294 } 295 296 public void visitDRETURN(DRETURN o){ 297 stack().pop(); 298 } 299 300 public void visitDSTORE(DSTORE o){ 301 locals().set(o.getIndex(), stack().pop()); 302 locals().set(o.getIndex()+1, Type.UNKNOWN); 303 } 304 305 public void visitDSUB(DSUB o){ 306 stack().pop(); 307 stack().pop(); 308 stack().push(Type.DOUBLE); 309 } 310 311 public void visitDUP(DUP o){ 312 Type t = stack().pop(); 313 stack().push(t); 314 stack().push(t); 315 } 316 317 public void visitDUP_X1(DUP_X1 o){ 318 Type w1 = stack().pop(); 319 Type w2 = stack().pop(); 320 stack().push(w1); 321 stack().push(w2); 322 stack().push(w1); 323 } 324 325 public void visitDUP_X2(DUP_X2 o){ 326 Type w1 = stack().pop(); 327 Type w2 = stack().pop(); 328 if (w2.getSize() == 2){ 329 stack().push(w1); 330 stack().push(w2); 331 stack().push(w1); 332 } 333 else{ 334 Type w3 = stack().pop(); 335 stack().push(w1); 336 stack().push(w3); 337 stack().push(w2); 338 stack().push(w1); 339 } 340 } 341 342 public void visitDUP2(DUP2 o){ 343 Type t = stack().pop(); 344 if (t.getSize() == 2){ 345 stack().push(t); 346 stack().push(t); 347 } 348 else{ Type u = stack().pop(); 350 stack().push(u); 351 stack().push(t); 352 stack().push(u); 353 stack().push(t); 354 } 355 } 356 357 public void visitDUP2_X1(DUP2_X1 o){ 358 Type t = stack().pop(); 359 if (t.getSize() == 2){ 360 Type u = stack().pop(); 361 stack().push(t); 362 stack().push(u); 363 stack().push(t); 364 } 365 else{ Type u = stack().pop(); 367 Type v = stack().pop(); 368 stack().push(u); 369 stack().push(t); 370 stack().push(v); 371 stack().push(u); 372 stack().push(t); 373 } 374 } 375 376 public void visitDUP2_X2(DUP2_X2 o){ 377 Type t = stack().pop(); 378 if (t.getSize() == 2){ 379 Type u = stack().pop(); 380 if (u.getSize() == 2){ 381 stack().push(t); 382 stack().push(u); 383 stack().push(t); 384 }else{ 385 Type v = stack().pop(); 386 stack().push(t); 387 stack().push(v); 388 stack().push(u); 389 stack().push(t); 390 } 391 } 392 else{ Type u = stack().pop(); 394 Type v = stack().pop(); 395 if (v.getSize() == 2){ 396 stack().push(u); 397 stack().push(t); 398 stack().push(v); 399 stack().push(u); 400 stack().push(t); 401 }else{ 402 Type w = stack().pop(); 403 stack().push(u); 404 stack().push(t); 405 stack().push(w); 406 stack().push(v); 407 stack().push(u); 408 stack().push(t); 409 } 410 } 411 } 412 413 public void visitF2D(F2D o){ 414 stack().pop(); 415 stack().push(Type.DOUBLE); 416 } 417 418 public void visitF2I(F2I o){ 419 stack().pop(); 420 stack().push(Type.INT); 421 } 422 423 public void visitF2L(F2L o){ 424 stack().pop(); 425 stack().push(Type.LONG); 426 } 427 428 public void visitFADD(FADD o){ 429 stack().pop(); 430 stack().pop(); 431 stack().push(Type.FLOAT); 432 } 433 434 public void visitFALOAD(FALOAD o){ 435 stack().pop(); 436 stack().pop(); 437 stack().push(Type.FLOAT); 438 } 439 440 public void visitFASTORE(FASTORE o){ 441 stack().pop(); 442 stack().pop(); 443 stack().pop(); 444 } 445 446 public void visitFCMPG(FCMPG o){ 447 stack().pop(); 448 stack().pop(); 449 stack().push(Type.INT); 450 } 451 452 public void visitFCMPL(FCMPL o){ 453 stack().pop(); 454 stack().pop(); 455 stack().push(Type.INT); 456 } 457 458 public void visitFCONST(FCONST o){ 459 stack().push(Type.FLOAT); 460 } 461 462 public void visitFDIV(FDIV o){ 463 stack().pop(); 464 stack().pop(); 465 stack().push(Type.FLOAT); 466 } 467 468 public void visitFLOAD(FLOAD o){ 469 stack().push(Type.FLOAT); 470 } 471 472 public void visitFMUL(FMUL o){ 473 stack().pop(); 474 stack().pop(); 475 stack().push(Type.FLOAT); 476 } 477 478 public void visitFNEG(FNEG o){ 479 stack().pop(); 480 stack().push(Type.FLOAT); 481 } 482 483 public void visitFREM(FREM o){ 484 stack().pop(); 485 stack().pop(); 486 stack().push(Type.FLOAT); 487 } 488 489 public void visitFRETURN(FRETURN o){ 490 stack().pop(); 491 } 492 493 public void visitFSTORE(FSTORE o){ 494 locals().set(o.getIndex(), stack().pop()); 495 } 496 497 public void visitFSUB(FSUB o){ 498 stack().pop(); 499 stack().pop(); 500 stack().push(Type.FLOAT); 501 } 502 503 public void visitGETFIELD(GETFIELD o){ 504 stack().pop(); 505 Type t = o.getFieldType(cpg); 506 if ( t.equals(Type.BOOLEAN) || 507 t.equals(Type.CHAR) || 508 t.equals(Type.BYTE) || 509 t.equals(Type.SHORT) ) { 510 t = Type.INT; 511 } 512 stack().push(t); 513 } 514 515 public void visitGETSTATIC(GETSTATIC o){ 516 Type t = o.getFieldType(cpg); 517 if ( t.equals(Type.BOOLEAN) || 518 t.equals(Type.CHAR) || 519 t.equals(Type.BYTE) || 520 t.equals(Type.SHORT) ) { 521 t = Type.INT; 522 } 523 stack().push(t); 524 } 525 526 public void visitGOTO(GOTO o){ 527 } 529 530 public void visitGOTO_W(GOTO_W o){ 531 } 533 534 public void visitI2B(I2B o){ 535 stack().pop(); 536 stack().push(Type.INT); 537 } 538 539 public void visitI2C(I2C o){ 540 stack().pop(); 541 stack().push(Type.INT); 542 } 543 544 public void visitI2D(I2D o){ 545 stack().pop(); 546 stack().push(Type.DOUBLE); 547 } 548 549 public void visitI2F(I2F o){ 550 stack().pop(); 551 stack().push(Type.FLOAT); 552 } 553 554 public void visitI2L(I2L o){ 555 stack().pop(); 556 stack().push(Type.LONG); 557 } 558 559 public void visitI2S(I2S o){ 560 stack().pop(); 561 stack().push(Type.INT); 562 } 563 564 public void visitIADD(IADD o){ 565 stack().pop(); 566 stack().pop(); 567 stack().push(Type.INT); 568 } 569 570 public void visitIALOAD(IALOAD o){ 571 stack().pop(); 572 stack().pop(); 573 stack().push(Type.INT); 574 } 575 576 public void visitIAND(IAND o){ 577 stack().pop(); 578 stack().pop(); 579 stack().push(Type.INT); 580 } 581 582 public void visitIASTORE(IASTORE o){ 583 stack().pop(); 584 stack().pop(); 585 stack().pop(); 586 } 587 588 public void visitICONST(ICONST o){ 589 stack().push(Type.INT); 590 } 591 592 public void visitIDIV(IDIV o){ 593 stack().pop(); 594 stack().pop(); 595 stack().push(Type.INT); 596 } 597 598 public void visitIF_ACMPEQ(IF_ACMPEQ o){ 599 stack().pop(); 600 stack().pop(); 601 } 602 603 public void visitIF_ACMPNE(IF_ACMPNE o){ 604 stack().pop(); 605 stack().pop(); 606 } 607 608 public void visitIF_ICMPEQ(IF_ICMPEQ o){ 609 stack().pop(); 610 stack().pop(); 611 } 612 613 public void visitIF_ICMPGE(IF_ICMPGE o){ 614 stack().pop(); 615 stack().pop(); 616 } 617 618 public void visitIF_ICMPGT(IF_ICMPGT o){ 619 stack().pop(); 620 stack().pop(); 621 } 622 623 public void visitIF_ICMPLE(IF_ICMPLE o){ 624 stack().pop(); 625 stack().pop(); 626 } 627 628 public void visitIF_ICMPLT(IF_ICMPLT o){ 629 stack().pop(); 630 stack().pop(); 631 } 632 633 public void visitIF_ICMPNE(IF_ICMPNE o){ 634 stack().pop(); 635 stack().pop(); 636 } 637 638 public void visitIFEQ(IFEQ o){ 639 stack().pop(); 640 } 641 642 public void visitIFGE(IFGE o){ 643 stack().pop(); 644 } 645 646 public void visitIFGT(IFGT o){ 647 stack().pop(); 648 } 649 650 public void visitIFLE(IFLE o){ 651 stack().pop(); 652 } 653 654 public void visitIFLT(IFLT o){ 655 stack().pop(); 656 } 657 658 public void visitIFNE(IFNE o){ 659 stack().pop(); 660 } 661 662 public void visitIFNONNULL(IFNONNULL o){ 663 stack().pop(); 664 } 665 666 public void visitIFNULL(IFNULL o){ 667 stack().pop(); 668 } 669 670 public void visitIINC(IINC o){ 671 } 673 674 public void visitILOAD(ILOAD o){ 675 stack().push(Type.INT); 676 } 677 678 public void visitIMUL(IMUL o){ 679 stack().pop(); 680 stack().pop(); 681 stack().push(Type.INT); 682 } 683 684 public void visitINEG(INEG o){ 685 stack().pop(); 686 stack().push(Type.INT); 687 } 688 689 public void visitINSTANCEOF(INSTANCEOF o){ 690 stack().pop(); 691 stack().push(Type.INT); 692 } 693 694 public void visitINVOKEINTERFACE(INVOKEINTERFACE o){ 695 stack().pop(); for (int i=0; i<o.getArgumentTypes(cpg).length; i++){ 697 stack().pop(); 698 } 699 if (o.getReturnType(cpg) != Type.VOID){ 704 Type t = o.getReturnType(cpg); 705 if ( t.equals(Type.BOOLEAN) || 706 t.equals(Type.CHAR) || 707 t.equals(Type.BYTE) || 708 t.equals(Type.SHORT) ) { 709 t = Type.INT; 710 } 711 stack().push(t); 712 } 713 } 714 715 public void visitINVOKESPECIAL(INVOKESPECIAL o){ 716 if (o.getMethodName(cpg).equals(Constants.CONSTRUCTOR_NAME)){ 717 UninitializedObjectType t = (UninitializedObjectType) stack().peek(o.getArgumentTypes(cpg).length); 718 if (t == Frame._this){ 719 Frame._this = null; 720 } 721 stack().initializeObject(t); 722 locals().initializeObject(t); 723 } 724 stack().pop(); for (int i=0; i<o.getArgumentTypes(cpg).length; i++){ 726 stack().pop(); 727 } 728 if (o.getReturnType(cpg) != Type.VOID){ 733 Type t = o.getReturnType(cpg); 734 if ( t.equals(Type.BOOLEAN) || 735 t.equals(Type.CHAR) || 736 t.equals(Type.BYTE) || 737 t.equals(Type.SHORT) ) { 738 t = Type.INT; 739 } 740 stack().push(t); 741 } 742 } 743 744 public void visitINVOKESTATIC(INVOKESTATIC o){ 745 for (int i=0; i<o.getArgumentTypes(cpg).length; i++){ 746 stack().pop(); 747 } 748 if (o.getReturnType(cpg) != Type.VOID){ 753 Type t = o.getReturnType(cpg); 754 if ( t.equals(Type.BOOLEAN) || 755 t.equals(Type.CHAR) || 756 t.equals(Type.BYTE) || 757 t.equals(Type.SHORT) ) { 758 t = Type.INT; 759 } 760 stack().push(t); 761 } 762 } 763 764 public void visitINVOKEVIRTUAL(INVOKEVIRTUAL o){ 765 stack().pop(); for (int i=0; i<o.getArgumentTypes(cpg).length; i++){ 767 stack().pop(); 768 } 769 if (o.getReturnType(cpg) != Type.VOID){ 774 Type t = o.getReturnType(cpg); 775 if ( t.equals(Type.BOOLEAN) || 776 t.equals(Type.CHAR) || 777 t.equals(Type.BYTE) || 778 t.equals(Type.SHORT) ) { 779 t = Type.INT; 780 } 781 stack().push(t); 782 } 783 } 784 785 public void visitIOR(IOR o){ 786 stack().pop(); 787 stack().pop(); 788 stack().push(Type.INT); 789 } 790 791 public void visitIREM(IREM o){ 792 stack().pop(); 793 stack().pop(); 794 stack().push(Type.INT); 795 } 796 797 public void visitIRETURN(IRETURN o){ 798 stack().pop(); 799 } 800 801 public void visitISHL(ISHL o){ 802 stack().pop(); 803 stack().pop(); 804 stack().push(Type.INT); 805 } 806 807 public void visitISHR(ISHR o){ 808 stack().pop(); 809 stack().pop(); 810 stack().push(Type.INT); 811 } 812 813 public void visitISTORE(ISTORE o){ 814 locals().set(o.getIndex(), stack().pop()); 815 } 816 817 public void visitISUB(ISUB o){ 818 stack().pop(); 819 stack().pop(); 820 stack().push(Type.INT); 821 } 822 823 public void visitIUSHR(IUSHR o){ 824 stack().pop(); 825 stack().pop(); 826 stack().push(Type.INT); 827 } 828 829 public void visitIXOR(IXOR o){ 830 stack().pop(); 831 stack().pop(); 832 stack().push(Type.INT); 833 } 834 835 836 public void visitJSR(JSR o){ 837 stack().push(new ReturnaddressType(o.physicalSuccessor())); 838 } 840 841 842 public void visitJSR_W(JSR_W o){ 843 stack().push(new ReturnaddressType(o.physicalSuccessor())); 844 } 845 846 847 public void visitL2D(L2D o){ 848 stack().pop(); 849 stack().push(Type.DOUBLE); 850 } 851 852 public void visitL2F(L2F o){ 853 stack().pop(); 854 stack().push(Type.FLOAT); 855 } 856 857 public void visitL2I(L2I o){ 858 stack().pop(); 859 stack().push(Type.INT); 860 } 861 862 public void visitLADD(LADD o){ 863 stack().pop(); 864 stack().pop(); 865 stack().push(Type.LONG); 866 } 867 868 public void visitLALOAD(LALOAD o){ 869 stack().pop(); 870 stack().pop(); 871 stack().push(Type.LONG); 872 } 873 874 public void visitLAND(LAND o){ 875 stack().pop(); 876 stack().pop(); 877 stack().push(Type.LONG); 878 } 879 880 public void visitLASTORE(LASTORE o){ 881 stack().pop(); 882 stack().pop(); 883 stack().pop(); 884 } 885 886 public void visitLCMP(LCMP o){ 887 stack().pop(); 888 stack().pop(); 889 stack().push(Type.INT); 890 } 891 892 public void visitLCONST(LCONST o){ 893 stack().push(Type.LONG); 894 } 895 896 public void visitLDC(LDC o){ 897 Constant c = cpg.getConstant(o.getIndex()); 898 if (c instanceof ConstantInteger){ 899 stack().push(Type.INT); 900 } 901 if (c instanceof ConstantFloat){ 902 stack().push(Type.FLOAT); 903 } 904 if (c instanceof ConstantString){ 905 stack().push(Type.STRING); 906 } 907 } 908 909 public void visitLDC_W(LDC_W o){ 910 Constant c = cpg.getConstant(o.getIndex()); 911 if (c instanceof ConstantInteger){ 912 stack().push(Type.INT); 913 } 914 if (c instanceof ConstantFloat){ 915 stack().push(Type.FLOAT); 916 } 917 if (c instanceof ConstantString){ 918 stack().push(Type.STRING); 919 } 920 } 921 922 public void visitLDC2_W(LDC2_W o){ 923 Constant c = cpg.getConstant(o.getIndex()); 924 if (c instanceof ConstantLong){ 925 stack().push(Type.LONG); 926 } 927 if (c instanceof ConstantDouble){ 928 stack().push(Type.DOUBLE); 929 } 930 } 931 932 public void visitLDIV(LDIV o){ 933 stack().pop(); 934 stack().pop(); 935 stack().push(Type.LONG); 936 } 937 938 public void visitLLOAD(LLOAD o){ 939 stack().push(locals().get(o.getIndex())); 940 } 941 942 public void visitLMUL(LMUL o){ 943 stack().pop(); 944 stack().pop(); 945 stack().push(Type.LONG); 946 } 947 948 public void visitLNEG(LNEG o){ 949 stack().pop(); 950 stack().push(Type.LONG); 951 } 952 953 public void visitLOOKUPSWITCH(LOOKUPSWITCH o){ 954 stack().pop(); } 956 957 public void visitLOR(LOR o){ 958 stack().pop(); 959 stack().pop(); 960 stack().push(Type.LONG); 961 } 962 963 public void visitLREM(LREM o){ 964 stack().pop(); 965 stack().pop(); 966 stack().push(Type.LONG); 967 } 968 969 public void visitLRETURN(LRETURN o){ 970 stack().pop(); 971 } 972 973 public void visitLSHL(LSHL o){ 974 stack().pop(); 975 stack().pop(); 976 stack().push(Type.LONG); 977 } 978 979 public void visitLSHR(LSHR o){ 980 stack().pop(); 981 stack().pop(); 982 stack().push(Type.LONG); 983 } 984 985 public void visitLSTORE(LSTORE o){ 986 locals().set(o.getIndex(), stack().pop()); 987 locals().set(o.getIndex()+1, Type.UNKNOWN); 988 } 989 990 public void visitLSUB(LSUB o){ 991 stack().pop(); 992 stack().pop(); 993 stack().push(Type.LONG); 994 } 995 996 public void visitLUSHR(LUSHR o){ 997 stack().pop(); 998 stack().pop(); 999 stack().push(Type.LONG); 1000 } 1001 1002 public void visitLXOR(LXOR o){ 1003 stack().pop(); 1004 stack().pop(); 1005 stack().push(Type.LONG); 1006 } 1007 1008 public void visitMONITORENTER(MONITORENTER o){ 1009 stack().pop(); 1010 } 1011 1012 public void visitMONITOREXIT(MONITOREXIT o){ 1013 stack().pop(); 1014 } 1015 1016 public void visitMULTIANEWARRAY(MULTIANEWARRAY o){ 1017 for (int i=0; i<o.getDimensions(); i++){ 1018 stack().pop(); 1019 } 1020 stack().push(o.getType(cpg)); 1021 } 1022 1023 public void visitNEW(NEW o){ 1024 stack().push(new UninitializedObjectType((ObjectType) (o.getType(cpg)))); 1025 } 1026 1027 public void visitNEWARRAY(NEWARRAY o){ 1028 stack().pop(); 1029 stack().push(o.getType()); 1030 } 1031 1032 public void visitNOP(NOP o){ 1033 } 1034 1035 public void visitPOP(POP o){ 1036 stack().pop(); 1037 } 1038 1039 public void visitPOP2(POP2 o){ 1040 Type t = stack().pop(); 1041 if (t.getSize() == 1){ 1042 stack().pop(); 1043 } 1044 } 1045 1046 public void visitPUTFIELD(PUTFIELD o){ 1047 stack().pop(); 1048 stack().pop(); 1049 } 1050 1051 public void visitPUTSTATIC(PUTSTATIC o){ 1052 stack().pop(); 1053 } 1054 1055 public void visitRET(RET o){ 1056 } 1059 1060 public void visitRETURN(RETURN o){ 1061 } 1063 1064 public void visitSALOAD(SALOAD o){ 1065 stack().pop(); 1066 stack().pop(); 1067 stack().push(Type.INT); 1068 } 1069 1070 public void visitSASTORE(SASTORE o){ 1071 stack().pop(); 1072 stack().pop(); 1073 stack().pop(); 1074 } 1075 1076 public void visitSIPUSH(SIPUSH o){ 1077 stack().push(Type.INT); 1078 } 1079 1080 public void visitSWAP(SWAP o){ 1081 Type t = stack().pop(); 1082 Type u = stack().pop(); 1083 stack().push(t); 1084 stack().push(u); 1085 } 1086 1087 public void visitTABLESWITCH(TABLESWITCH o){ 1088 stack().pop(); 1089 } 1090} 1091 | Popular Tags |