From 3e441ea1a22d49445b12554f05a91e0d6bf6e517 Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Tue, 5 Jul 2016 17:57:20 -0700 Subject: [PATCH] 8159888: [JVMCI] the client VM build is broken when INCLUDE_JVMCI is defined Fix Client VM build Reviewed-by: twisti, kvn --- hotspot/.mx.jvmci/mx_jvmci.py | 2 +- hotspot/src/share/vm/compiler/oopMap.cpp | 16 +++------------- hotspot/src/share/vm/jvmci/jvmci_globals.cpp | 16 ++++++++++++++++ hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp | 2 +- .../src/share/vm/utilities/globalDefinitions.hpp | 2 +- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/hotspot/.mx.jvmci/mx_jvmci.py b/hotspot/.mx.jvmci/mx_jvmci.py index ede9029a5ba..daa27f5d607 100644 --- a/hotspot/.mx.jvmci/mx_jvmci.py +++ b/hotspot/.mx.jvmci/mx_jvmci.py @@ -64,7 +64,7 @@ _jvmciModes = { _jdkDebugLevels = ['release', 'fastdebug', 'slowdebug'] # TODO: add client once/if it can be built on 64-bit platforms -_jdkJvmVariants = ['server'] +_jdkJvmVariants = ['server', 'client'] """ Translation table from mx_jvmci:8 --vmbuild values to mx_jvmci:9 --jdk-debug-level values. diff --git a/hotspot/src/share/vm/compiler/oopMap.cpp b/hotspot/src/share/vm/compiler/oopMap.cpp index 197324a4ac4..378198ecb9b 100644 --- a/hotspot/src/share/vm/compiler/oopMap.cpp +++ b/hotspot/src/share/vm/compiler/oopMap.cpp @@ -273,14 +273,9 @@ class DoNothingClosure: public OopClosure { static DoNothingClosure do_nothing; static void add_derived_oop(oop* base, oop* derived) { -#ifndef TIERED +#if !defined(TIERED) && !defined(INCLUDE_JVMCI) COMPILER1_PRESENT(ShouldNotReachHere();) -#if INCLUDE_JVMCI - if (UseJVMCICompiler) { - ShouldNotReachHere(); - } -#endif -#endif // TIERED +#endif // !defined(TIERED) && !defined(INCLUDE_JVMCI) #if defined(COMPILER2) || INCLUDE_JVMCI DerivedPointerTable::add(derived, base); #endif // COMPILER2 || INCLUDE_JVMCI @@ -473,13 +468,8 @@ void OopMapSet::update_register_map(const frame *fr, RegisterMap *reg_map) { #ifndef PRODUCT bool ImmutableOopMap::has_derived_pointer() const { -#ifndef TIERED +#if !defined(TIERED) && !defined(INCLUDE_JVMCI) COMPILER1_PRESENT(return false); -#if INCLUDE_JVMCI - if (UseJVMCICompiler) { - return false; - } -#endif #endif // !TIERED #if defined(COMPILER2) || INCLUDE_JVMCI OopMapStream oms(this,OopMapValue::derived_oop_value); diff --git a/hotspot/src/share/vm/jvmci/jvmci_globals.cpp b/hotspot/src/share/vm/jvmci/jvmci_globals.cpp index 12dd0c1eeca..e76503668f8 100644 --- a/hotspot/src/share/vm/jvmci/jvmci_globals.cpp +++ b/hotspot/src/share/vm/jvmci/jvmci_globals.cpp @@ -148,6 +148,22 @@ bool JVMCIGlobals::check_jvmci_flags_are_consistent() { #undef JVMCI_PRODUCT_FLAG_VALUE_CHANGED_CHECK_CODE #undef JVMCI_EXPERIMENTAL_FLAG_VALUE_CHANGED_CHECK_CODE +#ifndef TIERED + // JVMCI is only usable as a jit compiler if the VM supports tiered compilation. +#define JVMCI_CHECK_TIERED_ONLY_FLAG(FLAG) \ + if (!FLAG_IS_DEFAULT(FLAG)) { \ + jio_fprintf(defaultStream::error_stream(), "VM option '%s' cannot be set in non-tiered VM\n", #FLAG); \ + return false; \ + } + JVMCI_CHECK_TIERED_ONLY_FLAG(UseJVMCICompiler) + JVMCI_CHECK_TIERED_ONLY_FLAG(BootstrapJVMCI) + JVMCI_CHECK_TIERED_ONLY_FLAG(PrintBootstrap) + JVMCI_CHECK_TIERED_ONLY_FLAG(JVMCIThreads) + JVMCI_CHECK_TIERED_ONLY_FLAG(JVMCIHostThreads) + JVMCI_CHECK_TIERED_ONLY_FLAG(JVMCICountersExcludeCompiler) +#undef JVMCI_CHECK_TIERED_ONLY_FLAG +#endif + return true; } diff --git a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp index 9244cd46cda..b645ebe7d30 100644 --- a/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp +++ b/hotspot/src/share/vm/jvmci/vmStructs_jvmci.cpp @@ -550,7 +550,7 @@ declare_function(os::javaTimeNanos) \ \ declare_function(Deoptimization::fetch_unroll_info) \ - COMPILER2_PRESENT(declare_function(Deoptimization::uncommon_trap)) \ + declare_function(Deoptimization::uncommon_trap) \ declare_function(Deoptimization::unpack_frames) \ \ declare_function(JVMCIRuntime::new_instance) \ diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp index 4c9e513c65a..3363bca7ba4 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -951,7 +951,7 @@ enum CompLevel { CompLevel_full_profile = 3, // C1, invocation & backedge counters + mdo CompLevel_full_optimization = 4, // C2, Shark or JVMCI -#if defined(COMPILER2) || defined(SHARK) || INCLUDE_JVMCI +#if defined(COMPILER2) || defined(SHARK) CompLevel_highest_tier = CompLevel_full_optimization, // pure C2 and tiered or JVMCI and tiered #elif defined(COMPILER1) CompLevel_highest_tier = CompLevel_simple, // pure C1 or JVMCI