JDK-8050050 : [TESTBUG] compiler/stable tests fail because WB API is not implemented
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 8u20
  • Priority: P2
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2014-07-11
  • Updated: 2015-01-21
  • Resolved: 2014-09-02
Related Reports
Relates :  
Relates :  
Description
/export/local/aurora/CommonData/javase_testbase/hotspot/test/compiler/stable/StableConfiguration.java:37: error: cannot find symbol
        Boolean value = WB.getBooleanVMFlag("FoldStableValues");
                          ^
  symbol:   method getBooleanVMFlag(String)
  location: variable WB of type WhiteBox
1 error
result: Failed. Compilation failed: Compilation failed
Comments
Already in 8u40 by backport of JDK-8038756
02-09-2014

Clearing fix version as this did not go into 8u20 and 8u20 has shipped.
20-08-2014

In today's 8u20 RT meeting - we heard that this is NOT needed for 8u20. Please confirm and then add 8u20-defer-request. Ilya agreed that this is not needed for 8u20 so once I see the defer request - I'll approve
24-07-2014

This fix is only for 8u20. IMO, for 8u40 JDK-8038756 should be backported instead.
23-07-2014

Please push fix in 8u40. You do not need approval for that.
23-07-2014

FYI, the fix has been reviewed. http://cr.openjdk.java.net/~vlivanov/8050050/webrev.01/ http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2014-July/015074.html
23-07-2014

SQE asks us to fix it in 8u20. The fix is under review: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/2014-July/015024.html
21-07-2014

Are we going to fix this is 8u20? If not, retarget to next release.
21-07-2014

Suggested fix: diff --git a/test/compiler/stable/StableConfiguration.java b/test/compiler/stable/StableConfiguration.java --- a/test/compiler/stable/StableConfiguration.java +++ b/test/compiler/stable/StableConfiguration.java @@ -24,39 +24,41 @@ */ package java.lang.invoke; -import java.lang.reflect.Method; -import java.util.Properties; -import sun.hotspot.WhiteBox; +import com.sun.management.HotSpotDiagnosticMXBean; +import com.sun.management.VMOption; +import sun.management.ManagementFactoryHelper; public class StableConfiguration { - static final WhiteBox WB = WhiteBox.getWhiteBox(); static final boolean isStableEnabled; static final boolean isServerWithStable; static { - Boolean value = WB.getBooleanVMFlag("FoldStableValues"); - isStableEnabled = (value == null ? false : value); - isServerWithStable = isStableEnabled && get(); + isStableEnabled = Boolean.parseBoolean(get("FoldStableValues")); + + boolean isServer = false; + String javaVM = System.getProperty("java.vm.name", ""); + if (javaVM.contains("Server")) { + if (Boolean.parseBoolean(get("TieredCompilation"))) { + if (Integer.parseInt(get("TieredStopAtLevel")) == 4) { + isServer = true; + } + } else { + isServer = true; + } + } + isServerWithStable = isStableEnabled && isServer; System.out.println("@Stable: " + (isStableEnabled ? "enabled" : "disabled")); - System.out.println("Server Compiler: " + get()); + System.out.println("Server Compiler: " + isServer); } - // ::get() is among immediately compiled methods. - static boolean get() { + static String get(String name) { + HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean(); + VMOption tmp; try { - Method m = StableConfiguration.class.getDeclaredMethod("get"); - int level = WB.getMethodCompilationLevel(m); - if (level > 0) { - return (level == 4); - } else { - String javaVM = System.getProperty("java.vm.name", ""); - if (javaVM.contains("Server")) return true; - if (javaVM.contains("Client")) return false; - throw new Error("Unknown VM type: "+javaVM); - } - } catch (NoSuchMethodException e) { - throw new Error(e); + tmp = diagnostic.getVMOption(name); + } catch (IllegalArgumentException e) { + tmp = null; } + return tmp != null ? tmp.getValue() : null; } - }
15-07-2014

Please ensure tests are properly categorized in TEST.groups if their dependencies change. Thanks.
15-07-2014