# HG changeset patch # User sla # Date 1361180587 -3600 # Node ID 55126c3ce8e93e24889b6b258dd10a0ac0594ef3 # Parent 968cb74762172e6366e02ec209ef38dc81c2a0fa 8007901: SA: Don't read flag values as constants Reviewed-by: dholmes, mikael diff -r 968cb7476217 -r 55126c3ce8e9 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java --- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Fri Feb 15 10:29:23 2013 -0800 +++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java Mon Feb 18 10:43:07 2013 +0100 @@ -90,10 +90,6 @@ /** Flags indicating whether we are attached to a core, C1, or C2 build */ private boolean usingClientCompiler; private boolean usingServerCompiler; - /** Flag indicating whether UseTLAB is turned on */ - private boolean useTLAB; - /** Flag indicating whether invokedynamic support is on */ - private boolean enableInvokeDynamic; /** alignment constants */ private boolean isLP64; private int bytesPerLong; @@ -326,9 +322,6 @@ } } - useTLAB = (db.lookupIntConstant("UseTLAB").intValue() != 0); - enableInvokeDynamic = (db.lookupIntConstant("EnableInvokeDynamic").intValue() != 0); - if (debugger != null) { isLP64 = debugger.getMachineDescription().isLP64(); } @@ -579,15 +572,6 @@ } } - /** Indicates whether Thread-Local Allocation Buffers are used */ - public boolean getUseTLAB() { - return useTLAB; - } - - public boolean getEnableInvokeDynamic() { - return enableInvokeDynamic; - } - public TypeDataBase getTypeDataBase() { return db; } @@ -822,6 +806,12 @@ return objectAlignmentInBytes; } + /** Indicates whether Thread-Local Allocation Buffers are used */ + public boolean getUseTLAB() { + Flag flag = getCommandLineFlag("UseTLAB"); + return (flag == null) ? false: flag.getBool(); + } + // returns null, if not available. public Flag[] getCommandLineFlags() { if (commandLineFlags == null) { diff -r 968cb7476217 -r 55126c3ce8e9 hotspot/src/share/vm/runtime/vmStructs.cpp --- a/hotspot/src/share/vm/runtime/vmStructs.cpp Fri Feb 15 10:29:23 2013 -0800 +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp Mon Feb 18 10:43:07 2013 +0100 @@ -2109,8 +2109,6 @@ /* Useful globals */ \ /******************/ \ \ - declare_constant(UseTLAB) \ - declare_constant(EnableInvokeDynamic) \ \ /**************/ \ /* Stack bias */ \