Blame SOURCES/8062808-pr3548.patch

60224f
# HG changeset patch
60224f
# User stefank
60224f
# Date 1525453613 -3600
60224f
#      Fri May 04 18:06:53 2018 +0100
60224f
# Node ID 07a1135a327362f157955d470fad5df07cc35164
60224f
# Parent  de79964656fc652f2085dac4fe99bcc128b5a3b1
60224f
8062808, PR3548: Turn on the -Wreturn-type warning
60224f
Reviewed-by: mgerdin, tschatzl, coleenp, jrose, kbarrett
60224f
60224f
diff --git openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make
60224f
--- openjdk.orig/hotspot/make/linux/makefiles/gcc.make
60224f
+++ openjdk/hotspot/make/linux/makefiles/gcc.make
60224f
@@ -210,7 +210,7 @@
60224f
   WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
60224f
 endif
60224f
 
60224f
-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value
60224f
+WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wreturn-type
60224f
 
60224f
 ifeq ($(USE_CLANG),)
60224f
   # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
60224f
diff --git openjdk.orig/hotspot/src/cpu/x86/vm/x86_32.ad openjdk/hotspot/src/cpu/x86/vm/x86_32.ad
60224f
--- openjdk.orig/hotspot/src/cpu/x86/vm/x86_32.ad
60224f
+++ openjdk/hotspot/src/cpu/x86/vm/x86_32.ad
60224f
@@ -1250,6 +1250,7 @@
60224f
 
60224f
 
60224f
   Unimplemented();
60224f
+  return 0; // Mute compiler
60224f
 }
60224f
 
60224f
 #ifndef PRODUCT
60224f
diff --git openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
60224f
--- openjdk.orig/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
60224f
+++ openjdk/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp
60224f
@@ -541,6 +541,7 @@
60224f
   err.report_and_die();
60224f
 
60224f
   ShouldNotReachHere();
60224f
+  return true; // Mute compiler
60224f
 }
60224f
 
60224f
 void os::Linux::init_thread_fpu_state(void) {
60224f
diff --git openjdk.orig/hotspot/src/share/vm/classfile/defaultMethods.cpp openjdk/hotspot/src/share/vm/classfile/defaultMethods.cpp
60224f
--- openjdk.orig/hotspot/src/share/vm/classfile/defaultMethods.cpp
60224f
+++ openjdk/hotspot/src/share/vm/classfile/defaultMethods.cpp
60224f
@@ -506,7 +506,7 @@
60224f
   ss.write((const char*)name->bytes(), name->utf8_length());
60224f
   ss.write((const char*)signature->bytes(), signature->utf8_length());
60224f
   ss.print(" is abstract");
60224f
-  return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL);
60224f
+  return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD);
60224f
 }
60224f
 
60224f
 Symbol* MethodFamily::generate_conflicts_message(GrowableArray<Method*>* methods, TRAPS) const {
60224f
@@ -521,7 +521,7 @@
60224f
     ss.print(".");
60224f
     ss.write((const char*)name->bytes(), name->utf8_length());
60224f
   }
60224f
-  return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL);
60224f
+  return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD);
60224f
 }
60224f
 
60224f
 
60224f
diff --git openjdk.orig/hotspot/src/share/vm/classfile/symbolTable.cpp openjdk/hotspot/src/share/vm/classfile/symbolTable.cpp
60224f
--- openjdk.orig/hotspot/src/share/vm/classfile/symbolTable.cpp
60224f
+++ openjdk/hotspot/src/share/vm/classfile/symbolTable.cpp
60224f
@@ -249,7 +249,7 @@
60224f
   MutexLocker ml(SymbolTable_lock, THREAD);
60224f
 
60224f
   // Otherwise, add to symbol to table
60224f
-  return the_table()->basic_add(index, (u1*)name, len, hashValue, true, CHECK_NULL);
60224f
+  return the_table()->basic_add(index, (u1*)name, len, hashValue, true, THREAD);
60224f
 }
60224f
 
