void interp1()

in src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java [1120:1431]


  void  interp1                             (BytecodeStream itr) {
    if (DEBUG) {
      System.err.println(" - bci " + itr.bci() + " " + itr.code());
      printCurrentState(System.err, itr, false);
    }

    //    if (TraceNewOopMapGeneration) {
    //      print_current_state(tty, itr, TraceNewOopMapGenerationDetailed);
    //    }

    // Should we report the results? Result is reported *before* the
    // instruction at the current bci is executed.  However, not for
    // calls. For calls we do not want to include the arguments, so we
    // postpone the reporting until they have been popped (in method
    // ppl).
    if (_report_result == true) {
      switch(itr.code()) {
      case Bytecodes._invokevirtual:
      case Bytecodes._invokespecial:
      case Bytecodes._invokestatic:
      case Bytecodes._invokeinterface:
      case Bytecodes._invokedynamic:
        _itr_send = itr;
        _report_result_for_send = true;
        break;
      default:
        fillStackmapForOpcodes(itr, vars(), stack(), _stack_top);
        break;
      }
    }

    // abstract interpretation of current opcode
    switch(itr.code()) {
    case Bytecodes._nop:               break;
    case Bytecodes._goto:              break;
    case Bytecodes._goto_w:            break;
    case Bytecodes._iinc:              break;
    case Bytecodes._return:            doReturnMonitorCheck();
      break;

    case Bytecodes._aconst_null:
    case Bytecodes._new:               ppush1(CellTypeState.makeLineRef(itr.bci()));
      break;

    case Bytecodes._iconst_m1:
    case Bytecodes._iconst_0:
    case Bytecodes._iconst_1:
    case Bytecodes._iconst_2:
    case Bytecodes._iconst_3:
    case Bytecodes._iconst_4:
    case Bytecodes._iconst_5:
    case Bytecodes._fconst_0:
    case Bytecodes._fconst_1:
    case Bytecodes._fconst_2:
    case Bytecodes._bipush:
    case Bytecodes._sipush:            ppush1(valCTS);             break;

    case Bytecodes._lconst_0:
    case Bytecodes._lconst_1:
    case Bytecodes._dconst_0:
    case Bytecodes._dconst_1:          ppush(vvCTS);               break;

    case Bytecodes._ldc2_w:            ppush(vvCTS);               break;

    case Bytecodes._ldc:               doLdc(itr.bci());           break;
    case Bytecodes._ldc_w:             doLdc(itr.bci());           break;

    case Bytecodes._iload:
    case Bytecodes._fload:             ppload(vCTS, itr.getIndex()); break;

    case Bytecodes._lload:
    case Bytecodes._dload:             ppload(vvCTS,itr.getIndex()); break;

    case Bytecodes._aload:             ppload(rCTS, itr.getIndex()); break;

    case Bytecodes._iload_0:
    case Bytecodes._fload_0:           ppload(vCTS, 0);            break;
    case Bytecodes._iload_1:
    case Bytecodes._fload_1:           ppload(vCTS, 1);            break;
    case Bytecodes._iload_2:
    case Bytecodes._fload_2:           ppload(vCTS, 2);            break;
    case Bytecodes._iload_3:
    case Bytecodes._fload_3:           ppload(vCTS, 3);            break;

    case Bytecodes._lload_0:
    case Bytecodes._dload_0:           ppload(vvCTS, 0);           break;
    case Bytecodes._lload_1:
    case Bytecodes._dload_1:           ppload(vvCTS, 1);           break;
    case Bytecodes._lload_2:
    case Bytecodes._dload_2:           ppload(vvCTS, 2);           break;
    case Bytecodes._lload_3:
    case Bytecodes._dload_3:           ppload(vvCTS, 3);           break;

    case Bytecodes._aload_0:           ppload(rCTS, 0);            break;
    case Bytecodes._aload_1:           ppload(rCTS, 1);            break;
    case Bytecodes._aload_2:           ppload(rCTS, 2);            break;
    case Bytecodes._aload_3:           ppload(rCTS, 3);            break;

    case Bytecodes._iaload:
    case Bytecodes._faload:
    case Bytecodes._baload:
    case Bytecodes._caload:
    case Bytecodes._saload:            pp(vrCTS, vCTS); break;

    case Bytecodes._laload:            pp(vrCTS, vvCTS);  break;
    case Bytecodes._daload:            pp(vrCTS, vvCTS); break;

    case Bytecodes._aaload:            ppNewRef(vrCTS, itr.bci()); break;

    case Bytecodes._istore:
    case Bytecodes._fstore:            ppstore(vCTS, itr.getIndex()); break;

    case Bytecodes._lstore:
    case Bytecodes._dstore:            ppstore(vvCTS, itr.getIndex()); break;

    case Bytecodes._astore:            doAstore(itr.getIndex());     break;

    case Bytecodes._istore_0:
    case Bytecodes._fstore_0:          ppstore(vCTS, 0);           break;
    case Bytecodes._istore_1:
    case Bytecodes._fstore_1:          ppstore(vCTS, 1);           break;
    case Bytecodes._istore_2:
    case Bytecodes._fstore_2:          ppstore(vCTS, 2);           break;
    case Bytecodes._istore_3:
    case Bytecodes._fstore_3:          ppstore(vCTS, 3);           break;

    case Bytecodes._lstore_0:
    case Bytecodes._dstore_0:          ppstore(vvCTS, 0);          break;
    case Bytecodes._lstore_1:
    case Bytecodes._dstore_1:          ppstore(vvCTS, 1);          break;
    case Bytecodes._lstore_2:
    case Bytecodes._dstore_2:          ppstore(vvCTS, 2);          break;
    case Bytecodes._lstore_3:
    case Bytecodes._dstore_3:          ppstore(vvCTS, 3);          break;

    case Bytecodes._astore_0:          doAstore(0);                break;
    case Bytecodes._astore_1:          doAstore(1);                break;
    case Bytecodes._astore_2:          doAstore(2);                break;
    case Bytecodes._astore_3:          doAstore(3);                break;

    case Bytecodes._iastore:
    case Bytecodes._fastore:
    case Bytecodes._bastore:
    case Bytecodes._castore:
    case Bytecodes._sastore:           ppop(vvrCTS);               break;
    case Bytecodes._lastore:
    case Bytecodes._dastore:           ppop(vvvrCTS);              break;
    case Bytecodes._aastore:           ppop(rvrCTS);               break;

    case Bytecodes._pop:               ppopAny(1);                 break;
    case Bytecodes._pop2:              ppopAny(2);                 break;

    case Bytecodes._dup:               ppdupswap(1, "11");         break;
    case Bytecodes._dup_x1:            ppdupswap(2, "121");        break;
    case Bytecodes._dup_x2:            ppdupswap(3, "1321");       break;
    case Bytecodes._dup2:              ppdupswap(2, "2121");       break;
    case Bytecodes._dup2_x1:           ppdupswap(3, "21321");      break;
    case Bytecodes._dup2_x2:           ppdupswap(4, "214321");     break;
    case Bytecodes._swap:              ppdupswap(2, "12");         break;

    case Bytecodes._iadd:
    case Bytecodes._fadd:
    case Bytecodes._isub:
    case Bytecodes._fsub:
    case Bytecodes._imul:
    case Bytecodes._fmul:
    case Bytecodes._idiv:
    case Bytecodes._fdiv:
    case Bytecodes._irem:
    case Bytecodes._frem:
    case Bytecodes._ishl:
    case Bytecodes._ishr:
    case Bytecodes._iushr:
    case Bytecodes._iand:
    case Bytecodes._ior:
    case Bytecodes._ixor:
    case Bytecodes._l2f:
    case Bytecodes._l2i:
    case Bytecodes._d2f:
    case Bytecodes._d2i:
    case Bytecodes._fcmpl:
    case Bytecodes._fcmpg:             pp(vvCTS, vCTS); break;

    case Bytecodes._ladd:
    case Bytecodes._dadd:
    case Bytecodes._lsub:
    case Bytecodes._dsub:
    case Bytecodes._lmul:
    case Bytecodes._dmul:
    case Bytecodes._ldiv:
    case Bytecodes._ddiv:
    case Bytecodes._lrem:
    case Bytecodes._drem:
    case Bytecodes._land:
    case Bytecodes._lor:
    case Bytecodes._lxor:              pp(vvvvCTS, vvCTS); break;

    case Bytecodes._ineg:
    case Bytecodes._fneg:
    case Bytecodes._i2f:
    case Bytecodes._f2i:
    case Bytecodes._i2c:
    case Bytecodes._i2s:
    case Bytecodes._i2b:               pp(vCTS, vCTS); break;

    case Bytecodes._lneg:
    case Bytecodes._dneg:
    case Bytecodes._l2d:
    case Bytecodes._d2l:               pp(vvCTS, vvCTS); break;

    case Bytecodes._lshl:
    case Bytecodes._lshr:
    case Bytecodes._lushr:             pp(vvvCTS, vvCTS); break;

    case Bytecodes._i2l:
    case Bytecodes._i2d:
    case Bytecodes._f2l:
    case Bytecodes._f2d:               pp(vCTS, vvCTS); break;

    case Bytecodes._lcmp:              pp(vvvvCTS, vCTS); break;
    case Bytecodes._dcmpl:
    case Bytecodes._dcmpg:             pp(vvvvCTS, vCTS); break;

    case Bytecodes._ifeq:
    case Bytecodes._ifne:
    case Bytecodes._iflt:
    case Bytecodes._ifge:
    case Bytecodes._ifgt:
    case Bytecodes._ifle:
    case Bytecodes._tableswitch:       ppop1(valCTS);
      break;
    case Bytecodes._ireturn:
    case Bytecodes._freturn:           doReturnMonitorCheck();
      ppop1(valCTS);
      break;
    case Bytecodes._if_icmpeq:
    case Bytecodes._if_icmpne:
    case Bytecodes._if_icmplt:
    case Bytecodes._if_icmpge:
    case Bytecodes._if_icmpgt:
    case Bytecodes._if_icmple:         ppop(vvCTS);
      break;

    case Bytecodes._lreturn:           doReturnMonitorCheck();
      ppop(vvCTS);
      break;

    case Bytecodes._dreturn:           doReturnMonitorCheck();
      ppop(vvCTS);
      break;

    case Bytecodes._if_acmpeq:
    case Bytecodes._if_acmpne:         ppop(rrCTS);                 break;

    case Bytecodes._jsr:               doJsr(itr.dest());          break;
    case Bytecodes._jsr_w:             doJsr(itr.dest_w());        break;

    case Bytecodes._getstatic:         doField(true,  true,  itr.getIndexU2Cpcache(), itr.bci(), itr.code()); break;
    case Bytecodes._putstatic:         doField(false, true,  itr.getIndexU2Cpcache(), itr.bci(), itr.code()); break;
    case Bytecodes._getfield:          doField(true,  false, itr.getIndexU2Cpcache(), itr.bci(), itr.code()); break;
    case Bytecodes._putfield:          doField(false, false, itr.getIndexU2Cpcache(), itr.bci(), itr.code()); break;

    case Bytecodes._invokevirtual:
    case Bytecodes._invokespecial:     doMethod(false, false, itr.getIndexU2Cpcache(), itr.bci(), itr.code()); break;
    case Bytecodes._invokestatic:      doMethod(true,  false, itr.getIndexU2Cpcache(), itr.bci(), itr.code()); break;
    case Bytecodes._invokedynamic:     doMethod(true,  false, itr.getIndexU4(),        itr.bci(), itr.code()); break;
    case Bytecodes._invokeinterface:   doMethod(false,  true, itr.getIndexU2Cpcache(), itr.bci(), itr.code()); break;
    case Bytecodes._newarray:
    case Bytecodes._anewarray:         ppNewRef(vCTS, itr.bci()); break;
    case Bytecodes._checkcast:         doCheckcast(); break;
    case Bytecodes._arraylength:
    case Bytecodes._instanceof:        pp(rCTS, vCTS); break;
    case Bytecodes._monitorenter:      doMonitorenter(itr.bci()); break;
    case Bytecodes._monitorexit:       doMonitorexit(itr.bci()); break;

    case Bytecodes._athrow:            // handled by do_exception_edge() BUT ...
      // vlh(apple): doExceptionEdge() does not get
      // called if method has no exception handlers
      if ((!_has_exceptions) && (_monitor_top > 0)) {
        _monitor_safe = false;
      }
      break;

    case Bytecodes._areturn:           doReturnMonitorCheck();
      ppop1(refCTS);
      break;
    case Bytecodes._ifnull:
    case Bytecodes._ifnonnull:         ppop1(refCTS); break;
    case Bytecodes._multianewarray:    doMultianewarray(itr.codeAt(itr.bci() + 3), itr.bci()); break;

    case Bytecodes._wide:              throw new RuntimeException("Iterator should skip this bytecode");
    case Bytecodes._ret:                                           break;

      // Java opcodes
    case Bytecodes._fast_aaccess_0:     ppNewRef(rCTS, itr.bci()); break; // Pair bytecode for (aload_0, _fast_agetfield)

    case Bytecodes._fast_iaccess_0:     ppush1(valCTS);            break; // Pair bytecode for (aload_0, _fast_igetfield)

    case Bytecodes._fast_igetfield:     pp(rCTS, vCTS);            break;

    case Bytecodes._fast_agetfield:     ppNewRef(rCTS, itr.bci()); break;

    case Bytecodes._fast_aload_0:       ppload(rCTS,  0);          break;

    case Bytecodes._lookupswitch:
    case Bytecodes._fast_linearswitch:
    case Bytecodes._fast_binaryswitch:  ppop1(valCTS);             break;

    default:
      throw new RuntimeException("unexpected opcode: " + itr.code());
    }
  }