diff --git a/src/java.management/share/classes/sun/management/CompilerThreadStat.java b/src/java.management/share/classes/sun/management/CompilerThreadStat.java deleted file mode 100644 index 9ebffa3dc06..00000000000 --- a/src/java.management/share/classes/sun/management/CompilerThreadStat.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) 2003, 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 - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.management; - -/** - */ -@Deprecated -public class CompilerThreadStat implements java.io.Serializable { - private String name; - private long taskCount; - private long compileTime; - private MethodInfo lastMethod; - - CompilerThreadStat(String name, long taskCount, long time, MethodInfo lastMethod) { - this.name = name; - this.taskCount = taskCount; - this.compileTime = time; - this.lastMethod = lastMethod; - }; - - /** - * Returns the name of the compiler thread associated with - * this compiler thread statistic. - * - * @return the name of the compiler thread. - */ - public String getName() { - return name; - } - - /** - * Returns the number of compile tasks performed by the compiler thread - * associated with this compiler thread statistic. - * - * @return the number of compile tasks performed by the compiler thread. - */ - public long getCompileTaskCount() { - return taskCount; - } - - /** - * Returns the accumulated elapsed time spent by the compiler thread - * associated with this compiler thread statistic. - * - * @return the accumulated elapsed time spent by the compiler thread. - */ - public long getCompileTime() { - return compileTime; - } - - /** - * Returns the information about the last method compiled by - * the compiler thread associated with this compiler thread statistic. - * - * @return a {@link MethodInfo} object for the last method - * compiled by the compiler thread. - */ - public MethodInfo getLastCompiledMethodInfo() { - return lastMethod; - } - - public String toString() { - return getName() + " compileTasks = " + getCompileTaskCount() - + " compileTime = " + getCompileTime(); - } - - private static final long serialVersionUID = 6992337162326171013L; - -} diff --git a/src/java.management/share/classes/sun/management/HotspotCompilation.java b/src/java.management/share/classes/sun/management/HotspotCompilation.java index 9b1faa6738c..2e8b6494e02 100644 --- a/src/java.management/share/classes/sun/management/HotspotCompilation.java +++ b/src/java.management/share/classes/sun/management/HotspotCompilation.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -72,33 +72,6 @@ class HotspotCompilation private StringCounter lastInvalidatedMethod; private LongCounter lastInvalidatedType; - private class CompilerThreadInfo { - String name; - StringCounter method; - LongCounter type; - LongCounter compiles; - LongCounter time; - CompilerThreadInfo(String bname, int index) { - String basename = bname + "." + index + "."; - this.name = bname + "-" + index; - this.method = (StringCounter) lookup(basename + "method"); - this.type = (LongCounter) lookup(basename + "type"); - this.compiles = (LongCounter) lookup(basename + "compiles"); - this.time = (LongCounter) lookup(basename + "time"); - } - - @SuppressWarnings("deprecation") - CompilerThreadStat getCompilerThreadStat() { - MethodInfo minfo = new MethodInfo(method.stringValue(), - (int) type.longValue(), - -1); - return new CompilerThreadStat(name, - compiles.longValue(), - time.longValue(), - minfo); - } - } - private List threads; private int numActiveThreads; // number of active compiler threads private Map counters; @@ -145,15 +118,6 @@ class HotspotCompilation lastInvalidatedType = (LongCounter) lookup("lastInvalidatedType"); numActiveThreads = (int) compilerThreads.longValue(); - - // Allocate CompilerThreadInfo for compilerThread and adaptorThread - threads = new ArrayList<>(); - - for (int i = 0; i < numActiveThreads; i++) { - if (counters.containsKey(SUN_CI + "compilerThread." + i + ".method")) { - threads.add(new CompilerThreadInfo("compilerThread", i)); - } - } } public int getCompilerThreadCount() { @@ -180,15 +144,6 @@ class HotspotCompilation return nmethodSize.longValue(); } - @Deprecated - public List getCompilerThreadStats() { - List list = new ArrayList<>(threads.size()); - for (CompilerThreadInfo info : threads) { - list.add(info.getCompilerThreadStat()); - } - return list; - } - public MethodInfo getLastCompile() { return new MethodInfo(lastMethod.stringValue(), (int) lastType.longValue(), diff --git a/src/java.management/share/classes/sun/management/HotspotCompilationMBean.java b/src/java.management/share/classes/sun/management/HotspotCompilationMBean.java index 2a9849f0abb..a50aca253c9 100644 --- a/src/java.management/share/classes/sun/management/HotspotCompilationMBean.java +++ b/src/java.management/share/classes/sun/management/HotspotCompilationMBean.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 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 @@ -39,16 +39,6 @@ public interface HotspotCompilationMBean { */ public int getCompilerThreadCount(); - /** - * Returns the statistic of all compiler threads. - * - * @return a list of {@link CompilerThreadStat} object containing - * the statistic of a compiler thread. - * - */ - @Deprecated - public java.util.List getCompilerThreadStats(); - /** * Returns the total number of compiles. *