60224f
 Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) {
60224f
@@ -288,7 +288,7 @@
60224f
   // Grab SymbolTable_lock first.
60224f
   MutexLocker ml(SymbolTable_lock, THREAD);
60224f
 
60224f
-  return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, CHECK_NULL);
60224f
+  return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, THREAD);
60224f
 }
60224f
 
60224f
 Symbol* SymbolTable::lookup_only(const char* name, int len,
60224f
diff --git openjdk.orig/hotspot/src/share/vm/classfile/systemDictionary.cpp openjdk/hotspot/src/share/vm/classfile/systemDictionary.cpp
60224f
--- openjdk.orig/hotspot/src/share/vm/classfile/systemDictionary.cpp
60224f
+++ openjdk/hotspot/src/share/vm/classfile/systemDictionary.cpp
60224f
@@ -229,15 +229,15 @@
60224f
                  class_name->as_C_string(),
60224f
                  class_loader.is_null() ? "null" : class_loader->klass()->name()->as_C_string()));
60224f
   if (FieldType::is_array(class_name)) {
60224f
-    return resolve_array_class_or_null(class_name, class_loader, protection_domain, CHECK_NULL);
60224f
+    return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD);
60224f
   } else if (FieldType::is_obj(class_name)) {
60224f
     ResourceMark rm(THREAD);
60224f
     // Ignore wrapping L and ;.
60224f
     TempNewSymbol name = SymbolTable::new_symbol(class_name->as_C_string() + 1,
60224f
                                    class_name->utf8_length() - 2, CHECK_NULL);
60224f
-    return resolve_instance_class_or_null(name, class_loader, protection_domain, CHECK_NULL);
60224f
+    return resolve_instance_class_or_null(name, class_loader, protection_domain, THREAD);
60224f
   } else {
60224f
-    return resolve_instance_class_or_null(class_name, class_loader, protection_domain, CHECK_NULL);
60224f
+    return resolve_instance_class_or_null(class_name, class_loader, protection_domain, THREAD);
60224f
   }
60224f
 }
60224f
 
60224f
diff --git openjdk.orig/hotspot/src/share/vm/memory/heapInspection.hpp openjdk/hotspot/src/share/vm/memory/heapInspection.hpp
60224f
--- openjdk.orig/hotspot/src/share/vm/memory/heapInspection.hpp
60224f
+++ openjdk/hotspot/src/share/vm/memory/heapInspection.hpp
60224f
@@ -367,7 +367,7 @@
60224f
       _csv_format(csv_format), _print_help(print_help),
60224f
       _print_class_stats(print_class_stats), _columns(columns) {}
60224f
   void heap_inspection(outputStream* st) NOT_SERVICES_RETURN;
60224f
-  size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN;
60224f
+  size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN_(0);
60224f
   static void find_instances_at_safepoint(Klass* k, GrowableArray<oop>* result) NOT_SERVICES_RETURN;
60224f
  private:
60224f
   void iterate_over_heap(KlassInfoTable* cit, BoolObjectClosure* filter = NULL);
60224f
diff --git openjdk.orig/hotspot/src/share/vm/memory/metaspaceShared.hpp openjdk/hotspot/src/share/vm/memory/metaspaceShared.hpp
60224f
--- openjdk.orig/hotspot/src/share/vm/memory/metaspaceShared.hpp
60224f
+++ openjdk/hotspot/src/share/vm/memory/metaspaceShared.hpp
60224f
@@ -93,7 +93,7 @@
60224f
   static void preload_and_dump(TRAPS) NOT_CDS_RETURN;
60224f
   static int preload_and_dump(const char * class_list_path,
60224f
                               GrowableArray<Klass*>* class_promote_order,
60224f
-                              TRAPS) NOT_CDS_RETURN;
60224f
+                              TRAPS) NOT_CDS_RETURN_(0);
60224f
 
