Skip to content

Commit

Permalink
8325074: ZGC fails assert(index == 0 || is_power_of_2(index)) failed:…
Browse files Browse the repository at this point in the history
… Incorrect load shift: 11

Reviewed-by: eosterlund, stefank, rcastanedalo
  • Loading branch information
xmas92 committed Feb 16, 2024
1 parent 3d85103 commit 2705ed0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/hotspot/share/gc/z/zBarrierSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,12 @@ void ZBarrierSet::on_slowpath_allocation_exit(JavaThread* thread, oop new_obj) {
deoptimize_allocation(thread);
}

void ZBarrierSet::clone_obj_array(objArrayOop src_obj, objArrayOop dst_obj, size_t size) {
void ZBarrierSet::clone_obj_array(objArrayOop src_obj, objArrayOop dst_obj) {
volatile zpointer* src = (volatile zpointer*)src_obj->base();
volatile zpointer* dst = (volatile zpointer*)dst_obj->base();
const int length = src_obj->length();

for (const zpointer* const end = cast_from_oop<const zpointer*>(src_obj) + size; src < end; src++, dst++) {
for (const volatile zpointer* const end = src + length; src < end; src++, dst++) {
zaddress elem = ZBarrier::load_barrier_on_oop_field(src);
// We avoid healing here because the store below colors the pointer store good,
// hence avoiding the cost of a CAS.
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/z/zBarrierSet.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ZBarrierSet : public BarrierSet {
static ZBarrierSetAssembler* assembler();
static bool barrier_needed(DecoratorSet decorators, BasicType type);

static void clone_obj_array(objArrayOop src, objArrayOop dst, size_t size);
static void clone_obj_array(objArrayOop src, objArrayOop dst);

virtual void on_thread_create(Thread* thread);
virtual void on_thread_destroy(Thread* thread);
Expand Down
2 changes: 1 addition & 1 deletion src/hotspot/share/gc/z/zBarrierSet.inline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ inline void ZBarrierSet::AccessBarrier<decorators, BarrierSetT>::clone_in_heap(o
// for cloning arrays transform the clone to an optimized allocation
// and arraycopy sequence, so the performance of this runtime call
// does not matter for object arrays.
clone_obj_array(objArrayOop(src), objArrayOop(dst), size);
clone_obj_array(objArrayOop(src), objArrayOop(dst));
return;
}

Expand Down

3 comments on commit 2705ed0

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xmas92
Copy link
Member Author

@xmas92 xmas92 commented on 2705ed0 Feb 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk22u

@openjdk
Copy link

@openjdk openjdk bot commented on 2705ed0 Feb 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xmas92 the backport was successfully created on the branch backport-xmas92-2705ed0a in my personal fork of openjdk/jdk22u. To create a pull request with this backport targeting openjdk/jdk22u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 2705ed0a from the openjdk/jdk repository.

The commit being backported was authored by Axel Boldt-Christmas on 16 Feb 2024 and was reviewed by Erik Österlund, Stefan Karlsson and Roberto Castañeda Lozano.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk22u:

$ git fetch https://github.com/openjdk-bots/jdk22u.git backport-xmas92-2705ed0a:backport-xmas92-2705ed0a
$ git checkout backport-xmas92-2705ed0a
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk22u.git backport-xmas92-2705ed0a

⚠️ @xmas92 You are not yet a collaborator in my fork openjdk-bots/jdk22u. An invite will be sent out and you need to accept it before you can proceed.

Please sign in to comment.