8061616: HotspotDiagnosticMXBean.getVMOption() throws IllegalArgumentException for flags of type double
authorjbachorik
Mon, 03 Nov 2014 11:19:43 +0100
changeset 27466 36c9a91eb418
parent 27465 cba6e4a24ad9
child 27467 cdc1d5bc86cf
8061616: HotspotDiagnosticMXBean.getVMOption() throws IllegalArgumentException for flags of type double Reviewed-by: mchung, sla
hotspot/src/share/vm/services/jmm.h
hotspot/src/share/vm/services/management.cpp
hotspot/test/testlibrary_tests/whitebox/vm_flags/DoubleTest.java
--- 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};