case PREPARE_INT_opcode:case PREPARE_LONG_opcode: case ATTEMPT_INT_opcode:case ATTEMPT_LONG_opcode:
case PREPARE_INT_opcode:case PREPARE_ADDR_opcode: case ATTEMPT_INT_opcode:case ATTEMPT_ADDR_opcode:
  private static boolean checkEscapesThread (OPT_RegisterOperand use,       OPT_IR ir) {    OPT_Instruction inst = use.instruction;    OPT_Register reg = use.register;    switch (inst.getOpcode()) {      case INT_ASTORE_opcode:case LONG_ASTORE_opcode:      case FLOAT_ASTORE_opcode:case DOUBLE_ASTORE_opcode:      case BYTE_ASTORE_opcode:case SHORT_ASTORE_opcode:      case REF_ASTORE_opcode:        // as long as we don't store this operand elsewhere, all        // is OK        OPT_Operand value = AStore.getValue(inst);        if (value != use) {          return  false;        }         else {          return  true;        }      case GETFIELD_opcode:case GETSTATIC_opcode:      case INT_ALOAD_opcode:case LONG_ALOAD_opcode:      case FLOAT_ALOAD_opcode:case DOUBLE_ALOAD_opcode:      case BYTE_ALOAD_opcode:case UBYTE_ALOAD_opcode:      case BYTE_LOAD_opcode:case UBYTE_LOAD_opcode:      case SHORT_ALOAD_opcode:case USHORT_ALOAD_opcode:      case SHORT_LOAD_opcode:case USHORT_LOAD_opcode:      case REF_ALOAD_opcode:      case INT_LOAD_opcode: case LONG_LOAD_opcode:      case DOUBLE_LOAD_opcode: case REF_LOAD_opcode:        // all is OK, unless we load this register from memory        OPT_Operand result = ResultCarrier.getResult(inst);        if (result != use) {          return  false;        }         else {          return  true;        }      case PUTFIELD_opcode:        // as long as we don't store this operand elsewhere, all        // is OK. TODO: add more smarts.        value = PutField.getValue(inst);        if (value != use) {          return  false;        }         else {          return  true;        }      case PUTSTATIC_opcode:        // as long as we don't store this operand elsewhere, all        // is OK. TODO: add more smarts.        value = PutStatic.getValue(inst);        if (value != use) {          return  false;        }         else {          return  true;        }      case BYTE_STORE_opcode: case SHORT_STORE_opcode: case REF_STORE_opcode:      case INT_STORE_opcode:  case LONG_STORE_opcode: case DOUBLE_STORE_opcode:        // as long as we don't store this operand elsewhere, all        // is OK. TODO: add more smarts.        value = Store.getValue(inst);        if (value != use) {          return  false;        }         else {          return  true;        }        // the following instructions never cause an object to        // escape      case BOUNDS_CHECK_opcode:case MONITORENTER_opcode:      case MONITOREXIT_opcode:case NULL_CHECK_opcode:      case ARRAYLENGTH_opcode:case REF_IFCMP_opcode:      case INT_IFCMP_opcode:case IG_PATCH_POINT_opcode:      case IG_CLASS_TEST_opcode:case IG_METHOD_TEST_opcode:      case BOOLEAN_CMP_opcode:case OBJARRAY_STORE_CHECK_opcode:      case OBJARRAY_STORE_CHECK_NOTNULL_opcode:      case GET_OBJ_TIB_opcode:      case GET_TYPE_FROM_TIB_opcode:case NEW_opcode:case NEWARRAY_opcode:      case NEWOBJMULTIARRAY_opcode:case NEW_UNRESOLVED_opcode: case NEWARRAY_UNRESOLVED_opcode:      case INSTANCEOF_opcode:case INSTANCEOF_NOTNULL_opcode:      case INSTANCEOF_UNRESOLVED_opcode:      case CHECKCAST_opcode: case MUST_IMPLEMENT_INTERFACE_opcode:      case CHECKCAST_NOTNULL_opcode: case CHECKCAST_UNRESOLVED_opcode:      case GET_CAUGHT_EXCEPTION_opcode:      case IR_PROLOGUE_opcode:         return  false;      case RETURN_opcode:        // a return instruction might cause an object to escape,        // but not a parameter (whose escape properties are determined        // by caller)        if (ir.isParameter(use))          return  false;         else {          return  true;        }      case CALL_opcode:        OPT_MethodOperand mop = Call.getMethod(inst);        if (mop == null)          return  true;        if (!mop.hasPreciseTarget()) {          // if we're not sure of the dynamic target, give up          return true;        }        // try to get a method summary for the called method        OPT_MethodSummary summ = findOrCreateMethodSummary(mop.getTarget(), ir.options);        if (summ == null) {          // couldn't get one. assume the object escapes          return  true;        }        // if use is result of the call...        if (use == Call.getResult(inst)) {          if (summ.resultMayEscapeThread()) {            return  true;          }           else {            return  false;          }        }        // use is a parameter to the call.  Find out which one.        int p = getParameterIndex(use, inst);        if (summ.parameterMayEscapeThread(p)) {          // the call may make the parameter escape          return  true;        }         else {          return  false;        }      case REF_MOVE_opcode:case ATHROW_opcode:      case PREPARE_INT_opcode:case PREPARE_LONG_opcode:      case ATTEMPT_INT_opcode:case ATTEMPT_LONG_opcode:       case INT_MOVE_opcode:case INT_ADD_opcode:       case INT_MUL_opcode: case INT_DIV_opcode: case INT_REM_opcode:      case INT_NEG_opcode: case INT_ZERO_CHECK_opcode:                       case INT_OR_opcode: case INT_AND_opcode: case INT_XOR_opcode:      case INT_SUB_opcode:case INT_SHL_opcode:      case INT_SHR_opcode:case INT_USHR_opcode:case SYSCALL_opcode:      case GET_CLASS_OBJECT_opcode:case SET_CAUGHT_EXCEPTION_opcode:      case PHI_opcode: case INT_2LONG_opcode:      case REF_COND_MOVE_opcode: case INT_COND_MOVE_opcode://-#if RVM_FOR_64_ADDR      case LONG_OR_opcode: case LONG_AND_opcode: case LONG_XOR_opcode:      case LONG_SUB_opcode:case LONG_SHL_opcode: case LONG_ADD_opcode:      case LONG_SHR_opcode:case LONG_USHR_opcode:case LONG_NEG_opcode://-#endif//-#if RVM_FOR_IA32      case GET_JTOC_opcode: case GET_CURRENT_PROCESSOR_opcode://-#endif        // we don't currently analyze these instructions,        // so conservatively assume everything escapes        // TODO: add more smarts//-#if RVM_WITH_OSR      case YIELDPOINT_OSR_opcode:        // on stack replacement really a part of the current method, but        // we do not know exactly, so be conservative//-#endif        return  true;      default:        throw  new OPT_OptimizingCompilerException("OPT_SimpleEscape: Unexpected "                                                    + inst);    }  }