Skip to content
Permalink
Browse files
8270171: Shenandoah: Cleanup TestStringDedup and TestStringDedupStres…
…s tests

Reviewed-by: shade
  • Loading branch information
zhengyu123 committed Jul 9, 2021
1 parent 3588634 commit e4c24f01ef97de1c9a5a5faca5dd8ea2ad8c62d9
Showing 2 changed files with 1 addition and 20 deletions.
@@ -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) {

1 comment on commit e4c24f0

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on e4c24f0 Jul 9, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.