60224f
   static ReservedSpace* shared_rs() {
60224f
     CDS_ONLY(return _shared_rs);
60224f
diff --git openjdk.orig/hotspot/src/share/vm/oops/constantPool.hpp openjdk/hotspot/src/share/vm/oops/constantPool.hpp
60224f
--- openjdk.orig/hotspot/src/share/vm/oops/constantPool.hpp
60224f
+++ openjdk/hotspot/src/share/vm/oops/constantPool.hpp
60224f
@@ -352,7 +352,7 @@
60224f
 
60224f
   Klass* klass_at(int which, TRAPS) {
60224f
     constantPoolHandle h_this(THREAD, this);
60224f
-    return klass_at_impl(h_this, which, CHECK_NULL);
60224f
+    return klass_at_impl(h_this, which, THREAD);
60224f
   }
60224f
 
60224f
   Symbol* klass_name_at(int which);  // Returns the name, w/o resolving.
60224f
diff --git openjdk.orig/hotspot/src/share/vm/prims/jvm.cpp openjdk/hotspot/src/share/vm/prims/jvm.cpp
60224f
--- openjdk.orig/hotspot/src/share/vm/prims/jvm.cpp
60224f
+++ openjdk/hotspot/src/share/vm/prims/jvm.cpp
60224f
@@ -4244,7 +4244,7 @@
60224f
     JVM_DTraceProvider* providers))
60224f
   JVMWrapper("JVM_DTraceActivate");
60224f
   return DTraceJSDT::activate(
60224f
-    version, module_name, providers_count, providers, CHECK_0);
60224f
+    version, module_name, providers_count, providers, THREAD);
60224f
 JVM_END
60224f
 
60224f
 JVM_ENTRY(jboolean,JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method))
60224f
diff --git openjdk.orig/hotspot/src/share/vm/runtime/reflection.cpp openjdk/hotspot/src/share/vm/runtime/reflection.cpp
60224f
--- openjdk.orig/hotspot/src/share/vm/runtime/reflection.cpp
60224f
+++ openjdk/hotspot/src/share/vm/runtime/reflection.cpp
60224f
@@ -1093,7 +1093,7 @@
60224f
   } else {
60224f
     if (rtype == T_BOOLEAN || rtype == T_BYTE || rtype == T_CHAR || rtype == T_SHORT)
60224f
       narrow((jvalue*) result.get_value_addr(), rtype, CHECK_NULL);
60224f
-    return box((jvalue*) result.get_value_addr(), rtype, CHECK_NULL);
60224f
+    return box((jvalue*) result.get_value_addr(), rtype, THREAD);
60224f
   }
60224f
 }
60224f
 
60224f
diff --git openjdk.orig/hotspot/src/share/vm/runtime/sharedRuntime.cpp openjdk/hotspot/src/share/vm/runtime/sharedRuntime.cpp
60224f
--- openjdk.orig/hotspot/src/share/vm/runtime/sharedRuntime.cpp
60224f
+++ openjdk/hotspot/src/share/vm/runtime/sharedRuntime.cpp
60224f
@@ -1046,7 +1046,7 @@
60224f
   // last java frame on stack (which includes native call frames)
60224f
   vframeStream vfst(thread, true);  // Do not skip and javaCalls
60224f
 
60224f
-  return find_callee_info_helper(thread, vfst, bc, callinfo, CHECK_(Handle()));
60224f
+  return find_callee_info_helper(thread, vfst, bc, callinfo, THREAD);
60224f
 }
60224f
 
60224f
 
60224f
diff --git openjdk.orig/hotspot/src/share/vm/services/memTracker.hpp openjdk/hotspot/src/share/vm/services/memTracker.hpp
60224f
--- openjdk.orig/hotspot/src/share/vm/services/memTracker.hpp
60224f
+++ openjdk/hotspot/src/share/vm/services/memTracker.hpp
60224f
@@ -64,7 +64,7 @@
60224f
     const NativeCallStack& stack, MEMFLAGS flag = mtNone) { }
60224f
   static inline void record_virtual_memory_commit(void* addr, size_t size, const NativeCallStack& stack) { }
60224f
   static inline Tracker get_virtual_memory_uncommit_tracker() { return Tracker(); }
60224f
-  static inline Tracker get_virtual_memory_release_tracker() { }
60224f
+  static inline Tracker get_virtual_memory_release_tracker() { return Tracker(); }
60224f
   static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) { }
60224f
   static inline void record_thread_stack(void* addr, size_t size) { }
60224f
   static inline void release_thread_stack(void* addr, size_t size) { }