hotspot/src/share/vm/opto/library_call.cpp
changeset 42037 6269c5b5b651
parent 41330 8b2580e63aa0
child 42069 4bf36a6af07b
equal deleted inserted replaced
42035:10e6e31dc1aa 42037:6269c5b5b651
   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
   257 #ifdef TRACE_HAVE_INTRINSICS
   258   bool inline_native_classID();
   258   bool inline_native_classID();
       
   259   bool inline_native_getBufferWriter();
   259 #endif
   260 #endif
   260   bool inline_native_isInterrupted();
   261   bool inline_native_isInterrupted();
   261   bool inline_native_Class_query(vmIntrinsics::ID id);
   262   bool inline_native_Class_query(vmIntrinsics::ID id);
   262   bool inline_native_subtype_check();
   263   bool inline_native_subtype_check();
   263   bool inline_native_getLength();
   264   bool inline_native_getLength();
   711   case vmIntrinsics::_isInterrupted:            return inline_native_isInterrupted();
   712   case vmIntrinsics::_isInterrupted:            return inline_native_isInterrupted();
   712 
   713 
   713 #ifdef TRACE_HAVE_INTRINSICS
   714 #ifdef TRACE_HAVE_INTRINSICS
   714   case vmIntrinsics::_counterTime:              return inline_native_time_funcs(CAST_FROM_FN_PTR(address, TRACE_TIME_METHOD), "counterTime");
   715   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();
   716   case vmIntrinsics::_getClassId:               return inline_native_classID();
       
   717   case vmIntrinsics::_getBufferWriter:          return inline_native_getBufferWriter();
   716 #endif
   718 #endif
   717   case vmIntrinsics::_currentTimeMillis:        return inline_native_time_funcs(CAST_FROM_FN_PTR(address, os::javaTimeMillis), "currentTimeMillis");
   719   case vmIntrinsics::_currentTimeMillis:        return inline_native_time_funcs(CAST_FROM_FN_PTR(address, os::javaTimeMillis), "currentTimeMillis");
   718   case vmIntrinsics::_nanoTime:                 return inline_native_time_funcs(CAST_FROM_FN_PTR(address, os::javaTimeNanos), "nanoTime");
   720   case vmIntrinsics::_nanoTime:                 return inline_native_time_funcs(CAST_FROM_FN_PTR(address, os::javaTimeNanos), "nanoTime");
   719   case vmIntrinsics::_allocateInstance:         return inline_unsafe_allocate();
   721   case vmIntrinsics::_allocateInstance:         return inline_unsafe_allocate();
   720   case vmIntrinsics::_copyMemory:               return inline_unsafe_copyMemory();
   722   case vmIntrinsics::_copyMemory:               return inline_unsafe_copyMemory();
  3196   set_result(tvalue);
  3198   set_result(tvalue);
  3197   return true;
  3199   return true;
  3198 
  3200 
  3199 }
  3201 }
  3200 
  3202 
       
  3203 bool LibraryCallKit::inline_native_getBufferWriter() {
       
  3204   Node* tls_ptr = _gvn.transform(new ThreadLocalNode());
       
  3205 
       
  3206   Node* jobj_ptr = basic_plus_adr(top(), tls_ptr,
       
  3207                                   in_bytes(TRACE_THREAD_DATA_WRITER_OFFSET)
       
  3208                                   );
       
  3209 
       
  3210   Node* jobj = make_load(control(), jobj_ptr, TypeRawPtr::BOTTOM, T_ADDRESS, MemNode::unordered);
       
  3211 
       
  3212   Node* jobj_cmp_null = _gvn.transform( new CmpPNode(jobj, null()) );
       
  3213   Node* test_jobj_eq_null  = _gvn.transform( new BoolNode(jobj_cmp_null, BoolTest::eq) );
       
  3214 
       
  3215   IfNode* iff_jobj_null =
       
  3216     create_and_map_if(control(), test_jobj_eq_null, PROB_NEVER, COUNT_UNKNOWN);
       
  3217 
       
  3218    enum { _normal_path = 1,
       
  3219           _null_path = 2,
       
  3220           PATH_LIMIT };
       
  3221 
       
  3222   RegionNode* result_rgn = new RegionNode(PATH_LIMIT);
       
  3223   PhiNode*    result_val = new PhiNode(result_rgn, TypePtr::BOTTOM);
       
  3224   record_for_igvn(result_rgn);
       
  3225 
       
  3226   Node* jobj_is_null = _gvn.transform( new IfTrueNode(iff_jobj_null) );
       
  3227   result_rgn->init_req(_null_path, jobj_is_null);
       
  3228   result_val->init_req(_null_path, null());
       
  3229 
       
  3230   Node* jobj_is_not_null = _gvn.transform( new IfFalseNode(iff_jobj_null) );
       
  3231   result_rgn->init_req(_normal_path, jobj_is_not_null);
       
  3232 
       
  3233   Node* res = make_load(NULL, jobj, TypeInstPtr::BOTTOM, T_OBJECT, MemNode::unordered);
       
  3234   result_val->init_req(_normal_path, res);
       
  3235 
       
  3236   set_result(result_rgn, result_val);
       
  3237 
       
  3238   return true;
       
  3239 }
       
  3240 
  3201 #endif
  3241 #endif
  3202 
  3242 
  3203 //------------------------inline_native_currentThread------------------
  3243 //------------------------inline_native_currentThread------------------
  3204 bool LibraryCallKit::inline_native_currentThread() {
  3244 bool LibraryCallKit::inline_native_currentThread() {
  3205   Node* junk = NULL;
  3245   Node* junk = NULL;