void CodeInstaller::pd_patch_MetaspaceConstant(int pc_offset, Handle constant, TRAPS) {
  address pc = _instructions->start() + pc_offset;
  if (HotSpotMetaspaceConstantImpl::compressed(constant)) {
#ifdef _LP64
    address operand = Assembler::locate_operand(pc, Assembler::narrow_oop_operand);
    *((narrowKlass*) operand) = record_narrow_metadata_reference(_instructions, operand, constant, CHECK);
    TRACE_jvmci_3("relocating (narrow metaspace constant) at " PTR_FORMAT "/" PTR_FORMAT, p2i(pc), p2i(operand));
#else
    JVMCI_ERROR("compressed Klass* on 32bit");
#endif
  } else {
    address operand = Assembler::locate_operand(pc, Assembler::imm_operand);
    *((void**) operand) = record_metadata_reference(_instructions, operand, constant, CHECK);
    TRACE_jvmci_3("relocating (metaspace constant) at " PTR_FORMAT "/" PTR_FORMAT, p2i(pc), p2i(operand));
  }
}
void CodeInstaller::pd_patch_MetaspaceConstant(int pc_offset, Handle constant, TRAPS) {
  address pc = _instructions->start() + pc_offset;
  if (HotSpotMetaspaceConstantImpl::compressed(constant)) {
#ifdef _LP64
    NativeMovConstReg32* move = nativeMovConstReg32_at(pc);
    narrowKlass narrowOop = record_narrow_metadata_reference(constant, CHECK);
    move->set_data((intptr_t)narrowOop);
    TRACE_jvmci_3("relocating (narrow metaspace constant) at %p/%p", pc, narrowOop);
#else
    JVMCI_ERROR("compressed Klass* on 32bit");
#endif
  } else {
    NativeMovConstReg* move = nativeMovConstReg_at(pc);
    Metadata* reference = record_metadata_reference(constant, CHECK);
    move->set_data((intptr_t)reference);
    TRACE_jvmci_3("relocating (metaspace constant) at %p/%p", pc, reference);
  }
}