hotspot/src/share/vm/c1/c1_LIRGenerator.cpp
changeset 40899 d7140c75c2c6
parent 40030 274935bc5150
child 41066 e8c366069761
equal deleted inserted replaced
40898:1c147e5e2b71 40899:d7140c75c2c6
  3081 
  3081 
  3082   __ cmp(lir_cond(x->cond()), left.result(), right.result());
  3082   __ cmp(lir_cond(x->cond()), left.result(), right.result());
  3083   __ cmove(lir_cond(x->cond()), t_val.result(), f_val.result(), reg, as_BasicType(x->x()->type()));
  3083   __ cmove(lir_cond(x->cond()), t_val.result(), f_val.result(), reg, as_BasicType(x->x()->type()));
  3084 }
  3084 }
  3085 
  3085 
       
  3086 #ifdef TRACE_HAVE_INTRINSICS
       
  3087 void LIRGenerator::do_ClassIDIntrinsic(Intrinsic* x) {
       
  3088   CodeEmitInfo* info = state_for(x);
       
  3089   CodeEmitInfo* info2 = new CodeEmitInfo(info); // Clone for the second null check
       
  3090 
       
  3091   assert(info != NULL, "must have info");
       
  3092   LIRItem arg(x->argument_at(0), this);
       
  3093 
       
  3094   arg.load_item();
       
  3095   LIR_Opr klass = new_register(T_METADATA);
       
  3096   __ move(new LIR_Address(arg.result(), java_lang_Class::klass_offset_in_bytes(), T_ADDRESS), klass, info);
       
  3097   LIR_Opr id = new_register(T_LONG);
       
  3098   ByteSize offset = TRACE_KLASS_TRACE_ID_OFFSET;
       
  3099   LIR_Address* trace_id_addr = new LIR_Address(klass, in_bytes(offset), T_LONG);
       
  3100 
       
  3101   __ move(trace_id_addr, id);
       
  3102   __ logical_or(id, LIR_OprFact::longConst(0x01l), id);
       
  3103   __ store(id, trace_id_addr);
       
  3104 
       
  3105 #ifdef TRACE_ID_META_BITS
       
  3106   __ logical_and(id, LIR_OprFact::longConst(~TRACE_ID_META_BITS), id);
       
  3107 #endif
       
  3108 #ifdef TRACE_ID_CLASS_SHIFT
       
  3109   __ unsigned_shift_right(id, TRACE_ID_CLASS_SHIFT, id);
       
  3110 #endif
       
  3111 
       
  3112   __ move(id, rlock_result(x));
       
  3113 }
       
  3114 #endif
       
  3115 
       
  3116 
  3086 void LIRGenerator::do_RuntimeCall(address routine, Intrinsic* x) {
  3117 void LIRGenerator::do_RuntimeCall(address routine, Intrinsic* x) {
  3087   assert(x->number_of_arguments() == 0, "wrong type");
  3118   assert(x->number_of_arguments() == 0, "wrong type");
  3088   // Enforce computation of _reserved_argument_area_size which is required on some platforms.
  3119   // Enforce computation of _reserved_argument_area_size which is required on some platforms.
  3089   BasicTypeList signature;
  3120   BasicTypeList signature;
  3090   CallingConvention* cc = frame_map()->c_calling_convention(&signature);
  3121   CallingConvention* cc = frame_map()->c_calling_convention(&signature);
  3106     do_FPIntrinsics(x);
  3137     do_FPIntrinsics(x);
  3107     break;
  3138     break;
  3108   }
  3139   }
  3109 
  3140 
  3110 #ifdef TRACE_HAVE_INTRINSICS
  3141 #ifdef TRACE_HAVE_INTRINSICS
       
  3142   case vmIntrinsics::_getClassId:
       
  3143     do_ClassIDIntrinsic(x);
       
  3144     break;
  3111   case vmIntrinsics::_counterTime:
  3145   case vmIntrinsics::_counterTime:
  3112     do_RuntimeCall(CAST_FROM_FN_PTR(address, TRACE_TIME_METHOD), x);
  3146     do_RuntimeCall(CAST_FROM_FN_PTR(address, TRACE_TIME_METHOD), x);
  3113     break;
  3147     break;
  3114 #endif
  3148 #endif
  3115 
  3149