8061616: HotspotDiagnosticMXBean.getVMOption() throws IllegalArgumentException for flags of type double
Reviewed-by: mchung, sla
--- a/hotspot/src/share/vm/services/jmm.h Fri Oct 31 18:18:58 2014 +0000
+++ b/hotspot/src/share/vm/services/jmm.h Mon Nov 03 11:19:43 2014 +0100
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2014, 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
@@ -143,7 +143,8 @@
JMM_VMGLOBAL_TYPE_UNKNOWN = 0,
JMM_VMGLOBAL_TYPE_JBOOLEAN = 1,
JMM_VMGLOBAL_TYPE_JSTRING = 2,
- JMM_VMGLOBAL_TYPE_JLONG = 3
+ JMM_VMGLOBAL_TYPE_JLONG = 3,
+ JMM_VMGLOBAL_TYPE_JDOUBLE = 4
} jmmVMGlobalType;
typedef enum {
--- a/hotspot/src/share/vm/services/management.cpp Fri Oct 31 18:18:58 2014 +0000
+++ b/hotspot/src/share/vm/services/management.cpp Mon Nov 03 11:19:43 2014 +0100
@@ -1572,6 +1572,9 @@
} else if (flag->is_uint64_t()) {
global->value.j = (jlong)flag->get_uint64_t();
global->type = JMM_VMGLOBAL_TYPE_JLONG;
+ } else if (flag->is_double()) {
+ global->value.d = (jdouble)flag->get_double();
+ global->type = JMM_VMGLOBAL_TYPE_JDOUBLE;
} else if (flag->is_size_t()) {
global->value.j = (jlong)flag->get_size_t();
global->type = JMM_VMGLOBAL_TYPE_JLONG;
--- a/hotspot/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java Fri Oct 31 18:18:58 2014 +0000
+++ b/hotspot/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java Mon Nov 03 11:19:43 2014 +0100
@@ -34,7 +34,7 @@
*/
public class DoubleTest {
- private static final String FLAG_NAME = null;
+ private static final String FLAG_NAME = "CompileThresholdScaling";
private static final Double[] TESTS = {0d, -0d, -1d, 1d,
Double.MAX_VALUE, Double.MIN_VALUE, Double.NaN,
Double.NEGATIVE_INFINITY, Double.POSITIVE_INFINITY};