8181503: Can't compile hotspot with c++11
Summary: Fixed 5 unique c++14 compiler issues
Reviewed-by: coleenp, dholmes, kbarrett
--- a/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp Wed Jan 31 11:07:55 2018 -0500
+++ b/src/hotspot/os_cpu/bsd_x86/os_bsd_x86.cpp Wed Jan 31 11:12:12 2018 -0600
@@ -279,11 +279,11 @@
address os::current_stack_pointer() {
#if defined(__clang__) || defined(__llvm__)
register void *esp;
- __asm__("mov %%"SPELL_REG_SP", %0":"=r"(esp));
+ __asm__("mov %%" SPELL_REG_SP ", %0":"=r"(esp));
return (address) esp;
#elif defined(SPARC_WORKS)
register void *esp;
- __asm__("mov %%"SPELL_REG_SP", %0":"=r"(esp));
+ __asm__("mov %%" SPELL_REG_SP ", %0":"=r"(esp));
return (address) ((char*)esp + sizeof(long)*2);
#else
register void *esp __asm__ (SPELL_REG_SP);
@@ -415,7 +415,7 @@
intptr_t* _get_previous_fp() {
#if defined(SPARC_WORKS) || defined(__clang__) || defined(__llvm__)
register intptr_t **ebp;
- __asm__("mov %%"SPELL_REG_FP", %0":"=r"(ebp));
+ __asm__("mov %%" SPELL_REG_FP ", %0":"=r"(ebp));
#else
register intptr_t **ebp __asm__ (SPELL_REG_FP);
#endif
--- a/src/hotspot/share/code/compiledIC.cpp Wed Jan 31 11:07:55 2018 -0500
+++ b/src/hotspot/share/code/compiledIC.cpp Wed Jan 31 11:12:12 2018 -0600
@@ -224,7 +224,7 @@
assert(bytecode == Bytecodes::_invokeinterface, "");
int itable_index = call_info->itable_index();
entry = VtableStubs::find_itable_stub(itable_index);
- if (entry == false) {
+ if (entry == NULL) {
return false;
}
#ifdef ASSERT
--- a/src/hotspot/share/logging/logConfiguration.cpp Wed Jan 31 11:07:55 2018 -0500
+++ b/src/hotspot/share/logging/logConfiguration.cpp Wed Jan 31 11:12:12 2018 -0600
@@ -296,7 +296,7 @@
notify_update_listeners();
}
-void LogConfiguration::configure_stdout(LogLevelType level, bool exact_match, ...) {
+void LogConfiguration::configure_stdout(LogLevelType level, int exact_match, ...) {
size_t i;
va_list ap;
LogTagLevelExpression expr;
--- a/src/hotspot/share/logging/logConfiguration.hpp Wed Jan 31 11:07:55 2018 -0500
+++ b/src/hotspot/share/logging/logConfiguration.hpp Wed Jan 31 11:12:12 2018 -0600
@@ -102,7 +102,7 @@
// (exact_match=false is the same as "-Xlog:<tags>*=<level>", and exact_match=true is "-Xlog:<tags>=<level>").
// Tags should be specified using the LOG_TAGS macro, e.g.
// LogConfiguration::configure_stdout(LogLevel::<level>, <true/false>, LOG_TAGS(<tags>));
- static void configure_stdout(LogLevelType level, bool exact_match, ...);
+ static void configure_stdout(LogLevelType level, int exact_match, ...);
// Parse command line configuration. Parameter 'opts' is the string immediately following the -Xlog: argument ("gc" for -Xlog:gc).
static bool parse_command_line_arguments(const char* opts = "all");
--- a/src/hotspot/share/logging/logTagLevelExpression.hpp Wed Jan 31 11:07:55 2018 -0500
+++ b/src/hotspot/share/logging/logTagLevelExpression.hpp Wed Jan 31 11:12:12 2018 -0600
@@ -40,7 +40,7 @@
static const size_t MaxCombinations = 256;
private:
- friend void LogConfiguration::configure_stdout(LogLevelType, bool, ...);
+ friend void LogConfiguration::configure_stdout(LogLevelType, int, ...);
static const char* DefaultExpressionString;
--- a/src/hotspot/share/oops/accessBackend.cpp Wed Jan 31 11:07:55 2018 -0500
+++ b/src/hotspot/share/oops/accessBackend.cpp Wed Jan 31 11:12:12 2018 -0600
@@ -172,18 +172,3 @@
Copy::conjoint_jlongs_atomic(src, dst, length);
}
}
-
-template void AccessInternal::arraycopy_conjoint<jbyte>(jbyte* src, jbyte* dst, size_t length);
-template void AccessInternal::arraycopy_conjoint<jshort>(jshort* src, jshort* dst, size_t length);
-template void AccessInternal::arraycopy_conjoint<jint>(jint* src, jint* dst, size_t length);
-template void AccessInternal::arraycopy_conjoint<jlong>(jlong* src, jlong* dst, size_t length);
-
-template void AccessInternal::arraycopy_arrayof_conjoint<jbyte>(jbyte* src, jbyte* dst, size_t length);
-template void AccessInternal::arraycopy_arrayof_conjoint<jshort>(jshort* src, jshort* dst, size_t length);
-template void AccessInternal::arraycopy_arrayof_conjoint<jint>(jint* src, jint* dst, size_t length);
-template void AccessInternal::arraycopy_arrayof_conjoint<jlong>(jlong* src, jlong* dst, size_t length);
-
-template void AccessInternal::arraycopy_conjoint_atomic<jbyte>(jbyte* src, jbyte* dst, size_t length);
-template void AccessInternal::arraycopy_conjoint_atomic<jshort>(jshort* src, jshort* dst, size_t length);
-template void AccessInternal::arraycopy_conjoint_atomic<jint>(jint* src, jint* dst, size_t length);
-template void AccessInternal::arraycopy_conjoint_atomic<jlong>(jlong* src, jlong* dst, size_t length);
--- a/src/hotspot/share/utilities/vmError.cpp Wed Jan 31 11:07:55 2018 -0500
+++ b/src/hotspot/share/utilities/vmError.cpp Wed Jan 31 11:12:12 2018 -0600
@@ -480,7 +480,7 @@
STEP("printing type of error")
- switch(_id) {
+ switch(static_cast<unsigned int>(_id)) {
case OOM_MALLOC_ERROR:
case OOM_MMAP_ERROR:
if (_size) {