< prev index next >

src/hotspot/share/opto/library_call.cpp

Print this page
@@ -470,12 +470,12 @@
  
    case vmIntrinsics::_currentCarrierThread:     return inline_native_currentCarrierThread();
    case vmIntrinsics::_currentThread:            return inline_native_currentThread();
    case vmIntrinsics::_setCurrentThread:         return inline_native_setCurrentThread();
  
-   case vmIntrinsics::_extentLocalCache:          return inline_native_extentLocalCache();
-   case vmIntrinsics::_setExtentLocalCache:       return inline_native_setExtentLocalCache();
+   case vmIntrinsics::_scopedValueCache:          return inline_native_scopedValueCache();
+   case vmIntrinsics::_setScopedValueCache:       return inline_native_setScopedValueCache();
  
  #ifdef JFR_HAVE_INTRINSICS
    case vmIntrinsics::_counterTime:              return inline_native_time_funcs(CAST_FROM_FN_PTR(address, JfrTime::time_function()), "counterTime");
    case vmIntrinsics::_getEventWriter:           return inline_native_getEventWriter();
  #endif

@@ -3355,42 +3355,46 @@
    store_to_memory(control(), thread_obj_handle, arr, T_OBJECT, adr_type, MemNode::unordered);
    JFR_ONLY(extend_setCurrentThread(thread, arr);)
    return true;
  }
  
- Node* LibraryCallKit::extentLocalCache_helper() {
+ Node* LibraryCallKit::scopedValueCache_helper() {
    ciKlass *objects_klass = ciObjArrayKlass::make(env()->Object_klass());
    const TypeOopPtr *etype = TypeOopPtr::make_from_klass(env()->Object_klass());
  
    bool xk = etype->klass_is_exact();
  
    Node* thread = _gvn.transform(new ThreadLocalNode());
-   Node* p = basic_plus_adr(top()/*!oop*/, thread, in_bytes(JavaThread::extentLocalCache_offset()));
-   return _gvn.transform(LoadNode::make(_gvn, NULL, immutable_memory(), p, p->bottom_type()->is_ptr(),
-         TypeRawPtr::NOTNULL, T_ADDRESS, MemNode::unordered));
+   Node* p = basic_plus_adr(top()/*!oop*/, thread, in_bytes(JavaThread::scopedValueCache_offset()));
+   // We cannot use immutable_memory() because we might flip onto a
+   // different carrier thread, at which point we'll need to use that
+   // carrier thread's cache.
+   // return _gvn.transform(LoadNode::make(_gvn, NULL, immutable_memory(), p, p->bottom_type()->is_ptr(),
+   //       TypeRawPtr::NOTNULL, T_ADDRESS, MemNode::unordered));
+   return make_load(NULL, p, p->bottom_type()->is_ptr(), T_ADDRESS, MemNode::unordered);
  }
  
- //------------------------inline_native_extentLocalCache------------------
- bool LibraryCallKit::inline_native_extentLocalCache() {
+ //------------------------inline_native_scopedValueCache------------------
+ bool LibraryCallKit::inline_native_scopedValueCache() {
    ciKlass *objects_klass = ciObjArrayKlass::make(env()->Object_klass());
    const TypeOopPtr *etype = TypeOopPtr::make_from_klass(env()->Object_klass());
    const TypeAry* arr0 = TypeAry::make(etype, TypeInt::POS);
  
-   // Because we create the extentLocal cache lazily we have to make the
+   // Because we create the scopedValue cache lazily we have to make the
    // type of the result BotPTR.
    bool xk = etype->klass_is_exact();
    const Type* objects_type = TypeAryPtr::make(TypePtr::BotPTR, arr0, objects_klass, xk, 0);
-   Node* cache_obj_handle = extentLocalCache_helper();
+   Node* cache_obj_handle = scopedValueCache_helper();
    set_result(access_load(cache_obj_handle, objects_type, T_OBJECT, IN_NATIVE));
  
    return true;
  }
  
- //------------------------inline_native_setExtentLocalCache------------------
- bool LibraryCallKit::inline_native_setExtentLocalCache() {
+ //------------------------inline_native_setScopedValueCache------------------
+ bool LibraryCallKit::inline_native_setScopedValueCache() {
    Node* arr = argument(0);
-   Node* cache_obj_handle = extentLocalCache_helper();
+   Node* cache_obj_handle = scopedValueCache_helper();
  
    const TypePtr *adr_type = _gvn.type(cache_obj_handle)->isa_ptr();
    store_to_memory(control(), cache_obj_handle, arr, T_OBJECT, adr_type,
                    MemNode::unordered);
  
< prev index next >