Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions make/autoconf/hotspot.m4
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# All valid JVM features, regardless of platform
VALID_JVM_FEATURES="compiler1 compiler2 zero minimal dtrace jvmti jvmci \
graal vm-structs jni-check services management cmsgc epsilongc g1gc parallelgc serialgc shenandoahgc zgc nmt cds \
static-build link-time-opt aot jfr"
static-build link-time-opt aot jfr aiext"

# Deprecated JVM features (these are ignored, but with a warning)
DEPRECATED_JVM_FEATURES="trace"
Expand Down Expand Up @@ -357,6 +357,10 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
AC_MSG_ERROR([Specified JVM feature 'cmsgc' requires feature 'serialgc'])
fi

if HOTSPOT_CHECK_JVM_FEATURE(aiext) && ! HOTSPOT_CHECK_JVM_FEATURE(compiler2); then
AC_MSG_ERROR([Specified JVM feature 'aiext' requires feature 'compiler2'])
fi

# Enable JFR by default, except for Zero, linux-sparcv9 and on minimal.
if ! HOTSPOT_CHECK_JVM_VARIANT(zero); then
if test "x$OPENJDK_TARGET_OS" != xaix; then
Expand Down Expand Up @@ -518,6 +522,26 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],

AC_SUBST(ENABLE_AOT)

AC_MSG_CHECKING([if aiext should be built])
if HOTSPOT_IS_JVM_FEATURE_DISABLED(aiext); then
AC_MSG_RESULT([no, forced])
JVM_FEATURES_aiext=""
else
# Only enable aiext on x86_64/aarch64 linux
if test "x$OPENJDK_TARGET_OS" = xlinux && \
(test "x$OPENJDK_TARGET_CPU" = "xx86_64" || \
test "x$OPENJDK_TARGET_CPU" = "xaarch64"); then
AC_MSG_RESULT([yes])
JVM_FEATURES_aiext="aiext"
else
AC_MSG_RESULT([no])
JVM_FEATURES_aiext=""
if HOTSPOT_CHECK_JVM_FEATURE(aiext); then
AC_MSG_ERROR([aiext is currently not supported on this platform])
fi
fi
fi

if test "x$OPENJDK_TARGET_CPU" = xarm ; then
# Default to use link time optimizations on minimal on arm
JVM_FEATURES_link_time_opt="link-time-opt"
Expand Down Expand Up @@ -545,7 +569,7 @@ AC_DEFUN_ONCE([HOTSPOT_SETUP_JVM_FEATURES],
fi

# Enable features depending on variant.
JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal"
JVM_FEATURES_server="compiler1 compiler2 $NON_MINIMAL_FEATURES $JVM_FEATURES $JVM_FEATURES_jvmci $JVM_FEATURES_aot $JVM_FEATURES_graal $JVM_FEATURES_aiext"
JVM_FEATURES_client="compiler1 $NON_MINIMAL_FEATURES $JVM_FEATURES"
JVM_FEATURES_core="$NON_MINIMAL_FEATURES $JVM_FEATURES"
JVM_FEATURES_minimal="compiler1 minimal serialgc $JVM_FEATURES $JVM_FEATURES_link_time_opt"
Expand Down
7 changes: 7 additions & 0 deletions make/hotspot/lib/JvmFeatures.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ ifneq ($(call check-jvm-feature, jfr), true)
JVM_EXCLUDE_PATTERNS += jfr
endif

ifeq ($(call check-jvm-feature, aiext), true)
JVM_CFLAGS_FEATURES += -DINCLUDE_AIEXT=1
else
JVM_CFLAGS_FEATURES += -DINCLUDE_AIEXT=0
JVM_EXCLUDE_FILES += aiext.cpp aiExtension.cpp
endif

################################################################################

ifeq ($(call check-jvm-feature, link-time-opt), true)
Expand Down
11 changes: 11 additions & 0 deletions src/hotspot/share/ci/ciMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
#include "ci/ciTypeFlow.hpp"
#include "oops/method.hpp"
#endif
#if INCLUDE_AIEXT
#include "opto/aiExtension.hpp"
#endif

// ciMethod
//
Expand Down Expand Up @@ -100,6 +103,11 @@ ciMethod::ciMethod(const methodHandle& h_m, ciInstanceKlass* holder) :
_bcea = NULL;
#endif // COMPILER2

#if INCLUDE_AIEXT
// Get entry of accelerated call.
_accel_call_entry = AIExt::find(h_m->klass_name(), h_m->name(), h_m->signature());
#endif // INCLUDE_AIEXT

ciEnv *env = CURRENT_ENV;
if (env->jvmti_can_hotswap_or_post_breakpoint()) {
// 6328518 check hotswap conditions under the right lock.
Expand Down Expand Up @@ -169,6 +177,9 @@ ciMethod::ciMethod(ciInstanceKlass* holder,
_holder( holder),
_intrinsic_id( vmIntrinsics::_none),
_liveness( NULL),
#if INCLUDE_AIEXT
_accel_call_entry( NULL),
#endif // INCLUDE_AIEXT
_can_be_statically_bound(false),
_method_blocks( NULL),
_method_data( NULL)
Expand Down
13 changes: 13 additions & 0 deletions src/hotspot/share/ci/ciMethod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class MethodLiveness;
class Arena;
class BCEscapeAnalyzer;
class InlineTree;
#if INCLUDE_AIEXT
class AccelCallEntry;
#endif // INCLUDE_AIEXT

// Whether profiling found an oop to be always, never or sometimes
// null
Expand Down Expand Up @@ -82,6 +85,11 @@ class ciMethod : public ciMetadata {
int _instructions_size;
int _size_of_parameters;

#if INCLUDE_AIEXT
// Native acceleration.
const AccelCallEntry* _accel_call_entry;
#endif // INCLUDE_AIEXT

bool _uses_monitors;
bool _balanced_monitors;
bool _is_c1_compilable;
Expand Down Expand Up @@ -188,6 +196,11 @@ class ciMethod : public ciMetadata {
// Should the method be compiled with an age counter?
bool profile_aging() const;

#if INCLUDE_AIEXT
// Native acceleration.
const AccelCallEntry* accel_call_entry() const { check_is_loaded(); return _accel_call_entry; }
#endif // INCLUDE_AIEXT

// Code size for inlining decisions.
int code_size_for_inlining();

Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/logging/logTag.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#define LOG_TAG_LIST \
LOG_TAG(add) \
LOG_TAG(age) \
AIEXT_ONLY(LOG_TAG(aiext)) \
LOG_TAG(alloc) \
LOG_TAG(aot) \
LOG_TAG(annotation) \
Expand Down
Loading
Loading