8253824: Revert JDK-8253089 since VS warning C4307 has been disabled

Reviewed-by: mdoerr, iklam
diff --git a/src/hotspot/share/runtime/flags/jvmFlagLookup.cpp b/src/hotspot/share/runtime/flags/jvmFlagLookup.cpp
index 4a43ee0..fbdfcf0 100644
--- a/src/hotspot/share/runtime/flags/jvmFlagLookup.cpp
+++ b/src/hotspot/share/runtime/flags/jvmFlagLookup.cpp
@@ -30,9 +30,9 @@
 #define DO_FLAG(type, name,...) DO_HASH(FLAG_MEMBER_ENUM(name), XSTR(name))
 
 #define DO_HASH(flag_enum, flag_name) {          \
-  u2 hash = hash_code(flag_name);                \
+  unsigned int hash = hash_code(flag_name);      \
   int bucket_index = (int)(hash % NUM_BUCKETS);  \
-  _hashes[flag_enum] = hash;                     \
+  _hashes[flag_enum] = (u2)(hash);               \
   _table[flag_enum] = _buckets[bucket_index];    \
   _buckets[bucket_index] = (short)flag_enum;     \
 }
@@ -54,10 +54,10 @@
 constexpr JVMFlagLookup _flag_lookup_table;
 
 JVMFlag* JVMFlagLookup::find_impl(const char* name, size_t length) const {
-  u2 hash = hash_code(name, length);
+  unsigned int hash = hash_code(name, length);
   int bucket_index = (int)(hash % NUM_BUCKETS);
   for (int flag_enum = _buckets[bucket_index]; flag_enum >= 0; ) {
-    if (_hashes[flag_enum] == hash) {
+    if (_hashes[flag_enum] == (u2)hash) {
       JVMFlag* flag = JVMFlag::flags + flag_enum;
       if (strncmp(name, flag->name(), length) == 0) {
         // We know flag->name() has at least <length> bytes.
diff --git a/src/hotspot/share/runtime/flags/jvmFlagLookup.hpp b/src/hotspot/share/runtime/flags/jvmFlagLookup.hpp
index 3ac31b0..128025b 100644
--- a/src/hotspot/share/runtime/flags/jvmFlagLookup.hpp
+++ b/src/hotspot/share/runtime/flags/jvmFlagLookup.hpp
@@ -51,14 +51,14 @@
 
   // This is executed at build-time only, so it doesn't matter if we walk
   // the string twice.
-  static constexpr u2 hash_code(const char* s) {
+  static constexpr unsigned int hash_code(const char* s) {
     return hash_code(s, string_len(s));
   }
 
-  static constexpr u2 hash_code(const char* s, size_t len) {
-    u2 h = 0;
+  static constexpr unsigned int hash_code(const char* s, size_t len) {
+    unsigned int h = 0;
     while (len -- > 0) {
-      h = (u2)(31*h + (u2) *s);
+      h = 31*h + (unsigned int) *s;
       s++;
     }
     return h;