On Tue, 3 Nov 2026 21:37:40 GMT, Leonid Mesnik <[email protected]> wrote:
>> Hi >> >> During testing of >> [JDK-8383787](https://bugs.openjdk.org/browse/JDK-8383787): >> JVMTI_EVENT_SAMPLED_OBJECT_ALLOC may make a cloned object accessible to Java >> before clone >> >> I find that clone() intrinsic doesn't call JVMTI VMObjectAlloc as well as >> SampledObjecAlloc. There is no requirement for SampledObjectAlloc to be >> triggered by any allocation. While VMObjectAlloc should be called. >> I find 2 compiler optimizations that allocated object during clone without >> corresponding notification. >> >> I applied fix similar to >> [JDK-8307462](https://bugs.openjdk.org/browse/JDK-8307462) [REDO] >> VmObjectAlloc is not generated by intrinsics methods which allocate objects >> >> The allocation check if notification are enabled using >> JvmtiExport::_should_notify_object_alloc and deoptimize clone in this case. >> >> I verified that VMObjectAllocCloneTest.java failed with `-Xcomp >> -XX:-TieredCompilation `and -`Xcomp -XX:TieredStopAtLevel=1`. However I >> haven't added them as separate testcases. >> >> --------- >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Leonid Mesnik has updated the pull request incrementally with one additional > commit since the last revision: > > fixed risc-v instr This looks good in general. I've posted a couple of questions and some nit. Comments in the files `jvmtiExport.hpp: L422` and `jvmtiExport.cpp: L1088` need update to cover C1 case as they say about C2 only. src/hotspot/share/opto/library_call.cpp line 6314: > 6312: uncommon_trap(Deoptimization::Reason_intrinsic, > 6313: Deoptimization::Action_make_not_entrant); > 6314: } Nit: The lines 6311-6313 are incorrectly indented. test/hotspot/jtreg/compiler/escapeAnalysis/TestArrayCopyEliminationUncRematerialization.java line 291: > 289: """ > 290: @Test > 291: @IR(counts = { IRNode.LOAD_#{typeAbbrev}, > "=#{loadCountAdjusted}" }, Q: Do I read it correctly that this updates accounts for a JVMTI availability? However, I do not see this tests requires JVMTI. Does this need an adjustment? test/hotspot/jtreg/serviceability/jvmti/events/VMObjectAlloc/VMObjectAllocClone/VMObjectAllocCloneTest.java line 32: > 30: * > 31: * @run main/othervm/native -agentlib:VMObjectAllocClone -Xbatch > VMObjectAllocCloneTest > 32: */ Q: Should this test make two runs with C1 and C2? ------------- PR Review: https://git.openjdk.org/jdk/pull/33684#pullrequestreview-5765167905 PR Review Comment: https://git.openjdk.org/jdk/pull/33684#discussion_r4465146186 PR Review Comment: https://git.openjdk.org/jdk/pull/33684#discussion_r4465087658 PR Review Comment: https://git.openjdk.org/jdk/pull/33684#discussion_r4465104690
