Skip to content

Commit 7e02039

Browse files
author
Andrey Turbanov
committed
8293647: Avoid unnecessary boxing in jdk.hotspot.agent
Reviewed-by: cjplummer, sspitsyn
1 parent 9039022 commit 7e02039

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/CommandProcessor.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ public void doit(Tokens t) {
12261226
if (t.countTokens() == 0) {
12271227
out.println("echo is " + doEcho);
12281228
} else if (t.countTokens() == 1) {
1229-
doEcho = Boolean.valueOf(t.nextToken()).booleanValue();
1229+
doEcho = Boolean.parseBoolean(t.nextToken());
12301230
} else {
12311231
usage();
12321232
}
@@ -1238,7 +1238,7 @@ public void doit(Tokens t) {
12381238
out.println("versioncheck is " +
12391239
(System.getProperty("sun.jvm.hotspot.runtime.VM.disableVersionCheck") == null));
12401240
} else if (t.countTokens() == 1) {
1241-
if (Boolean.valueOf(t.nextToken()).booleanValue()) {
1241+
if (Boolean.parseBoolean(t.nextToken())) {
12421242
System.clearProperty("sun.jvm.hotspot.runtime.VM.disableVersionCheck");
12431243
} else {
12441244
System.setProperty("sun.jvm.hotspot.runtime.VM.disableVersionCheck", "true");
@@ -1302,7 +1302,7 @@ public void doit(Tokens t) {
13021302
}
13031303
} else if (t.countTokens() == 2) {
13041304
String name = t.nextToken();
1305-
Integer value = Integer.valueOf(t.nextToken());
1305+
int value = Integer.parseInt(t.nextToken());
13061306
db.addIntConstant(name, value);
13071307
}
13081308
}
@@ -1325,7 +1325,7 @@ public void doit(Tokens t) {
13251325
}
13261326
} else if (t.countTokens() == 2) {
13271327
String name = t.nextToken();
1328-
Long value = Long.valueOf(t.nextToken());
1328+
long value = Long.parseLong(t.nextToken());
13291329
db.addLongConstant(name, value);
13301330
}
13311331
}
@@ -1352,7 +1352,7 @@ public void doit(Tokens t) {
13521352
// The field's Type must already be in the database -- no exceptions
13531353
Type fieldType = agent.getTypeDataBase().lookupType(t.nextToken());
13541354

1355-
boolean isStatic = Boolean.valueOf(t.nextToken()).booleanValue();
1355+
boolean isStatic = Boolean.parseBoolean(t.nextToken());
13561356
long offset = Long.parseLong(t.nextToken());
13571357
Address staticAddress = parseAddress(t.nextToken());
13581358
if (isStatic && staticAddress == null) {
@@ -1414,9 +1414,9 @@ public void doit(Tokens t) {
14141414
if (superclassName.equals("null")) {
14151415
superclassName = null;
14161416
}
1417-
boolean isOop = Boolean.valueOf(t.nextToken()).booleanValue();
1418-
boolean isInteger = Boolean.valueOf(t.nextToken()).booleanValue();
1419-
boolean isUnsigned = Boolean.valueOf(t.nextToken()).booleanValue();
1417+
boolean isOop = Boolean.parseBoolean(t.nextToken());
1418+
boolean isInteger = Boolean.parseBoolean(t.nextToken());
1419+
boolean isUnsigned = Boolean.parseBoolean(t.nextToken());
14201420
long size = Long.parseLong(t.nextToken());
14211421

14221422
BasicType type = null;
@@ -1807,7 +1807,7 @@ public void doit(Tokens t) {
18071807
if (t.countTokens() != 1) {
18081808
usage();
18091809
} else {
1810-
verboseExceptions = Boolean.valueOf(t.nextToken()).booleanValue();
1810+
verboseExceptions = Boolean.parseBoolean(t.nextToken());
18111811
}
18121812
}
18131813
},
@@ -1816,7 +1816,7 @@ public void doit(Tokens t) {
18161816
if (t.countTokens() != 1) {
18171817
usage();
18181818
} else {
1819-
Assert.ASSERTS_ENABLED = Boolean.valueOf(t.nextToken()).booleanValue();
1819+
Assert.ASSERTS_ENABLED = Boolean.parseBoolean(t.nextToken());
18201820
}
18211821
}
18221822
},

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2000, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -267,7 +267,7 @@ private void readExternalDefinitions() {
267267
t.nextToken();
268268
Type fieldType = lookupType(t.sval);
269269
t.nextToken();
270-
boolean isStatic = Boolean.valueOf(t.sval).booleanValue();
270+
boolean isStatic = Boolean.parseBoolean(t.sval);
271271
t.nextToken();
272272
long offset = Long.parseLong(t.sval);
273273
t.nextToken();
@@ -321,11 +321,11 @@ private void readExternalDefinitions() {
321321
superclassName = null;
322322
}
323323
t.nextToken();
324-
boolean isOop = Boolean.valueOf(t.sval).booleanValue();
324+
boolean isOop = Boolean.parseBoolean(t.sval);
325325
t.nextToken();
326-
boolean isInteger = Boolean.valueOf(t.sval).booleanValue();
326+
boolean isInteger = Boolean.parseBoolean(t.sval);
327327
t.nextToken();
328-
boolean isUnsigned = Boolean.valueOf(t.sval).booleanValue();
328+
boolean isUnsigned = Boolean.parseBoolean(t.sval);
329329
t.nextToken();
330330
long size = Long.parseLong(t.sval);
331331

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/utilities/PointerFinder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public static PointerLocation find(Address a) {
7373
JavaThread t = threads.getJavaThreadAt(i);
7474
Address stackBase = t.getStackBase();
7575
if (stackBase != null) {
76-
Long stackSize = t.getStackSize();
76+
long stackSize = t.getStackSize();
7777
Address stackEnd = stackBase.addOffsetTo(-stackSize);
7878
if (a.lessThanOrEqual(stackBase) && a.greaterThan(stackEnd)) {
7979
loc.stackThread = t;

0 commit comments

Comments
 (0)