Skip to content
Permalink
Browse files
8253900: SA: wrong size computation when JVM was built without AOT
Reviewed-by: cjplummer, sspitsyn
  • Loading branch information
jrziviani authored and TheRealMDoerr committed Oct 9, 2020
1 parent 2bc8bc5 commit b1448da109bc0105971360cf6de2397b66051956
@@ -229,6 +229,7 @@
JVMTI_ONLY(nonstatic_field(MethodCounters, _number_of_breakpoints, u2)) \
nonstatic_field(MethodCounters, _invocation_counter, InvocationCounter) \
nonstatic_field(MethodCounters, _backedge_counter, InvocationCounter) \
AOT_ONLY(nonstatic_field(MethodCounters, _method, Method*)) \
\
nonstatic_field(MethodData, _size, int) \
nonstatic_field(MethodData, _method, Method*) \
@@ -296,6 +296,7 @@ typedef HashtableEntry<InstanceKlass*, mtClass> KlassHashtableEntry;
JVMTI_ONLY(nonstatic_field(MethodCounters, _number_of_breakpoints, u2)) \
nonstatic_field(MethodCounters, _invocation_counter, InvocationCounter) \
nonstatic_field(MethodCounters, _backedge_counter, InvocationCounter) \
AOT_ONLY(nonstatic_field(MethodCounters, _method, Method*)) \
nonstatic_field(Method, _constMethod, ConstMethod*) \
nonstatic_field(Method, _method_data, MethodData*) \
nonstatic_field(Method, _method_counters, MethodCounters*) \
@@ -316,6 +316,11 @@ public static boolean shouldStoreFingerprint() {
}

public boolean hasStoredFingerprint() {
// has_stored_fingerprint() @ instanceKlass.cpp can return true only if INCLUDE_AOT is
// set during compilation.
if (!VM.getVM().hasAOT()) {
return false;
}
return shouldStoreFingerprint() || isShared();
}

@@ -89,6 +89,8 @@ be notified whenever the VM is initialized (or re-initialized). To
private FileMapInfo fileMapInfo;
private Bytes bytes;

/** Flag indicating if AOT is enabled in the build */
private boolean hasAOT;
/** Flag indicating if JVMTI support is included in the build */
private boolean isJvmtiSupported;
/** Flags indicating whether we are attached to a core, C1, or C2 build */
@@ -444,6 +446,16 @@ private VM(TypeDataBase db, JVMDebugger debugger, boolean isBigEndian) {

invocationEntryBCI = db.lookupIntConstant("InvocationEntryBci").intValue();

// We infer AOT if _method @ methodCounters is declared.
{
Type type = db.lookupType("MethodCounters");
if (type.getField("_method", false, false) == null) {
hasAOT = false;
} else {
hasAOT = true;
}
}

// We infer the presence of JVMTI from the presence of the InstanceKlass::_breakpoints field.
{
Type type = db.lookupType("InstanceKlass");
@@ -829,6 +841,11 @@ public boolean isBigEndian() {
return isBigEndian;
}

/** Returns true if AOT is enabled, false otherwise */
public boolean hasAOT() {
return hasAOT;
}

/** Returns true if JVMTI is supported, false otherwise */
public boolean isJvmtiSupported() {
return isJvmtiSupported;
@@ -92,8 +92,6 @@ runtime/ReservedStack/ReservedStackTest.java 8231031 generic-all
# :hotspot_serviceability

serviceability/sa/sadebugd/DebugdConnectTest.java 8239062 macosx-x64
serviceability/sa/TestInstanceKlassSize.java 8230664 linux-ppc64le,linux-ppc64
serviceability/sa/TestInstanceKlassSizeForInterface.java 8230664 linux-ppc64le,linux-ppc64
serviceability/sa/TestRevPtrsForInvokeDynamic.java 8241235 generic-all

serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java 8214032 generic-all
@@ -107,7 +107,7 @@ private static void startMeWithArgs() throws Exception {
for (String s : output.asLines()) {
if (s.contains(instanceKlassName)) {
Asserts.assertTrue(
s.contains(size), "The size computed by SA for" +
s.contains(size), "The size computed by SA for " +
instanceKlassName + " does not match.");
match = true;
}

1 comment on commit b1448da

@bridgekeeper

This comment has been minimized.

Copy link

@bridgekeeper bridgekeeper bot commented on b1448da Oct 9, 2020

Please sign in to comment.