8155108: CompilerControl: tests incorrectly set states for excluded methods
authorneliasso
Thu, 19 May 2016 10:40:19 +0200
changeset 38696 441abd3b3345
parent 38695 08b834856583
child 38697 110bb528423b
8155108: CompilerControl: tests incorrectly set states for excluded methods Summary: Remove redundant code that was not properly updated Reviewed-by: kvn
hotspot/src/share/vm/compiler/compilerDirectives.cpp
hotspot/src/share/vm/compiler/compilerDirectives.hpp
hotspot/src/share/vm/compiler/directivesParser.cpp
--- a/hotspot/src/share/vm/compiler/compilerDirectives.cpp	Wed May 18 21:50:27 2016 +0000
+++ b/hotspot/src/share/vm/compiler/compilerDirectives.cpp	Thu May 19 10:40:19 2016 +0200
@@ -204,7 +204,7 @@
   compilerdirectives_common_flags(init_defaults_definition)
   compilerdirectives_c2_flags(init_defaults_definition)
   compilerdirectives_c1_flags(init_defaults_definition)
-  memset(_modified, 0, sizeof _modified);
+  memset(_modified, 0, sizeof(_modified));
 
   // Canonicalize DisableIntrinsic to contain only ',' as a separator.
   this->DisableIntrinsicOption = canonicalize_disableintrinsic(DisableIntrinsic);
--- a/hotspot/src/share/vm/compiler/compilerDirectives.hpp	Wed May 18 21:50:27 2016 +0000
+++ b/hotspot/src/share/vm/compiler/compilerDirectives.hpp	Thu May 19 10:40:19 2016 +0200
@@ -127,7 +127,7 @@
     number_of_flags
   } flags;
 
-  bool _modified[number_of_flags];
+  bool _modified[number_of_flags]; // Records what options where set by a directive
 
 #define flag_store_definition(name, type, dvalue, cc_flag) type name##Option;
   compilerdirectives_common_flags(flag_store_definition)
@@ -135,7 +135,7 @@
   compilerdirectives_c1_flags(flag_store_definition)
 
 // Casting to get the same function signature for all setters. Used from parser.
-#define set_function_definition(name, type, dvalue, cc_flag) void set_##name(void* value) { type val = *(type*)value; name##Option = val; _modified[name##Index] = 1; }
+#define set_function_definition(name, type, dvalue, cc_flag) void set_##name(void* value) { type val = *(type*)value; name##Option = val; _modified[name##Index] = true; }
   compilerdirectives_common_flags(set_function_definition)
   compilerdirectives_c2_flags(set_function_definition)
   compilerdirectives_c1_flags(set_function_definition)
@@ -149,7 +149,7 @@
 void print(outputStream* st) {
     print_inline(st);
     st->print("  ");
-#define print_function_definition(name, type, dvalue, cc_flag) print_##type(st, #name, this->name##Option, true);//(bool)_modified[name##Index]);
+#define print_function_definition(name, type, dvalue, cc_flag) print_##type(st, #name, this->name##Option, true);
     compilerdirectives_common_flags(print_function_definition)
     compilerdirectives_c2_flags(print_function_definition)
     compilerdirectives_c1_flags(print_function_definition)
--- a/hotspot/src/share/vm/compiler/directivesParser.cpp	Wed May 18 21:50:27 2016 +0000
+++ b/hotspot/src/share/vm/compiler/directivesParser.cpp	Thu May 19 10:40:19 2016 +0200
@@ -151,8 +151,6 @@
     { "c2",     type_c2,     0, mask(type_directives), NULL, UnknownFlagType },
     { "match",  type_match,  1, mask(type_directives), NULL, UnknownFlagType },
     { "inline", type_inline, 1, mask(type_directives) | mask(type_c1) | mask(type_c2), NULL, UnknownFlagType },
-    { "enable", type_enable, 1, mask(type_directives) | mask(type_c1) | mask(type_c2), NULL, UnknownFlagType },
-    { "preset", type_preset, 0, mask(type_c1) | mask(type_c2), NULL, UnknownFlagType },
 
     // Global flags
     #define common_flag_key(name, type, dvalue, compiler) \
@@ -353,7 +351,7 @@
       if (!set_option_flag(t, v, option_key, current_directive->_c1_store)) {
         return false;
       }
-      if(!set_option_flag(t, v, option_key, current_directive->_c2_store)) {
+      if (!set_option_flag(t, v, option_key, current_directive->_c2_store)) {
         return false;
       }
     } else {
@@ -436,31 +434,6 @@
     }
     break;
 
-  case type_enable:
-    switch (enclosing_key->type) {
-    case type_c1:
-    case type_c2:
-    {
-      if (t != JSON_TRUE && t != JSON_FALSE) {
-        error(VALUE_ERROR, "Key of type %s enclosed in a %s key needs a true or false value", option_key->name, enclosing_key->name);
-        return false;
-      }
-      int val = (t == JSON_TRUE);
-      current_directiveset->set_Enable(&val);
-      break;
-    }
-
-    case type_directives:
-      error(VALUE_ERROR, "Enable keyword not available for generic directive");
-      return false;
-
-    default:
-      error(INTERNAL_ERROR, "Unexpected enclosing type for key %s: %s", option_key->name, enclosing_key->name);
-      ShouldNotReachHere();
-      return false;
-    }
-    break;
-
   default:
     break;
   }
@@ -730,19 +703,6 @@
     DirectivesParser::test(
       "[{c1:{c1:{c1:{c1:{c1:{c1:{c1:{}}}}}}}}]", false);
 
-  DirectivesParser::test(
-    "[" "\n"
-    "  {" "\n"
-    "    c1: true," "\n"
-    "    c2: true," "\n"
-    "    match: true," "\n"
-    "    inline: true," "\n"
-    "    enable: true," "\n"
-    "    c1: {" "\n"
-    "      preset: true," "\n"
-    "    }" "\n"
-    "  }" "\n"
-    "]" "\n", false);
 }
 
 void DirectivesParser_test() {