Skip to content

Commit 5d39d14

Browse files
committed
8299970: Speed up compiler/arraycopy/TestArrayCopyConjoint.java
Reviewed-by: chagedorn, kvn, thartmann
1 parent d1c87a0 commit 5d39d14

File tree

2 files changed

+18
-28
lines changed

2 files changed

+18
-28
lines changed

test/hotspot/jtreg/compiler/arraycopy/TestArrayCopyConjoint.java

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -232,8 +232,7 @@ public static void main(String [] args) {
232232

233233
setup();
234234

235-
try {
236-
for (int i = 0 ; i < 1000000 ; i++ ) {
235+
for (int i = 0 ; i < 30_000 ; i++ ) {
237236
int index = r.nextInt(2048);
238237
testByte(lengths[i % lengths.length], index , index+2);
239238
reinit(byte.class);
@@ -262,10 +261,6 @@ public static void main(String [] args) {
262261
reinit(long.class);
263262
testLong_constant_LT64B (index , index+2);
264263
reinit(long.class);
265-
}
266-
System.out.println("PASS : " + validate_ctr);
267-
} catch (Exception e) {
268-
System.out.println(e.getMessage());
269264
}
270265
}
271266
}

test/hotspot/jtreg/compiler/arraycopy/TestArrayCopyDisjoint.java

+16-21
Original file line numberDiff line numberDiff line change
@@ -202,27 +202,22 @@ public static void main(String [] args) {
202202

203203
setup();
204204

205-
try {
206-
for (int i = 0 ; i < 1000000 ; i++ ) {
207-
testByte(lengths[i % lengths.length], r.nextInt(2048) , r.nextInt(2048));
208-
testByte_constant_LT32B (r.nextInt(2048) , r.nextInt(2048));
209-
testByte_constant_LT64B (r.nextInt(2048) , r.nextInt(2048));
210-
211-
testChar(lengths[i % lengths.length] >> 1, r.nextInt(2048) , r.nextInt(2048));
212-
testChar_constant_LT32B (r.nextInt(2048) , r.nextInt(2048));
213-
testChar_constant_LT64B (r.nextInt(2048) , r.nextInt(2048));
214-
215-
testInt(lengths[i % lengths.length] >> 2, r.nextInt(2048) , r.nextInt(2048));
216-
testInt_constant_LT32B (r.nextInt(2048) , r.nextInt(2048));
217-
testInt_constant_LT64B (r.nextInt(2048) , r.nextInt(2048));
218-
219-
testLong(lengths[i % lengths.length] >> 3, r.nextInt(2048) , r.nextInt(2048));
220-
testLong_constant_LT32B (r.nextInt(2048) , r.nextInt(2048));
221-
testLong_constant_LT64B (r.nextInt(2048) , r.nextInt(2048));
222-
}
223-
System.out.println("PASS : " + validate_ctr);
224-
} catch (Exception e) {
225-
System.out.println(e.getMessage());
205+
for (int i = 0 ; i < 30_000 ; i++ ) {
206+
testByte(lengths[i % lengths.length], r.nextInt(2048) , r.nextInt(2048));
207+
testByte_constant_LT32B (r.nextInt(2048) , r.nextInt(2048));
208+
testByte_constant_LT64B (r.nextInt(2048) , r.nextInt(2048));
209+
210+
testChar(lengths[i % lengths.length] >> 1, r.nextInt(2048) , r.nextInt(2048));
211+
testChar_constant_LT32B (r.nextInt(2048) , r.nextInt(2048));
212+
testChar_constant_LT64B (r.nextInt(2048) , r.nextInt(2048));
213+
214+
testInt(lengths[i % lengths.length] >> 2, r.nextInt(2048) , r.nextInt(2048));
215+
testInt_constant_LT32B (r.nextInt(2048) , r.nextInt(2048));
216+
testInt_constant_LT64B (r.nextInt(2048) , r.nextInt(2048));
217+
218+
testLong(lengths[i % lengths.length] >> 3, r.nextInt(2048) , r.nextInt(2048));
219+
testLong_constant_LT32B (r.nextInt(2048) , r.nextInt(2048));
220+
testLong_constant_LT64B (r.nextInt(2048) , r.nextInt(2048));
226221
}
227222
}
228223
}

0 commit comments

Comments
 (0)