< prev index next >

src/hotspot/share/c1/c1_LIRGenerator.cpp

Print this page
*** 1301,12 ***
    __ branch_destination(L_not_prim->label());
    __ move(new LIR_Address(klass, in_bytes(Klass::modifier_flags_offset()), T_INT), result);
    __ branch_destination(L_done->label());
  }
  
! // Example: Thread.currentThread()
! void LIRGenerator::do_currentThread(Intrinsic* x) {
    assert(x->number_of_arguments() == 0, "wrong type");
    LIR_Opr temp = new_register(T_ADDRESS);
    LIR_Opr reg = rlock_result(x);
    __ move(new LIR_Address(getThreadPointer(), in_bytes(JavaThread::threadObj_offset()), T_ADDRESS), temp);
    // threadObj = ((OopHandle)_threadObj)->resolve();
--- 1301,12 ---
    __ branch_destination(L_not_prim->label());
    __ move(new LIR_Address(klass, in_bytes(Klass::modifier_flags_offset()), T_INT), result);
    __ branch_destination(L_done->label());
  }
  
! // Example: Thread.currentThread0()
! void LIRGenerator::do_currentThread0(Intrinsic* x) {
    assert(x->number_of_arguments() == 0, "wrong type");
    LIR_Opr temp = new_register(T_ADDRESS);
    LIR_Opr reg = rlock_result(x);
    __ move(new LIR_Address(getThreadPointer(), in_bytes(JavaThread::threadObj_offset()), T_ADDRESS), temp);
    // threadObj = ((OopHandle)_threadObj)->resolve();

*** 1415,10 ***
--- 1415,32 ---
  #endif
  
    __ branch_destination(L_done->label());
  }
  
+ void LIRGenerator::do_scopeLocalCache(Intrinsic* x) {
+   assert(x->number_of_arguments() == 0, "wrong type");
+   LIR_Opr temp = new_register(T_ADDRESS);
+   LIR_Opr reg = rlock_result(x);
+   __ move(new LIR_Address(getThreadPointer(), in_bytes(JavaThread::scopeLocalCache_offset()), T_ADDRESS), temp);
+   // threadObj = ((OopHandle)_vthread)->resolve();
+   access_load(IN_NATIVE, T_OBJECT,
+               LIR_OprFact::address(new LIR_Address(temp, T_OBJECT)), reg);
+ }
+ 
+ 
+ void LIRGenerator::do_vthread(Intrinsic* x) {
+   assert(x->number_of_arguments() == 0, "wrong type");
+   LIR_Opr temp = new_register(T_ADDRESS);
+   LIR_Opr reg = rlock_result(x);
+   __ move(new LIR_Address(getThreadPointer(), in_bytes(JavaThread::vthread_offset()), T_ADDRESS), temp);
+   // threadObj = ((OopHandle)_vthread)->resolve();
+   access_load(IN_NATIVE, T_OBJECT,
+               LIR_OprFact::address(new LIR_Address(temp, T_OBJECT)), reg);
+ }
+ 
+ 
  void LIRGenerator::do_RegisterFinalizer(Intrinsic* x) {
    assert(x->number_of_arguments() == 1, "wrong type");
    LIRItem receiver(x->argument_at(0), this);
  
    receiver.load_item();

*** 2874,27 ***
  }
  
  #ifdef JFR_HAVE_INTRINSICS
  
  void LIRGenerator::do_getEventWriter(Intrinsic* x) {
!   LabelObj* L_end = new LabelObj();
! 
!   // FIXME T_ADDRESS should actually be T_METADATA but it can't because the
!   // meaning of these two is mixed up (see JDK-8026837).
!   LIR_Address* jobj_addr = new LIR_Address(getThreadPointer(),
!                                            in_bytes(THREAD_LOCAL_WRITER_OFFSET_JFR),
!                                            T_ADDRESS);
    LIR_Opr result = rlock_result(x);
!   __ move(LIR_OprFact::oopConst(NULL), result);
-   LIR_Opr jobj = new_register(T_METADATA);
-   __ move_wide(jobj_addr, jobj);
-   __ cmp(lir_cond_equal, jobj, LIR_OprFact::metadataConst(0));
-   __ branch(lir_cond_equal, L_end->label());
- 
-   access_load(IN_NATIVE, T_OBJECT, LIR_OprFact::address(new LIR_Address(jobj, T_OBJECT)), result);
- 
-   __ branch_destination(L_end->label());
  }
  
  #endif
  
  
--- 2896,19 ---
  }
  
  #ifdef JFR_HAVE_INTRINSICS
  
  void LIRGenerator::do_getEventWriter(Intrinsic* x) {
!   LabelObj* L_NULL = new LabelObj();
!   BasicTypeList signature(0);
!   CallingConvention* cc = frame_map()->c_calling_convention(&signature);
!   LIR_Opr reg = result_register_for(x->type());
!   address entry = StubRoutines::jfr_get_event_writer();
!   CodeEmitInfo* info = state_for(x, x->state());
!   __ call_runtime(entry, getThreadTemp(), reg, cc->args(), info);
    LIR_Opr result = rlock_result(x);
!   __ move(reg, result);
  }
  
  #endif
  
  

*** 2942,12 ***
    case vmIntrinsics::_Object_init:    do_RegisterFinalizer(x); break;
    case vmIntrinsics::_isInstance:     do_isInstance(x);    break;
    case vmIntrinsics::_isPrimitive:    do_isPrimitive(x);   break;
    case vmIntrinsics::_getModifiers:   do_getModifiers(x);  break;
    case vmIntrinsics::_getClass:       do_getClass(x);      break;
-   case vmIntrinsics::_currentThread:  do_currentThread(x); break;
    case vmIntrinsics::_getObjectSize:  do_getObjectSize(x); break;
  
    case vmIntrinsics::_dlog:           // fall through
    case vmIntrinsics::_dlog10:         // fall through
    case vmIntrinsics::_dabs:           // fall through
    case vmIntrinsics::_dsqrt:          // fall through
--- 2956,14 ---
    case vmIntrinsics::_Object_init:    do_RegisterFinalizer(x); break;
    case vmIntrinsics::_isInstance:     do_isInstance(x);    break;
    case vmIntrinsics::_isPrimitive:    do_isPrimitive(x);   break;
    case vmIntrinsics::_getModifiers:   do_getModifiers(x);  break;
    case vmIntrinsics::_getClass:       do_getClass(x);      break;
    case vmIntrinsics::_getObjectSize:  do_getObjectSize(x); break;
+   case vmIntrinsics::_currentThread0: do_currentThread0(x); break;
+   case vmIntrinsics::_currentThread:  do_vthread(x);       break;
+   case vmIntrinsics::_scopeLocalCache: do_scopeLocalCache(x); break;
  
    case vmIntrinsics::_dlog:           // fall through
    case vmIntrinsics::_dlog10:         // fall through
    case vmIntrinsics::_dabs:           // fall through
    case vmIntrinsics::_dsqrt:          // fall through

*** 3006,10 ***
--- 3022,14 ---
      break;
  
    case vmIntrinsics::_vectorizedMismatch:
      do_vectorizedMismatch(x);
      break;
+           
+   case vmIntrinsics::_Continuation_doYield:
+     do_continuation_doYield(x);
+     break;
  
    case vmIntrinsics::_blackhole:
      do_blackhole(x);
      break;
  
< prev index next >