# HG changeset patch # User Bernhard Urban # Date 1394465170 -3600 # Node ID 7ad529321294c6c1efb567e6dab7d43a01e0d7aa # Parent dc41eab09fe8861218054b9ee9202a8e80b7530a make: remove GRAALVM and introduce COMPILERGRAAL. fix client hosted-mode diff -r dc41eab09fe8 -r 7ad529321294 make/bsd/makefiles/graal.make --- a/make/bsd/makefiles/graal.make Mon Mar 10 16:20:45 2014 +0100 +++ b/make/bsd/makefiles/graal.make Mon Mar 10 16:26:10 2014 +0100 @@ -32,4 +32,4 @@ # To make a non-tiered Graal build, remove the -DCOMPILER1 below and # in vm.make remove COMPILER1_PATHS from Src_Dirs/GRAAL and add # COMPILER1_SPECIFIC_FILES to Src_Files_EXCLUDE/GRAAL -CFLAGS += -DGRAAL -DCOMPILER1 +CFLAGS += -DCOMPILERGRAAL -DGRAAL -DCOMPILER1 diff -r dc41eab09fe8 -r 7ad529321294 make/linux/makefiles/graal.make --- a/make/linux/makefiles/graal.make Mon Mar 10 16:20:45 2014 +0100 +++ b/make/linux/makefiles/graal.make Mon Mar 10 16:26:10 2014 +0100 @@ -32,4 +32,4 @@ # To make a non-tiered Graal build, remove the -DCOMPILER1 below and # in vm.make remove COMPILER1_PATHS from Src_Dirs/GRAAL and add # COMPILER1_SPECIFIC_FILES to Src_Files_EXCLUDE/GRAAL -CFLAGS += -DGRAAL -DCOMPILER1 +CFLAGS += -DCOMPILERGRAAL -DGRAAL -DCOMPILER1 diff -r dc41eab09fe8 -r 7ad529321294 make/solaris/makefiles/graal.make --- a/make/solaris/makefiles/graal.make Mon Mar 10 16:20:45 2014 +0100 +++ b/make/solaris/makefiles/graal.make Mon Mar 10 16:26:10 2014 +0100 @@ -32,4 +32,4 @@ # To make a non-tiered Graal build, remove the -DCOMPILER1 below and # in vm.make remove COMPILER1_PATHS from Src_Dirs/GRAAL and add # COMPILER1_SPECIFIC_FILES to Src_Files_EXCLUDE/GRAAL -CFLAGS += -DGRAAL -DCOMPILER1 +CFLAGS += -DCOMPILERGRAAL -DGRAAL -DCOMPILER1 diff -r dc41eab09fe8 -r 7ad529321294 make/windows/makefiles/projectcreator.make --- a/make/windows/makefiles/projectcreator.make Mon Mar 10 16:20:45 2014 +0100 +++ b/make/windows/makefiles/projectcreator.make Mon Mar 10 16:26:10 2014 +0100 @@ -183,6 +183,7 @@ ################################################## ProjectCreatorIDEOptions=$(ProjectCreatorIDEOptions) \ -define_graal COMPILER1 \ + -define_graal COMPILERGRAAL \ -define_graal GRAAL \ $(ProjectCreatorIDEOptionsIgnoreCompiler2:TARGET=graal) diff -r dc41eab09fe8 -r 7ad529321294 src/cpu/sparc/vm/graalGlobals_sparc.hpp --- a/src/cpu/sparc/vm/graalGlobals_sparc.hpp Mon Mar 10 16:20:45 2014 +0100 +++ b/src/cpu/sparc/vm/graalGlobals_sparc.hpp Mon Mar 10 16:26:10 2014 +0100 @@ -31,13 +31,13 @@ // Sets the default values for platform dependent flags used by the Graal compiler. // (see graalGlobals.hpp) -#if !defined(COMPILER2) +#ifdef COMPILERGRAAL define_pd_global(bool, BackgroundCompilation, true ); define_pd_global(bool, UseTLAB, true ); define_pd_global(bool, ResizeTLAB, true ); define_pd_global(bool, InlineIntrinsics, true ); define_pd_global(bool, PreferInterpreterNativeStubs, false); -define_pd_global(bool, TieredCompilation, true); +define_pd_global(bool, TieredCompilation, trueInTiered); define_pd_global(intx, BackEdgeThreshold, 100000); define_pd_global(intx, OnStackReplacePercentage, 933 ); @@ -58,6 +58,6 @@ define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K); define_pd_global(intx, TypeProfileWidth, 8); define_pd_global(intx, MethodProfileWidth, 4); -#endif +#endif // COMPILERGRAAL #endif // CPU_SPARC_VM_GRAALGLOBALS_SPARC_HPP diff -r dc41eab09fe8 -r 7ad529321294 src/cpu/x86/vm/graalGlobals_x86.hpp --- a/src/cpu/x86/vm/graalGlobals_x86.hpp Mon Mar 10 16:20:45 2014 +0100 +++ b/src/cpu/x86/vm/graalGlobals_x86.hpp Mon Mar 10 16:26:10 2014 +0100 @@ -31,13 +31,13 @@ // Sets the default values for platform dependent flags used by the Graal compiler. // (see graalGlobals.hpp) -#if !defined(COMPILER2) +#ifdef COMPILERGRAAL define_pd_global(bool, BackgroundCompilation, true ); define_pd_global(bool, UseTLAB, true ); define_pd_global(bool, ResizeTLAB, true ); define_pd_global(bool, InlineIntrinsics, true ); define_pd_global(bool, PreferInterpreterNativeStubs, false); -define_pd_global(bool, TieredCompilation, true); +define_pd_global(bool, TieredCompilation, trueInTiered); define_pd_global(intx, BackEdgeThreshold, 100000); define_pd_global(intx, OnStackReplacePercentage, 933 ); @@ -58,6 +58,6 @@ define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K); define_pd_global(intx, TypeProfileWidth, 8); define_pd_global(intx, MethodProfileWidth, 4); -#endif +#endif // COMPILERGRAAL #endif // CPU_X86_VM_GRAALGLOBALS_X86_HPP diff -r dc41eab09fe8 -r 7ad529321294 src/cpu/x86/vm/sharedRuntime_x86_64.cpp --- a/src/cpu/x86/vm/sharedRuntime_x86_64.cpp Mon Mar 10 16:20:45 2014 +0100 +++ b/src/cpu/x86/vm/sharedRuntime_x86_64.cpp Mon Mar 10 16:26:10 2014 +0100 @@ -3368,7 +3368,7 @@ __ jmp(cont); int reexecute_offset = __ pc() - start; -#ifdef GRAALVM +#if defined(COMPILERGRAAL) && !defined(COMPILER1) // Graal does not use this kind of deoptimization __ should_not_reach_here(); #endif diff -r dc41eab09fe8 -r 7ad529321294 src/share/vm/compiler/compileBroker.cpp --- a/src/share/vm/compiler/compileBroker.cpp Mon Mar 10 16:20:45 2014 +0100 +++ b/src/share/vm/compiler/compileBroker.cpp Mon Mar 10 16:26:10 2014 +0100 @@ -795,11 +795,11 @@ #ifdef GRAAL GraalCompiler* graal = new GraalCompiler(); #endif -#if defined(GRAALVM) && !defined(TIERED) +#if defined(COMPILERGRAAL) && !defined(TIERED) _compilers[0] = graal; c1_count = 0; c2_count = 0; -#endif // GRAALVM && !TIERED +#endif // COMPILERGRAAL && !TIERED #ifdef COMPILER1 if (c1_count > 0) { @@ -807,10 +807,10 @@ } #endif // COMPILER1 -#if defined(GRAALVM) +#if defined(COMPILERGRAAL) _compilers[1] = graal; c2_count = 0; -#endif // GRAALVM +#endif // COMPILERGRAAL #ifdef COMPILER2 if (c2_count > 0) { @@ -1014,9 +1014,9 @@ void CompileBroker::init_compiler_threads(int c1_compiler_count, int c2_compiler_count) { EXCEPTION_MARK; -#if !defined(ZERO) && !defined(SHARK) && !defined(GRAALVM) +#if !defined(ZERO) && !defined(SHARK) && !defined(COMPILERGRAAL) assert(c2_compiler_count > 0 || c1_compiler_count > 0, "No compilers?"); -#endif // !ZERO && !SHARK && !GRAALVM +#endif // !ZERO && !SHARK && !COMPILERGRAAL // Initialize the compilation queue if (c2_compiler_count > 0) { _c2_method_queue = new CompileQueue("C2MethodQueue", MethodCompileQueue_lock); @@ -1148,7 +1148,7 @@ return; } -#if defined(GRAALVM) +#if defined(COMPILERGRAAL) // In tiered mode we want to only handle highest tier compiles and // in non-tiered mode the default level should be // CompLevel_full_optimization which equals CompLevel_highest_tier. @@ -1165,7 +1165,7 @@ return; } assert(TieredCompilation, "should only reach here in tiered mode"); -#endif // GRAALVM +#endif // COMPILERGRAAL // Outputs from the following MutexLocker block: CompileTask* task = NULL; diff -r dc41eab09fe8 -r 7ad529321294 src/share/vm/compiler/oopMap.cpp --- a/src/share/vm/compiler/oopMap.cpp Mon Mar 10 16:20:45 2014 +0100 +++ b/src/share/vm/compiler/oopMap.cpp Mon Mar 10 16:26:10 2014 +0100 @@ -319,7 +319,7 @@ static void add_derived_oop(oop* base, oop* derived) { #ifndef TIERED COMPILER1_PRESENT(ShouldNotReachHere();) - GRAALVM_ONLY(ShouldNotReachHere();) + COMPILERGRAAL_PRESENT(ShouldNotReachHere();) #endif // TIERED #ifdef COMPILER2 DerivedPointerTable::add(derived, base); @@ -381,7 +381,7 @@ if (!oms.is_done()) { #ifndef TIERED COMPILER1_PRESENT(ShouldNotReachHere();) - GRAALVM_ONLY(ShouldNotReachHere();) + COMPILERGRAAL_PRESENT(ShouldNotReachHere();) #endif // !TIERED // Protect the operation on the derived pointers. This // protects the addition of derived pointers to the shared @@ -523,7 +523,7 @@ bool OopMap::has_derived_pointer() const { #ifndef TIERED COMPILER1_PRESENT(return false); - GRAALVM_ONLY(return false); + COMPILERGRAAL_PRESENT(return false); #endif // !TIERED #ifdef COMPILER2 OopMapStream oms((OopMap*)this,OopMapValue::derived_oop_value); diff -r dc41eab09fe8 -r 7ad529321294 src/share/vm/graal/graalCompiler.cpp --- a/src/share/vm/graal/graalCompiler.cpp Mon Mar 10 16:20:45 2014 +0100 +++ b/src/share/vm/graal/graalCompiler.cpp Mon Mar 10 16:26:10 2014 +0100 @@ -99,7 +99,7 @@ VMToCompiler::finalizeOptions(CITime || CITimeEach); if (UseCompiler) { - bool bootstrap = GRAALVM_ONLY(BootstrapGraal) NOT_GRAALVM(false); + bool bootstrap = COMPILERGRAAL_PRESENT(BootstrapGraal) NOT_COMPILERGRAAL(false); VMToCompiler::startCompiler(bootstrap); _initialized = true; CompilationPolicy::completed_vm_startup(); diff -r dc41eab09fe8 -r 7ad529321294 src/share/vm/graal/graalGlobals.hpp --- a/src/share/vm/graal/graalGlobals.hpp Mon Mar 10 16:20:45 2014 +0100 +++ b/src/share/vm/graal/graalGlobals.hpp Mon Mar 10 16:26:10 2014 +0100 @@ -49,7 +49,7 @@ product(bool, DebugGraal, true, \ "Enable JVMTI for the compiler thread") \ \ - GRAALVM_ONLY(product(bool, BootstrapGraal, true, \ + COMPILERGRAAL_PRESENT(product(bool, BootstrapGraal, true, \ "Bootstrap Graal before running Java main method")) \ \ product(intx, TraceGraal, 0, \ diff -r dc41eab09fe8 -r 7ad529321294 src/share/vm/runtime/deoptimization.hpp --- a/src/share/vm/runtime/deoptimization.hpp Mon Mar 10 16:20:45 2014 +0100 +++ b/src/share/vm/runtime/deoptimization.hpp Mon Mar 10 16:26:10 2014 +0100 @@ -309,7 +309,7 @@ } static int make_trap_request(DeoptReason reason, DeoptAction action, int index = -1) { -#ifdef GRAALVM +#if defined(COMPILERGRAAL) && !defined(COMPILER1) && !defined(COMPILER2) assert(index == -1, "Graal does not use index"); #endif diff -r dc41eab09fe8 -r 7ad529321294 src/share/vm/runtime/globals.hpp --- a/src/share/vm/runtime/globals.hpp Mon Mar 10 16:20:45 2014 +0100 +++ b/src/share/vm/runtime/globals.hpp Mon Mar 10 16:26:10 2014 +0100 @@ -120,7 +120,7 @@ # include "c1_globals_bsd.hpp" #endif #endif -#ifdef GRAAL +#ifdef COMPILERGRAAL #ifdef TARGET_ARCH_x86 # include "graalGlobals_x86.hpp" #endif @@ -133,7 +133,7 @@ #ifdef TARGET_ARCH_ppc # include "graalGlobals_ppc.hpp" #endif -#endif // GRAAL +#endif // COMPILERGRAAL #ifdef COMPILER2 #ifdef TARGET_ARCH_x86 # include "c2_globals_x86.hpp" @@ -163,7 +163,7 @@ #endif #endif -#if !defined(COMPILER1) && !defined(COMPILER2) && !defined(SHARK) && !defined(GRAAL) +#if !defined(COMPILER1) && !defined(COMPILER2) && !defined(SHARK) && !defined(COMPILERGRAAL) define_pd_global(bool, BackgroundCompilation, false); define_pd_global(bool, UseTLAB, false); define_pd_global(bool, CICompileOSR, false); diff -r dc41eab09fe8 -r 7ad529321294 src/share/vm/runtime/thread.cpp --- a/src/share/vm/runtime/thread.cpp Mon Mar 10 16:20:45 2014 +0100 +++ b/src/share/vm/runtime/thread.cpp Mon Mar 10 16:26:10 2014 +0100 @@ -3709,7 +3709,7 @@ } // initialize compiler(s) -#if defined(COMPILER1) || defined(COMPILER2) || defined(SHARK) || defined(GRAALVM) +#if defined(COMPILER1) || defined(COMPILER2) || defined(SHARK) || defined(COMPILERGRAAL) CompileBroker::compilation_init(); #endif diff -r dc41eab09fe8 -r 7ad529321294 src/share/vm/runtime/vm_version.cpp --- a/src/share/vm/runtime/vm_version.cpp Mon Mar 10 16:20:45 2014 +0100 +++ b/src/share/vm/runtime/vm_version.cpp Mon Mar 10 16:26:10 2014 +0100 @@ -112,26 +112,23 @@ #ifndef VMTYPE #ifdef TIERED - #ifdef GRAAL + #ifdef COMPILERGRAAL #define VMTYPE "Graal" - #else + #else // COMPILERGRAAL #define VMTYPE "Server" - #endif + #endif // COMPILERGRAAL #else // TIERED - #ifdef ZERO - #ifdef SHARK - #define VMTYPE "Shark" - #else // SHARK - #define VMTYPE "Zero" - #endif // SHARK - #else // ZERO - #ifdef GRAALVM - #define VMTYPE "Graal" - #else // GRAALVM - #define VMTYPE COMPILER1_PRESENT("Client") \ - COMPILER2_PRESENT("Server") - #endif // GRAALVM - #endif // ZERO + #ifdef ZERO + #ifdef SHARK + #define VMTYPE "Shark" + #else // SHARK + #define VMTYPE "Zero" + #endif // SHARK + #else // ZERO + #define VMTYPE COMPILER1_PRESENT("Client") \ + COMPILER2_PRESENT("Server") \ + COMPILERGRAAL_PRESENT("Graal") + #endif // ZERO #endif // TIERED #endif diff -r dc41eab09fe8 -r 7ad529321294 src/share/vm/utilities/macros.hpp --- a/src/share/vm/utilities/macros.hpp Mon Mar 10 16:20:45 2014 +0100 +++ b/src/share/vm/utilities/macros.hpp Mon Mar 10 16:26:10 2014 +0100 @@ -166,7 +166,7 @@ // COMPILER1 variant #ifdef COMPILER1 -#if defined(COMPILER2) || defined(GRAAL) +#if defined(COMPILER2) || defined(COMPILERGRAAL) #define TIERED #endif #define COMPILER1_PRESENT(code) code @@ -183,34 +183,32 @@ #define NOT_COMPILER2(code) code #endif // COMPILER2 +#ifdef COMPILERGRAAL +#define COMPILERGRAAL_PRESENT(code) code +#define NOT_COMPILERGRAAL(code) +#else // COMPILERGRAAL +#define COMPILERGRAAL_PRESENT(code) +#define NOT_COMPILERGRAAL(code) code +#endif // COMPILERGRAAL + +#if defined(COMPILERGRAAL) && !defined(GRAAL) +#error "COMPILERGRAAL needs GRAAL to be defined" +#endif + #ifdef GRAAL #define GRAAL_ONLY(code) code #define NOT_GRAAL(code) #define IS_GRAAL_DEFINED true -#if !defined(COMPILER2) -// Graal is the only compiler in the system and so will be used for compilation -// requests issued by the compile broker. -#define GRAALVM -#define GRAALVM_ONLY(code) code -#define NOT_GRAALVM(code) -#else -// Graal is not the only compiler in the system and so will only be used for -// compilation requests issued via the Graal API -#define GRAALVM_ONLY(code) -#define NOT_GRAALVM(code) code -#endif -#else // !GRAAL +#else // GRAAL #define GRAAL_ONLY(code) #define NOT_GRAAL(code) code #define IS_GRAAL_DEFINED false -#define GRAALVM_ONLY(code) -#define NOT_GRAALVM(code) code #endif // GRAAL #ifdef TIERED #define TIERED_ONLY(code) code #define NOT_TIERED(code) -#else +#else // TIERED #define TIERED_ONLY(code) #define NOT_TIERED(code) code #endif // TIERED