diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp b/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp index 421ebd7396f43..ff159a490c184 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp @@ -115,6 +115,13 @@ class CompilerToVM { // Minimum alignment of an offset into CodeBuffer::SECT_CONSTS static int data_section_item_alignment; + /* + * Pointer to JvmtiExport::_should_notify_object_alloc. + * Exposed as an int* instead of an address so the + * underlying type is part of the JVMCIVMStructs definition. + */ + static int* _should_notify_object_alloc; + public: static void initialize(JVMCI_TRAPS); diff --git a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp index a3e2bd525ecf6..302a6c811c9d1 100644 --- a/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp +++ b/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp @@ -130,6 +130,8 @@ address CompilerToVM::Data::symbol_clinit; int CompilerToVM::Data::data_section_item_alignment; +int* CompilerToVM::Data::_should_notify_object_alloc; + void CompilerToVM::Data::initialize(JVMCI_TRAPS) { Klass_vtable_start_offset = in_bytes(Klass::vtable_start_offset()); Klass_vtable_length_offset = in_bytes(Klass::vtable_length_offset()); @@ -196,6 +198,8 @@ void CompilerToVM::Data::initialize(JVMCI_TRAPS) { data_section_item_alignment = relocInfo::addr_unit(); + _should_notify_object_alloc = &JvmtiExport::_should_notify_object_alloc; + BarrierSet* bs = BarrierSet::barrier_set(); if (bs->is_a(BarrierSet::CardTableBarrierSet)) { CardTable::CardValue* base = ci_card_table_address(); diff --git a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp index bac9a786fd9fb..2ad442db93483 100644 --- a/src/hotspot/share/jvmci/vmStructs_jvmci.cpp +++ b/src/hotspot/share/jvmci/vmStructs_jvmci.cpp @@ -122,6 +122,8 @@ \ static_field(CompilerToVM::Data, data_section_item_alignment, int) \ \ + static_field(CompilerToVM::Data, _should_notify_object_alloc, int*) \ + \ static_field(Abstract_VM_Version, _features, uint64_t) \ \ nonstatic_field(Annotations, _class_annotations, AnnotationArray*) \