8183271: VectorizeDebug compiler directive command is broken
authorneliasso
Fri, 07 Jul 2017 10:37:52 +0200
changeset 46638 3c5c50af29a7
parent 46637 ad6940426976
child 46639 c6618ddbe993
child 46640 70bdce04c59b
8183271: VectorizeDebug compiler directive command is broken Summary: Add parser support for uint Reviewed-by: kvn, thartmann
hotspot/src/share/vm/compiler/compilerDirectives.hpp
hotspot/src/share/vm/compiler/directivesParser.cpp
hotspot/src/share/vm/utilities/json.hpp
--- a/hotspot/src/share/vm/compiler/compilerDirectives.hpp	Mon Jul 03 11:41:19 2017 +0200
+++ b/hotspot/src/share/vm/compiler/compilerDirectives.hpp	Fri Jul 07 10:37:52 2017 +0200
@@ -64,7 +64,7 @@
 NOT_PRODUCT(cflags(TraceOptoOutput,     bool, TraceOptoOutput, TraceOptoOutput)) \
     cflags(TraceSpilling,           bool, TraceSpilling, TraceSpilling) \
     cflags(Vectorize,               bool, false, Vectorize) \
-    cflags(VectorizeDebug,         uintx, 0, VectorizeDebug) \
+    cflags(VectorizeDebug,          uintx, 0, VectorizeDebug) \
     cflags(CloneMapDebug,           bool, false, CloneMapDebug) \
     cflags(IGVPrintLevel,           intx, PrintIdealGraphLevel, IGVPrintLevel) \
     cflags(MaxNodeLimit,            intx, MaxNodeLimit, MaxNodeLimit)
--- a/hotspot/src/share/vm/compiler/directivesParser.cpp	Mon Jul 03 11:41:19 2017 +0200
+++ b/hotspot/src/share/vm/compiler/directivesParser.cpp	Fri Jul 07 10:37:52 2017 +0200
@@ -283,17 +283,18 @@
       break;
 
     case JSON_NUMBER_INT:
-      if (option_key->flag_type != intxFlag) {
-        if (option_key->flag_type == doubleFlag) {
-          double dval = (double)v->int_value;
-          (set->*test)((void *)&dval);
-          break;
-        }
+      if (option_key->flag_type == intxFlag) {
+        intx ival = v->int_value;
+        (set->*test)((void *)&ival);
+      } else if (option_key->flag_type == uintxFlag) {
+        uintx ival = v->uint_value;
+        (set->*test)((void *)&ival);
+      } else if (option_key->flag_type == doubleFlag) {
+        double dval = (double)v->int_value;
+        (set->*test)((void *)&dval);
+      } else {
         error(VALUE_ERROR, "Cannot use int value for an %s flag", flag_type_names[option_key->flag_type]);
         return false;
-      } else {
-        intx ival = v->int_value;
-        (set->*test)((void *)&ival);
       }
       break;
 
@@ -627,6 +628,8 @@
     "    match: \"foo/bar.*\"," "\n"
     "    c2: {" "\n"
     "      PrintInlining: false," "\n"
+    "      VectorizeDebug: 1," "\n"
+    "      VectorizeDebug: -1," "\n"
     "    }" "\n"
     "  }" "\n"
     "]" "\n", true);
--- a/hotspot/src/share/vm/utilities/json.hpp	Mon Jul 03 11:41:19 2017 +0200
+++ b/hotspot/src/share/vm/utilities/json.hpp	Fri Jul 07 10:37:52 2017 +0200
@@ -52,6 +52,7 @@
 
   typedef union {
     int64_t int_value;
+    uint64_t uint_value;
     double double_value;
 
     struct {