Skip to content

Commit

Permalink
8326605: [lworld] SplitIfSharedFastLockBehindCastPP performs synchron…
Browse files Browse the repository at this point in the history
…ization on a value class
  • Loading branch information
TobiHartmann committed Aug 14, 2024
1 parent a7f3d20 commit 9531c85
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2019, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
Expand Down Expand Up @@ -70,6 +71,14 @@ private static void test1(boolean flag, Object obj) {
}
}

static class MyBox {
int val;

public MyBox(int val) {
this.val = val;
}
}

private static Object test2(boolean flag) {
int integer;
if (flag) {
Expand All @@ -80,7 +89,7 @@ private static Object test2(boolean flag) {
integer = 2;
}

Object obj = integer;
Object obj = new MyBox(integer);

// This loop will be unswitched. The condition becomes candidate for split if
for (int i = 0; i < 100; i++) {
Expand Down

0 comments on commit 9531c85

Please sign in to comment.