# HG changeset patch # User thartmann # Date 1484728202 0 # Node ID 617ed26c48d2b80cf005de0a253ba33f11721a27 # Parent 96560cffef4db891b7b5a69d62dfcf6e2f571ac3# Parent ff64053e7c5f30fd4ae0960392e5afe395ca157d Merge diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/src/share/vm/compiler/compilerDefinitions.cpp --- a/hotspot/src/share/vm/compiler/compilerDefinitions.cpp Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/src/share/vm/compiler/compilerDefinitions.cpp Wed Jan 18 08:30:02 2017 +0000 @@ -23,6 +23,8 @@ */ #include "precompiled.hpp" +#include "runtime/globals.hpp" +#include "runtime/globals_extension.hpp" #include "compiler/compilerDefinitions.hpp" const char* compilertype2name_tab[compiler_number_of_types] = { @@ -32,3 +34,80 @@ "jvmci", "shark" }; + +#if defined(COMPILER2) || defined(SHARK) +CompLevel CompLevel_highest_tier = CompLevel_full_optimization; // pure C2 and tiered or JVMCI and tiered +#elif defined(COMPILER1) +CompLevel CompLevel_highest_tier = CompLevel_simple; // pure C1 or JVMCI +#else +CompLevel CompLevel_highest_tier = CompLevel_none; +#endif + +#if defined(TIERED) +CompLevel CompLevel_initial_compile = CompLevel_full_profile; // tiered +#elif defined(COMPILER1) || INCLUDE_JVMCI +CompLevel CompLevel_initial_compile = CompLevel_simple; // pure C1 or JVMCI +#elif defined(COMPILER2) || defined(SHARK) +CompLevel CompLevel_initial_compile = CompLevel_full_optimization; // pure C2 +#else +CompLevel CompLevel_initial_compile = CompLevel_none; +#endif + +#if defined(COMPILER2) +CompMode Compilation_mode = CompMode_server; +#elif defined(COMPILER1) +CompMode Compilation_mode = CompMode_client; +#else +CompMode Compilation_mode = CompMode_none; +#endif + +#ifdef TIERED +void set_client_compilation_mode() { + Compilation_mode = CompMode_client; + CompLevel_highest_tier = CompLevel_simple; + CompLevel_initial_compile = CompLevel_simple; + FLAG_SET_ERGO(bool, TieredCompilation, false); + FLAG_SET_ERGO(bool, ProfileInterpreter, false); + FLAG_SET_ERGO(bool, NeverActAsServerClassMachine, true); +#if INCLUDE_JVMCI + FLAG_SET_ERGO(bool, EnableJVMCI, false); + FLAG_SET_ERGO(bool, UseJVMCICompiler, false); +#endif +#if INCLUDE_AOT + FLAG_SET_ERGO(bool, UseAOT, false); +#endif + if (FLAG_IS_DEFAULT(InitialCodeCacheSize)) { + FLAG_SET_ERGO(uintx, InitialCodeCacheSize, 160*K); + } + if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) { + FLAG_SET_ERGO(uintx, ReservedCodeCacheSize, 32*M); + } + if (FLAG_IS_DEFAULT(NonProfiledCodeHeapSize)) { + FLAG_SET_ERGO(uintx, NonProfiledCodeHeapSize, 27*M); + } + if (FLAG_IS_DEFAULT(ProfiledCodeHeapSize)) { + FLAG_SET_ERGO(uintx, ProfiledCodeHeapSize, 0); + } + if (FLAG_IS_DEFAULT(NonNMethodCodeHeapSize)) { + FLAG_SET_ERGO(uintx, NonNMethodCodeHeapSize, 5*M); + } + if (FLAG_IS_DEFAULT(CodeCacheExpansionSize)) { + FLAG_SET_ERGO(uintx, CodeCacheExpansionSize, 32*K); + } + if (FLAG_IS_DEFAULT(MetaspaceSize)) { + FLAG_SET_ERGO(size_t, MetaspaceSize, 12*M); + } + if (FLAG_IS_DEFAULT(MaxRAM)) { + FLAG_SET_ERGO(uint64_t, MaxRAM, 1ULL*G); + } + if (FLAG_IS_DEFAULT(CompileThreshold)) { + FLAG_SET_ERGO(intx, CompileThreshold, 1500); + } + if (FLAG_IS_DEFAULT(OnStackReplacePercentage)) { + FLAG_SET_ERGO(intx, OnStackReplacePercentage, 933); + } + if (FLAG_IS_DEFAULT(CICompilerCount)) { + FLAG_SET_ERGO(intx, CICompilerCount, 1); + } +} +#endif // TIERED diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/src/share/vm/compiler/compilerDefinitions.hpp --- a/hotspot/src/share/vm/compiler/compilerDefinitions.hpp Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/src/share/vm/compiler/compilerDefinitions.hpp Wed Jan 18 08:30:02 2017 +0000 @@ -54,26 +54,29 @@ CompLevel_simple = 1, // C1 CompLevel_limited_profile = 2, // C1, invocation & backedge counters CompLevel_full_profile = 3, // C1, invocation & backedge counters + mdo - CompLevel_full_optimization = 4, // C2, Shark or JVMCI + CompLevel_full_optimization = 4 // C2, Shark or JVMCI +}; + +extern CompLevel CompLevel_highest_tier; +extern CompLevel CompLevel_initial_compile; -#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 -#else - CompLevel_highest_tier = CompLevel_none, -#endif +enum CompMode { + CompMode_none = 0, + CompMode_client = 1, + CompMode_server = 2 +}; -#if defined(TIERED) - CompLevel_initial_compile = CompLevel_full_profile // tiered -#elif defined(COMPILER1) || INCLUDE_JVMCI - CompLevel_initial_compile = CompLevel_simple // pure C1 or JVMCI -#elif defined(COMPILER2) || defined(SHARK) - CompLevel_initial_compile = CompLevel_full_optimization // pure C2 -#else - CompLevel_initial_compile = CompLevel_none -#endif -}; +extern CompMode Compilation_mode; + +inline bool is_server_compilation_mode_vm() { + return Compilation_mode == CompMode_server; +} + +inline bool is_client_compilation_mode_vm() { + return Compilation_mode == CompMode_client; +} + +extern void set_client_compilation_mode(); inline bool is_c1_compile(int comp_level) { return comp_level > CompLevel_none && comp_level < CompLevel_full_optimization; diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/src/share/vm/compiler/compilerDirectives.cpp --- a/hotspot/src/share/vm/compiler/compilerDirectives.cpp Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/src/share/vm/compiler/compilerDirectives.cpp Wed Jan 18 08:30:02 2017 +0000 @@ -445,7 +445,9 @@ _default_directives->_c1_store->EnableOption = true; #endif #ifdef COMPILER2 - _default_directives->_c2_store->EnableOption = true; + if (is_server_compilation_mode_vm()) { + _default_directives->_c2_store->EnableOption = true; + } #endif assert(error_msg == NULL, "Must succeed."); push(_default_directives); diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/src/share/vm/gc/shared/collectedHeap.cpp --- a/hotspot/src/share/vm/gc/shared/collectedHeap.cpp Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/src/share/vm/gc/shared/collectedHeap.cpp Wed Jan 18 08:30:02 2017 +0000 @@ -233,7 +233,7 @@ // Used for ReduceInitialCardMarks (when COMPILER2 is used); // otherwise remains unused. #if defined(COMPILER2) || INCLUDE_JVMCI - _defer_initial_card_mark = ReduceInitialCardMarks && can_elide_tlab_store_barriers() + _defer_initial_card_mark = is_server_compilation_mode_vm() && ReduceInitialCardMarks && can_elide_tlab_store_barriers() && (DeferInitialCardMark || card_mark_must_follow_store()); #else assert(_defer_initial_card_mark == false, "Who would set it?"); diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp --- a/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/src/share/vm/gc/shared/genCollectedHeap.cpp Wed Jan 18 08:30:02 2017 +0000 @@ -1209,7 +1209,7 @@ #if defined(COMPILER2) || INCLUDE_JVMCI assert(DerivedPointerTable::is_empty(), "derived pointer present"); size_t actual_gap = pointer_delta((HeapWord*) (max_uintx-3), *(end_addr())); - guarantee(actual_gap > (size_t)FastAllocateSizeLimit, "inline allocation wraps"); + guarantee(is_client_compilation_mode_vm() || actual_gap > (size_t)FastAllocateSizeLimit, "inline allocation wraps"); #endif /* COMPILER2 || INCLUDE_JVMCI */ resize_all_tlabs(); diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/src/share/vm/gc/shared/referenceProcessor.cpp --- a/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/src/share/vm/gc/shared/referenceProcessor.cpp Wed Jan 18 08:30:02 2017 +0000 @@ -57,11 +57,11 @@ java_lang_ref_SoftReference::set_clock(_soft_ref_timestamp_clock); _always_clear_soft_ref_policy = new AlwaysClearPolicy(); -#if defined(COMPILER2) || INCLUDE_JVMCI - _default_soft_ref_policy = new LRUMaxHeapPolicy(); -#else - _default_soft_ref_policy = new LRUCurrentHeapPolicy(); -#endif + if (is_server_compilation_mode_vm()) { + _default_soft_ref_policy = new LRUMaxHeapPolicy(); + } else { + _default_soft_ref_policy = new LRUCurrentHeapPolicy(); + } if (_always_clear_soft_ref_policy == NULL || _default_soft_ref_policy == NULL) { vm_exit_during_initialization("Could not allocate reference policy object"); } diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp --- a/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/src/share/vm/gc/shared/threadLocalAllocBuffer.cpp Wed Jan 18 08:30:02 2017 +0000 @@ -233,9 +233,11 @@ // If the C2 compiler is not present, no space is reserved. // +1 for rounding up to next cache line, +1 to be safe - int lines = MAX2(AllocatePrefetchLines, AllocateInstancePrefetchLines) + 2; - _reserve_for_allocation_prefetch = (AllocatePrefetchDistance + AllocatePrefetchStepSize * lines) / - (int)HeapWordSize; + if (is_server_compilation_mode_vm()) { + int lines = MAX2(AllocatePrefetchLines, AllocateInstancePrefetchLines) + 2; + _reserve_for_allocation_prefetch = (AllocatePrefetchDistance + AllocatePrefetchStepSize * lines) / + (int)HeapWordSize; + } #endif // During jvm startup, the main (primordial) thread is initialized diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/src/share/vm/oops/methodData.cpp --- a/hotspot/src/share/vm/oops/methodData.cpp Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/src/share/vm/oops/methodData.cpp Wed Jan 18 08:30:02 2017 +0000 @@ -717,9 +717,9 @@ } int MethodData::bytecode_cell_count(Bytecodes::Code code) { -#if defined(COMPILER1) && !(defined(COMPILER2) || INCLUDE_JVMCI) - return no_profile_data; -#else + if (is_client_compilation_mode_vm()) { + return no_profile_data; + } switch (code) { case Bytecodes::_checkcast: case Bytecodes::_instanceof: @@ -778,7 +778,6 @@ return variable_cell_count; } return no_profile_data; -#endif } // Compute the size of the profiling information corresponding to @@ -840,7 +839,9 @@ case Bytecodes::_ifnonnull: case Bytecodes::_invokestatic: #ifdef COMPILER2 - return UseTypeSpeculation; + if (is_server_compilation_mode_vm()) { + return UseTypeSpeculation; + } #endif default: return false; @@ -942,9 +943,9 @@ // the segment in bytes. int MethodData::initialize_data(BytecodeStream* stream, int data_index) { -#if defined(COMPILER1) && !(defined(COMPILER2) || INCLUDE_JVMCI) - return 0; -#else + if (is_client_compilation_mode_vm()) { + return 0; + } int cell_count = -1; int tag = DataLayout::no_tag; DataLayout* data_layout = data_layout_at(data_index); @@ -1061,7 +1062,6 @@ assert(!bytecode_has_profile(c), "agree w/ !BHP"); return 0; } -#endif } // Get the data at an arbitrary (sort of) data index. diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/src/share/vm/prims/whitebox.cpp --- a/hotspot/src/share/vm/prims/whitebox.cpp Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/src/share/vm/prims/whitebox.cpp Wed Jan 18 08:30:02 2017 +0000 @@ -659,6 +659,9 @@ WB_END WB_ENTRY(jboolean, WB_IsMethodCompilable(JNIEnv* env, jobject o, jobject method, jint comp_level, jboolean is_osr)) + if (method == NULL || comp_level > MIN2((CompLevel) TieredStopAtLevel, CompLevel_highest_tier)) { + return false; + } jmethodID jmid = reflected_method_to_jmid(thread, env, method); CHECK_JNI_EXCEPTION_(env, JNI_FALSE); MutexLockerEx mu(Compile_lock); diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/src/share/vm/runtime/arguments.cpp --- a/hotspot/src/share/vm/runtime/arguments.cpp Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/src/share/vm/runtime/arguments.cpp Wed Jan 18 08:30:02 2017 +0000 @@ -1819,6 +1819,25 @@ #endif // INCLUDE_ALL_GCS } +#ifdef TIERED +bool Arguments::compilation_mode_selected() { + return !FLAG_IS_DEFAULT(TieredCompilation) || !FLAG_IS_DEFAULT(TieredStopAtLevel) || + !FLAG_IS_DEFAULT(UseAOT) JVMCI_ONLY(|| !FLAG_IS_DEFAULT(EnableJVMCI) || !FLAG_IS_DEFAULT(UseJVMCICompiler)); + +} + +void Arguments::select_compilation_mode_ergonomically() { +#if defined(_WINDOWS) && !defined(_LP64) + if (FLAG_IS_DEFAULT(NeverActAsServerClassMachine)) { + NeverActAsServerClassMachine = true; + } +#endif + if (NeverActAsServerClassMachine) { + set_client_compilation_mode(); + } +} +#endif //TIERED + void Arguments::select_gc_ergonomically() { #if INCLUDE_ALL_GCS if (os::is_server_class_machine()) { @@ -1883,6 +1902,11 @@ #endif void Arguments::set_ergonomics_flags() { +#ifdef TIERED + if (!compilation_mode_selected()) { + select_compilation_mode_ergonomically(); + } +#endif select_gc(); #if defined(COMPILER2) || INCLUDE_JVMCI @@ -1891,7 +1915,7 @@ // server performance. When -server is specified, keep the default off // unless it is asked for. Future work: either add bytecode rewriting // at link time, or rewrite bytecodes in non-shared methods. - if (!DumpSharedSpaces && !RequireSharedSpaces && + if (is_server_compilation_mode_vm() && !DumpSharedSpaces && !RequireSharedSpaces && (FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) { no_shared_spaces("COMPILER2 default: -Xshare:auto | off, have to manually setup to on."); } @@ -3711,6 +3735,12 @@ return JNI_ERR; } +#if INCLUDE_JVMCI + if (UseJVMCICompiler) { + Compilation_mode = CompMode_server; + } +#endif + return JNI_OK; } @@ -4456,7 +4486,9 @@ } else { int max_compilation_policy_choice = 1; #ifdef COMPILER2 - max_compilation_policy_choice = 2; + if (is_server_compilation_mode_vm()) { + max_compilation_policy_choice = 2; + } #endif // Check if the policy is valid. if (CompilationPolicyChoice >= max_compilation_policy_choice) { diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/src/share/vm/runtime/arguments.hpp --- a/hotspot/src/share/vm/runtime/arguments.hpp Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/src/share/vm/runtime/arguments.hpp Wed Jan 18 08:30:02 2017 +0000 @@ -455,6 +455,10 @@ static intx _Tier3InvokeNotifyFreqLog; static intx _Tier4InvocationThreshold; + // Compilation mode. + static bool compilation_mode_selected(); + static void select_compilation_mode_ergonomically(); + // Tiered static void set_tiered_flags(); // CMS/ParNew garbage collectors diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/src/share/vm/runtime/compilationPolicy.cpp --- a/hotspot/src/share/vm/runtime/compilationPolicy.cpp Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/src/share/vm/runtime/compilationPolicy.cpp Wed Jan 18 08:30:02 2017 +0000 @@ -238,31 +238,17 @@ // Note: this policy is used ONLY if TieredCompilation is off. // compiler_count() behaves the following way: // - with TIERED build (with both COMPILER1 and COMPILER2 defined) it should return -// zero for the c1 compilation levels, hence the particular ordering of the -// statements. -// - the same should happen when COMPILER2 is defined and COMPILER1 is not -// (server build without TIERED defined). -// - if only COMPILER1 is defined (client build), zero should be returned for -// the c2 level. +// zero for the c1 compilation levels in server compilation mode runs +// and c2 compilation levels in client compilation mode runs. +// - with COMPILER2 not defined it should return zero for c2 compilation levels. +// - with COMPILER1 not defined it should return zero for c1 compilation levels. // - if neither is defined - always return zero. int NonTieredCompPolicy::compiler_count(CompLevel comp_level) { assert(!TieredCompilation, "This policy should not be used with TieredCompilation"); -#ifdef COMPILER2 - if (is_c2_compile(comp_level)) { + if (COMPILER2_PRESENT(is_server_compilation_mode_vm() && is_c2_compile(comp_level) ||) + is_client_compilation_mode_vm() && is_c1_compile(comp_level)) { return _compiler_count; - } else { - return 0; } -#endif - -#ifdef COMPILER1 - if (is_c1_compile(comp_level)) { - return _compiler_count; - } else { - return 0; - } -#endif - return 0; } diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/src/share/vm/runtime/vm_version.cpp --- a/hotspot/src/share/vm/runtime/vm_version.cpp Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/src/share/vm/runtime/vm_version.cpp Wed Jan 18 08:30:02 2017 +0000 @@ -131,19 +131,32 @@ return UseSharedSpaces ? "interpreted mode, sharing" : "interpreted mode"; case Arguments::_mixed: if (UseSharedSpaces) { - if (UseAOT) { - return "mixed mode, aot, sharing"; - } else { - return "mixed mode, sharing"; - } + if (UseAOT) { + return "mixed mode, aot, sharing"; +#ifdef TIERED + } else if(is_client_compilation_mode_vm()) { + return "mixed mode, emulated-client, sharing"; +#endif + } else { + return "mixed mode, sharing"; + } } else { if (UseAOT) { return "mixed mode, aot"; +#ifdef TIERED + } else if(is_client_compilation_mode_vm()) { + return "mixed mode, emulated-client"; +#endif } else { return "mixed mode"; } } case Arguments::_comp: +#ifdef TIERED + if (is_client_compilation_mode_vm()) { + return UseSharedSpaces ? "compiled mode, emulated-client, sharing" : "compiled mode, emulated-client"; + } +#endif return UseSharedSpaces ? "compiled mode, sharing" : "compiled mode"; }; ShouldNotReachHere(); diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/TEST.ROOT --- a/hotspot/test/TEST.ROOT Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/TEST.ROOT Wed Jan 18 08:30:02 2017 +0000 @@ -46,6 +46,7 @@ vm.gc.Parallel \ vm.gc.ConcMarkSweep \ vm.jvmci \ + vm.emulatedClient \ vm.cpu.features \ vm.debug diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java --- a/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/arraycopy/TestArrayCopyNoInitDeopt.java Wed Jan 18 08:30:02 2017 +0000 @@ -25,7 +25,7 @@ * @test * @bug 8072016 * @summary Infinite deoptimization/recompilation cycles in case of arraycopy with tightly coupled allocation - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management @@ -86,8 +86,8 @@ } static public void main(String[] args) throws Exception { - if (!Platform.isServer()) { - throw new Error("TESTBUG: Not server VM"); + if (!Platform.isServer() || Platform.isEmulatedClient()) { + throw new Error("TESTBUG: Not server mode"); } // Only execute if C2 is available if (TIERED_STOP_AT_LEVEL == CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION) { diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/c2/cr7200264/TestSSE2IntVect.java --- a/hotspot/test/compiler/c2/cr7200264/TestSSE2IntVect.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/c2/cr7200264/TestSSE2IntVect.java Wed Jan 18 08:30:02 2017 +0000 @@ -26,6 +26,7 @@ * @bug 7200264 * @summary 7192963 changes disabled shift vectors * @requires vm.cpu.features ~= ".*sse2.*" & vm.debug & vm.flavor == "server" + * @requires !vm.emulatedClient * @library /test/lib / * @run driver compiler.c2.cr7200264.TestSSE2IntVect */ diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/c2/cr7200264/TestSSE4IntVect.java --- a/hotspot/test/compiler/c2/cr7200264/TestSSE4IntVect.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/c2/cr7200264/TestSSE4IntVect.java Wed Jan 18 08:30:02 2017 +0000 @@ -26,6 +26,7 @@ * @bug 7200264 * @summary 7192963 changes disabled shift vectors * @requires vm.cpu.features ~= ".*sse4\\.1.*" & vm.debug & vm.flavor == "server" + * @requires !vm.emulatedClient * @library /test/lib / * @run driver compiler.c2.cr7200264.TestSSE4IntVect */ diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/codecache/stress/OverloadCompileQueueTest.java --- a/hotspot/test/compiler/codecache/stress/OverloadCompileQueueTest.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/codecache/stress/OverloadCompileQueueTest.java Wed Jan 18 08:30:02 2017 +0000 @@ -65,9 +65,9 @@ AVAILABLE_LEVELS = IntStream .rangeClosed(LEVEL_SIMPLE, TIERED_STOP_AT_LEVEL) .toArray(); - } else if (Platform.isServer()) { + } else if (Platform.isServer() && !Platform.isEmulatedClient()) { AVAILABLE_LEVELS = new int[] { LEVEL_FULL_OPTIMIZATION }; - } else if (Platform.isClient() || Platform.isMinimal()) { + } else if (Platform.isClient() || Platform.isMinimal() || Platform.isEmulatedClient()) { AVAILABLE_LEVELS = new int[] { LEVEL_SIMPLE }; } else { throw new Error("TESTBUG: unknown VM: " + Platform.vmName); diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java --- a/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/cpuflags/TestAESIntrinsicsOnSupportedConfig.java Wed Jan 18 08:30:02 2017 +0000 @@ -75,7 +75,7 @@ prepareArguments(prepareBooleanFlag(AESIntrinsicsBase .USE_AES, true))); final String errorMessage = "Case testUseAES failed"; - if (Platform.isServer()) { + if (Platform.isServer() && !Platform.isEmulatedClient()) { verifyOutput(new String[]{AESIntrinsicsBase.CIPHER_INTRINSIC, AESIntrinsicsBase.AES_INTRINSIC}, null, errorMessage, outputAnalyzer); diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/IntrinsicAvailableTest.java --- a/hotspot/test/compiler/intrinsics/IntrinsicAvailableTest.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/IntrinsicAvailableTest.java Wed Jan 18 08:30:02 2017 +0000 @@ -114,7 +114,7 @@ public void test() throws Exception { Executable intrinsicMethod = testCase.getExecutable(); - if (Platform.isServer() && (TIERED_STOP_AT_LEVEL == COMP_LEVEL_FULL_OPTIMIZATION)) { + if (Platform.isServer() && !Platform.isEmulatedClient() && (TIERED_STOP_AT_LEVEL == COMP_LEVEL_FULL_OPTIMIZATION)) { if (TIERED_COMPILATION) { checkIntrinsicForCompilationLevel(intrinsicMethod, COMP_LEVEL_SIMPLE); } diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/IntrinsicDisabledTest.java --- a/hotspot/test/compiler/intrinsics/IntrinsicDisabledTest.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/IntrinsicDisabledTest.java Wed Jan 18 08:30:02 2017 +0000 @@ -197,7 +197,8 @@ } public static void main(String args[]) { - if (Platform.isServer() && (TIERED_STOP_AT_LEVEL == CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION)) { + if (Platform.isServer() && !Platform.isEmulatedClient() && + (TIERED_STOP_AT_LEVEL == CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION)) { if (TIERED_COMPILATION) { test(CompilerWhiteBoxTest.COMP_LEVEL_SIMPLE); } diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/bigInteger/MontgomeryMultiplyTest.java --- a/hotspot/test/compiler/intrinsics/bigInteger/MontgomeryMultiplyTest.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/bigInteger/MontgomeryMultiplyTest.java Wed Jan 18 08:30:02 2017 +0000 @@ -26,7 +26,7 @@ * @test * @bug 8130150 8131779 8139907 * @summary Verify that the Montgomery multiply and square intrinsic works and correctly checks their arguments. - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @modules java.base/jdk.internal.misc:open * @modules java.base/java.math:open * @library /test/lib / @@ -314,8 +314,8 @@ } public static void main(String args[]) { - if (!Platform.isServer()) { - throw new Error("TESTBUG: Not server VM"); + if (!Platform.isServer() || Platform.isEmulatedClient()) { + throw new Error("TESTBUG: Not server mode"); } if (wb.isIntrinsicAvailable(getExecutable(true), CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION) && wb.isIntrinsicAvailable(getExecutable(false), CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION)) { diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestI.java --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestI.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestI.java Wed Jan 18 08:30:02 2017 +0000 @@ -24,7 +24,7 @@ /* * @test * @bug 8031321 - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestL.java --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestL.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/AndnTestL.java Wed Jan 18 08:30:02 2017 +0000 @@ -24,7 +24,7 @@ /* * @test * @bug 8031321 - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestI.java Wed Jan 18 08:30:02 2017 +0000 @@ -24,7 +24,7 @@ /* * @test * @bug 8031321 - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsiTestL.java Wed Jan 18 08:30:02 2017 +0000 @@ -24,7 +24,7 @@ /* * @test * @bug 8031321 - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestI.java Wed Jan 18 08:30:02 2017 +0000 @@ -24,7 +24,7 @@ /* * @test * @bug 8031321 - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsmskTestL.java Wed Jan 18 08:30:02 2017 +0000 @@ -24,7 +24,7 @@ /* * @test * @bug 8031321 - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestI.java Wed Jan 18 08:30:02 2017 +0000 @@ -24,7 +24,7 @@ /* * @test * @bug 8031321 - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BlsrTestL.java Wed Jan 18 08:30:02 2017 +0000 @@ -24,7 +24,7 @@ /* * @test * @bug 8031321 - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/BmiIntrinsicBase.java Wed Jan 18 08:30:02 2017 +0000 @@ -78,7 +78,7 @@ System.out.println(testCase.name()); - if (TIERED_COMPILATION && TIERED_STOP_AT_LEVEL != CompilerWhiteBoxTest.COMP_LEVEL_MAX) { + if (TIERED_COMPILATION && TIERED_STOP_AT_LEVEL != CompilerWhiteBoxTest.COMP_LEVEL_MAX || Platform.isEmulatedClient()) { System.out.println("TieredStopAtLevel value (" + TIERED_STOP_AT_LEVEL + ") is too low, test SKIPPED"); return; } diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestI.java Wed Jan 18 08:30:02 2017 +0000 @@ -24,7 +24,7 @@ /* * @test * @bug 8031321 - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/LZcntTestL.java Wed Jan 18 08:30:02 2017 +0000 @@ -24,7 +24,7 @@ /* * @test * @bug 8031321 - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestI.java Wed Jan 18 08:30:02 2017 +0000 @@ -24,7 +24,7 @@ /* * @test * @bug 8031321 - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java --- a/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/bmi/verifycode/TZcntTestL.java Wed Jan 18 08:30:02 2017 +0000 @@ -24,7 +24,7 @@ /* * @test * @bug 8031321 - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java --- a/hotspot/test/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/klass/CastNullCheckDroppingsTest.java Wed Jan 18 08:30:02 2017 +0000 @@ -25,7 +25,7 @@ * @test NullCheckDroppingsTest * @bug 8054492 * @summary Casting can result in redundant null checks in generated code - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib * @modules java.base/jdk.internal.misc * java.management @@ -84,8 +84,8 @@ int[] asink; public static void main(String[] args) throws Exception { - if (!Platform.isServer()) { - throw new Error("TESTBUG: Not server VM"); + if (!Platform.isServer() || Platform.isEmulatedClient()) { + throw new Error("TESTBUG: Not server mode"); } // Make sure background compilation is disabled if (WHITE_BOX.getBooleanVMFlag("BackgroundCompilation")) { diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java --- a/hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/intrinsics/mathexact/sanity/IntrinsicBase.java Wed Jan 18 08:30:02 2017 +0000 @@ -50,7 +50,7 @@ int expectedIntrinsicCount = 0; - if (Platform.isServer()) { + if (Platform.isServer() && !Platform.isEmulatedClient()) { if (TIERED_COMPILATION) { int max_level = TIERED_STOP_AT_LEVEL; expectedIntrinsicCount = (max_level == COMP_LEVEL_MAX) ? 1 : 0; diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/loopopts/TestCountedLoopSafepointBackedge.java --- a/hotspot/test/compiler/loopopts/TestCountedLoopSafepointBackedge.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/loopopts/TestCountedLoopSafepointBackedge.java Wed Jan 18 08:30:02 2017 +0000 @@ -24,7 +24,7 @@ /** * @test * @bug 8161147 - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @summary Safepoint on backedge breaks UseCountedLoopSafepoints * @run main/othervm -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:+UseCountedLoopSafepoints TestCountedLoopSafepointBackedge * diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/loopopts/UseCountedLoopSafepointsTest.java --- a/hotspot/test/compiler/loopopts/UseCountedLoopSafepointsTest.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/loopopts/UseCountedLoopSafepointsTest.java Wed Jan 18 08:30:02 2017 +0000 @@ -28,6 +28,7 @@ * @summary Test that C2 flag UseCountedLoopSafepoints ensures a safepoint is kept in a CountedLoop * @library /test/lib / * @requires vm.compMode != "Xint" & vm.flavor == "server" & (vm.opt.TieredStopAtLevel == null | vm.opt.TieredStopAtLevel == 4) & vm.debug == true + * @requires !vm.emulatedClient * @modules java.base/jdk.internal.misc * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox @@ -37,6 +38,7 @@ package compiler.loopopts; +import jdk.test.lib.Platform; import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; import java.util.List; @@ -51,6 +53,9 @@ public class UseCountedLoopSafepointsTest { public static void main (String args[]) { + if (!Platform.isServer() || Platform.isEmulatedClient()) { + throw new Error("TESTBUG: Not server mode"); + } check(true); // check ideal graph with UseCountedLoopSafepoint enabled check(false); // ... and disabled } diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/rangechecks/TestExplicitRangeChecks.java --- a/hotspot/test/compiler/rangechecks/TestExplicitRangeChecks.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/rangechecks/TestExplicitRangeChecks.java Wed Jan 18 08:30:02 2017 +0000 @@ -445,7 +445,7 @@ success = false; } // Only perform these additional checks if C2 is available - if (Platform.isServer() && + if (Platform.isServer() && !Platform.isEmulatedClient() && TIERED_STOP_AT_LEVEL == CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION) { if (deoptimize && WHITE_BOX.isMethodCompiled(m)) { System.out.println(name + " not deoptimized on invalid access"); diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/testlibrary/CompilerUtils.java --- a/hotspot/test/compiler/testlibrary/CompilerUtils.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/testlibrary/CompilerUtils.java Wed Jan 18 08:30:02 2017 +0000 @@ -53,10 +53,10 @@ "TieredStopAtLevel has value out of int capacity"); return IntStream.rangeClosed(1, maxLevel).toArray(); } else { - if (Platform.isServer()) { + if (Platform.isServer() && !Platform.isEmulatedClient()) { return new int[]{4}; } - if (Platform.isClient() || Platform.isMinimal()) { + if (Platform.isClient() || Platform.isMinimal() || Platform.isEmulatedClient()) { return new int[]{1}; } } diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java --- a/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java Wed Jan 18 08:30:02 2017 +0000 @@ -55,7 +55,7 @@ "TieredStopAtLevel"); boolean maxLevelIsReachable = (tieredMaxLevel == IntrinsicPredicates.TIERED_MAX_LEVEL); - return Platform.isServer() && (!isTiered || maxLevelIsReachable); + return Platform.isServer() && !Platform.isEmulatedClient() && (!isTiered || maxLevelIsReachable); }; public static final BooleanSupplier SHA1_INSTRUCTION_AVAILABLE diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/tiered/NonTieredLevelsTest.java --- a/hotspot/test/compiler/tiered/NonTieredLevelsTest.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/tiered/NonTieredLevelsTest.java Wed Jan 18 08:30:02 2017 +0000 @@ -47,10 +47,10 @@ private static final int AVAILABLE_COMP_LEVEL; private static final IntPredicate IS_AVAILABLE_COMPLEVEL; static { - if (Platform.isServer()) { + if (Platform.isServer() && !Platform.isEmulatedClient()) { AVAILABLE_COMP_LEVEL = COMP_LEVEL_FULL_OPTIMIZATION; IS_AVAILABLE_COMPLEVEL = x -> x == COMP_LEVEL_FULL_OPTIMIZATION; - } else if (Platform.isClient() || Platform.isMinimal()) { + } else if (Platform.isClient() || Platform.isMinimal() || Platform.isEmulatedClient()) { AVAILABLE_COMP_LEVEL = COMP_LEVEL_SIMPLE; IS_AVAILABLE_COMPLEVEL = x -> x >= COMP_LEVEL_SIMPLE && x <= COMP_LEVEL_FULL_PROFILE; diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/types/correctness/CorrectnessTest.java --- a/hotspot/test/compiler/types/correctness/CorrectnessTest.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/types/correctness/CorrectnessTest.java Wed Jan 18 08:30:02 2017 +0000 @@ -25,7 +25,7 @@ * @test CorrectnessTest * @bug 8038418 * @summary Tests correctness of type usage with type profiling and speculations - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management @@ -88,8 +88,8 @@ private static final WhiteBox WHITE_BOX = WhiteBox.getWhiteBox(); public static void main(String[] args) { - if (!Platform.isServer()) { - throw new Error("TESTBUG: Not server VM"); + if (!Platform.isServer() || Platform.isEmulatedClient()) { + throw new Error("TESTBUG: Not server mode"); } Asserts.assertGTE(args.length, 1); ProfilingType profilingType = ProfilingType.valueOf(args[0]); diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java --- a/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/uncommontrap/TestUnstableIfTrap.java Wed Jan 18 08:30:02 2017 +0000 @@ -206,7 +206,7 @@ boolean isMethodCompiledAtMaxTier = WB.getMethodCompilationLevel(m) == MAX_TIER; - return Platform.isServer() && isMethodCompiled + return Platform.isServer() && !Platform.isEmulatedClient() && isMethodCompiled && (!isTiered || isMethodCompiledAtMaxTier); } diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/unsafe/UnsafeGetConstantField.java --- a/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/unsafe/UnsafeGetConstantField.java Wed Jan 18 08:30:02 2017 +0000 @@ -28,7 +28,7 @@ * @summary tests on constant folding of unsafe get operations * @library /test/lib * - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.vm.annotation @@ -93,8 +93,8 @@ static final Unsafe U = Unsafe.getUnsafe(); public static void main(String[] args) { - if (!Platform.isServer()) { - throw new Error("TESTBUG: Not server VM"); + if (!Platform.isServer() || Platform.isEmulatedClient()) { + throw new Error("TESTBUG: Not server mode"); } testUnsafeGetAddress(); testUnsafeGetField(); diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/unsafe/UnsafeGetStableArrayElement.java --- a/hotspot/test/compiler/unsafe/UnsafeGetStableArrayElement.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/unsafe/UnsafeGetStableArrayElement.java Wed Jan 18 08:30:02 2017 +0000 @@ -28,7 +28,7 @@ * @summary tests on constant folding of unsafe get operations from stable arrays * @library /test/lib * - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * * @modules java.base/jdk.internal.vm.annotation * java.base/jdk.internal.misc @@ -332,8 +332,8 @@ } public static void main(String[] args) throws Exception { - if (!Platform.isServer()) { - throw new Error("TESTBUG: Not server VM"); + if (!Platform.isServer() || Platform.isEmulatedClient()) { + throw new Error("TESTBUG: Not server mode"); } testUnsafeAccess(); System.out.println("TEST PASSED"); diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/compiler/whitebox/IsMethodCompilableTest.java --- a/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/compiler/whitebox/IsMethodCompilableTest.java Wed Jan 18 08:30:02 2017 +0000 @@ -25,7 +25,8 @@ * @test IsMethodCompilableTest * @bug 8007270 8006683 8007288 8022832 * @summary testing of WB::isMethodCompilable() - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & (vm.opt.TieredStopAtLevel == null | vm.opt.TieredStopAtLevel == 4) + * @requires !vm.emulatedClient * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management @@ -82,8 +83,8 @@ protected void test() throws Exception { // Only c2 compilations can be disabled through PerMethodRecompilationCutoff - if (!Platform.isServer()) { - throw new Error("TESTBUG: Not server VM"); + if (!Platform.isServer() || Platform.isEmulatedClient()) { + throw new Error("TESTBUG: Not server mode"); } if (skipXcompOSR()) { diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/gc/stress/gcbasher/TestGCBasherWithCMS.java --- a/hotspot/test/gc/stress/gcbasher/TestGCBasherWithCMS.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/gc/stress/gcbasher/TestGCBasherWithCMS.java Wed Jan 18 08:30:02 2017 +0000 @@ -29,7 +29,7 @@ * @key gc * @key stress * @requires vm.gc.ConcMarkSweep - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @summary Stress the CMS GC by trying to make old objects more likely to be garbage than young objects. * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx256m -server -XX:+UseConcMarkSweepGC TestGCBasherWithCMS 120000 */ diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/gc/stress/gcbasher/TestGCBasherWithG1.java --- a/hotspot/test/gc/stress/gcbasher/TestGCBasherWithG1.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/gc/stress/gcbasher/TestGCBasherWithG1.java Wed Jan 18 08:30:02 2017 +0000 @@ -29,7 +29,7 @@ * @key gc * @key stress * @requires vm.gc.G1 - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @summary Stress the G1 GC by trying to make old objects more likely to be garbage than young objects. * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx256m -server -XX:+UseG1GC TestGCBasherWithG1 120000 */ diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/gc/stress/gcbasher/TestGCBasherWithParallel.java --- a/hotspot/test/gc/stress/gcbasher/TestGCBasherWithParallel.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/gc/stress/gcbasher/TestGCBasherWithParallel.java Wed Jan 18 08:30:02 2017 +0000 @@ -29,7 +29,7 @@ * @key gc * @key stress * @requires vm.gc.Parallel - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @summary Stress the Parallel GC by trying to make old objects more likely to be garbage than young objects. * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx256m -server -XX:+UseParallelGC -XX:-UseGCOverheadLimit TestGCBasherWithParallel 120000 */ diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/gc/stress/gcbasher/TestGCBasherWithSerial.java --- a/hotspot/test/gc/stress/gcbasher/TestGCBasherWithSerial.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/gc/stress/gcbasher/TestGCBasherWithSerial.java Wed Jan 18 08:30:02 2017 +0000 @@ -29,7 +29,7 @@ * @key gc * @key stress * @requires vm.gc.Serial - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @summary Stress the Serial GC by trying to make old objects more likely to be garbage than young objects. * @run main/othervm/timeout=200 -Xlog:gc*=info -Xmx256m -server -XX:+UseSerialGC TestGCBasherWithSerial 120000 */ diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java --- a/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/runtime/CDSCompressedKPtrs/XShareAuto.java Wed Jan 18 08:30:02 2017 +0000 @@ -48,8 +48,9 @@ "-server", "-XX:+UnlockDiagnosticVMOptions", "-XX:SharedArchiveFile=./XShareAuto.jsa", "-version"); output = new OutputAnalyzer(pb.start()); + String outputString = output.getOutput(); // We asked for server but it could be aliased to something else - if (output.getOutput().contains("Server VM")) { + if (outputString.contains("Server VM") && !outputString.contains("emulated-client")) { // In server case we don't expect to see sharing flag output.shouldNotContain("sharing"); output.shouldHaveExitValue(0); diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/runtime/ReservedStack/ReservedStackTestCompiler.java --- a/hotspot/test/runtime/ReservedStack/ReservedStackTestCompiler.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/runtime/ReservedStack/ReservedStackTestCompiler.java Wed Jan 18 08:30:02 2017 +0000 @@ -24,7 +24,7 @@ /* * @test ReservedStackTestCompiler * @summary Run ReservedStackTest with dedicated compilers C1 and C2. - * @requires vm.flavor == "server" + * @requires vm.flavor == "server" & !vm.emulatedClient * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/serviceability/dcmd/compiler/CompilerDirectivesDCMDTest.java --- a/hotspot/test/serviceability/dcmd/compiler/CompilerDirectivesDCMDTest.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/serviceability/dcmd/compiler/CompilerDirectivesDCMDTest.java Wed Jan 18 08:30:02 2017 +0000 @@ -49,7 +49,7 @@ public void run(CommandExecutor executor) { - if (Platform.isServer()) { + if (Platform.isServer() && !Platform.isEmulatedClient()) { filename = System.getProperty("test.src", ".") + File.separator + "control2.txt"; } else { filename = System.getProperty("test.src", ".") + File.separator + "control1.txt"; diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java --- a/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java Wed Jan 18 08:30:02 2017 +0000 @@ -101,10 +101,12 @@ INITIAL_COMP_LEVEL = 1; } else { String vmName = System.getProperty("java.vm.name"); - if (Utils.endsWithIgnoreCase(vmName, " Server VM")) { + String vmInfo = System.getProperty("java.vm.info"); + boolean isEmulatedClient = (vmInfo != null) && vmInfo.contains("emulated-client"); + if (Utils.endsWithIgnoreCase(vmName, " Server VM") && !isEmulatedClient) { INITIAL_COMP_LEVEL = 4; } else if (Utils.endsWithIgnoreCase(vmName, " Client VM") - || Utils.endsWithIgnoreCase(vmName, " Minimal VM")) { + || Utils.endsWithIgnoreCase(vmName, " Minimal VM") || isEmulatedClient) { INITIAL_COMP_LEVEL = 1; } else { throw new RuntimeException("Unknown VM: " + vmName); diff -r ff64053e7c5f -r 617ed26c48d2 hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java --- a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java Wed Jan 18 08:54:29 2017 +0100 +++ b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java Wed Jan 18 08:30:02 2017 +0000 @@ -50,7 +50,7 @@ OS("isAix", "isLinux", "isOSX", "isSolaris", "isWindows"), VM_TYPE("isClient", "isServer", "isGraal", "isMinimal", "isZero", "isEmbedded"), MODE("isInt", "isMixed", "isComp"), - IGNORED("isDebugBuild", "isFastDebugBuild", "isSlowDebugBuild", + IGNORED("isEmulatedClient", "isDebugBuild", "isFastDebugBuild", "isSlowDebugBuild", "shouldSAAttach", "canPtraceAttachLinux", "canAttachOSX", "isTieredSupported");