Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8270171: Shenandoah: Cleanup TestStringDedup and TestStringDedupStress tests #4742

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -49,7 +49,6 @@
* @key randomness
* @requires vm.gc.Shenandoah
* @library /test/lib
* @modules java.base/jdk.internal.misc:open
* @modules java.base/java.lang:open
* java.management
*
@@ -72,7 +71,6 @@
* @key randomness
* @requires vm.gc.Shenandoah
* @library /test/lib
* @modules java.base/jdk.internal.misc:open
* @modules java.base/java.lang:open
* java.management
*
@@ -89,22 +87,15 @@
import java.util.*;
import jdk.test.lib.Utils;

import sun.misc.*;

public class TestStringDedup {
private static Field valueField;
private static Unsafe unsafe;

private static final int UniqueStrings = 20;
// How many GC cycles are needed to complete deduplication.
private static final int GCCount = Integer.getInteger("GCCount", 3);

static {
try {
Field field = Unsafe.class.getDeclaredField("theUnsafe");
field.setAccessible(true);
unsafe = (Unsafe) field.get(null);

valueField = String.class.getDeclaredField("value");
valueField.setAccessible(true);
} catch (Exception e) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
* Copyright (c) 2017, 2021, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
* @key randomness
* @requires vm.gc.Shenandoah
* @library /test/lib
* @modules java.base/jdk.internal.misc:open
* @modules java.base/java.lang:open
* java.management
*
@@ -49,7 +48,6 @@
* @key randomness
* @requires vm.gc.Shenandoah
* @library /test/lib
* @modules java.base/jdk.internal.misc:open
* @modules java.base/java.lang:open
* java.management
*
@@ -80,7 +78,6 @@
* @key randomness
* @requires vm.gc.Shenandoah
* @library /test/lib
* @modules java.base/jdk.internal.misc:open
* @modules java.base/java.lang:open
* java.management
*
@@ -111,11 +108,8 @@
import java.util.*;
import jdk.test.lib.Utils;

import sun.misc.*;

public class TestStringDedupStress {
private static Field valueField;
private static Unsafe unsafe;

private static final int TARGET_STRINGS = Integer.getInteger("targetStrings", 2_500_000);
private static final long MAX_REWRITE_GC_CYCLES = 6;
@@ -125,10 +119,6 @@ public class TestStringDedupStress {

static {
try {
Field field = Unsafe.class.getDeclaredField("theUnsafe");
field.setAccessible(true);
unsafe = (Unsafe) field.get(null);

valueField = String.class.getDeclaredField("value");
valueField.setAccessible(true);
} catch (Exception e) {