< prev index next >

src/hotspot/share/c1/c1_LIRGenerator.cpp

Print this page
*** 1335,15 ***
  
    // Get the answer.
    __ move(new LIR_Address(klass, in_bytes(Klass::modifier_flags_offset()), T_INT), result);
  }
  
  void LIRGenerator::do_getObjectSize(Intrinsic* x) {
    assert(x->number_of_arguments() == 3, "wrong type");
    LIR_Opr result_reg = rlock_result(x);
  
!   LIRItem value(x->argument_at(2), this);
    value.load_item();
  
    LIR_Opr klass = new_register(T_METADATA);
    load_klass(value.result(), klass, nullptr);
    LIR_Opr layout = new_register(T_INT);
--- 1335,40 ---
  
    // Get the answer.
    __ move(new LIR_Address(klass, in_bytes(Klass::modifier_flags_offset()), T_INT), result);
  }
  
+ void LIRGenerator::do_addressOf(Intrinsic* x) {
+   assert(x->number_of_arguments() == 1, "wrong type");
+   LIR_Opr reg = rlock_result(x);
+ 
+   LIRItem value(x->argument_at(0), this);
+   value.load_item();
+ 
+ #ifdef _LP64
+   __ move(value.result(), reg, NULL);
+ #else
+   LIR_Opr res = new_register(T_INT);
+   __ move(value.result(), res, NULL);
+   __ convert(Bytecodes::_i2l, res, reg);
+ #endif
+ }
+ 
+ void LIRGenerator::do_sizeOf(Intrinsic* x) {
+   assert(x->number_of_arguments() == 1, "wrong type");
+   do_sizeOf_impl(x, 0);
+ }
+ 
  void LIRGenerator::do_getObjectSize(Intrinsic* x) {
    assert(x->number_of_arguments() == 3, "wrong type");
+   do_sizeOf_impl(x, 2);
+ }
+ 
+ void LIRGenerator::do_sizeOf_impl(Intrinsic* x, int arg_idx) {
    LIR_Opr result_reg = rlock_result(x);
  
!   LIRItem value(x->argument_at(arg_idx), this);
    value.load_item();
  
    LIR_Opr klass = new_register(T_METADATA);
    load_klass(value.result(), klass, nullptr);
    LIR_Opr layout = new_register(T_INT);

*** 2963,10 ***
--- 2988,12 ---
    case vmIntrinsics::_getClass:       do_getClass(x);      break;
    case vmIntrinsics::_getObjectSize:  do_getObjectSize(x); break;
    case vmIntrinsics::_currentCarrierThread: do_currentCarrierThread(x); break;
    case vmIntrinsics::_currentThread:  do_vthread(x);       break;
    case vmIntrinsics::_scopedValueCache: do_scopedValueCache(x); break;
+   case vmIntrinsics::_shipilev_magic_sizeOf:         do_sizeOf(x);        break;
+   case vmIntrinsics::_shipilev_magic_addressOf:      do_addressOf(x);     break;
  
    case vmIntrinsics::_dlog:           // fall through
    case vmIntrinsics::_dlog10:         // fall through
    case vmIntrinsics::_dabs:           // fall through
    case vmIntrinsics::_dsqrt:          // fall through
< prev index next >