Skip to content
Permalink
Browse files
8277413: Remove unused local variables in jdk.hotspot.agent
Reviewed-by: lmesnik, tschatzl, sspitsyn
  • Loading branch information
turbanoff authored and Thomas Schatzl committed Nov 23, 2021
1 parent 36b887a commit 66eaf6526126eb27c18acc64c2bb0791142815c9
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 26 deletions.
@@ -52,7 +52,6 @@
import sun.jvm.hotspot.debugger.OopHandle;
import sun.jvm.hotspot.classfile.ClassLoaderDataGraph;
import sun.jvm.hotspot.memory.FileMapInfo;
import sun.jvm.hotspot.memory.SystemDictionary;
import sun.jvm.hotspot.memory.Universe;
import sun.jvm.hotspot.gc.shared.CollectedHeap;
import sun.jvm.hotspot.gc.g1.G1CollectedHeap;
@@ -94,11 +93,9 @@
import sun.jvm.hotspot.ui.tree.SimpleTreeNode;
import sun.jvm.hotspot.utilities.AddressOps;
import sun.jvm.hotspot.utilities.Assert;
import sun.jvm.hotspot.utilities.CompactHashTable;
import sun.jvm.hotspot.utilities.HeapProgressThunk;
import sun.jvm.hotspot.utilities.LivenessPathElement;
import sun.jvm.hotspot.utilities.MethodArray;
import sun.jvm.hotspot.utilities.ObjectReader;
import sun.jvm.hotspot.utilities.PointerFinder;
import sun.jvm.hotspot.utilities.PointerLocation;
import sun.jvm.hotspot.utilities.ReversePtrs;
@@ -132,7 +129,7 @@ public boolean canInclude(InstanceKlass kls) {
if (kls.getClassLoader() == null) return false;
if (emitted.get(kls.getName()) != null) {
// Since multiple class loaders are being shoved
// together duplicate classes are a possibilty. For
// together duplicate classes are a possibility. For
// now just ignore them.
return false;
}
@@ -436,7 +433,6 @@ public void doit(Tokens t) {
Matcher m2 = args2.matcher(arg);
Address start = null;
Address end = null;
String format = "";
int formatSize = (int)VM.getVM().getAddressSize();

if (m1.matches()) {
@@ -40,7 +40,6 @@
import sun.jvm.hotspot.gc.g1.*;
import sun.jvm.hotspot.gc.z.*;
import sun.jvm.hotspot.interpreter.*;
import sun.jvm.hotspot.memory.*;
import sun.jvm.hotspot.oops.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.ui.*;
@@ -1737,7 +1736,6 @@ private void doHeapIteration(String frameTitle,
String progressBarText,
HeapVisitor visitor,
CleanupThunk cleanup) {
sun.jvm.hotspot.oops.ObjectHistogram histo = new sun.jvm.hotspot.oops.ObjectHistogram();
HeapProgress progress = new HeapProgress(frameTitle,
progressBarText,
cleanup);
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2021, 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
@@ -426,7 +426,6 @@ private void readVMStructs() {
boolean isStatic = false;
long offset = 0;
Address staticFieldAddr = null;
long size = 0;
long index = 0;
String opaqueName = "<opaque>";
lookupOrCreateClass(opaqueName, false, false, false);
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2021, 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
@@ -350,7 +350,6 @@ PCDesc find_pc_desc_internal(long pc, boolean approximate) {

// Take giant steps at first (4096, then 256, then 16, then 1)
int LOG2_RADIX = 4;
int RADIX = (1 << LOG2_RADIX);
Address mid;
for (int step = (1 << (LOG2_RADIX*3)); step > 1; step >>= LOG2_RADIX) {
while ((mid = lower.addOffsetTo(step * pcDescSize)).lessThan(upper)) {
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2021, 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
@@ -24,7 +24,6 @@

package sun.jvm.hotspot.code;

import java.util.*;
import sun.jvm.hotspot.debugger.*;
import sun.jvm.hotspot.runtime.*;
import sun.jvm.hotspot.types.*;
@@ -88,7 +87,6 @@ public boolean contains(Address pc) {

public Stub getStubContaining(Address pc) {
if (contains(pc)) {
int i = 0;
for (Stub s = getFirst(); s != null; s = getNext(s)) {
if (stubContains(s, pc)) {
return s;
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2021, 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
@@ -417,7 +417,6 @@ CDebugInfoDataBase buildDataBase(String dllName, Address base) {
// and UDT references to understand how to build the global
// database vs. the module-by-module one)
DebugVC50SubsectionDirectory dir = vc50.getSubsectionDirectory();
int moduleNumber = 0; // Debugging
for (int i = 0; i < dir.getNumEntries(); i++) {
DebugVC50Subsection ss = dir.getSubsection(i);
int ssType = ss.getSubsectionType();
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2021, 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
@@ -310,10 +310,10 @@ void markAsAlive() {
int _max_stack; // Cached value of max. stack depth
int _max_monitors; // Cached value of max. monitor stack depth
boolean _has_exceptions; // True, if exceptions exist for method
boolean _got_error; // True, if an error occured during interpretation.
boolean _got_error; // True, if an error occurred during interpretation.
String _error_msg; // Error message. Set if _got_error is true.
// bool _did_rewriting; // was bytecodes rewritten
// bool _did_relocation; // was relocation neccessary
// bool _did_relocation; // was relocation necessary
boolean _monitor_safe; // The monitors in this method have been determined
// to be safe.

@@ -529,7 +529,6 @@ void replaceAllCTSMatches (CellTypeState match,
CellTypeState replace) {
int i;
int len = _max_locals + _stack_top;
boolean change = false;

for (i = len - 1; i >= 0; i--) {
if (match.equal(_state.get(i))) {
@@ -1894,7 +1893,7 @@ int copyCTS (CellTypeState[] dst, CellTypeState[]

// Create result set
boolean _report_result;
boolean _report_result_for_send; // Unfortunatly, stackmaps for sends are special, so we need some extra
boolean _report_result_for_send; // Unfortunately, stackmaps for sends are special, so we need some extra
BytecodeStream _itr_send; // variables to handle them properly.

void reportResult () {
@@ -1947,7 +1946,7 @@ void addToRefInitSet (int localNo) {
}

// Conflicts rewrite logic
boolean _conflict; // True, if a conflict occured during interpretation
boolean _conflict; // True, if a conflict occurred during interpretation
int _nof_refval_conflicts; // No. of conflicts that require rewrites
int[] _new_var_map;

@@ -2131,7 +2130,7 @@ boolean jumpTargetsDo (BytecodeStream bcs, JumpClosure closu
// Public routines for GenerateOopMap
//
public GenerateOopMap(Method method) {
// We have to initialize all variables here, that can be queried direcly
// We have to initialize all variables here, that can be queried directly
_method = method;
_max_locals=0;
_init_vars = null;
@@ -2204,7 +2203,7 @@ public void computeMap() {

if (_got_error) {
// We could expand this code to throw somekind of exception (e.g., VerifyException). However,
// an exception thrown in this part of the code is likly to mean that we are executing some
// an exception thrown in this part of the code is likely to mean that we are executing some
// illegal bytecodes (that the verifier should have caught if turned on), so we will just exit
// with a fatal.
throw new RuntimeException("Illegal bytecode sequence encountered while generating interpreter pointer maps - method should be rejected by verifier.");
@@ -1281,8 +1281,6 @@ protected String locationAsString(Location loc) {
if (w == Location.Where.ON_STACK) {
buf.append("stack[" + loc.getStackOffset() + "]");
} else if (w == Location.Where.IN_REGISTER) {
boolean isFloat = (type == Location.Type.FLOAT_IN_DBL ||
type == Location.Type.DBL);
int regNum = loc.getRegisterNumber();
VMReg vmReg = new VMReg(regNum);
buf.append(VMRegImpl.getRegisterName(vmReg.getValue()));

1 comment on commit 66eaf65

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on 66eaf65 Nov 23, 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.