mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8232896: ZGC: Enable C2 clone intrinsic
Reviewed-by: pliden, kvn
This commit is contained in:
parent
55f7c48828
commit
3ca7e3f6ff
13 changed files with 94 additions and 21 deletions
|
@ -43,12 +43,17 @@ public class Clone {
|
|||
private BitSet testObj1;
|
||||
private Date testObj2;
|
||||
private char[] testObj3;
|
||||
private char[] testObj4;
|
||||
private String[] testObj5;
|
||||
|
||||
@Setup
|
||||
public void setup() {
|
||||
testObj1 = new BitSet(10);
|
||||
testObj2 = new Date();
|
||||
testObj3 = new char[5];
|
||||
testObj4 = new char[311];
|
||||
String str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut";
|
||||
testObj5 = str.split(" ", -1);
|
||||
}
|
||||
|
||||
/** Calls clone on three different types. The types are java.util.BitSet, java.util.Date and char[]. */
|
||||
|
@ -59,5 +64,11 @@ public class Clone {
|
|||
bh.consume(testObj3.clone());
|
||||
}
|
||||
|
||||
@Benchmark
|
||||
public void cloneLarge(Blackhole bh) {
|
||||
bh.consume(testObj4.clone());
|
||||
bh.consume(testObj5.clone());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue