> This changes our runtime clone barriers to unconditionally handle tenured 
> destination objects. 
> 
> We already had a solution for object arrays as they were something ZGCs own 
> allocator could tenure, however we assumed no safepoints for normal object 
> clones. However  because of `JVMTI_EVENT_SAMPLED_OBJECT_ALLOC` arbitrary java 
> code may be ran between the allocation and the clone barrier. 
> 
> This patch creates a lock-step iterator, which iterates over the object, 
> copies everything between the oops incrementally and does the proper load, 
> and store barriers. 
> 
> _The only thing the implementation currently rely on is that our 
> `oop_oop_iterate` iterator visits the fields or elements in address order, 
> which I do not see changing, but is currently not an explicit contract but an 
> implementation detail._
> 
> The initial implementation used this new construction for tenured object 
> clone. By the fact is that the new cloner can handle cloning any object with 
> the same or better overhead than the three different implementations. So 
> added a commit which generalised and uses this cloner for all objects: 
> https://github.com/openjdk/jdk/commit/e7e4de633204d50d2a8b153a590dc82d02bdf6f7
> 
> Also added a `JVMTI_EVENT_SAMPLED_OBJECT_ALLOC` reproducer, which verifies 
> that we can handle tenured object and object array clones. 
> 
> Currently running testing.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

Axel Boldt-Christmas has updated the pull request incrementally with one 
additional commit since the last revision:

  Page is_old check is all we need

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/31149/files
  - new: https://git.openjdk.org/jdk/pull/31149/files/90bd7bcb..625b871c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=31149&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=31149&range=01-02

  Stats: 15 lines in 2 files changed: 0 ins; 11 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/31149.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/31149/head:pull/31149

PR: https://git.openjdk.org/jdk/pull/31149

Reply via email to