hotspot/src/share/vm/opto/library_call.cpp
changeset 41330 8b2580e63aa0
parent 41323 ddd5600d4762
parent 41066 e8c366069761
child 42037 6269c5b5b651
equal deleted inserted replaced
41329:f79b4f079360 41330:8b2580e63aa0
   252   bool inline_unsafe_newArray(bool uninitialized);
   252   bool inline_unsafe_newArray(bool uninitialized);
   253   bool inline_unsafe_copyMemory();
   253   bool inline_unsafe_copyMemory();
   254   bool inline_native_currentThread();
   254   bool inline_native_currentThread();
   255 
   255 
   256   bool inline_native_time_funcs(address method, const char* funcName);
   256   bool inline_native_time_funcs(address method, const char* funcName);
       
   257 #ifdef TRACE_HAVE_INTRINSICS
       
   258   bool inline_native_classID();
       
   259 #endif
   257   bool inline_native_isInterrupted();
   260   bool inline_native_isInterrupted();
   258   bool inline_native_Class_query(vmIntrinsics::ID id);
   261   bool inline_native_Class_query(vmIntrinsics::ID id);
   259   bool inline_native_subtype_check();
   262   bool inline_native_subtype_check();
   260   bool inline_native_getLength();
   263   bool inline_native_getLength();
   261   bool inline_array_copyOf(bool is_copyOfRange);
   264   bool inline_array_copyOf(bool is_copyOfRange);
   707   case vmIntrinsics::_currentThread:            return inline_native_currentThread();
   710   case vmIntrinsics::_currentThread:            return inline_native_currentThread();
   708   case vmIntrinsics::_isInterrupted:            return inline_native_isInterrupted();
   711   case vmIntrinsics::_isInterrupted:            return inline_native_isInterrupted();
   709 
   712 
   710 #ifdef TRACE_HAVE_INTRINSICS
   713 #ifdef TRACE_HAVE_INTRINSICS
   711   case vmIntrinsics::_counterTime:              return inline_native_time_funcs(CAST_FROM_FN_PTR(address, TRACE_TIME_METHOD), "counterTime");
   714   case vmIntrinsics::_counterTime:              return inline_native_time_funcs(CAST_FROM_FN_PTR(address, TRACE_TIME_METHOD), "counterTime");
       
   715   case vmIntrinsics::_getClassId:               return inline_native_classID();
   712 #endif
   716 #endif
   713   case vmIntrinsics::_currentTimeMillis:        return inline_native_time_funcs(CAST_FROM_FN_PTR(address, os::javaTimeMillis), "currentTimeMillis");
   717   case vmIntrinsics::_currentTimeMillis:        return inline_native_time_funcs(CAST_FROM_FN_PTR(address, os::javaTimeMillis), "currentTimeMillis");
   714   case vmIntrinsics::_nanoTime:                 return inline_native_time_funcs(CAST_FROM_FN_PTR(address, os::javaTimeNanos), "nanoTime");
   718   case vmIntrinsics::_nanoTime:                 return inline_native_time_funcs(CAST_FROM_FN_PTR(address, os::javaTimeNanos), "nanoTime");
   715   case vmIntrinsics::_allocateInstance:         return inline_unsafe_allocate();
   719   case vmIntrinsics::_allocateInstance:         return inline_unsafe_allocate();
   716   case vmIntrinsics::_copyMemory:               return inline_unsafe_copyMemory();
   720   case vmIntrinsics::_copyMemory:               return inline_unsafe_copyMemory();
  3157 #endif
  3161 #endif
  3158   set_result(value);
  3162   set_result(value);
  3159   return true;
  3163   return true;
  3160 }
  3164 }
  3161 
  3165 
       
  3166 #ifdef TRACE_HAVE_INTRINSICS
       
  3167 
       
  3168 /*
       
  3169 * oop -> myklass
       
  3170 * myklass->trace_id |= USED
       
  3171 * return myklass->trace_id & ~0x3
       
  3172 */
       
  3173 bool LibraryCallKit::inline_native_classID() {
       
  3174   Node* cls = null_check(argument(0), T_OBJECT);
       
  3175   Node* kls = load_klass_from_mirror(cls, false, NULL, 0);
       
  3176   kls = null_check(kls, T_OBJECT);
       
  3177 
       
  3178   ByteSize offset = TRACE_KLASS_TRACE_ID_OFFSET;
       
  3179   Node* insp = basic_plus_adr(kls, in_bytes(offset));
       
  3180   Node* tvalue = make_load(NULL, insp, TypeLong::LONG, T_LONG, MemNode::unordered);
       
  3181 
       
  3182   Node* clsused = longcon(0x01l); // set the class bit
       
  3183   Node* orl = _gvn.transform(new OrLNode(tvalue, clsused));
       
  3184   const TypePtr *adr_type = _gvn.type(insp)->isa_ptr();
       
  3185   store_to_memory(control(), insp, orl, T_LONG, adr_type, MemNode::unordered);
       
  3186 
       
  3187 #ifdef TRACE_ID_META_BITS
       
  3188   Node* mbits = longcon(~TRACE_ID_META_BITS);
       
  3189   tvalue = _gvn.transform(new AndLNode(tvalue, mbits));
       
  3190 #endif
       
  3191 #ifdef TRACE_ID_CLASS_SHIFT
       
  3192   Node* cbits = intcon(TRACE_ID_CLASS_SHIFT);
       
  3193   tvalue = _gvn.transform(new URShiftLNode(tvalue, cbits));
       
  3194 #endif
       
  3195 
       
  3196   set_result(tvalue);
       
  3197   return true;
       
  3198 
       
  3199 }
       
  3200 
       
  3201 #endif
       
  3202 
  3162 //------------------------inline_native_currentThread------------------
  3203 //------------------------inline_native_currentThread------------------
  3163 bool LibraryCallKit::inline_native_currentThread() {
  3204 bool LibraryCallKit::inline_native_currentThread() {
  3164   Node* junk = NULL;
  3205   Node* junk = NULL;
  3165   set_result(generate_current_thread(junk));
  3206   set_result(generate_current_thread(junk));
  3166   return true;
  3207   return true;