Skip to content
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

8277413: Remove unused local variables in jdk.hotspot.agent #6329

Closed
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
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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()) {
Expand Down
2 changes: 0 additions & 2 deletions src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HSDB.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.*;
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.*;
Expand Down Expand Up @@ -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;
Expand Down
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, 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
Expand Down Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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))) {
Expand Down Expand Up @@ -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 () {
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down