Skip to content

Commit

Permalink
8328341: Remove deprecated per-thread compiler stats in sun.management
Browse files Browse the repository at this point in the history
Reviewed-by: kevinw
  • Loading branch information
Eirik Bjørsnøs committed Mar 19, 2024
1 parent 1329216 commit 9214a62
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 149 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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<CompilerThreadInfo> threads;
private int numActiveThreads; // number of active compiler threads

private Map<String, Counter> counters;
Expand Down Expand Up @@ -145,15 +118,6 @@ private void initCompilerCounters() {
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() {
Expand All @@ -180,15 +144,6 @@ public long getCompiledMethodSize() {
return nmethodSize.longValue();
}

@Deprecated
public List<CompilerThreadStat> getCompilerThreadStats() {
List<CompilerThreadStat> 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(),
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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<CompilerThreadStat> getCompilerThreadStats();

/**
* Returns the total number of compiles.
*
Expand Down

1 comment on commit 9214a62

@openjdk-notifier
Copy link

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.