Skip to content

8332252: Clean up vmTestbase/vm/share #3640

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. 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
Expand Down Expand Up @@ -47,12 +47,8 @@

package gc.gctests.LoadUnloadGC;

import nsk.share.test.*;
import nsk.share.gc.*;
import nsk.share.classload.ClassPathNonDelegatingClassLoader;
import vm.share.monitoring.MemoryPoolFinder;

import java.io.*;
import java.util.*;
import java.lang.management.MemoryPoolMXBean;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. 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
Expand All @@ -20,11 +20,11 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package vm.share.monitoring;
package gc.gctests.LoadUnloadGC;

import java.lang.management.*;

public enum MemoryPoolFinder {
enum MemoryPoolFinder {
CODE_CACHE,
EDEN_SPACE,
SURVIVOR_SPACE,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. 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
Expand All @@ -24,7 +24,6 @@
package metaspace.gc;

import java.util.Arrays;
import vm.share.VMRuntimeEnvUtils;

/**
* Test metaspace ergonomic.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package vm.share.gc;
package metaspace.share;

/**
* This class is used to distinguish between OOME in metaspace and OOME in heap when triggering class unloading.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package vm.share.gc;
package metaspace.share;

import nsk.share.test.ExecutionController;
import nsk.share.gc.gp.classload.GeneratedClassProducer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package vm.share.gc;
package metaspace.share;

import nsk.share.test.ExecutionController;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package vm.share.gc;
package metaspace.share;


import jdk.test.whitebox.WhiteBox;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. 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
Expand Down Expand Up @@ -53,14 +53,14 @@
import java.util.Map;
import java.util.Random;

import jdk.test.lib.compiler.InMemoryJavaCompiler;
import metaspace.share.TriggerUnloadingHelper;
import metaspace.share.TriggerUnloadingWithWhiteBox;
import nsk.share.gc.GCTestBase;
import nsk.share.test.ExecutionController;
import nsk.share.test.Stresser;
import nsk.share.test.TestBase;
import nsk.share.test.Tests;
import vm.share.gc.TriggerUnloadingHelper;
import vm.share.gc.TriggerUnloadingWithWhiteBox;
import jdk.test.lib.compiler.InMemoryJavaCompiler;

/**
* Test checks that static fields will be initialized in new loaded class. Test performs in loop the following routine:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. 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
Expand Down Expand Up @@ -28,13 +28,13 @@
import java.lang.reflect.Proxy;
import java.util.List;

import jdk.test.whitebox.WhiteBox;
import metaspace.share.TriggerUnloadingHelper;
import metaspace.stressHierarchy.common.classloader.tree.Node;
import metaspace.stressHierarchy.common.classloader.tree.Tree;
import metaspace.stressHierarchy.common.exceptions.ClassNotUnloadedException;
import metaspace.stressHierarchy.common.exceptions.TimeIsOverException;
import nsk.share.test.ExecutionController;
import jdk.test.whitebox.WhiteBox;
import vm.share.gc.TriggerUnloadingHelper;

public class PerformChecksHelper {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@

import java.net.MalformedURLException;

import vm.share.gc.HeapOOMEException;
import vm.share.gc.TriggerUnloadingByFillingMetaspace;
import vm.share.gc.TriggerUnloadingHelper;
import vm.share.gc.TriggerUnloadingWithWhiteBox;

import metaspace.share.HeapOOMEException;
import metaspace.share.TriggerUnloadingByFillingMetaspace;
import metaspace.share.TriggerUnloadingHelper;
import metaspace.share.TriggerUnloadingWithWhiteBox;
import metaspace.stressHierarchy.common.classloader.tree.Node;
import metaspace.stressHierarchy.common.classloader.tree.Tree;
import metaspace.stressHierarchy.common.exceptions.TimeIsOverException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. 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
Expand Down Expand Up @@ -56,8 +56,6 @@

package nsk.jvmti.scenarios.hotswap.HS203.hs203t004;

import vm.share.VMRuntimeEnvUtils;
import nsk.share.Consts;
import nsk.share.jvmti.RedefineAgent;

public class hs203t004 extends RedefineAgent {
Expand All @@ -68,13 +66,6 @@ public hs203t004(String[] arg) {

public static void main(String[] arg) {
arg = nsk.share.jvmti.JVMTITest.commonInit(arg);

if (!VMRuntimeEnvUtils.isJITEnabled()) {
System.out.println("WARNING: test isn't valid if JIT compilation is disabled");
System.out.println("Exiting with 'PASSED' status");
System.exit(Consts.JCK_STATUS_BASE + Consts.TEST_PASSED);
}

hs203t004 hsCase = new hs203t004(arg);
System.exit(hsCase.runAgent());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. 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
Expand Down Expand Up @@ -29,7 +29,6 @@
import nsk.share.log.LogSupport;
import vm.share.options.Option;
import vm.share.options.OptionSupport;
import vm.share.process.ProcessExecutor;

import java.io.File;
import java.io.FileNotFoundException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,16 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package vm.share.process;
package vm.compiler.complog.share;

import nsk.share.TestBug;
import nsk.share.TestFailure;
import nsk.share.log.Log;
import vm.share.ProcessUtils;

import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.io.IOException;
import java.util.*;
import java.lang.reflect.Field;

public class ProcessExecutor {
private static long CLEANUP_TIMEOUT = 60000;
Expand Down Expand Up @@ -138,8 +131,8 @@ public int waitFor(long timeout) {
return -1;
}

public int getPid() {
return ProcessUtils.getPid(process);
public long getPid() {
return process.pid();
}

public OutputStream getStdIn() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package vm.share.process;
package vm.compiler.complog.share;

/*
* StreamListener listens on events from BufferedInputStream.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package vm.share.process;
package vm.compiler.complog.share;

import nsk.share.log.Log;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package vm.share.process;
package vm.compiler.complog.share;

import java.io.InputStream;
import java.io.InputStreamReader;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2024, Oracle and/or its affiliates. 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
Expand Down Expand Up @@ -50,7 +50,7 @@

import vm.mlvm.hiddenloader.share.HiddenkTestee01;
import vm.mlvm.share.MlvmTest;
import vm.share.FileUtils;
import vm.mlvm.share.FileUtils;

public class Test extends MlvmTest {
private static final Class<?> PARENT = HiddenkTestee01.class;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2024, Oracle and/or its affiliates. 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
Expand All @@ -23,24 +23,25 @@

package vm.mlvm.hiddenloader.share;

import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodHandles.Lookup;


import java.io.File;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodHandles.Lookup;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;

import nsk.share.test.Stresser;
import vm.share.options.Option;
import vm.share.options.OptionSupport;
import vm.share.options.IgnoreUnknownArgumentsHandler;
import vm.mlvm.share.Env;
import vm.mlvm.share.MlvmTest;
import vm.mlvm.share.CustomClassLoaders;
import vm.share.FileUtils;
import vm.share.UnsafeAccess;
import vm.mlvm.share.FileUtils;
import vm.share.options.Option;
import vm.share.options.OptionSupport;
import vm.share.options.IgnoreUnknownArgumentsHandler;

/**
* Does stress-testing of class loading subsystem.
Expand Down Expand Up @@ -164,7 +165,7 @@ public void run() {
c = CustomClassLoaders.makeClassBytesLoader(classBytes, className)
.loadClass(className);
}
UnsafeAccess.unsafe.ensureClassInitialized(c);
MethodHandles.lookup().ensureInitialized(c);
} catch (Throwable e) {
Env.traceVerbose(e, "parser caught exception");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2024, Oracle and/or its affiliates. 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
Expand Down Expand Up @@ -44,7 +44,7 @@

import vm.mlvm.hiddenloader.share.HiddenkTestee01;
import vm.mlvm.hiddenloader.share.StressClassLoadingTest;
import vm.share.FileUtils;
import vm.mlvm.share.FileUtils;
import vm.share.options.Option;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2024, Oracle and/or its affiliates. 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
Expand Down Expand Up @@ -51,7 +51,7 @@
import vm.mlvm.share.MlvmOOMTest;
import vm.mlvm.share.MlvmTestExecutor;
import vm.mlvm.share.Env;
import vm.share.FileUtils;
import vm.mlvm.share.FileUtils;

/**
* This test loads a class using defineHiddenClass, creates instances
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2024, Oracle and/or its affiliates. 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
Expand Down Expand Up @@ -51,7 +51,7 @@
import vm.mlvm.share.MlvmOOMTest;
import vm.mlvm.share.MlvmTestExecutor;
import vm.mlvm.share.Env;
import vm.share.FileUtils;
import vm.mlvm.share.FileUtils;

/**
* This test loads classes using defineHiddenClass and stores them,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2010, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2024, Oracle and/or its affiliates. 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
Expand Down Expand Up @@ -51,7 +51,7 @@
import vm.mlvm.hiddenloader.share.HiddenkTestee01;
import vm.mlvm.share.MlvmTestExecutor;
import vm.mlvm.share.MultiThreadedTest;
import vm.share.FileUtils;
import vm.mlvm.share.FileUtils;

/**
* Verifies that loading classes in parallel from several threads using
Expand Down
Loading