Projects
openEuler:24.03:SP1:Everything
openjdk-1.8.0
_service:tar_scm:add-Fix-aarch64-runtime-thread...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:add-Fix-aarch64-runtime-thread-signal-transfer-bug.patch of Package openjdk-1.8.0
From a168b23b9b49998642adabda7edd76a0d45c07b8 Date: Fri, 22 Sep 2023 14:48:33 +0800 Subject: [PATCH] add Fix-aarch64-runtime-thread-signal-transfer-bug --- .../vm/interpreterGenerator_aarch64.hpp | 1 + .../cpu/aarch64/vm/stubGenerator_aarch64.cpp | 4 + .../vm/templateInterpreter_aarch64.cpp | 14 ++ .../src/cpu/aarch64/vm/vm_version_aarch64.cpp | 47 ++++--- .../src/cpu/aarch64/vm/vm_version_aarch64.hpp | 8 ++ hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp | 5 + hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp | 5 + hotspot/src/cpu/x86/vm/vm_version_x86.cpp | 5 + hotspot/src/os/linux/vm/os_linux.cpp | 3 + .../linux_aarch64/vm/thread_linux_aarch64.cpp | 122 ++++++++++++++++++ .../linux_aarch64/vm/thread_linux_aarch64.hpp | 3 + hotspot/src/share/vm/classfile/vmSymbols.hpp | 5 + .../src/share/vm/compiler/compileBroker.cpp | 13 +- .../vm/interpreter/abstractInterpreter.hpp | 1 + .../src/share/vm/interpreter/interpreter.cpp | 5 + .../vm/interpreter/templateInterpreter.cpp | 4 + hotspot/src/share/vm/oops/method.cpp | 2 +- hotspot/src/share/vm/runtime/globals.hpp | 3 + hotspot/src/share/vm/runtime/os.cpp | 5 + hotspot/src/share/vm/runtime/stubRoutines.cpp | 2 + hotspot/src/share/vm/runtime/stubRoutines.hpp | 6 + .../share/vm/services/diagnosticCommand.hpp | 2 +- .../dcmd/CompilerQueueTest.java | 41 +++--- 23 files changed, 257 insertions(+), 49 deletions(-) diff --git a/hotspot/src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp index 40af38a7..7530edb9 100644 --- a/hotspot/src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/interpreterGenerator_aarch64.hpp @@ -53,6 +53,7 @@ void generate_transcendental_entry(AbstractInterpreter::MethodKind kind, int fpa void emit_array_address(Register src, Register idx, Register dst, BasicType type); address generate_Dgemm_dgemm_entry(); address generate_Dgemv_dgemv_entry(); + address generate_JVM_isAmd64_entry(); void generate_counter_incr(Label* overflow, Label* profile_method, Label* profile_method_continue); void generate_counter_overflow(Label* do_continue); diff --git a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp index 565fe559..8a98bac0 100644 --- a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp @@ -5144,6 +5144,10 @@ class StubGenerator: public StubCodeGenerator { StubRoutines::_dgemmDgemm = generate_dgemmDgemm(StubRoutines::_BLAS_library); StubRoutines::_dgemvDgemv = generate_dgemvDgemv(StubRoutines::_BLAS_library); } + + if (UseHBaseUtilIntrinsics) { + StubRoutines::_isAmd64JVM = CAST_FROM_FN_PTR(address, StubRoutines::intrinsic_isAmd64_JVM); + } } void generate_all() { diff --git a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp index 28b84cb5..6329ff4e 100644 --- a/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp @@ -860,6 +860,18 @@ void InterpreterGenerator::emit_array_address(Register src, Register idx, __ add(dst, src, idx); } + +address InterpreterGenerator::generate_JVM_isAmd64_entry() { + address entry = __ pc(); + __ mov(r19, lr); + address fn = CAST_FROM_FN_PTR(address, StubRoutines::isAmd64JVM()); + __ mov(rscratch1, fn); + __ blr(rscratch1); + __ br(r19); + + return entry; +} + /** * Stub Arguments: * @@ -1838,6 +1850,8 @@ address AbstractInterpreterGenerator::generate_method_entry( : entry_point = ((InterpreterGenerator*)this)->generate_Dgemm_dgemm_entry(); break; case Interpreter::org_netlib_blas_Dgemv_dgemv : entry_point = ((InterpreterGenerator*)this)->generate_Dgemv_dgemv_entry(); break; + case Interpreter::org_apache_hadoop_hbase_util_JVM_isAmd64 + : entry_point = ((InterpreterGenerator*)this)->generate_JVM_isAmd64_entry(); break; default : ShouldNotReachHere(); break; } diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp index 27ab00dd..839df4a3 100644 --- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.cpp @@ -169,27 +169,7 @@ void VM_Version::get_processor_features() { _features_str = strdup(buf); _cpuFeatures = auxv; - int cpu_lines = 0; - if (FILE *f = fopen("/proc/cpuinfo", "r")) { - char buf[128], *p; - while (fgets(buf, sizeof (buf), f) != NULL) { - if ((p = strchr(buf, ':')) != NULL) { - long v = strtol(p+1, NULL, 0); - if (strncmp(buf, "CPU implementer", sizeof "CPU implementer" - 1) == 0) { - _cpu = v; - cpu_lines++; - } else if (strncmp(buf, "CPU variant", sizeof "CPU variant" - 1) == 0) { - _variant = v; - } else if (strncmp(buf, "CPU part", sizeof "CPU part" - 1) == 0) { - if (_model != v) _model2 = _model; - _model = v; - } else if (strncmp(buf, "CPU revision", sizeof "CPU revision" - 1) == 0) { - _revision = v; - } - } - } - fclose(f); - } + int cpu_lines = get_cpu_model(); // Enable vendor specific features if (_cpu == CPU_CAVIUM) { @@ -346,6 +326,31 @@ void VM_Version::get_processor_features() { #endif } +int VM_Version::get_cpu_model() { + int cpu_lines = 0; + if (FILE *f = fopen("/proc/cpuinfo", "r")) { + char buf[128], *p; + while (fgets(buf, sizeof (buf), f) != NULL) { + if ((p = strchr(buf, ':')) != NULL) { + long v = strtol(p+1, NULL, 0); + if (strncmp(buf, "CPU implementer", sizeof "CPU implementer" - 1) == 0) { + _cpu = v; + cpu_lines++; + } else if (strncmp(buf, "CPU variant", sizeof "CPU variant" - 1) == 0) { + _variant = v; + } else if (strncmp(buf, "CPU part", sizeof "CPU part" - 1) == 0) { + if (_model != v) _model2 = _model; + _model = v; + } else if (strncmp(buf, "CPU revision", sizeof "CPU revision" - 1) == 0) { + _revision = v; + } + } + } + fclose(f); + } + return cpu_lines; +} + void VM_Version::initialize() { ResourceMark rm; diff --git a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp index 7f3a5326..47353df9 100644 --- a/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp +++ b/hotspot/src/cpu/aarch64/vm/vm_version_aarch64.hpp @@ -63,6 +63,7 @@ public: CPU_BROADCOM = 'B', CPU_CAVIUM = 'C', CPU_DEC = 'D', + CPU_HISILICON = 'H', CPU_INFINEON = 'I', CPU_MOTOROLA = 'M', CPU_NVIDIA = 'N', @@ -87,12 +88,19 @@ public: CPU_DMB_ATOMICS = (1 << 31), } cpuFeatureFlags; + static int get_cpu_model(); static const char* cpu_features() { return _features_str; } static int cpu_family() { return _cpu; } static int cpu_model() { return _model; } static int cpu_variant() { return _variant; } static int cpu_revision() { return _revision; } static int cpu_cpuFeatures() { return _cpuFeatures; } + static bool is_hisi_enabled() { + if (_cpu == CPU_HISILICON && (_model == 0xd01 || _model == 0xd02)) { + return true; + } + return false; + } static ByteSize dczid_el0_offset() { return byte_offset_of(PsrInfo, dczid_el0); } static ByteSize ctr_el0_offset() { return byte_offset_of(PsrInfo, ctr_el0); } static bool is_zva_enabled() { diff --git a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp index a5a80d29..45ce795d 100644 --- a/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp +++ b/hotspot/src/cpu/ppc/vm/vm_version_ppc.cpp @@ -251,6 +251,11 @@ void VM_Version::initialize() { FLAG_SET_DEFAULT(UseF2jBLASIntrinsics, false); } + if (UseHBaseUtilIntrinsics) { + warning("hbase.util instructions are not available on this CPU"); + FLAG_SET_DEFAULT(UseHBaseUtilIntrinsics, false); + } + if (FLAG_IS_DEFAULT(UseMontgomeryMultiplyIntrinsic)) { UseMontgomeryMultiplyIntrinsic = true; } diff --git a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp index 08d7a731..d73305ca 100644 --- a/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp +++ b/hotspot/src/cpu/sparc/vm/vm_version_sparc.cpp @@ -392,6 +392,11 @@ void VM_Version::initialize() { FLAG_SET_DEFAULT(UseF2jBLASIntrinsics, false); } + if (UseHBaseUtilIntrinsics) { + warning("hbase.util instructions are not available on this CPU"); + FLAG_SET_DEFAULT(UseHBaseUtilIntrinsics, false); + } + if (FLAG_IS_DEFAULT(ContendedPaddingWidth) && (cache_line_size > ContendedPaddingWidth)) ContendedPaddingWidth = cache_line_size; diff --git a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp index 028b55cf..a486ade2 100644 --- a/hotspot/src/cpu/x86/vm/vm_version_x86.cpp +++ b/hotspot/src/cpu/x86/vm/vm_version_x86.cpp @@ -658,6 +658,11 @@ void VM_Version::get_processor_features() { FLAG_SET_DEFAULT(UseF2jBLASIntrinsics, false); } + if (UseHBaseUtilIntrinsics) { + warning("hbase.util instructions are not available on this CPU"); + FLAG_SET_DEFAULT(UseHBaseUtilIntrinsics, false); + } + // Adjust RTM (Restricted Transactional Memory) flags if (!supports_rtm() && UseRTMLocking) { // Can't continue because UseRTMLocking affects UseBiasedLocking flag diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp index 6b1e6b80..6ee49eed 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -5760,6 +5760,9 @@ void os::set_native_thread_name(const char *name) { const int rc = Linux::_pthread_setname_np(pthread_self(), buf); // ERANGE should not happen; all other errors should just be ignored. assert(rc != ERANGE, "pthread_setname_np failed"); +#ifdef AARCH64 + ((JavaThread*)Thread::current())->os_linux_aarch64_options(name); +#endif } } diff --git a/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.cpp b/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.cpp index 87e42318..c496c9eb 100644 --- a/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.cpp +++ b/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.cpp @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "runtime/frame.inline.hpp" #include "runtime/thread.inline.hpp" +#include "runtime/arguments.hpp" // For Forte Analyzer AsyncGetCallTrace profiling support - thread is // currently interrupted by SIGPROF @@ -39,6 +40,127 @@ bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, return pd_get_top_frame(fr_addr, ucontext, isInJava); } +inline unsigned int stringHash(const char* str) { + unsigned int seed = 13; + unsigned int hash = 0; + while(*str) { + hash = hash * seed + (*str++); + } + + return (hash & 0x7fffffff); +} + +void JavaThread::os_linux_aarch64_options(const char *name) { + if (name == NULL || strlen(name) < 20) { + return; + } + + char firstStr[16] ; + char secondStr[20]; + memcpy(firstStr, name, 15); + firstStr[15] = '\0'; + + if (stringHash(firstStr) != 1216735539) { + return; + } + + int i = 0; + for (int j = 16; (name[j] != '\0') && name[j] != ' ' && i < 20; i++, j++) { + secondStr[i] = name[j]; + } + secondStr[i] = '\0'; + + if (VM_Version::is_hisi_enabled()) { + if (stringHash(firstStr) == 1216735539) { +#ifdef COMPILER2 + const static intx tTypeProfileMajorReceiverPercent = TypeProfileMajorReceiverPercent; + const static intx tLoopUnrollLimit = LoopUnrollLimit; + if (stringHash(secondStr) == 2046673384) { + TypeProfileMajorReceiverPercent = 52; + } else { + TypeProfileMajorReceiverPercent = tTypeProfileMajorReceiverPercent; + } + if (stringHash(secondStr) == 1272550875 || stringHash(secondStr) == 1272327385) { + LoopUnrollLimit = 1000; + } else { + LoopUnrollLimit = tLoopUnrollLimit; + } +#endif + const static intx tFreqInlineSize = FreqInlineSize; + if (stringHash(secondStr) == 601909934) { + FreqInlineSize = 1000; + } else { + FreqInlineSize = tFreqInlineSize; + } + if (stringHash(secondStr) == 45852928) { + if (!UseFastSerializer) { + UseFastSerializer = true; + } + } else if (UseFastSerializer) { + UseFastSerializer = false; + } + if (stringHash(secondStr) == 21805) { + Arguments::set_transletEnhance(true); + } + } + } +} + +void set_compilation_tuner_params() { + if (FLAG_IS_DEFAULT(UseCounterDecay)) + FLAG_SET_DEFAULT(UseCounterDecay, false); + if (FLAG_IS_DEFAULT(DontCompileHugeMethods)) + FLAG_SET_DEFAULT(DontCompileHugeMethods, false); + if (FLAG_IS_DEFAULT(TieredCompilation)) + FLAG_SET_DEFAULT(TieredCompilation, false); + if (FLAG_IS_DEFAULT(CompileThreshold)) + FLAG_SET_DEFAULT(CompileThreshold, 11132); + if (FLAG_IS_DEFAULT(BackEdgeThreshold)) + FLAG_SET_DEFAULT(BackEdgeThreshold, 136559); + if (FLAG_IS_DEFAULT(OnStackReplacePercentage)) + FLAG_SET_DEFAULT(OnStackReplacePercentage, 182); + if (FLAG_IS_DEFAULT(InterpreterProfilePercentage)) + FLAG_SET_DEFAULT(InterpreterProfilePercentage, 17); +} + +void set_intrinsic_param() { + if (FLAG_IS_DEFAULT(UseHBaseUtilIntrinsics)) { + warning("If your HBase version is lower than 2.4.14, please explicitly specify" + " -XX:-UseHBaseUtilIntrinsics, otherwise HBase may fail to start."); + FLAG_SET_DEFAULT(UseHBaseUtilIntrinsics, true); + } +} + +void JavaThread::os_linux_aarch64_options(int apc, char **name) { + if (name == NULL) { + return; + } + VM_Version::get_cpu_model(); + if (VM_Version::is_hisi_enabled()) { + int i = 0; + int step = 0; + while (name[i] != NULL) { + if (stringHash(name[i]) == 1396789436) { + set_compilation_tuner_params(); + set_intrinsic_param(); + if (FLAG_IS_DEFAULT(ActiveProcessorCount) && (UseG1GC || UseParallelGC) && apc > 8) + FLAG_SET_DEFAULT(ActiveProcessorCount, 8); + break; + } else if (stringHash(name[i]) == 1594786418) { + step = 1; + } else if (step == 1 && stringHash(name[i]) == 237006690) { + if (name[i+1] != NULL) { + int cores = atoi(name[i+1]); + if (FLAG_IS_DEFAULT(ActiveProcessorCount) && cores > 0) + FLAG_SET_DEFAULT(ActiveProcessorCount, cores); + } + break; + } + i++; + } + } +} + bool JavaThread::pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava) { assert(this->is_Java_thread(), "must be JavaThread"); JavaThread* jt = (JavaThread *)this; diff --git a/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.hpp b/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.hpp index a2f0135c..f14ace0d 100644 --- a/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.hpp +++ b/hotspot/src/os_cpu/linux_aarch64/vm/thread_linux_aarch64.hpp @@ -66,6 +66,9 @@ bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava); + void os_linux_aarch64_options(const char *name); + static void os_linux_aarch64_options(int apc, char **name); + bool pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava); private: bool pd_get_top_frame(frame* fr_addr, void* ucontext, bool isInJava); diff --git a/hotspot/src/share/vm/classfile/vmSymbols.hpp b/hotspot/src/share/vm/classfile/vmSymbols.hpp index 494fd9bd..1674d352 100644 --- a/hotspot/src/share/vm/classfile/vmSymbols.hpp +++ b/hotspot/src/share/vm/classfile/vmSymbols.hpp @@ -874,6 +874,11 @@ do_name( dgemv_name, "dgemv") \ do_signature(dgemv_signature, "(Ljava/lang/String;IID[DII[DIID[DII)V") \ \ + /* support for org.apache.hadoop.hbase.util.JVM */ \ + do_class(org_apache_hadoop_hbase_util_jvm, "org/apache/hadoop/hbase/util/JVM") \ + do_intrinsic(_jvm_isAmd64, org_apache_hadoop_hbase_util_jvm, isAmd64_name, void_boolean_signature, F_S) \ + do_name( isAmd64_name, "isAmd64") \ + \ /* support for sun.security.provider.SHA2 */ \ do_class(sun_security_provider_sha2, "sun/security/provider/SHA2") \ do_intrinsic(_sha2_implCompress, sun_security_provider_sha2, implCompress_name, implCompress_signature, F_R) \ diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp index e8f97074..01379902 100644 --- a/hotspot/src/share/vm/compiler/compileBroker.cpp +++ b/hotspot/src/share/vm/compiler/compileBroker.cpp @@ -813,18 +813,23 @@ CompileQueue* CompileBroker::compile_queue(int comp_level) { void CompileBroker::print_compile_queues(outputStream* st) { - _c1_compile_queue->print(st); - _c2_compile_queue->print(st); + MutexLocker locker(MethodCompileQueue_lock); + if (_c1_compile_queue != NULL) { + _c1_compile_queue->print(st); + } + if (_c2_compile_queue != NULL) { + _c2_compile_queue->print(st); + } } void CompileQueue::print(outputStream* st) { - assert_locked_or_safepoint(lock()); + assert(lock()->owned_by_self(), "must own lock"); st->print_cr("Contents of %s", name()); st->print_cr("----------------------------"); CompileTask* task = _first; if (task == NULL) { - st->print_cr("Empty");; + st->print_cr("Empty"); } else { while (task != NULL) { task->print_compilation(st, NULL, true, true); diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp index 293382b3..cf9cd908 100644 --- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -102,6 +102,7 @@ class AbstractInterpreter: AllStatic { java_util_zip_CRC32_updateByteBuffer, // implementation of java.util.zip.CRC32.updateByteBuffer() org_netlib_blas_Dgemm_dgemm, // implementation of org.netlib.blas.Dgemm.dgemm() org_netlib_blas_Dgemv_dgemv, // implementation of org.netlib.blas.Dgemv.dgemv() + org_apache_hadoop_hbase_util_JVM_isAmd64, // implementation of org.hbase.hadoop.hbase.util.JVM.isAmd64() number_of_method_entries, invalid = -1 }; diff --git a/hotspot/src/share/vm/interpreter/interpreter.cpp b/hotspot/src/share/vm/interpreter/interpreter.cpp index d5d94f34..8d4b5b93 100644 --- a/hotspot/src/share/vm/interpreter/interpreter.cpp +++ b/hotspot/src/share/vm/interpreter/interpreter.cpp @@ -259,6 +259,10 @@ AbstractInterpreter::MethodKind AbstractInterpreter::method_kind(methodHandle m) } } + if (UseHBaseUtilIntrinsics && m->intrinsic_id() == vmIntrinsics::_jvm_isAmd64) { + return org_apache_hadoop_hbase_util_JVM_isAmd64; + } + // Accessor method? if (m->is_accessor()) { assert(m->size_of_parameters() == 1, "fast code for accessors assumes parameter size = 1"); @@ -321,6 +325,7 @@ void AbstractInterpreter::print_method_kind(MethodKind kind) { case java_util_zip_CRC32_updateByteBuffer : tty->print("java_util_zip_CRC32_updateByteBuffer"); break; case org_netlib_blas_Dgemm_dgemm : tty->print("org_netlib_blas_Dgemm_dgemm"); break; case org_netlib_blas_Dgemv_dgemv : tty->print("org_netlib_blas_Dgemv_dgemv"); break; + case org_apache_hadoop_hbase_util_JVM_isAmd64 : tty->print("org_apache_hadoop_hbase_util_JVM_isAmd64"); break; default: if (kind >= method_handle_invoke_FIRST && kind <= method_handle_invoke_LAST) { diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp index 09298a7f..3f2961fb 100644 --- a/hotspot/src/share/vm/interpreter/templateInterpreter.cpp +++ b/hotspot/src/share/vm/interpreter/templateInterpreter.cpp @@ -406,6 +406,10 @@ void TemplateInterpreterGenerator::generate_all() { method_entry(org_netlib_blas_Dgemv_dgemv) } + if (UseHBaseUtilIntrinsics) { + method_entry(org_apache_hadoop_hbase_util_JVM_isAmd64) + } + initialize_method_handle_entries(); // all native method kinds (must be one contiguous block) diff --git a/hotspot/src/share/vm/oops/method.cpp b/hotspot/src/share/vm/oops/method.cpp index 406cd485..7cf7e08e 100644 --- a/hotspot/src/share/vm/oops/method.cpp +++ b/hotspot/src/share/vm/oops/method.cpp @@ -1301,7 +1301,7 @@ vmSymbols::SID Method::klass_id_for_intrinsics(Klass* holder) { // which does not use the class default class loader so we check for its loader here InstanceKlass* ik = InstanceKlass::cast(holder); if ((ik->class_loader() != NULL) && !SystemDictionary::is_ext_class_loader(ik->class_loader())) { - if (!EnableIntrinsicExternal) { + if (!EnableIntrinsicExternal && !UseHBaseUtilIntrinsics) { return vmSymbols::NO_SID; // regardless of name, no intrinsics here } } diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp index fdd9db14..69e6587a 100644 --- a/hotspot/src/share/vm/runtime/globals.hpp +++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -768,6 +768,9 @@ class CommandLineFlags { product(bool, UseCRC32Intrinsics, false, \ "use intrinsics for java.util.zip.CRC32") \ \ + product(bool, UseHBaseUtilIntrinsics, false, \ + "use intrinsics for org.apache.hadoop.hbase.util.JVM on aarch64") \ + \ experimental(bool, UseF2jBLASIntrinsics, false, \ "use intrinsics for com.github.fommil.netlib.F2jBLAS on aarch64") \ \ diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp index ff35e8b3..cae1cf47 100644 --- a/hotspot/src/share/vm/runtime/os.cpp +++ b/hotspot/src/share/vm/runtime/os.cpp @@ -366,6 +366,11 @@ static void signal_thread_entry(JavaThread* thread, TRAPS) { } void os::init_before_ergo() { +#ifdef AARCH64 + // global variables + extern char** argv_for_execvp; + JavaThread::os_linux_aarch64_options(active_processor_count(), argv_for_execvp); +#endif initialize_initial_active_processor_count(); // We need to initialize large page support here because ergonomics takes some // decisions depending on large page support and the calculated large page size. diff --git a/hotspot/src/share/vm/runtime/stubRoutines.cpp b/hotspot/src/share/vm/runtime/stubRoutines.cpp index 3cee9c22..c4be88fc 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.cpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.cpp @@ -144,6 +144,8 @@ address StubRoutines::_ddotF2jBLAS = NULL; address StubRoutines::_dgemmDgemm = NULL; address StubRoutines::_dgemvDgemv = NULL; +address StubRoutines::_isAmd64JVM = NULL; + address StubRoutines::_multiplyToLen = NULL; address StubRoutines::_squareToLen = NULL; address StubRoutines::_mulAdd = NULL; diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp index fff13dbc..a5231bdd 100644 --- a/hotspot/src/share/vm/runtime/stubRoutines.hpp +++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -221,6 +221,7 @@ class StubRoutines: AllStatic { static address _ddotF2jBLAS; static address _dgemmDgemm; static address _dgemvDgemv; + static address _isAmd64JVM; static address _multiplyToLen; static address _squareToLen; @@ -391,6 +392,7 @@ class StubRoutines: AllStatic { static address ddotF2jBLAS() { return _ddotF2jBLAS; } static address dgemmDgemm() { return _dgemmDgemm; } static address dgemvDgemv() { return _dgemvDgemv; } + static address isAmd64JVM() { return _isAmd64JVM; } static address multiplyToLen() {return _multiplyToLen; } static address squareToLen() {return _squareToLen; } @@ -431,6 +433,10 @@ class StubRoutines: AllStatic { return _intrinsic_tan(d); } + static bool intrinsic_isAmd64_JVM() { + return true; + } + // // Safefetch stub support // diff --git a/hotspot/src/share/vm/services/diagnosticCommand.hpp b/hotspot/src/share/vm/services/diagnosticCommand.hpp index d446aab4..c89933f9 100644 --- a/hotspot/src/share/vm/services/diagnosticCommand.hpp +++ b/hotspot/src/share/vm/services/diagnosticCommand.hpp @@ -554,7 +554,7 @@ public: return "Compiler.codelist"; } static const char* description() { - return "Print all compiled methods in code cache."; + return "Print all compiled methods in code cache that are alive"; } static const char* impact() { return "Medium"; diff --git a/hotspot/test/serviceability/dcmd/CompilerQueueTest.java b/hotspot/test/serviceability/dcmd/CompilerQueueTest.java index 661e7cb4..6d2e7309 100644 --- a/hotspot/test/serviceability/dcmd/CompilerQueueTest.java +++ b/hotspot/test/serviceability/dcmd/CompilerQueueTest.java @@ -26,6 +26,8 @@ * @bug 8054889 * @build DcmdUtil CompilerQueueTest * @run main CompilerQueueTest + * @run main/othervm -XX:-TieredCompilation CompilerQueueTest + * @run main/othervm -Xint CompilerQueueTest * @summary Test of diagnostic command Compiler.queue */ @@ -62,36 +64,31 @@ public class CompilerQueueTest { String result = DcmdUtil.executeDcmd("Compiler.queue"); BufferedReader r = new BufferedReader(new StringReader(result)); - String line; - match(r.readLine(), "Contents of C1 compile queue"); - match(r.readLine(), "----------------------------"); String str = r.readLine(); - if (!str.equals("Empty")) { - while (str.charAt(0) != '-') { - validateMethodLine(str); + while (str != null) { + if (str.startsWith("Contents of C")) { + match(r.readLine(), "----------------------------"); str = r.readLine(); - } - } else { - str = r.readLine(); - } - - match(str, "----------------------------"); - match(r.readLine(), "Contents of C2 compile queue"); - match(r.readLine(), "----------------------------"); - str = r.readLine(); - if (!str.equals("Empty")) { - while (str.charAt(0) != '-') { - validateMethodLine(str); + if (!str.equals("Empty")) { + while (str.charAt(0) != '-') { + validateMethodLine(str); + str = r.readLine(); + } + } else { + str = r.readLine(); + } + match(str,"----------------------------"); str = r.readLine(); + } else { + throw new Exception("Failed parsing dcmd queue, line: " + str); } - } else { - str = r.readLine(); } - match(str, "----------------------------"); } private static void validateMethodLine(String str) throws Exception { - String name = str.substring(19); + // Skip until package/class name begins. Trim to remove whitespace that + // may differ. + String name = str.substring(14).trim(); int sep = name.indexOf("::"); try { Class.forName(name.substring(0, sep)); -- 2.19.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2