> 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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains 11 additional commits since the last revision: - Updated defines, risc-v support and test. - Merge branch 'master' of https://github.com/openjdk/jdk into 8396399 - added include_jvmit macros - Support reading intrinsic in AOT compiled code. - Updated test to take in account additional load instructions for integer. - added new line - space added - small refactoring - Merge branch 'master' of https://github.com/openjdk/jdk into 8396399 - Updated C1 allocation for array. - ... and 1 more: https://git.openjdk.org/jdk/compare/7344a89f...535df622 ------------- Changes: - all: https://git.openjdk.org/jdk/pull/33684/files - new: https://git.openjdk.org/jdk/pull/33684/files/df6f9b10..535df622 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=33684&range=03 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=33684&range=02-03 Stats: 2225 lines in 61 files changed: 839 ins; 1005 del; 381 mod Patch: https://git.openjdk.org/jdk/pull/33684.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/33684/head:pull/33684 PR: https://git.openjdk.org/jdk/pull/33684
