8218136: minor hotspot adjustments for xlclang++ from xlc16 on AIX

Reviewed-by: dholmes, goetz, ihse
This commit is contained in:
Matthias Baesken 2019-02-05 17:40:15 +01:00
parent 9efdb33a59
commit 8218872024
5 changed files with 51 additions and 44 deletions

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, 2013 SAP SE. All rights reserved. * Copyright (c) 2012, 2019 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -34,7 +34,15 @@
#include "utilities/align.hpp" #include "utilities/align.hpp"
#include "utilities/debug.hpp" #include "utilities/debug.hpp"
// distinguish old xlc and xlclang++, where
// <ibmdemangle.h> is suggested but not found in GA release (might come with a fix)
#if defined(__clang__)
#define DISABLE_DEMANGLE
// #include <ibmdemangle.h>
#else
#include <demangle.h> #include <demangle.h>
#endif
#include <sys/debug.h> #include <sys/debug.h>
#include <pthread.h> #include <pthread.h>
#include <ucontext.h> #include <ucontext.h>
@ -237,6 +245,7 @@ bool AixSymbols::get_function_name (
p_name[i] = '\0'; p_name[i] = '\0';
// If it is a C++ name, try and demangle it using the Demangle interface (see demangle.h). // If it is a C++ name, try and demangle it using the Demangle interface (see demangle.h).
#ifndef DISABLE_DEMANGLE
if (demangle) { if (demangle) {
char* rest; char* rest;
Name* const name = Demangle(p_name, rest); Name* const name = Demangle(p_name, rest);
@ -249,6 +258,7 @@ bool AixSymbols::get_function_name (
delete name; delete name;
} }
} }
#endif
} else { } else {
strncpy(p_name, "<nameless function>", namelen-1); strncpy(p_name, "<nameless function>", namelen-1);
p_name[namelen-1] = '\0'; p_name[namelen-1] = '\0';

View file

@ -43,7 +43,7 @@ inline void Prefetch::read(void *loc, intx interval) {
} }
inline void Prefetch::write(void *loc, intx interval) { inline void Prefetch::write(void *loc, intx interval) {
#if !defined(USE_XLC_PREFETCH_WRITE_BUILTIN) #if !defined(USE_XLC_BUILTINS)
__asm__ __volatile__ ( __asm__ __volatile__ (
" dcbtst 0, %0 \n" " dcbtst 0, %0 \n"
: :

View file

@ -3794,8 +3794,8 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
#endif #endif
#if defined(AIX) #if defined(AIX)
UNSUPPORTED_OPTION(AllocateHeapAt); UNSUPPORTED_OPTION_NULL(AllocateHeapAt);
UNSUPPORTED_OPTION(AllocateOldGenAt); UNSUPPORTED_OPTION_NULL(AllocateOldGenAt);
#endif #endif
#ifndef PRODUCT #ifndef PRODUCT

View file

@ -663,4 +663,16 @@ do { \
} \ } \
} while(0) } while(0)
// similar to UNSUPPORTED_OPTION but sets flag to NULL
#define UNSUPPORTED_OPTION_NULL(opt) \
do { \
if (opt) { \
if (FLAG_IS_CMDLINE(opt)) { \
warning("-XX flag " #opt " not supported in this VM"); \
} \
FLAG_SET_DEFAULT(opt, NULL); \
} \
} while(0)
#endif // SHARE_RUNTIME_ARGUMENTS_HPP #endif // SHARE_RUNTIME_ARGUMENTS_HPP

View file

@ -1,6 +1,6 @@
/* /*
* Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2017 SAP SE. All rights reserved. * Copyright (c) 2012, 2019 SAP SE. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -51,41 +51,34 @@
#include <stdint.h> #include <stdint.h>
// __IBMCPP__ is not defined any more with xlclang++
#ifdef __IBMCPP__
#if __IBMCPP__ < 1200
#error "xlc < 12 not supported"
#endif
#endif
#ifndef _AIX
#error "missing AIX-specific definition _AIX"
#endif
// Use XLC compiler builtins instead of inline assembler // Use XLC compiler builtins instead of inline assembler
#define USE_XLC_BUILTINS #define USE_XLC_BUILTINS
#ifdef USE_XLC_BUILTINS #ifdef USE_XLC_BUILTINS
#include <builtins.h> #include <builtins.h>
#if __IBMCPP__ < 1000 // XLC V10 and higher provide the prototype for __dcbtst (void *);
// the funtion prototype for __dcbtst(void *) is missing in XLC V8.0
// I could compile a little test, where I provided the prototype.
// The generated code was correct there. This is the prototype:
// extern "builtin" void __dcbtst (void *);
// For now we don't make use of it when compiling with XLC V8.0
#else
// __IBMCPP__ >= 1000
// XLC V10 provides the prototype for __dcbtst (void *);
#define USE_XLC_PREFETCH_WRITE_BUILTIN
#endif
#endif // USE_XLC_BUILTINS #endif // USE_XLC_BUILTINS
// NULL vs NULL_WORD: // NULL vs NULL_WORD:
// On Linux NULL is defined as a special type '__null'. Assigning __null to // Some platform/tool-chain combinations can't assign NULL to an integer
// integer variable will cause gcc warning. Use NULL_WORD in places where a // type so we define NULL_WORD to use in those contexts. For xlc they are the same.
// pointer is stored as integer value. On some platforms, sizeof(intptr_t) >
// sizeof(void*), so here we want something which is integer type, but has the
// same size as a pointer.
#ifdef __GNUC__
#error XLC and __GNUC__?
#else
#define NULL_WORD NULL #define NULL_WORD NULL
#endif
// AIX also needs a 64 bit NULL to work as a null address pointer. // AIX also needs a 64 bit NULL to work as a null address pointer.
// Most system includes on AIX would define it as an int 0 if not already defined with one // Most system includes on AIX would define it as an int 0 if not already defined with one
// exception: /usr/include/dirent.h will unconditionally redefine NULL to int 0 again. // exception: /usr/include/dirent.h will unconditionally redefine NULL to int 0 again.
// In this case you need to copy the following defines to a position after #include <dirent.h> // In this case you need to copy the following defines to a position after #include <dirent.h>
// (see jmv_aix.h).
#ifdef AIX
#include <dirent.h> #include <dirent.h>
#ifdef _LP64 #ifdef _LP64
#undef NULL #undef NULL
@ -95,7 +88,6 @@
#define NULL 0 #define NULL 0
#endif #endif
#endif #endif
#endif // AIX
// Compiler-specific primitive types // Compiler-specific primitive types
// All defs of int (uint16_6 etc) are defined in AIX' /usr/include/stdint.h // All defs of int (uint16_6 etc) are defined in AIX' /usr/include/stdint.h
@ -108,21 +100,14 @@ typedef uint32_t juint;
typedef uint64_t julong; typedef uint64_t julong;
// checking for nanness // checking for nanness
#ifdef AIX
inline int g_isnan(float f) { return isnan(f); } inline int g_isnan(float f) { return isnan(f); }
inline int g_isnan(double f) { return isnan(f); } inline int g_isnan(double f) { return isnan(f); }
#else
#error "missing platform-specific definition here"
#endif
// Checking for finiteness // Checking for finiteness
inline int g_isfinite(jfloat f) { return finite(f); } inline int g_isfinite(jfloat f) { return finite(f); }
inline int g_isfinite(jdouble f) { return finite(f); } inline int g_isfinite(jdouble f) { return finite(f); }
// Wide characters // Wide characters
inline int wcslen(const jchar* x) { return wcslen((const wchar_t*)x); } inline int wcslen(const jchar* x) { return wcslen((const wchar_t*)x); }