diff --git a/8014628-Support-AES-Encryption-with-HMAC-SHA2-for-Ke.patch b/8014628-Support-AES-Encryption-with-HMAC-SHA2-for-Ke.patch index 148c5aec8f9a0b602caa90520c14c5242e55cd65..08411fd6f00c8cf19db13e61916c1528e037fbc9 100644 --- a/8014628-Support-AES-Encryption-with-HMAC-SHA2-for-Ke.patch +++ b/8014628-Support-AES-Encryption-with-HMAC-SHA2-for-Ke.patch @@ -1954,13 +1954,13 @@ index 6413e155b..b59832f73 100644 /* * @test -- * @bug 7152176 -+ * @bug 7152176 8014628 +- * @bug 7152176 8168518 ++ * @bug 7152176 8168518 8014628 * @summary More krb5 tests * @library ../../../../java/security/testlibrary/ * @compile -XDignore.symbol.file ReplayCacheTestProc.java -@@ -95,8 +95,13 @@ public class ReplayCacheTestProc { - kdc.addPrincipalRandKey(peer(i)); +@@ -126,8 +126,13 @@ public class ReplayCacheTestProc { + kdc.addPrincipalRandKey(service(i)); } + // Native lib might not support aes-sha2 @@ -1972,8 +1972,8 @@ index 6413e155b..b59832f73 100644 kdc.writeKtab(OneKDC.KTAB); - KDC.saveConfig(OneKDC.KRB5_CONF, kdc); - if (mode != -1) { - // A special native server to check basic sanity + // User-provided libs + String userLibs = System.getProperty("test.libs"); diff --git a/jdk/test/sun/security/krb5/etype/ETypeOrder.java b/jdk/test/sun/security/krb5/etype/ETypeOrder.java index 9437b16ed..be36d6372 100644 --- a/jdk/test/sun/security/krb5/etype/ETypeOrder.java diff --git a/8057743-process-Synchronize-exiting-of-threads-and-p.patch b/8057743-process-Synchronize-exiting-of-threads-and-p.patch index 25c783e438eaeeb562ae3d7c591cde28fee7c8ff..2dbe3502a81cda95f2a1467308821264d0e70c3c 100644 --- a/8057743-process-Synchronize-exiting-of-threads-and-p.patch +++ b/8057743-process-Synchronize-exiting-of-threads-and-p.patch @@ -259,7 +259,7 @@ diff --git a/hotspot/src/os/windows/vm/os_windows.inline.hpp b/hotspot/src/os/wi index 5dac11c90..83c51935d 100644 --- a/hotspot/src/os/windows/vm/os_windows.inline.hpp +++ b/hotspot/src/os/windows/vm/os_windows.inline.hpp -@@ -96,6 +96,10 @@ inline int os::close(int fd) { +@@ -96,4 +96,8 @@ inline int os::close(int fd) { return ::close(fd); } @@ -267,9 +267,7 @@ index 5dac11c90..83c51935d 100644 + win32::exit_process_or_thread(win32::EPT_PROCESS, num); +} + - #define CALL_TEST_FUNC_WITH_WRAPPER_IF_NEEDED(f) \ - os::win32::call_test_func_with_wrapper(f) - + #endif // OS_WINDOWS_VM_OS_WINDOWS_INLINE_HPP diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp index 5b82a7a36..c72a5a766 100644 --- a/hotspot/src/share/vm/runtime/java.cpp diff --git a/8138922-StubCodeDesc-constructor-publishes-partially-constructed.patch b/8138922-StubCodeDesc-constructor-publishes-partially-constructed.patch new file mode 100644 index 0000000000000000000000000000000000000000..c95b6b3f827849383fdba039148ab759de75a4ac --- /dev/null +++ b/8138922-StubCodeDesc-constructor-publishes-partially-constructed.patch @@ -0,0 +1,176 @@ +diff --git a/hotspot/src/share/vm/code/codeBlob.cpp b/hotspot/src/share/vm/code/codeBlob.cpp +index aff2aaf0c..83a7659a3 100644 +--- a/hotspot/src/share/vm/code/codeBlob.cpp ++++ b/hotspot/src/share/vm/code/codeBlob.cpp +@@ -337,6 +337,9 @@ MethodHandlesAdapterBlob* MethodHandlesAdapterBlob::create(int buffer_size) { + // This means that CodeCacheMinimumFreeSpace is used, if necessary + const bool is_critical = true; + blob = new (size, is_critical) MethodHandlesAdapterBlob(size); ++ if (blob == NULL) { ++ vm_exit_out_of_memory(size, OOM_MALLOC_ERROR, "CodeCache: no room for method handle adapter blob"); ++ } + } + // Track memory usage statistic after releasing CodeCache_lock + MemoryService::track_code_cache_memory_usage(); +diff --git a/hotspot/src/share/vm/prims/methodHandles.cpp b/hotspot/src/share/vm/prims/methodHandles.cpp +index 231d62d29..63f333db2 100644 +--- a/hotspot/src/share/vm/prims/methodHandles.cpp ++++ b/hotspot/src/share/vm/prims/methodHandles.cpp +@@ -1469,19 +1469,6 @@ static JNINativeMethod MH_methods[] = { + {CC "invokeExact", CC "([" OBJ ")" OBJ, FN_PTR(MH_invokeExact_UOE)} + }; + +-/** +- * Helper method to register native methods. +- */ +-static bool register_natives(JNIEnv* env, jclass clazz, const JNINativeMethod* methods, jint nMethods) { +- int status = env->RegisterNatives(clazz, methods, nMethods); +- if (status != JNI_OK || env->ExceptionOccurred()) { +- warning("JSR 292 method handle code is mismatched to this JVM. Disabling support."); +- env->ExceptionClear(); +- return false; +- } +- return true; +-} +- + /** + * This one function is exported, used by NativeLookup. + */ +@@ -1492,34 +1479,27 @@ JVM_ENTRY(void, JVM_RegisterMethodHandleMethods(JNIEnv *env, jclass MHN_class)) + } + + assert(!MethodHandles::enabled(), "must not be enabled"); +- bool enable_MH = true; ++ if (!EnableInvokeDynamic || SystemDictionary::MethodHandle_klass() == NULL) return; + +- jclass MH_class = NULL; +- if (SystemDictionary::MethodHandle_klass() == NULL) { +- enable_MH = false; +- } else { +- oop mirror = SystemDictionary::MethodHandle_klass()->java_mirror(); +- MH_class = (jclass) JNIHandles::make_local(env, mirror); +- } ++ oop mirror = SystemDictionary::MethodHandle_klass()->java_mirror(); ++ jclass MH_class = (jclass) JNIHandles::make_local(env, mirror); + +- if (enable_MH) { ++ { + ThreadToNativeFromVM ttnfv(thread); + +- if (enable_MH) { +- enable_MH = register_natives(env, MHN_class, MHN_methods, sizeof(MHN_methods)/sizeof(JNINativeMethod)); +- } +- if (enable_MH) { +- enable_MH = register_natives(env, MH_class, MH_methods, sizeof(MH_methods)/sizeof(JNINativeMethod)); +- } ++ int status = env->RegisterNatives(MHN_class, MHN_methods, sizeof(MHN_methods)/sizeof(JNINativeMethod)); ++ guarantee(status == JNI_OK && !env->ExceptionOccurred(), ++ "register java.lang.invoke.MethodHandleNative natives"); ++ ++ status = env->RegisterNatives(MH_class, MH_methods, sizeof(MH_methods)/sizeof(JNINativeMethod)); ++ guarantee(status == JNI_OK && !env->ExceptionOccurred(), ++ "register java.lang.invoke.MethodHandle natives"); + } + + if (TraceInvokeDynamic) { + tty->print_cr("MethodHandle support loaded (using LambdaForms)"); + } + +- if (enable_MH) { +- MethodHandles::generate_adapters(); +- MethodHandles::set_enabled(true); +- } ++ MethodHandles::set_enabled(true); + } + JVM_END +diff --git a/hotspot/src/share/vm/runtime/init.cpp b/hotspot/src/share/vm/runtime/init.cpp +index f709db941..71caac72b 100644 +--- a/hotspot/src/share/vm/runtime/init.cpp ++++ b/hotspot/src/share/vm/runtime/init.cpp +@@ -136,6 +136,7 @@ jint init_globals() { + } + javaClasses_init(); // must happen after vtable initialization + stubRoutines_init2(); // note: StubRoutines need 2-phase init ++ MethodHandles::generate_adapters(); + + #if INCLUDE_NMT + // Solaris stack is walkable only after stubRoutines are set up. +diff --git a/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp b/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp +index 7b592d9fa..68ff3afe9 100644 +--- a/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp ++++ b/hotspot/src/share/vm/runtime/stubCodeGenerator.cpp +@@ -36,6 +36,7 @@ + + StubCodeDesc* volatile StubCodeDesc::_list = NULL; + int StubCodeDesc::_count = 0; ++bool StubCodeDesc::_frozen = false; + + + StubCodeDesc* StubCodeDesc::desc_for(address pc) { +@@ -58,6 +59,10 @@ const char* StubCodeDesc::name_for(address pc) { + return p == NULL ? NULL : p->name(); + } + ++void StubCodeDesc::freeze() { ++ assert(!_frozen, "repeated freeze operation"); ++ _frozen = true; ++} + + void StubCodeDesc::print_on(outputStream* st) const { + st->print("%s", group()); +diff --git a/hotspot/src/share/vm/runtime/stubCodeGenerator.hpp b/hotspot/src/share/vm/runtime/stubCodeGenerator.hpp +index dc2b5165b..ec157cfec 100644 +--- a/hotspot/src/share/vm/runtime/stubCodeGenerator.hpp ++++ b/hotspot/src/share/vm/runtime/stubCodeGenerator.hpp +@@ -37,9 +37,10 @@ + // this may have to change if searching becomes too slow. + + class StubCodeDesc: public CHeapObj { +- protected: ++ private: + static StubCodeDesc* volatile _list; // the list of all descriptors + static int _count; // length of list ++ static bool _frozen; // determines whether _list modifications are allowed + + StubCodeDesc* _next; // the next element in the linked list + const char* _group; // the group to which the stub code belongs +@@ -68,6 +69,7 @@ class StubCodeDesc: public CHeapObj { + static const char* name_for(address pc); // returns the name of the code containing pc or NULL + + StubCodeDesc(const char* group, const char* name, address begin) { ++ assert(!_frozen, "no modifications allowed"); + assert(name != NULL, "no name specified"); + _next = (StubCodeDesc*)OrderAccess::load_ptr_acquire(&_list); + _group = group; +@@ -78,6 +80,8 @@ class StubCodeDesc: public CHeapObj { + OrderAccess::release_store_ptr(&_list, this); + }; + ++ static void freeze(); ++ + const char* group() const { return _group; } + const char* name() const { return _name; } + int index() const { return _index; } +@@ -117,7 +121,7 @@ class StubCodeGenerator: public StackObj { + // later via an address pointing into it. + + class StubCodeMark: public StackObj { +- protected: ++ private: + StubCodeGenerator* _cgen; + StubCodeDesc* _cdesc; + +diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp +index 50543ac73..95dbb77fb 100644 +--- a/hotspot/src/share/vm/runtime/thread.cpp ++++ b/hotspot/src/share/vm/runtime/thread.cpp +@@ -3615,6 +3615,9 @@ jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { + + quicken_jni_functions(); + ++ // No more stub generation allowed after that point. ++ StubCodeDesc::freeze(); ++ + // Set flag that basic initialization has completed. Used by exceptions and various + // debug stuff, that does not work until all basic classes have been initialized. + set_init_completed(); diff --git a/8139595-MethodHandles-remove_dependent_nmethod-is-no.patch b/8139595-MethodHandles-remove_dependent_nmethod-is-no.patch new file mode 100644 index 0000000000000000000000000000000000000000..94a3dc9845afd90e7fd4e71faccd047377cb9e1d --- /dev/null +++ b/8139595-MethodHandles-remove_dependent_nmethod-is-no.patch @@ -0,0 +1,1220 @@ +Date: Sat, 30 Mar 2024 07:12:45 +0000 +Subject: 8139595: MethodHandles::remove_dependent_nmethod is not + MT safe + +--- + .../src/share/vm/classfile/javaClasses.cpp | 17 +- + .../src/share/vm/classfile/javaClasses.hpp | 5 +- + .../src/share/vm/code/dependencyContext.cpp | 347 ++++++++++++++++++ + .../src/share/vm/code/dependencyContext.hpp | 152 ++++++++ + .../src/share/vm/compiler/compileBroker.cpp | 2 +- + hotspot/src/share/vm/oops/instanceKlass.cpp | 207 +---------- + hotspot/src/share/vm/oops/instanceKlass.hpp | 62 +--- + hotspot/src/share/vm/prims/jni.cpp | 2 + + hotspot/src/share/vm/prims/methodHandles.cpp | 64 ++-- + hotspot/src/share/vm/runtime/init.cpp | 2 + + hotspot/src/share/vm/runtime/perfData.hpp | 1 + + hotspot/src/share/vm/runtime/vmStructs.cpp | 5 - + 12 files changed, 573 insertions(+), 293 deletions(-) + create mode 100644 hotspot/src/share/vm/code/dependencyContext.cpp + create mode 100644 hotspot/src/share/vm/code/dependencyContext.hpp + +diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp +index 267bbacd..ece8ef03 100644 +--- a/hotspot/src/share/vm/classfile/javaClasses.cpp ++++ b/hotspot/src/share/vm/classfile/javaClasses.cpp +@@ -28,6 +28,7 @@ + #include "classfile/symbolTable.hpp" + #include "classfile/vmSymbols.hpp" + #include "code/debugInfo.hpp" ++#include "code/dependencyContext.hpp" + #include "code/pcDesc.hpp" + #include "compiler/compilerOracle.hpp" + #include "interpreter/interpreter.hpp" +@@ -3033,14 +3034,16 @@ void java_lang_invoke_MethodHandleNatives_CallSiteContext::compute_offsets() { + } + } + +-nmethodBucket* java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(oop call_site) { ++DependencyContext java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(oop call_site) { + assert(java_lang_invoke_MethodHandleNatives_CallSiteContext::is_instance(call_site), ""); +- return (nmethodBucket*) (address) call_site->long_field(_vmdependencies_offset); +-} +- +-void java_lang_invoke_MethodHandleNatives_CallSiteContext::set_vmdependencies(oop call_site, nmethodBucket* context) { +- assert(java_lang_invoke_MethodHandleNatives_CallSiteContext::is_instance(call_site), ""); +- call_site->long_field_put(_vmdependencies_offset, (jlong) (address) context); ++ intptr_t* vmdeps_addr = (intptr_t*)call_site->address_field_addr(_vmdependencies_offset); ++#ifndef ASSERT ++ DependencyContext dep_ctx(vmdeps_addr); ++#else ++ // Verify that call_site isn't moved during DependencyContext lifetime. ++ DependencyContext dep_ctx(vmdeps_addr, Handle(call_site)); ++#endif // ASSERT ++ return dep_ctx; + } + + // Support for java_security_AccessControlContext +diff --git a/hotspot/src/share/vm/classfile/javaClasses.hpp b/hotspot/src/share/vm/classfile/javaClasses.hpp +index 1eb04b96..ccd0cf27 100644 +--- a/hotspot/src/share/vm/classfile/javaClasses.hpp ++++ b/hotspot/src/share/vm/classfile/javaClasses.hpp +@@ -1243,6 +1243,8 @@ public: + #define CALLSITECONTEXT_INJECTED_FIELDS(macro) \ + macro(java_lang_invoke_MethodHandleNatives_CallSiteContext, vmdependencies, intptr_signature, false) + ++class DependencyContext; ++ + class java_lang_invoke_MethodHandleNatives_CallSiteContext : AllStatic { + friend class JavaClasses; + +@@ -1253,8 +1255,7 @@ private: + + public: + // Accessors +- static nmethodBucket* vmdependencies(oop context); +- static void set_vmdependencies(oop context, nmethodBucket* bucket); ++ static DependencyContext vmdependencies(oop context); + + // Testers + static bool is_subclass(Klass* klass) { +diff --git a/hotspot/src/share/vm/code/dependencyContext.cpp b/hotspot/src/share/vm/code/dependencyContext.cpp +new file mode 100644 +index 00000000..5c0af1e3 +--- /dev/null ++++ b/hotspot/src/share/vm/code/dependencyContext.cpp +@@ -0,0 +1,347 @@ ++/* ++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include "precompiled.hpp" ++#include "code/nmethod.hpp" ++#include "code/dependencies.hpp" ++#include "code/dependencyContext.hpp" ++#include "memory/resourceArea.hpp" ++#include "runtime/atomic.hpp" ++#include "runtime/perfData.hpp" ++#include "utilities/exceptions.hpp" ++ ++PerfCounter* DependencyContext::_perf_total_buckets_allocated_count = NULL; ++PerfCounter* DependencyContext::_perf_total_buckets_deallocated_count = NULL; ++PerfCounter* DependencyContext::_perf_total_buckets_stale_count = NULL; ++PerfCounter* DependencyContext::_perf_total_buckets_stale_acc_count = NULL; ++ ++void dependencyContext_init() { ++ DependencyContext::init(); ++} ++ ++void DependencyContext::init() { ++ if (UsePerfData) { ++ EXCEPTION_MARK; ++ _perf_total_buckets_allocated_count = ++ PerfDataManager::create_counter(SUN_CI, "nmethodBucketsAllocated", PerfData::U_Events, CHECK); ++ _perf_total_buckets_deallocated_count = ++ PerfDataManager::create_counter(SUN_CI, "nmethodBucketsDeallocated", PerfData::U_Events, CHECK); ++ _perf_total_buckets_stale_count = ++ PerfDataManager::create_counter(SUN_CI, "nmethodBucketsStale", PerfData::U_Events, CHECK); ++ _perf_total_buckets_stale_acc_count = ++ PerfDataManager::create_counter(SUN_CI, "nmethodBucketsStaleAccumulated", PerfData::U_Events, CHECK); ++ } ++} ++ ++// ++// Walk the list of dependent nmethods searching for nmethods which ++// are dependent on the changes that were passed in and mark them for ++// deoptimization. Returns the number of nmethods found. ++// ++int DependencyContext::mark_dependent_nmethods(DepChange& changes) { ++ int found = 0; ++ for (nmethodBucket* b = dependencies(); b != NULL; b = b->next()) { ++ nmethod* nm = b->get_nmethod(); ++ // since dependencies aren't removed until an nmethod becomes a zombie, ++ // the dependency list may contain nmethods which aren't alive. ++ if (b->count() > 0 && nm->is_alive() && !nm->is_marked_for_deoptimization() && nm->check_dependency_on(changes)) { ++ if (TraceDependencies) { ++ ResourceMark rm; ++ tty->print_cr("Marked for deoptimization"); ++ changes.print(); ++ nm->print(); ++ nm->print_dependencies(); ++ } ++ nm->mark_for_deoptimization(); ++ found++; ++ } ++ } ++ return found; ++} ++ ++// ++// Add an nmethod to the dependency context. ++// It's possible that an nmethod has multiple dependencies on a klass ++// so a count is kept for each bucket to guarantee that creation and ++// deletion of dependencies is consistent. ++// ++void DependencyContext::add_dependent_nmethod(nmethod* nm, bool expunge) { ++ assert_lock_strong(CodeCache_lock); ++ for (nmethodBucket* b = dependencies(); b != NULL; b = b->next()) { ++ if (nm == b->get_nmethod()) { ++ b->increment(); ++ return; ++ } ++ } ++ set_dependencies(new nmethodBucket(nm, dependencies())); ++ if (UsePerfData) { ++ _perf_total_buckets_allocated_count->inc(); ++ } ++ if (expunge) { ++ // Remove stale entries from the list. ++ expunge_stale_entries(); ++ } ++} ++ ++// ++// Remove an nmethod dependency from the context. ++// Decrement count of the nmethod in the dependency list and, optionally, remove ++// the bucket completely when the count goes to 0. This method must find ++// a corresponding bucket otherwise there's a bug in the recording of dependencies. ++// Can be called concurrently by parallel GC threads. ++// ++void DependencyContext::remove_dependent_nmethod(nmethod* nm, bool expunge) { ++ assert_locked_or_safepoint(CodeCache_lock); ++ nmethodBucket* first = dependencies(); ++ nmethodBucket* last = NULL; ++ for (nmethodBucket* b = first; b != NULL; b = b->next()) { ++ if (nm == b->get_nmethod()) { ++ int val = b->decrement(); ++ guarantee(val >= 0, err_msg("Underflow: %d", val)); ++ if (val == 0) { ++ if (expunge) { ++ if (last == NULL) { ++ set_dependencies(b->next()); ++ } else { ++ last->set_next(b->next()); ++ } ++ delete b; ++ if (UsePerfData) { ++ _perf_total_buckets_deallocated_count->inc(); ++ } ++ } else { ++ // Mark the context as having stale entries, since it is not safe to ++ // expunge the list right now. ++ set_has_stale_entries(true); ++ if (UsePerfData) { ++ _perf_total_buckets_stale_count->inc(); ++ _perf_total_buckets_stale_acc_count->inc(); ++ } ++ } ++ } ++ if (expunge) { ++ // Remove stale entries from the list. ++ expunge_stale_entries(); ++ } ++ return; ++ } ++ last = b; ++ } ++#ifdef ASSERT ++ tty->print_raw_cr("### can't find dependent nmethod"); ++ nm->print(); ++#endif // ASSERT ++ ShouldNotReachHere(); ++} ++ ++// ++// Reclaim all unused buckets. ++// ++void DependencyContext::expunge_stale_entries() { ++ assert_locked_or_safepoint(CodeCache_lock); ++ if (!has_stale_entries()) { ++ assert(!find_stale_entries(), "inconsistent info"); ++ return; ++ } ++ nmethodBucket* first = dependencies(); ++ nmethodBucket* last = NULL; ++ int removed = 0; ++ for (nmethodBucket* b = first; b != NULL;) { ++ assert(b->count() >= 0, err_msg("bucket count: %d", b->count())); ++ nmethodBucket* next = b->next(); ++ if (b->count() == 0) { ++ if (last == NULL) { ++ first = next; ++ } else { ++ last->set_next(next); ++ } ++ removed++; ++ delete b; ++ // last stays the same. ++ } else { ++ last = b; ++ } ++ b = next; ++ } ++ set_dependencies(first); ++ set_has_stale_entries(false); ++ if (UsePerfData && removed > 0) { ++ _perf_total_buckets_deallocated_count->inc(removed); ++ _perf_total_buckets_stale_count->dec(removed); ++ } ++} ++ ++// ++// Invalidate all dependencies in the context ++int DependencyContext::remove_all_dependents() { ++ assert_locked_or_safepoint(CodeCache_lock); ++ nmethodBucket* b = dependencies(); ++ set_dependencies(NULL); ++ int marked = 0; ++ int removed = 0; ++ while (b != NULL) { ++ nmethod* nm = b->get_nmethod(); ++ if (b->count() > 0 && nm->is_alive() && !nm->is_marked_for_deoptimization()) { ++ nm->mark_for_deoptimization(); ++ marked++; ++ } ++ nmethodBucket* next = b->next(); ++ removed++; ++ delete b; ++ b = next; ++ } ++ set_has_stale_entries(false); ++ if (UsePerfData && removed > 0) { ++ _perf_total_buckets_deallocated_count->inc(removed); ++ } ++ return marked; ++} ++ ++#ifndef PRODUCT ++void DependencyContext::print_dependent_nmethods(bool verbose) { ++ int idx = 0; ++ for (nmethodBucket* b = dependencies(); b != NULL; b = b->next()) { ++ nmethod* nm = b->get_nmethod(); ++ tty->print("[%d] count=%d { ", idx++, b->count()); ++ if (!verbose) { ++ nm->print_on(tty, "nmethod"); ++ tty->print_cr(" } "); ++ } else { ++ nm->print(); ++ nm->print_dependencies(); ++ tty->print_cr("--- } "); ++ } ++ } ++} ++ ++bool DependencyContext::is_dependent_nmethod(nmethod* nm) { ++ for (nmethodBucket* b = dependencies(); b != NULL; b = b->next()) { ++ if (nm == b->get_nmethod()) { ++#ifdef ASSERT ++ int count = b->count(); ++ assert(count >= 0, "count shouldn't be negative"); ++#endif ++ return true; ++ } ++ } ++ return false; ++} ++ ++bool DependencyContext::find_stale_entries() { ++ for (nmethodBucket* b = dependencies(); b != NULL; b = b->next()) { ++ if (b->count() == 0) return true; ++ } ++ return false; ++} ++ ++#endif //PRODUCT ++ ++int nmethodBucket::decrement() { ++ return Atomic::add(-1, (volatile int *)&_count); ++} ++ ++/////////////// Unit tests /////////////// ++ ++#ifndef PRODUCT ++ ++class TestDependencyContext { ++ public: ++ nmethod* _nmethods[3]; ++ ++ intptr_t _dependency_context; ++ ++ TestDependencyContext() : _dependency_context(DependencyContext::EMPTY) { ++ CodeCache_lock->lock_without_safepoint_check(); ++ ++ DependencyContext depContext(&_dependency_context); ++ ++ _nmethods[0] = reinterpret_cast(0x8 * 0); ++ _nmethods[1] = reinterpret_cast(0x8 * 1); ++ _nmethods[2] = reinterpret_cast(0x8 * 2); ++ ++ depContext.add_dependent_nmethod(_nmethods[2]); ++ depContext.add_dependent_nmethod(_nmethods[1]); ++ depContext.add_dependent_nmethod(_nmethods[0]); ++ } ++ ++ ~TestDependencyContext() { ++ wipe(); ++ CodeCache_lock->unlock(); ++ } ++ ++ static void testRemoveDependentNmethod(int id, bool delete_immediately) { ++ TestDependencyContext c; ++ DependencyContext depContext(&c._dependency_context); ++ assert(!has_stale_entries(depContext), "check"); ++ ++ nmethod* nm = c._nmethods[id]; ++ depContext.remove_dependent_nmethod(nm, delete_immediately); ++ ++ if (!delete_immediately) { ++ assert(has_stale_entries(depContext), "check"); ++ assert(depContext.is_dependent_nmethod(nm), "check"); ++ depContext.expunge_stale_entries(); ++ } ++ ++ assert(!has_stale_entries(depContext), "check"); ++ assert(!depContext.is_dependent_nmethod(nm), "check"); ++ } ++ ++ static void testRemoveDependentNmethod() { ++ testRemoveDependentNmethod(0, false); ++ testRemoveDependentNmethod(1, false); ++ testRemoveDependentNmethod(2, false); ++ ++ testRemoveDependentNmethod(0, true); ++ testRemoveDependentNmethod(1, true); ++ testRemoveDependentNmethod(2, true); ++ } ++ ++ static void test() { ++ testRemoveDependentNmethod(); ++ } ++ ++ static bool has_stale_entries(DependencyContext ctx) { ++ assert(ctx.has_stale_entries() == ctx.find_stale_entries(), "check"); ++ return ctx.has_stale_entries(); ++ } ++ ++ void wipe() { ++ DependencyContext ctx(&_dependency_context); ++ nmethodBucket* b = ctx.dependencies(); ++ ctx.set_dependencies(NULL); ++ ctx.set_has_stale_entries(false); ++ while (b != NULL) { ++ nmethodBucket* next = b->next(); ++ delete b; ++ b = next; ++ } ++ } ++}; ++ ++void TestDependencyContext_test() { ++ TestDependencyContext::test(); ++} ++ ++#endif // PRODUCT +\ No newline at end of file +diff --git a/hotspot/src/share/vm/code/dependencyContext.hpp b/hotspot/src/share/vm/code/dependencyContext.hpp +new file mode 100644 +index 00000000..533112b8 +--- /dev/null ++++ b/hotspot/src/share/vm/code/dependencyContext.hpp +@@ -0,0 +1,152 @@ ++/* ++ * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef SHARE_VM_CODE_DEPENDENCYCONTEXT_HPP ++#define SHARE_VM_CODE_DEPENDENCYCONTEXT_HPP ++ ++#include "memory/allocation.hpp" ++#include "oops/oop.hpp" ++#include "runtime/handles.hpp" ++#include "runtime/perfData.hpp" ++ ++class nmethod; ++class DepChange; ++ ++// ++// nmethodBucket is used to record dependent nmethods for ++// deoptimization. nmethod dependencies are actually ++// pairs but we really only care about the klass part for purposes of ++// finding nmethods which might need to be deoptimized. Instead of ++// recording the method, a count of how many times a particular nmethod ++// was recorded is kept. This ensures that any recording errors are ++// noticed since an nmethod should be removed as many times are it's ++// added. ++// ++class nmethodBucket: public CHeapObj { ++ friend class VMStructs; ++ private: ++ nmethod* _nmethod; ++ int _count; ++ nmethodBucket* _next; ++ ++ public: ++ nmethodBucket(nmethod* nmethod, nmethodBucket* next) : ++ _nmethod(nmethod), _next(next), _count(1) {} ++ ++ int count() { return _count; } ++ int increment() { _count += 1; return _count; } ++ int decrement(); ++ nmethodBucket* next() { return _next; } ++ void set_next(nmethodBucket* b) { _next = b; } ++ nmethod* get_nmethod() { return _nmethod; } ++}; ++ ++// ++// Utility class to manipulate nmethod dependency context. ++// The context consists of nmethodBucket* (a head of a linked list) ++// and a boolean flag (does the list contains stale entries). The structure is ++// encoded as an intptr_t: lower bit is used for the flag. It is possible since ++// nmethodBucket* is aligned - the structure is malloc'ed in C heap. ++// Dependency context can be attached either to an InstanceKlass (_dep_context field) ++// or CallSiteContext oop for call_site_target dependencies (see javaClasses.hpp). ++// DependencyContext class operates on some location which holds a intptr_t value. ++// ++class DependencyContext : public StackObj { ++ friend class VMStructs; ++ friend class TestDependencyContext; ++ private: ++ enum TagBits { _has_stale_entries_bit = 1, _has_stale_entries_mask = 1 }; ++ ++ intptr_t* _dependency_context_addr; ++ ++ void set_dependencies(nmethodBucket* b) { ++ assert((intptr_t(b) & _has_stale_entries_mask) == 0, "should be aligned"); ++ if (has_stale_entries()) { ++ *_dependency_context_addr = intptr_t(b) | _has_stale_entries_mask; ++ } else { ++ *_dependency_context_addr = intptr_t(b); ++ } ++ } ++ ++ void set_has_stale_entries(bool x) { ++ if (x) { ++ *_dependency_context_addr |= _has_stale_entries_mask; ++ } else { ++ *_dependency_context_addr &= ~_has_stale_entries_mask; ++ } ++ } ++ ++ nmethodBucket* dependencies() { ++ intptr_t value = *_dependency_context_addr; ++ return (nmethodBucket*) (value & ~_has_stale_entries_mask); ++ } ++ ++ bool has_stale_entries() const { ++ intptr_t value = *_dependency_context_addr; ++ return (value & _has_stale_entries_mask) != 0; ++ } ++ ++ static PerfCounter* _perf_total_buckets_allocated_count; ++ static PerfCounter* _perf_total_buckets_deallocated_count; ++ static PerfCounter* _perf_total_buckets_stale_count; ++ static PerfCounter* _perf_total_buckets_stale_acc_count; ++ ++ public: ++#ifdef ASSERT ++ // Verification for dependency contexts rooted at Java objects. ++ Handle _base; // non-NULL if dependency context resides in an oop (e.g. CallSite). ++ oop _base_oop; ++ ++ DependencyContext(intptr_t* addr, Handle base = Handle()) ++ : _dependency_context_addr(addr), _base(base) ++ { ++ _base_oop = _base(); ++ } ++ ++ ~DependencyContext() { ++ // Base oop relocation invalidates _dependency_context_addr. ++ assert(_base_oop == _base(), "base oop relocation is forbidden"); ++ } ++#else ++ DependencyContext(intptr_t* addr) : _dependency_context_addr(addr) {} ++#endif // ASSERT ++ ++ static const intptr_t EMPTY = 0; // dependencies = NULL, has_stale_entries = false ++ ++ static void init(); ++ ++ int mark_dependent_nmethods(DepChange& changes); ++ void add_dependent_nmethod(nmethod* nm, bool expunge_stale_entries = false); ++ void remove_dependent_nmethod(nmethod* nm, bool expunge_stale_entries = false); ++ int remove_all_dependents(); ++ ++ void expunge_stale_entries(); ++ ++#ifndef PRODUCT ++ void print_dependent_nmethods(bool verbose); ++ bool is_dependent_nmethod(nmethod* nm); ++ bool find_stale_entries(); ++#endif //PRODUCT ++}; ++#endif // SHARE_VM_CODE_DEPENDENCYCONTEXT_HPP +\ No newline at end of file +diff --git a/hotspot/src/share/vm/compiler/compileBroker.cpp b/hotspot/src/share/vm/compiler/compileBroker.cpp +index e8f97074..22372d07 100644 +--- a/hotspot/src/share/vm/compiler/compileBroker.cpp ++++ b/hotspot/src/share/vm/compiler/compileBroker.cpp +@@ -26,6 +26,7 @@ + #include "classfile/systemDictionary.hpp" + #include "classfile/vmSymbols.hpp" + #include "code/codeCache.hpp" ++#include "code/dependencyContext.hpp" + #include "compiler/compileBroker.hpp" + #include "compiler/compileLog.hpp" + #include "compiler/compilerOracle.hpp" +@@ -919,7 +920,6 @@ void CompileBroker::compilation_init() { + PerfData::U_Ticks, CHECK); + } + +- + if (UsePerfData) { + + EXCEPTION_MARK; +diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp +index ce297b68..1bff1309 100644 +--- a/hotspot/src/share/vm/oops/instanceKlass.cpp ++++ b/hotspot/src/share/vm/oops/instanceKlass.cpp +@@ -28,6 +28,7 @@ + #include "classfile/systemDictionaryShared.hpp" + #include "classfile/verifier.hpp" + #include "classfile/vmSymbols.hpp" ++#include "code/dependencyContext.hpp" + #include "compiler/compileBroker.hpp" + #include "gc_implementation/shared/markSweep.inline.hpp" + #include "gc_interface/collectedHeap.inline.hpp" +@@ -194,7 +195,6 @@ InstanceKlass* InstanceKlass::allocate_instance_klass( + + int size = InstanceKlass::size(vtable_len, itable_len, nonstatic_oop_map_size, + access_flags.is_interface(), is_anonymous); +- + // Allocation + InstanceKlass* ik; + if (rt == REF_NONE) { +@@ -296,7 +296,7 @@ InstanceKlass::InstanceKlass(int vtable_len, + set_static_oop_field_count(0); + set_nonstatic_field_size(0); + set_is_marked_dependent(false); +- set_has_unloaded_dependent(false); ++ _dep_context = DependencyContext::EMPTY; + set_init_state(InstanceKlass::allocated); + set_init_thread(NULL); + set_init_state(allocated); +@@ -311,7 +311,6 @@ InstanceKlass::InstanceKlass(int vtable_len, + set_annotations(NULL); + set_jvmti_cached_class_field_map(NULL); + set_initial_method_idnum(0); +- _dependencies = NULL; + set_jvmti_cached_class_field_map(NULL); + set_cached_class_file(NULL); + set_initial_method_idnum(0); +@@ -2093,200 +2092,31 @@ jmethodID InstanceKlass::jmethod_id_or_null(Method* method) { + return id; + } + +-int nmethodBucket::decrement() { +- return Atomic::add(-1, (volatile int *)&_count); +-} +- +-// +-// Walk the list of dependent nmethods searching for nmethods which +-// are dependent on the changes that were passed in and mark them for +-// deoptimization. Returns the number of nmethods found. +-// +-int nmethodBucket::mark_dependent_nmethods(nmethodBucket* deps, DepChange& changes) { +- assert_locked_or_safepoint(CodeCache_lock); +- int found = 0; +- for (nmethodBucket* b = deps; b != NULL; b = b->next()) { +- nmethod* nm = b->get_nmethod(); +- // since dependencies aren't removed until an nmethod becomes a zombie, +- // the dependency list may contain nmethods which aren't alive. +- if (b->count() > 0 && nm->is_alive() && !nm->is_marked_for_deoptimization() && nm->check_dependency_on(changes)) { +- if (TraceDependencies) { +- ResourceMark rm; +- tty->print_cr("Marked for deoptimization"); +- changes.print(); +- nm->print(); +- nm->print_dependencies(); +- } +- nm->mark_for_deoptimization(); +- found++; +- } +- } +- return found; +-} +- +-// +-// Add an nmethodBucket to the list of dependencies for this nmethod. +-// It's possible that an nmethod has multiple dependencies on this klass +-// so a count is kept for each bucket to guarantee that creation and +-// deletion of dependencies is consistent. Returns new head of the list. +-// +-nmethodBucket* nmethodBucket::add_dependent_nmethod(nmethodBucket* deps, nmethod* nm) { +- assert_locked_or_safepoint(CodeCache_lock); +- for (nmethodBucket* b = deps; b != NULL; b = b->next()) { +- if (nm == b->get_nmethod()) { +- b->increment(); +- return deps; +- } +- } +- return new nmethodBucket(nm, deps); +-} +- +-// +-// Decrement count of the nmethod in the dependency list and remove +-// the bucket completely when the count goes to 0. This method must +-// find a corresponding bucket otherwise there's a bug in the +-// recording of dependencies. Returns true if the bucket was deleted, +-// or marked ready for reclaimation. +-bool nmethodBucket::remove_dependent_nmethod(nmethodBucket** deps, nmethod* nm, bool delete_immediately) { +- assert_locked_or_safepoint(CodeCache_lock); +- +- nmethodBucket* first = *deps; +- nmethodBucket* last = NULL; +- for (nmethodBucket* b = first; b != NULL; b = b->next()) { +- if (nm == b->get_nmethod()) { +- int val = b->decrement(); +- guarantee(val >= 0, err_msg("Underflow: %d", val)); +- if (val == 0) { +- if (delete_immediately) { +- if (last == NULL) { +- *deps = b->next(); +- } else { +- last->set_next(b->next()); +- } +- delete b; +- } +- } +- return true; +- } +- last = b; +- } +- +-#ifdef ASSERT +- tty->print_raw_cr("### can't find dependent nmethod"); +- nm->print(); +-#endif // ASSERT +- ShouldNotReachHere(); +- return false; +-} +- +-// Convenience overload, for callers that don't want to delete the nmethodBucket entry. +-bool nmethodBucket::remove_dependent_nmethod(nmethodBucket* deps, nmethod* nm) { +- nmethodBucket** deps_addr = &deps; +- return remove_dependent_nmethod(deps_addr, nm, false /* Don't delete */); +-} +- +-// +-// Reclaim all unused buckets. Returns new head of the list. +-// +-nmethodBucket* nmethodBucket::clean_dependent_nmethods(nmethodBucket* deps) { +- nmethodBucket* first = deps; +- nmethodBucket* last = NULL; +- nmethodBucket* b = first; +- +- while (b != NULL) { +- assert(b->count() >= 0, err_msg("bucket count: %d", b->count())); +- nmethodBucket* next = b->next(); +- if (b->count() == 0) { +- if (last == NULL) { +- first = next; +- } else { +- last->set_next(next); +- } +- delete b; +- // last stays the same. +- } else { +- last = b; +- } +- b = next; +- } +- return first; +-} +- +-#ifndef PRODUCT +-void nmethodBucket::print_dependent_nmethods(nmethodBucket* deps, bool verbose) { +- int idx = 0; +- for (nmethodBucket* b = deps; b != NULL; b = b->next()) { +- nmethod* nm = b->get_nmethod(); +- tty->print("[%d] count=%d { ", idx++, b->count()); +- if (!verbose) { +- nm->print_on(tty, "nmethod"); +- tty->print_cr(" } "); +- } else { +- nm->print(); +- nm->print_dependencies(); +- tty->print_cr("--- } "); +- } +- } ++inline DependencyContext InstanceKlass::dependencies() { ++ DependencyContext dep_context(&_dep_context); ++ return dep_context; + } + +-bool nmethodBucket::is_dependent_nmethod(nmethodBucket* deps, nmethod* nm) { +- for (nmethodBucket* b = deps; b != NULL; b = b->next()) { +- if (nm == b->get_nmethod()) { +-#ifdef ASSERT +- int count = b->count(); +- assert(count >= 0, err_msg("count shouldn't be negative: %d", count)); +-#endif +- return true; +- } +- } +- return false; +-} +-#endif //PRODUCT +- + int InstanceKlass::mark_dependent_nmethods(DepChange& changes) { +- assert_locked_or_safepoint(CodeCache_lock); +- return nmethodBucket::mark_dependent_nmethods(_dependencies, changes); +-} +- +-void InstanceKlass::clean_dependent_nmethods() { +- assert_locked_or_safepoint(CodeCache_lock); +- +- if (has_unloaded_dependent()) { +- _dependencies = nmethodBucket::clean_dependent_nmethods(_dependencies); +- set_has_unloaded_dependent(false); +- } +-#ifdef ASSERT +- else { +- // Verification +- for (nmethodBucket* b = _dependencies; b != NULL; b = b->next()) { +- assert(b->count() >= 0, err_msg("bucket count: %d", b->count())); +- assert(b->count() != 0, "empty buckets need to be cleaned"); +- } +- } +-#endif ++ return dependencies().mark_dependent_nmethods(changes); + } + + void InstanceKlass::add_dependent_nmethod(nmethod* nm) { +- assert_locked_or_safepoint(CodeCache_lock); +- _dependencies = nmethodBucket::add_dependent_nmethod(_dependencies, nm); ++ dependencies().add_dependent_nmethod(nm); + } + + void InstanceKlass::remove_dependent_nmethod(nmethod* nm, bool delete_immediately) { +- assert_locked_or_safepoint(CodeCache_lock); +- +- if (nmethodBucket::remove_dependent_nmethod(&_dependencies, nm, delete_immediately)) { +- set_has_unloaded_dependent(true); +- } ++ dependencies().remove_dependent_nmethod(nm, delete_immediately); + } + + #ifndef PRODUCT + void InstanceKlass::print_dependent_nmethods(bool verbose) { +- nmethodBucket::print_dependent_nmethods(_dependencies, verbose); ++ dependencies().print_dependent_nmethods(verbose); + } + + + bool InstanceKlass::is_dependent_nmethod(nmethod* nm) { +- return nmethodBucket::is_dependent_nmethod(_dependencies, nm); ++ return dependencies().is_dependent_nmethod(nm); + } + #endif //PRODUCT + +@@ -2583,7 +2413,9 @@ void InstanceKlass::clean_weak_instanceklass_links(BoolObjectClosure* is_alive) + clean_implementors_list(is_alive); + clean_method_data(is_alive); + +- clean_dependent_nmethods(); ++ // Since GC iterates InstanceKlasses sequentially, it is safe to remove stale entries here. ++ DependencyContext dep_context(&_dep_context); ++ dep_context.expunge_stale_entries(); + } + + void InstanceKlass::clean_implementors_list(BoolObjectClosure* is_alive) { +@@ -2630,6 +2462,8 @@ void InstanceKlass::remove_unshareable_info() { + + constants()->remove_unshareable_info(); + ++ assert(_dep_context == DependencyContext::EMPTY, "dependency context is not shareable"); ++ + for (int i = 0; i < methods()->length(); i++) { + Method* m = methods()->at(i); + m->remove_unshareable_info(); +@@ -2654,7 +2488,6 @@ void InstanceKlass::remove_unshareable_info() { + array_klasses_do(remove_unshareable_in_class); + // These are not allocated from metaspace. They are safe to set to NULL. + _member_names = NULL; +- _dependencies = NULL; + _osr_nmethods_head = NULL; + _init_thread = NULL; + } +@@ -2796,12 +2629,10 @@ void InstanceKlass::release_C_heap_structures() { + } + + // release dependencies +- nmethodBucket* b = _dependencies; +- _dependencies = NULL; +- while (b != NULL) { +- nmethodBucket* next = b->next(); +- delete b; +- b = next; ++ { ++ DependencyContext ctx(&_dep_context); ++ int marked = ctx.remove_all_dependents(); ++ assert(marked == 0, "all dependencies should be already invalidated"); + } + + // Deallocate breakpoint records +diff --git a/hotspot/src/share/vm/oops/instanceKlass.hpp b/hotspot/src/share/vm/oops/instanceKlass.hpp +index 9750ae56..14556a38 100644 +--- a/hotspot/src/share/vm/oops/instanceKlass.hpp ++++ b/hotspot/src/share/vm/oops/instanceKlass.hpp +@@ -83,15 +83,15 @@ + + + // forward declaration for class -- see below for definition +-class SuperTypeClosure; +-class JNIid; +-class jniIdMapBase; + class BreakpointInfo; +-class fieldDescriptor; + class DepChange; +-class nmethodBucket; ++class DependencyContext; ++class fieldDescriptor; ++class jniIdMapBase; ++class JNIid; + class JvmtiCachedClassFieldMap; + class MemberNameTable; ++class SuperTypeClosure; + + // This is used in iterators below. + class FieldClosure: public StackObj { +@@ -227,7 +227,6 @@ class InstanceKlass: public Klass { + // _misc_flags. + bool _is_marked_dependent; // used for marking during flushing and deoptimization + bool _is_being_redefined; // used for locking redefinition +- bool _has_unloaded_dependent; + + enum { + _misc_rewritten = 1 << 0, // methods rewritten. +@@ -249,7 +248,7 @@ class InstanceKlass: public Klass { + MemberNameTable* _member_names; // Member names + JNIid* _jni_ids; // First JNI identifier for static fields in this class + jmethodID* _methods_jmethod_ids; // jmethodIDs corresponding to method_idnum, or NULL if none +- nmethodBucket* _dependencies; // list of dependent nmethods ++ intptr_t _dep_context; // packed DependencyContext structure + nmethod* _osr_nmethods_head; // Head of list of on-stack replacement nmethods for this class + BreakpointInfo* _breakpoints; // bpt lists, managed by Method* + // Linked instanceKlasses of previous versions +@@ -480,9 +479,6 @@ class InstanceKlass: public Klass { + bool is_marked_dependent() const { return _is_marked_dependent; } + void set_is_marked_dependent(bool value) { _is_marked_dependent = value; } + +- bool has_unloaded_dependent() const { return _has_unloaded_dependent; } +- void set_has_unloaded_dependent(bool value) { _has_unloaded_dependent = value; } +- + // initialization (virtuals from Klass) + bool should_be_initialized() const; // means that initialize should be called + void initialize(TRAPS); +@@ -831,7 +827,8 @@ class InstanceKlass: public Klass { + JNIid* jni_id_for(int offset); + + // maintenance of deoptimization dependencies +- int mark_dependent_nmethods(DepChange& changes); ++ inline DependencyContext dependencies(); ++ int mark_dependent_nmethods(DepChange& changes); + void add_dependent_nmethod(nmethod* nm); + void remove_dependent_nmethod(nmethod* nm, bool delete_immediately); + +@@ -1026,7 +1023,6 @@ class InstanceKlass: public Klass { + void clean_weak_instanceklass_links(BoolObjectClosure* is_alive); + void clean_implementors_list(BoolObjectClosure* is_alive); + void clean_method_data(BoolObjectClosure* is_alive); +- void clean_dependent_nmethods(); + + // Explicit metaspace deallocation of fields + // For RedefineClasses and class file parsing errors, we need to deallocate +@@ -1258,48 +1254,6 @@ class JNIid: public CHeapObj { + void verify(Klass* holder); + }; + +- +-// +-// nmethodBucket is used to record dependent nmethods for +-// deoptimization. nmethod dependencies are actually +-// pairs but we really only care about the klass part for purposes of +-// finding nmethods which might need to be deoptimized. Instead of +-// recording the method, a count of how many times a particular nmethod +-// was recorded is kept. This ensures that any recording errors are +-// noticed since an nmethod should be removed as many times are it's +-// added. +-// +-class nmethodBucket: public CHeapObj { +- friend class VMStructs; +- private: +- nmethod* _nmethod; +- int _count; +- nmethodBucket* _next; +- +- public: +- nmethodBucket(nmethod* nmethod, nmethodBucket* next) { +- _nmethod = nmethod; +- _next = next; +- _count = 1; +- } +- int count() { return _count; } +- int increment() { _count += 1; return _count; } +- int decrement(); +- nmethodBucket* next() { return _next; } +- void set_next(nmethodBucket* b) { _next = b; } +- nmethod* get_nmethod() { return _nmethod; } +- +- static int mark_dependent_nmethods(nmethodBucket* deps, DepChange& changes); +- static nmethodBucket* add_dependent_nmethod(nmethodBucket* deps, nmethod* nm); +- static bool remove_dependent_nmethod(nmethodBucket** deps, nmethod* nm, bool delete_immediately); +- static bool remove_dependent_nmethod(nmethodBucket* deps, nmethod* nm); +- static nmethodBucket* clean_dependent_nmethods(nmethodBucket* deps); +-#ifndef PRODUCT +- static void print_dependent_nmethods(nmethodBucket* deps, bool verbose); +- static bool is_dependent_nmethod(nmethodBucket* deps, nmethod* nm); +-#endif //PRODUCT +-}; +- + // An iterator that's used to access the inner classes indices in the + // InstanceKlass::_inner_classes array. + class InnerClassesIterator : public StackObj { +diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp +index c0d789b4..bfb902d5 100644 +--- a/hotspot/src/share/vm/prims/jni.cpp ++++ b/hotspot/src/share/vm/prims/jni.cpp +@@ -5107,6 +5107,7 @@ _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_GetDefaultJavaVMInitArgs(void *args_) { + unit_test_function_call + + // Forward declaration ++void TestDependencyContext_test(); + void TestOS_test(); + void TestReservedSpace_test(); + void TestReserveMemorySpecial_test(); +@@ -5132,6 +5133,7 @@ void ChunkManager_test_list_index(); + void execute_internal_vm_tests() { + if (ExecuteInternalVMTests) { + tty->print_cr("Running internal VM tests"); ++ run_unit_test(TestDependencyContext_test()); + run_unit_test(TestOS_test()); + run_unit_test(TestReservedSpace_test()); + run_unit_test(TestReserveMemorySpecial_test()); +diff --git a/hotspot/src/share/vm/prims/methodHandles.cpp b/hotspot/src/share/vm/prims/methodHandles.cpp +index d950d4f3..231d62d2 100644 +--- a/hotspot/src/share/vm/prims/methodHandles.cpp ++++ b/hotspot/src/share/vm/prims/methodHandles.cpp +@@ -24,6 +24,7 @@ + + #include "precompiled.hpp" + #include "classfile/symbolTable.hpp" ++#include "code/dependencyContext.hpp" + #include "compiler/compileBroker.hpp" + #include "interpreter/interpreter.hpp" + #include "interpreter/oopMapCache.hpp" +@@ -946,30 +947,33 @@ int MethodHandles::find_MemberNames(KlassHandle k, + return rfill + overflow; + } + ++// Is it safe to remove stale entries from a dependency list? ++static bool safe_to_expunge() { ++ // Since parallel GC threads can concurrently iterate over a dependency ++ // list during safepoint, it is safe to remove entries only when ++ // CodeCache lock is held. ++ return CodeCache_lock->owned_by_self(); ++} ++ + void MethodHandles::add_dependent_nmethod(oop call_site, nmethod* nm) { + assert_locked_or_safepoint(CodeCache_lock); + + oop context = java_lang_invoke_CallSite::context(call_site); +- nmethodBucket* deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context); +- +- nmethodBucket* new_deps = nmethodBucket::add_dependent_nmethod(deps, nm); +- if (deps != new_deps) { +- java_lang_invoke_MethodHandleNatives_CallSiteContext::set_vmdependencies(context, new_deps); +- } ++ DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context); ++ // Try to purge stale entries on updates. ++ // Since GC doesn't clean dependency contexts rooted at CallSiteContext objects, ++ // in order to avoid memory leak, stale entries are purged whenever a dependency list ++ // is changed (both on addition and removal). Though memory reclamation is delayed, ++ // it avoids indefinite memory usage growth. ++ deps.add_dependent_nmethod(nm, /*expunge_stale_entries=*/safe_to_expunge()); + } + + void MethodHandles::remove_dependent_nmethod(oop call_site, nmethod* nm) { + assert_locked_or_safepoint(CodeCache_lock); + + oop context = java_lang_invoke_CallSite::context(call_site); +- nmethodBucket* deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context); +- +- if (nmethodBucket::remove_dependent_nmethod(deps, nm)) { +- nmethodBucket* new_deps = nmethodBucket::clean_dependent_nmethods(deps); +- if (deps != new_deps) { +- java_lang_invoke_MethodHandleNatives_CallSiteContext::set_vmdependencies(context, new_deps); +- } +- } ++ DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context); ++ deps.remove_dependent_nmethod(nm, /*expunge_stale_entries=*/safe_to_expunge()); + } + + void MethodHandles::flush_dependent_nmethods(Handle call_site, Handle target) { +@@ -978,21 +982,15 @@ void MethodHandles::flush_dependent_nmethods(Handle call_site, Handle target) { + int marked = 0; + CallSiteDepChange changes(call_site(), target()); + { ++ No_Safepoint_Verifier nsv; + MutexLockerEx mu2(CodeCache_lock, Mutex::_no_safepoint_check_flag); + + oop context = java_lang_invoke_CallSite::context(call_site()); +- nmethodBucket* deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context); +- +- marked = nmethodBucket::mark_dependent_nmethods(deps, changes); +- if (marked > 0) { +- nmethodBucket* new_deps = nmethodBucket::clean_dependent_nmethods(deps); +- if (deps != new_deps) { +- java_lang_invoke_MethodHandleNatives_CallSiteContext::set_vmdependencies(context, new_deps); +- } +- } ++ DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context); ++ marked = deps.mark_dependent_nmethods(changes); + } + if (marked > 0) { +- // At least one nmethod has been marked for deoptimization ++ // At least one nmethod has been marked for deoptimization. + VM_Deoptimize op; + VMThread::execute(&op); + } +@@ -1379,6 +1377,8 @@ JVM_ENTRY(void, MHN_setCallSiteTargetVolatile(JNIEnv* env, jobject igcls, jobjec + } + JVM_END + ++// It is called by a Cleaner object which ensures that dropped CallSites properly ++// deallocate their dependency information. + JVM_ENTRY(void, MHN_clearCallSiteContext(JNIEnv* env, jobject igcls, jobject context_jh)) { + Handle context(THREAD, JNIHandles::resolve_non_null(context_jh)); + { +@@ -1387,19 +1387,11 @@ JVM_ENTRY(void, MHN_clearCallSiteContext(JNIEnv* env, jobject igcls, jobject con + + int marked = 0; + { ++ No_Safepoint_Verifier nsv; + MutexLockerEx mu2(CodeCache_lock, Mutex::_no_safepoint_check_flag); +- nmethodBucket* b = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context()); +- while(b != NULL) { +- nmethod* nm = b->get_nmethod(); +- if (b->count() > 0 && nm->is_alive() && !nm->is_marked_for_deoptimization()) { +- nm->mark_for_deoptimization(); +- marked++; +- } +- nmethodBucket* next = b->next(); +- delete b; +- b = next; +- } +- java_lang_invoke_MethodHandleNatives_CallSiteContext::set_vmdependencies(context(), NULL); // reset context ++ assert(safe_to_expunge(), "removal is not safe"); ++ DependencyContext deps = java_lang_invoke_MethodHandleNatives_CallSiteContext::vmdependencies(context()); ++ marked = deps.remove_all_dependents(); + } + if (marked > 0) { + // At least one nmethod has been marked for deoptimization +diff --git a/hotspot/src/share/vm/runtime/init.cpp b/hotspot/src/share/vm/runtime/init.cpp +index b1854092..f709db94 100644 +--- a/hotspot/src/share/vm/runtime/init.cpp ++++ b/hotspot/src/share/vm/runtime/init.cpp +@@ -71,6 +71,7 @@ void InlineCacheBuffer_init(); + void compilerOracle_init(); + void compilationPolicy_init(); + void compileBroker_init(); ++void dependencyContext_init(); + + // Initialization after compiler initialization + bool universe_post_init(); // must happen after compiler_init +@@ -127,6 +128,7 @@ jint init_globals() { + compilerOracle_init(); + compilationPolicy_init(); + compileBroker_init(); ++ dependencyContext_init(); + VMRegImpl::set_regName(); + + if (!universe_post_init()) { +diff --git a/hotspot/src/share/vm/runtime/perfData.hpp b/hotspot/src/share/vm/runtime/perfData.hpp +index 4a62d2e0..b9f5c1a7 100644 +--- a/hotspot/src/share/vm/runtime/perfData.hpp ++++ b/hotspot/src/share/vm/runtime/perfData.hpp +@@ -424,6 +424,7 @@ class PerfLongVariant : public PerfLong { + public: + inline void inc() { (*(jlong*)_valuep)++; } + inline void inc(jlong val) { (*(jlong*)_valuep) += val; } ++ inline void dec(jlong val) { inc(-val); } + inline void add(jlong val) { (*(jlong*)_valuep) += val; } + void clear_sample_helper() { _sample_helper = NULL; } + }; +diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp +index 744c43e0..5140c015 100644 +--- a/hotspot/src/share/vm/runtime/vmStructs.cpp ++++ b/hotspot/src/share/vm/runtime/vmStructs.cpp +@@ -330,10 +330,6 @@ typedef OffsetCompactHashtable*) \ + nonstatic_field(InstanceKlass, _default_vtable_indices, Array*) \ + nonstatic_field(Klass, _super_check_offset, juint) \ +@@ -1472,7 +1468,6 @@ typedef OffsetCompactHashtablenext(); ++ delete b; ++ b = next; ++ } ++} ++ + #ifndef PRODUCT + void DependencyContext::print_dependent_nmethods(bool verbose) { + int idx = 0; +@@ -271,28 +283,31 @@ class TestDependencyContext { + + intptr_t _dependency_context; + ++ DependencyContext dependencies() { ++ DependencyContext depContext(&_dependency_context); ++ return depContext; ++ } ++ + TestDependencyContext() : _dependency_context(DependencyContext::EMPTY) { + CodeCache_lock->lock_without_safepoint_check(); + +- DependencyContext depContext(&_dependency_context); +- + _nmethods[0] = reinterpret_cast(0x8 * 0); + _nmethods[1] = reinterpret_cast(0x8 * 1); + _nmethods[2] = reinterpret_cast(0x8 * 2); + +- depContext.add_dependent_nmethod(_nmethods[2]); +- depContext.add_dependent_nmethod(_nmethods[1]); +- depContext.add_dependent_nmethod(_nmethods[0]); ++ dependencies().add_dependent_nmethod(_nmethods[2]); ++ dependencies().add_dependent_nmethod(_nmethods[1]); ++ dependencies().add_dependent_nmethod(_nmethods[0]); + } + + ~TestDependencyContext() { +- wipe(); ++ dependencies().wipe(); + CodeCache_lock->unlock(); + } + + static void testRemoveDependentNmethod(int id, bool delete_immediately) { + TestDependencyContext c; +- DependencyContext depContext(&c._dependency_context); ++ DependencyContext depContext = c.dependencies(); + assert(!has_stale_entries(depContext), "check"); + + nmethod* nm = c._nmethods[id]; +@@ -327,17 +342,6 @@ class TestDependencyContext { + return ctx.has_stale_entries(); + } + +- void wipe() { +- DependencyContext ctx(&_dependency_context); +- nmethodBucket* b = ctx.dependencies(); +- ctx.set_dependencies(NULL); +- ctx.set_has_stale_entries(false); +- while (b != NULL) { +- nmethodBucket* next = b->next(); +- delete b; +- b = next; +- } +- } + }; + + void TestDependencyContext_test() { +diff --git a/hotspot/src/share/vm/code/dependencyContext.hpp b/hotspot/src/share/vm/code/dependencyContext.hpp +index 533112b8..414ce0c0 100644 +--- a/hotspot/src/share/vm/code/dependencyContext.hpp ++++ b/hotspot/src/share/vm/code/dependencyContext.hpp +@@ -143,6 +143,10 @@ class DependencyContext : public StackObj { + + void expunge_stale_entries(); + ++ // Unsafe deallocation of nmethodBuckets. Used in IK::release_C_heap_structures ++ // to clean up the context possibly containing live entries pointing to unloaded nmethods. ++ void wipe(); ++ + #ifndef PRODUCT + void print_dependent_nmethods(bool verbose); + bool is_dependent_nmethod(nmethod* nm); +diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp +index 1bff1309..df44e531 100644 +--- a/hotspot/src/share/vm/oops/instanceKlass.cpp ++++ b/hotspot/src/share/vm/oops/instanceKlass.cpp +@@ -2628,12 +2628,16 @@ void InstanceKlass::release_C_heap_structures() { + } + } + +- // release dependencies +- { +- DependencyContext ctx(&_dep_context); +- int marked = ctx.remove_all_dependents(); +- assert(marked == 0, "all dependencies should be already invalidated"); +- } ++ // Release dependencies. ++ // It is desirable to use DC::remove_all_dependents() here, but, unfortunately, ++ // it is not safe (see JDK-8143408). The problem is that the klass dependency ++ // context can contain live dependencies, since there's a race between nmethod & ++ // klass unloading. If the klass is dead when nmethod unloading happens, relevant ++ // dependencies aren't removed from the context associated with the class (see ++ // nmethod::flush_dependencies). It ends up during klass unloading as seemingly ++ // live dependencies pointing to unloaded nmethods and causes a crash in ++ // DC::remove_all_dependents() when it touches unloaded nmethod. ++ dependencies().wipe(); + + // Deallocate breakpoint records + if (breakpoints() != 0x0) { +-- +2.17.1 + diff --git a/8149343-assert-rp-num_q-no_of_gc_workers-failed-sani.patch b/8149343-assert-rp-num_q-no_of_gc_workers-failed-sani.patch new file mode 100644 index 0000000000000000000000000000000000000000..3264beb7813820c9936cea38a5677ffbd9a84ab3 --- /dev/null +++ b/8149343-assert-rp-num_q-no_of_gc_workers-failed-sani.patch @@ -0,0 +1,144 @@ +Date: Sat, 30 Mar 2024 07:12:06 +0000 +Subject: 8149343: assert(rp->num_q() == no_of_gc_workers) failed: + sanity + +--- + .../gc_implementation/g1/g1CollectedHeap.cpp | 20 +++++++++++-------- + .../share/vm/memory/referenceProcessor.cpp | 9 +++++++-- + .../share/vm/memory/referenceProcessor.hpp | 4 +++- + .../TestDynamicNumberOfGCThreads.java | 8 ++++++++ + 4 files changed, 30 insertions(+), 11 deletions(-) + +diff --git a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +index 84d5d4d8..5b156f99 100644 +--- a/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp ++++ b/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp +@@ -5462,7 +5462,7 @@ public: + _workers(workers), + _active_workers(n_workers) + { +- assert(n_workers > 0, "shouldn't call this otherwise"); ++ g1h->ref_processor_stw()->set_active_mt_degree(n_workers); + } + + // Executes the given task using concurrent marking worker threads. +@@ -5595,7 +5595,9 @@ public: + _queues(task_queues), + _terminator(workers, _queues), + _n_workers(workers) +- { } ++ { ++ g1h->ref_processor_cm()->set_active_mt_degree(workers); ++ } + + void work(uint worker_id) { + ResourceMark rm; +@@ -5760,8 +5762,10 @@ void G1CollectedHeap::process_discovered_references(uint no_of_gc_workers) { + _gc_tracer_stw->gc_id()); + } else { + // Parallel reference processing +- assert(rp->num_q() == no_of_gc_workers, "sanity"); +- assert(no_of_gc_workers <= rp->max_num_q(), "sanity"); ++ assert(no_of_gc_workers <= rp->max_num_q(), ++ err_msg( ++ "Mismatch between the number of GC workers %u and the maximum number of Reference process queues %u", ++ no_of_gc_workers, rp->max_num_q())); + + G1STWRefProcTaskExecutor par_task_executor(this, workers(), _task_queues, no_of_gc_workers); + stats = rp->process_discovered_references(&is_alive, +@@ -5796,10 +5800,10 @@ void G1CollectedHeap::enqueue_discovered_references(uint no_of_gc_workers) { + } else { + // Parallel reference enqueueing + +- assert(no_of_gc_workers == workers()->active_workers(), +- "Need to reset active workers"); +- assert(rp->num_q() == no_of_gc_workers, "sanity"); +- assert(no_of_gc_workers <= rp->max_num_q(), "sanity"); ++ assert(no_of_gc_workers <= rp->max_num_q(), ++ err_msg( ++ "Mismatch between the number of GC workers %u and the maximum number of Reference process queues %u", ++ no_of_gc_workers, rp->max_num_q())); + + G1STWRefProcTaskExecutor par_task_executor(this, workers(), _task_queues, no_of_gc_workers); + rp->enqueue_discovered_references(&par_task_executor); +diff --git a/hotspot/src/share/vm/memory/referenceProcessor.cpp b/hotspot/src/share/vm/memory/referenceProcessor.cpp +index b916e696..823fd49c 100644 +--- a/hotspot/src/share/vm/memory/referenceProcessor.cpp ++++ b/hotspot/src/share/vm/memory/referenceProcessor.cpp +@@ -136,7 +136,7 @@ void ReferenceProcessor::verify_no_references_recorded() { + guarantee(!_discovering_refs, "Discovering refs?"); + for (uint i = 0; i < _max_num_q * number_of_subclasses_of_ref(); i++) { + guarantee(_discovered_refs[i].is_empty(), +- "Found non-empty discovered list"); ++ err_msg("Found non-empty discovered list at %u", i)); + } + } + #endif +@@ -780,6 +780,11 @@ private: + bool _clear_referent; + }; + ++void ReferenceProcessor::set_active_mt_degree(uint v) { ++ _num_q = v; ++ _next_id = 0; ++} ++ + // Balances reference queues. + // Move entries from all queues[0, 1, ..., _max_num_q-1] to + // queues[0, 1, ..., _num_q-1] because only the first _num_q +@@ -862,7 +867,7 @@ void ReferenceProcessor::balance_queues(DiscoveredList ref_lists[]) + } + #ifdef ASSERT + size_t balanced_total_refs = 0; +- for (uint i = 0; i < _max_num_q; ++i) { ++ for (uint i = 0; i < _num_q; ++i) { + balanced_total_refs += ref_lists[i].length(); + if (TraceReferenceGC && PrintGCDetails) { + gclog_or_tty->print("%d ", ref_lists[i].length()); +diff --git a/hotspot/src/share/vm/memory/referenceProcessor.hpp b/hotspot/src/share/vm/memory/referenceProcessor.hpp +index 470503ee..da148a6c 100644 +--- a/hotspot/src/share/vm/memory/referenceProcessor.hpp ++++ b/hotspot/src/share/vm/memory/referenceProcessor.hpp +@@ -270,7 +270,7 @@ class ReferenceProcessor : public CHeapObj { + + uint num_q() { return _num_q; } + uint max_num_q() { return _max_num_q; } +- void set_active_mt_degree(uint v) { _num_q = v; } ++ void set_active_mt_degree(uint v); + + DiscoveredList* discovered_refs() { return _discovered_refs; } + +@@ -385,9 +385,11 @@ class ReferenceProcessor : public CHeapObj { + // round-robin mod _num_q (not: _not_ mode _max_num_q) + uint next_id() { + uint id = _next_id; ++ assert(!_discovery_is_mt, "Round robin should only be used in serial discovery"); + if (++_next_id == _num_q) { + _next_id = 0; + } ++ assert(_next_id < _num_q, err_msg("_next_id %u _num_q %u _max_num_q %u", _next_id, _num_q, _max_num_q)); + return id; + } + DiscoveredList* get_discovered_list(ReferenceType rt); +diff --git a/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java b/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java +index f4a6625a..2005a67e 100644 +--- a/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java ++++ b/hotspot/test/gc/ergonomics/TestDynamicNumberOfGCThreads.java +@@ -63,6 +63,14 @@ public class TestDynamicNumberOfGCThreads { + System.arraycopy(baseArgs, 0, finalArgs, extraArgs.length, baseArgs.length); + pb_enabled = ProcessTools.createJavaProcessBuilder(finalArgs); + verifyDynamicNumberOfGCThreads(new OutputAnalyzer(pb_enabled.start())); ++ ++ // Turn on parallel reference processing ++ String[] parRefProcArg = {"-XX:+ParallelRefProcEnabled", "-XX:-ShowMessageBoxOnError"}; ++ String[] parRefArgs = new String[baseArgs.length + parRefProcArg.length]; ++ System.arraycopy(parRefProcArg, 0, parRefArgs, 0, parRefProcArg.length); ++ System.arraycopy(baseArgs, 0, parRefArgs, parRefProcArg.length, baseArgs.length); ++ pb_enabled = ProcessTools.createJavaProcessBuilder(parRefArgs); ++ verifyDynamicNumberOfGCThreads(new OutputAnalyzer(pb_enabled.start())); + } + + static class GCTest { +-- +2.17.1 + diff --git a/8220175-serviceability-dcmd-framework-VMVersionTest..patch b/8220175-serviceability-dcmd-framework-VMVersionTest..patch new file mode 100644 index 0000000000000000000000000000000000000000..6c149dcc9c84e3fca7cc713012fa7074d5cfb42c --- /dev/null +++ b/8220175-serviceability-dcmd-framework-VMVersionTest..patch @@ -0,0 +1,24 @@ +Date: Sat, 30 Mar 2024 07:11:17 +0000 +Subject: 8220175: serviceability/dcmd/framework/VMVersionTest.java + fails with a timeout + +--- + hotspot/src/os/linux/vm/perfMemory_linux.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hotspot/src/os/linux/vm/perfMemory_linux.cpp b/hotspot/src/os/linux/vm/perfMemory_linux.cpp +index b45032ed..4746531f 100644 +--- a/hotspot/src/os/linux/vm/perfMemory_linux.cpp ++++ b/hotspot/src/os/linux/vm/perfMemory_linux.cpp +@@ -659,7 +659,7 @@ static int get_namespace_pid(int vmid) { + if (fp) { + int pid, nspid; + int ret; +- while (!feof(fp)) { ++ while (!feof(fp) && !ferror(fp)) { + ret = fscanf(fp, "NSpid: %d %d", &pid, &nspid); + if (ret == 1) { + break; +-- +2.17.1 + diff --git a/8223485-C2-PhaseIdealLoop-create_new_if_for_predicat.patch b/8223485-C2-PhaseIdealLoop-create_new_if_for_predicat.patch new file mode 100644 index 0000000000000000000000000000000000000000..aa9142cca3b26cc0a7789a715206bc85a8f80061 --- /dev/null +++ b/8223485-C2-PhaseIdealLoop-create_new_if_for_predicat.patch @@ -0,0 +1,21 @@ +Subject: 8223485: C2:PhaseIdealLoop::create_new_if_for_predicate() computes wrong IDOM +--- + hotspot/src/share/vm/opto/loopPredicate.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/hotspot/src/share/vm/opto/loopPredicate.cpp b/hotspot/src/share/vm/opto/loopPredicate.cpp +index a21702e98..b2a3e86eb 100644 +--- a/hotspot/src/share/vm/opto/loopPredicate.cpp ++++ b/hotspot/src/share/vm/opto/loopPredicate.cpp +@@ -143,7 +143,7 @@ ProjNode* PhaseIdealLoop::create_new_if_for_predicate(ProjNode* cont_proj, Node* + // When called from beautify_loops() idom is not constructed yet. + if (_idom != NULL) { + Node* ridom = idom(rgn); +- Node* nrdom = dom_lca(ridom, new_iff); ++ Node* nrdom = dom_lca_internal(ridom, new_iff); + set_idom(rgn, nrdom, dom_depth(rgn)); + } + +-- +2.19.1 + diff --git a/8223486-split-if-update_uses-accesses-stale-idom-dat.patch b/8223486-split-if-update_uses-accesses-stale-idom-dat.patch new file mode 100644 index 0000000000000000000000000000000000000000..a98f9e5d45787424808f755473a0feb0c0c3780a --- /dev/null +++ b/8223486-split-if-update_uses-accesses-stale-idom-dat.patch @@ -0,0 +1,38 @@ +Subject: 8223486: split-if update_uses accesses stale idom data +--- + hotspot/src/share/vm/opto/split_if.cpp | 11 ++++------- + 1 file changed, 4 insertions(+), 7 deletions(-) + +diff --git a/hotspot/src/share/vm/opto/split_if.cpp b/hotspot/src/share/vm/opto/split_if.cpp +index 94d680c11..636af191d 100644 +--- a/hotspot/src/share/vm/opto/split_if.cpp ++++ b/hotspot/src/share/vm/opto/split_if.cpp +@@ -486,7 +486,9 @@ void PhaseIdealLoop::do_split_if( Node *iff ) { + } + _igvn.remove_dead_node(new_iff); + // Lazy replace IDOM info with the region's dominator +- lazy_replace( iff, region_dom ); ++ lazy_replace(iff, region_dom); ++ lazy_update(region, region_dom); // idom must be update before handle_uses ++ region->set_req(0, NULL); // Break the self-cycle. Required for lazy_update to work on region + + // Now make the original merge point go dead, by handling all its uses. + small_cache region_cache; +@@ -529,13 +531,8 @@ void PhaseIdealLoop::do_split_if( Node *iff ) { + --k; + } // End of while merge point has phis + +- assert(region->outcnt() == 1, "Only self reference should remain"); // Just Self on the Region +- region->set_req(0, NULL); // Break the self-cycle ++ _igvn.remove_dead_node(region); + +- // Any leftover bits in the splitting block must not have depended on local +- // Phi inputs (these have already been split-up). Hence it's safe to hoist +- // these guys to the dominating point. +- lazy_replace( region, region_dom ); + #ifndef PRODUCT + if( VerifyLoopOptimizations ) verify(); + #endif +-- +2.19.1 + diff --git a/8256488-Use-ldpq-stpq-instead-of-ld4-st4-for-small-c.patch b/8256488-Use-ldpq-stpq-instead-of-ld4-st4-for-small-c.patch new file mode 100644 index 0000000000000000000000000000000000000000..a9289985bab6548fe402a26ee4557bb18fbad134 --- /dev/null +++ b/8256488-Use-ldpq-stpq-instead-of-ld4-st4-for-small-c.patch @@ -0,0 +1,60 @@ +Subject: 8256488: Use ldpq/stpq instead of ld4/st4 for small copies in StubGenerator::copy_memory + +-- + .../cpu/aarch64/vm/stubGenerator_aarch64.cpp | 30 ++++++++++++++++--- + 1 file changed, 26 insertions(+), 4 deletions(-) + +diff --git a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp +index f61028d5007..cf66df296e4 100644 +--- a/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp ++++ b/hotspot/src/cpu/aarch64/vm/stubGenerator_aarch64.cpp +@@ -1149,10 +1149,10 @@ class StubGenerator: public StubCodeGenerator { + Register count, Register tmp, int step) { + copy_direction direction = step < 0 ? copy_backwards : copy_forwards; + bool is_backwards = step < 0; +- int granularity = uabs(step); ++ unsigned granularity = uabs(step); + const Register t0 = r3, t1 = r4; + +- // <= 96 bytes do inline. Direction doesn't matter because we always ++ // <= 80 (or 96 for SIMD) bytes do inline. Direction doesn't matter because we always + // load all the data before writing anything + Label copy4, copy8, copy16, copy32, copy80, copy128, copy_big, finish; + const Register t2 = r5, t3 = r6, t4 = r7, t5 = r8; +@@ -1207,9 +1207,31 @@ class StubGenerator: public StubCodeGenerator { + // (96 bytes if SIMD because we do 32 byes per instruction) + __ bind(copy80); + if (UseSIMDForMemoryOps) { +- __ ld4(v0, v1, v2, v3, __ T16B, Address(s, 0)); ++ __ ldpq(v0, v1, Address(s, 0)); ++ __ ldpq(v2, v3, Address(s, 32)); ++ // Unaligned pointers can be an issue for copying. ++ // The issue has more chances to happen when granularity of data is ++ // less than 4(sizeof(jint)). Pointers for arrays of jint are at least ++ // 4 byte aligned. Pointers for arrays of jlong are 8 byte aligned. ++ // The most performance drop has been seen for the range 65-80 bytes. ++ // For such cases using the pair of ldp/stp instead of the third pair of ++ // ldpq/stpq fixes the performance issue. ++ if (granularity < sizeof (jint)) { ++ Label copy96; ++ __ cmp(count, u1(80/granularity)); ++ __ br(Assembler::HI, copy96); ++ __ ldp(t0, t1, Address(send, -16)); ++ ++ __ stpq(v0, v1, Address(d, 0)); ++ __ stpq(v2, v3, Address(d, 32)); ++ __ stp(t0, t1, Address(dend, -16)); ++ __ b(finish); ++ ++ __ bind(copy96); ++ } + __ ldpq(v4, v5, Address(send, -32)); +- __ st4(v0, v1, v2, v3, __ T16B, Address(d, 0)); ++ __ stpq(v0, v1, Address(d, 0)); ++ __ stpq(v2, v3, Address(d, 32)); + __ stpq(v4, v5, Address(dend, -32)); + } else { + __ ldp(t0, t1, Address(s, 0)); +-- +2.19.1 + diff --git a/DependencyContext-mark_dependent_nmethods-crash-in-Dynamic-cds-mode.patch b/DependencyContext-mark_dependent_nmethods-crash-in-Dynamic-cds-mode.patch new file mode 100644 index 0000000000000000000000000000000000000000..a0a9115b822c1d8a81b356121410107277c8f207 --- /dev/null +++ b/DependencyContext-mark_dependent_nmethods-crash-in-Dynamic-cds-mode.patch @@ -0,0 +1,29 @@ +DependencyContext::mark_dependent_nmethods crash in Dynamic cds mode +--- + hotspot/src/share/vm/oops/instanceKlass.cpp | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/hotspot/src/share/vm/oops/instanceKlass.cpp b/hotspot/src/share/vm/oops/instanceKlass.cpp +index df44e5319..833cf9afe 100644 +--- a/hotspot/src/share/vm/oops/instanceKlass.cpp ++++ b/hotspot/src/share/vm/oops/instanceKlass.cpp +@@ -2462,8 +2462,6 @@ void InstanceKlass::remove_unshareable_info() { + + constants()->remove_unshareable_info(); + +- assert(_dep_context == DependencyContext::EMPTY, "dependency context is not shareable"); +- + for (int i = 0; i < methods()->length(); i++) { + Method* m = methods()->at(i); + m->remove_unshareable_info(); +@@ -2487,6 +2485,7 @@ void InstanceKlass::remove_unshareable_info() { + // do array classes also. + array_klasses_do(remove_unshareable_in_class); + // These are not allocated from metaspace. They are safe to set to NULL. ++ _dep_context = DependencyContext::EMPTY; + _member_names = NULL; + _osr_nmethods_head = NULL; + _init_thread = NULL; +-- +2.22.0 + diff --git a/GCC-12-reports-some-compiler-warnings.patch b/GCC-12-reports-some-compiler-warnings.patch new file mode 100644 index 0000000000000000000000000000000000000000..ef232eaa39e64e7f17c3b3873650655e7df755ff --- /dev/null +++ b/GCC-12-reports-some-compiler-warnings.patch @@ -0,0 +1,41 @@ +Subject: fix GCC 12 fails to compile AArch64 due to -Wstringop-overflow + +--- + hotspot/make/linux/makefiles/gcc.make | 2 +- + hotspot/src/share/vm/opto/type.cpp | 7 +++++-- + 2 files changed, 6 insertions(+), 3 deletions(-) + +diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make +index 7dde7f096..d122f0eae 100644 +--- a/hotspot/make/linux/makefiles/gcc.make ++++ b/hotspot/make/linux/makefiles/gcc.make +@@ -212,7 +212,7 @@ ifeq ($(USE_CLANG), true) + WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body + endif + +-WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type ++WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type -Wno-stringop-overflow + + ifeq ($(USE_CLANG),) + # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit +diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp +index 58572f137..92d4e6b70 100644 +--- a/hotspot/src/share/vm/opto/type.cpp ++++ b/hotspot/src/share/vm/opto/type.cpp +@@ -2553,8 +2553,11 @@ TypeOopPtr::TypeOopPtr(TYPES t, PTR ptr, ciKlass* k, bool xk, ciObject* o, int o + _offset >= InstanceMirrorKlass::offset_of_static_fields()) { + // Static fields + assert(o != NULL, "must be constant"); +- ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass(); +- ciField* field = k->get_field_by_offset(_offset, true); ++ ciField* field = NULL; ++ if (o != NULL) { ++ ciInstanceKlass* k = o->as_instance()->java_lang_Class_klass()->as_instance_klass(); ++ field = k->get_field_by_offset(_offset, true); ++ } + assert(field != NULL, "missing field"); + BasicType basic_elem_type = field->layout_type(); + _is_ptr_to_narrowoop = UseCompressedOops && (basic_elem_type == T_OBJECT || +-- +2.22.0 + diff --git a/LoongArch64-support.patch b/LoongArch64-support.patch index e88f15f1da195c1ccfdee460aaaba4e26bb9f605..6be43aca669dbb53b47d3d2b8021669afbd05995 100644 --- a/LoongArch64-support.patch +++ b/LoongArch64-support.patch @@ -1,7 +1,662 @@ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/common/autoconf/build-aux/autoconf-config.guess b/common/autoconf/build-aux/autoconf-config.guess ---- a/common/autoconf/build-aux/autoconf-config.guess 2024-01-11 09:53:23.000000000 +0800 -+++ b/common/autoconf/build-aux/autoconf-config.guess 2023-12-20 09:23:19.571483804 +0800 -@@ -977,6 +977,9 @@ +From f762ff2634a7140bc295b98676f1db9602b15dcd Mon Sep 17 00:00:00 2001 +From: songliyang +Date: Mon, 20 May 2024 09:51:57 +0800 +Subject: [PATCH] add loongarch support + +--- + .../autoconf/build-aux/autoconf-config.guess | 3 + + common/autoconf/build-aux/autoconf-config.sub | 1 + + common/autoconf/build-aux/config.guess | 11 + + common/autoconf/configure.ac | 7 + + common/autoconf/generated-configure.sh | 95 +- + common/autoconf/jdk-options.m4 | 12 + + common/autoconf/platform.m4 | 65 + + common/autoconf/spec.gmk.in | 23 + + hotspot/agent/make/saenv.sh | 14 + + .../agent/src/os/linux/LinuxDebuggerLocal.c | 72 +- + hotspot/agent/src/os/linux/Makefile | 10 +- + hotspot/agent/src/os/linux/libproc.h | 15 +- + hotspot/agent/src/os/linux/ps_proc.c | 8 +- + .../classes/sun/jvm/hotspot/HotSpotAgent.java | 12 + + .../sun/jvm/hotspot/asm/Disassembler.java | 6 + + .../MachineDescriptionLOONGARCH64.java | 41 + + .../debugger/MachineDescriptionMIPS64.java | 41 + + .../debugger/linux/LinuxCDebugger.java | 18 + + .../linux/LinuxThreadContextFactory.java | 6 + + .../loongarch64/LinuxLOONGARCH64CFrame.java | 80 + + .../LinuxLOONGARCH64ThreadContext.java | 47 + + .../linux/mips64/LinuxMIPS64CFrame.java | 80 + + .../mips64/LinuxMIPS64ThreadContext.java | 47 + + .../loongarch64/LOONGARCH64ThreadContext.java | 123 + + .../debugger/mips64/MIPS64ThreadContext.java | 123 + + .../hotspot/debugger/posix/elf/ELFHeader.java | 2 + + .../debugger/proc/ProcDebuggerLocal.java | 12 + + .../loongarch64/ProcLOONGARCH64Thread.java | 92 + + .../ProcLOONGARCH64ThreadContext.java | 47 + + .../ProcLOONGARCH64ThreadFactory.java | 45 + + .../proc/mips64/ProcMIPS64Thread.java | 92 + + .../proc/mips64/ProcMIPS64ThreadContext.java | 47 + + .../proc/mips64/ProcMIPS64ThreadFactory.java | 45 + + .../debugger/remote/RemoteDebuggerClient.java | 12 + + .../loongarch64/RemoteLOONGARCH64Thread.java | 54 + + .../RemoteLOONGARCH64ThreadContext.java | 51 + + .../RemoteLOONGARCH64ThreadFactory.java | 45 + + .../remote/mips64/RemoteMIPS64Thread.java | 54 + + .../mips64/RemoteMIPS64ThreadContext.java | 51 + + .../mips64/RemoteMIPS64ThreadFactory.java | 45 + + .../sun/jvm/hotspot/runtime/Threads.java | 6 + + .../LinuxLOONGARCH64JavaThreadPDAccess.java | 133 + + .../LinuxMIPS64JavaThreadPDAccess.java | 132 + + .../LOONGARCH64CurrentFrameGuess.java | 217 + + .../runtime/loongarch64/LOONGARCH64Frame.java | 534 + + .../LOONGARCH64JavaCallWrapper.java | 57 + + .../loongarch64/LOONGARCH64RegisterMap.java | 52 + + .../mips64/MIPS64CurrentFrameGuess.java | 217 + + .../hotspot/runtime/mips64/MIPS64Frame.java | 547 + + .../runtime/mips64/MIPS64JavaCallWrapper.java | 57 + + .../runtime/mips64/MIPS64RegisterMap.java | 52 + + .../jvm/hotspot/utilities/PlatformInfo.java | 11 + + hotspot/make/defs.make | 37 +- + hotspot/make/linux/Makefile | 4 + + hotspot/make/linux/makefiles/defs.make | 56 + + hotspot/make/linux/makefiles/gcc.make | 11 +- + hotspot/make/linux/makefiles/loongarch64.make | 43 + + hotspot/make/linux/makefiles/mips64.make | 43 + + hotspot/make/linux/makefiles/sa.make | 8 + + hotspot/make/linux/makefiles/saproc.make | 12 + + hotspot/make/linux/makefiles/sparcWorks.make | 7 + + hotspot/make/linux/makefiles/vm.make | 28 + + hotspot/make/linux/platform_loongarch64 | 17 + + hotspot/make/linux/platform_mips64 | 17 + + hotspot/make/sa.files | 16 + + .../aarch64/vm/c1_LIRAssembler_aarch64.cpp | 17 +- + .../aarch64/vm/c1_LIRGenerator_aarch64.cpp | 19 +- + .../cpu/loongarch/vm/assembler_loongarch.cpp | 855 + + .../cpu/loongarch/vm/assembler_loongarch.hpp | 2810 ++++ + .../vm/assembler_loongarch.inline.hpp | 33 + + .../vm/bytecodeInterpreter_loongarch.hpp | 110 + + .../bytecodeInterpreter_loongarch.inline.hpp | 286 + + .../cpu/loongarch/vm/bytecodes_loongarch.cpp | 38 + + .../cpu/loongarch/vm/bytecodes_loongarch.hpp | 31 + + .../src/cpu/loongarch/vm/bytes_loongarch.hpp | 75 + + .../vm/c1_CodeStubs_loongarch_64.cpp | 387 + + .../cpu/loongarch/vm/c1_Defs_loongarch.hpp | 79 + + .../loongarch/vm/c1_FpuStackSim_loongarch.hpp | 32 + + .../vm/c1_FpuStackSim_loongarch_64.cpp | 31 + + .../loongarch/vm/c1_FrameMap_loongarch.hpp | 143 + + .../loongarch/vm/c1_FrameMap_loongarch_64.cpp | 362 + + .../vm/c1_LIRAssembler_loongarch.hpp | 83 + + .../vm/c1_LIRAssembler_loongarch_64.cpp | 3377 ++++ + .../vm/c1_LIRGenerator_loongarch_64.cpp | 1442 ++ + .../loongarch/vm/c1_LinearScan_loongarch.hpp | 70 + + .../vm/c1_LinearScan_loongarch_64.cpp | 33 + + .../vm/c1_MacroAssembler_loongarch.hpp | 112 + + .../vm/c1_MacroAssembler_loongarch_64.cpp | 346 + + .../loongarch/vm/c1_Runtime1_loongarch_64.cpp | 1252 ++ + .../cpu/loongarch/vm/c1_globals_loongarch.hpp | 69 + + .../cpu/loongarch/vm/c2_globals_loongarch.hpp | 87 + + .../cpu/loongarch/vm/c2_init_loongarch.cpp | 34 + + .../cpu/loongarch/vm/codeBuffer_loongarch.hpp | 35 + + .../cpu/loongarch/vm/compiledIC_loongarch.cpp | 167 + + .../src/cpu/loongarch/vm/copy_loongarch.hpp | 90 + + .../vm/cppInterpreterGenerator_loongarch.hpp | 53 + + .../loongarch/vm/cppInterpreter_loongarch.cpp | 215 + + .../src/cpu/loongarch/vm/debug_loongarch.cpp | 51 + + .../cpu/loongarch/vm/depChecker_loongarch.cpp | 30 + + .../cpu/loongarch/vm/depChecker_loongarch.hpp | 31 + + .../loongarch/vm/disassembler_loongarch.hpp | 37 + + .../src/cpu/loongarch/vm/frame_loongarch.cpp | 711 + + .../src/cpu/loongarch/vm/frame_loongarch.hpp | 229 + + .../loongarch/vm/frame_loongarch.inline.hpp | 312 + + .../vm/globalDefinitions_loongarch.hpp | 41 + + .../cpu/loongarch/vm/globals_loongarch.hpp | 103 + + .../cpu/loongarch/vm/icBuffer_loongarch.cpp | 101 + + .../src/cpu/loongarch/vm/icache_loongarch.cpp | 42 + + .../src/cpu/loongarch/vm/icache_loongarch.hpp | 41 + + .../loongarch/vm/interp_masm_loongarch_64.cpp | 1960 +++ + .../loongarch/vm/interp_masm_loongarch_64.hpp | 269 + + .../vm/interpreterGenerator_loongarch.hpp | 51 + + .../loongarch/vm/interpreterRT_loongarch.hpp | 66 + + .../vm/interpreterRT_loongarch_64.cpp | 274 + + .../loongarch/vm/interpreter_loongarch.hpp | 50 + + .../loongarch/vm/interpreter_loongarch_64.cpp | 277 + + .../vm/javaFrameAnchor_loongarch.hpp | 87 + + .../vm/jniFastGetField_loongarch_64.cpp | 169 + + .../cpu/loongarch/vm/jniTypes_loongarch.hpp | 144 + + hotspot/src/cpu/loongarch/vm/jni_loongarch.h | 51 + + hotspot/src/cpu/loongarch/vm/loongarch.ad | 24 + + hotspot/src/cpu/loongarch/vm/loongarch_64.ad | 12861 ++++++++++++++ + .../loongarch/vm/macroAssembler_loongarch.cpp | 3895 +++++ + .../loongarch/vm/macroAssembler_loongarch.hpp | 771 + + .../vm/macroAssembler_loongarch.inline.hpp | 34 + + .../vm/metaspaceShared_loongarch_64.cpp | 120 + + .../loongarch/vm/methodHandles_loongarch.cpp | 566 + + .../loongarch/vm/methodHandles_loongarch.hpp | 62 + + .../cpu/loongarch/vm/nativeInst_loongarch.cpp | 485 + + .../cpu/loongarch/vm/nativeInst_loongarch.hpp | 513 + + .../loongarch/vm/registerMap_loongarch.hpp | 45 + + .../vm/register_definitions_loongarch.cpp | 103 + + .../cpu/loongarch/vm/register_loongarch.cpp | 59 + + .../cpu/loongarch/vm/register_loongarch.hpp | 436 + + .../cpu/loongarch/vm/relocInfo_loongarch.cpp | 130 + + .../cpu/loongarch/vm/relocInfo_loongarch.hpp | 40 + + .../cpu/loongarch/vm/runtime_loongarch_64.cpp | 199 + + .../vm/sharedRuntime_loongarch_64.cpp | 3453 ++++ + .../vm/stubGenerator_loongarch_64.cpp | 3445 ++++ + .../vm/stubRoutines_loongarch_64.cpp | 264 + + .../vm/stubRoutines_loongarch_64.hpp | 60 + + ...templateInterpreterGenerator_loongarch.hpp | 35 + + .../vm/templateInterpreter_loongarch.hpp | 41 + + .../vm/templateInterpreter_loongarch_64.cpp | 2335 +++ + .../vm/templateTable_loongarch_64.cpp | 4024 +++++ + .../vm/templateTable_loongarch_64.hpp | 44 + + .../cpu/loongarch/vm/vmStructs_loongarch.hpp | 68 + + .../loongarch/vm/vm_version_ext_loongarch.cpp | 84 + + .../loongarch/vm/vm_version_ext_loongarch.hpp | 54 + + .../cpu/loongarch/vm/vm_version_loongarch.cpp | 443 + + .../cpu/loongarch/vm/vm_version_loongarch.hpp | 299 + + .../src/cpu/loongarch/vm/vmreg_loongarch.cpp | 51 + + .../src/cpu/loongarch/vm/vmreg_loongarch.hpp | 35 + + .../loongarch/vm/vmreg_loongarch.inline.hpp | 66 + + .../loongarch/vm/vtableStubs_loongarch_64.cpp | 300 + + hotspot/src/cpu/mips/vm/assembler_mips.cpp | 774 + + hotspot/src/cpu/mips/vm/assembler_mips.hpp | 1789 ++ + .../src/cpu/mips/vm/assembler_mips.inline.hpp | 33 + + .../cpu/mips/vm/bytecodeInterpreter_mips.cpp | 53 + + .../cpu/mips/vm/bytecodeInterpreter_mips.hpp | 110 + + .../vm/bytecodeInterpreter_mips.inline.hpp | 286 + + hotspot/src/cpu/mips/vm/bytecodes_mips.cpp | 38 + + hotspot/src/cpu/mips/vm/bytecodes_mips.hpp | 31 + + hotspot/src/cpu/mips/vm/bytes_mips.hpp | 193 + + hotspot/src/cpu/mips/vm/c2_globals_mips.hpp | 100 + + hotspot/src/cpu/mips/vm/c2_init_mips.cpp | 34 + + hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp | 35 + + hotspot/src/cpu/mips/vm/compiledIC_mips.cpp | 173 + + hotspot/src/cpu/mips/vm/copy_mips.hpp | 90 + + .../mips/vm/cppInterpreterGenerator_mips.hpp | 53 + + .../src/cpu/mips/vm/cppInterpreter_mips.cpp | 215 + + .../src/cpu/mips/vm/cppInterpreter_mips.hpp | 40 + + hotspot/src/cpu/mips/vm/debug_mips.cpp | 51 + + hotspot/src/cpu/mips/vm/depChecker_mips.cpp | 30 + + hotspot/src/cpu/mips/vm/depChecker_mips.hpp | 31 + + hotspot/src/cpu/mips/vm/disassembler_mips.hpp | 37 + + hotspot/src/cpu/mips/vm/frame_mips.cpp | 711 + + hotspot/src/cpu/mips/vm/frame_mips.hpp | 229 + + hotspot/src/cpu/mips/vm/frame_mips.inline.hpp | 312 + + .../cpu/mips/vm/globalDefinitions_mips.hpp | 41 + + hotspot/src/cpu/mips/vm/globals_mips.hpp | 124 + + hotspot/src/cpu/mips/vm/icBuffer_mips.cpp | 97 + + hotspot/src/cpu/mips/vm/icache_mips.cpp | 41 + + hotspot/src/cpu/mips/vm/icache_mips.hpp | 41 + + .../src/cpu/mips/vm/interp_masm_mips_64.cpp | 2084 +++ + .../src/cpu/mips/vm/interp_masm_mips_64.hpp | 269 + + .../cpu/mips/vm/interpreterGenerator_mips.hpp | 49 + + .../src/cpu/mips/vm/interpreterRT_mips.hpp | 61 + + .../src/cpu/mips/vm/interpreterRT_mips_64.cpp | 259 + + hotspot/src/cpu/mips/vm/interpreter_mips.hpp | 50 + + .../src/cpu/mips/vm/interpreter_mips_64.cpp | 286 + + .../src/cpu/mips/vm/javaFrameAnchor_mips.hpp | 87 + + .../cpu/mips/vm/jniFastGetField_mips_64.cpp | 172 + + hotspot/src/cpu/mips/vm/jniTypes_mips.hpp | 144 + + hotspot/src/cpu/mips/vm/jni_mips.h | 51 + + .../src/cpu/mips/vm/macroAssembler_mips.cpp | 4332 +++++ + .../src/cpu/mips/vm/macroAssembler_mips.hpp | 701 + + .../mips/vm/macroAssembler_mips.inline.hpp | 34 + + .../cpu/mips/vm/metaspaceShared_mips_64.cpp | 123 + + .../src/cpu/mips/vm/methodHandles_mips.cpp | 576 + + .../src/cpu/mips/vm/methodHandles_mips.hpp | 62 + + hotspot/src/cpu/mips/vm/mips.ad | 25 + + hotspot/src/cpu/mips/vm/mips_64.ad | 14036 ++++++++++++++++ + hotspot/src/cpu/mips/vm/nativeInst_mips.cpp | 1829 ++ + hotspot/src/cpu/mips/vm/nativeInst_mips.hpp | 735 + + hotspot/src/cpu/mips/vm/registerMap_mips.hpp | 47 + + .../cpu/mips/vm/register_definitions_mips.cpp | 103 + + hotspot/src/cpu/mips/vm/register_mips.cpp | 52 + + hotspot/src/cpu/mips/vm/register_mips.hpp | 346 + + hotspot/src/cpu/mips/vm/relocInfo_mips.cpp | 156 + + hotspot/src/cpu/mips/vm/relocInfo_mips.hpp | 40 + + hotspot/src/cpu/mips/vm/runtime_mips_64.cpp | 206 + + .../src/cpu/mips/vm/sharedRuntime_mips_64.cpp | 3816 +++++ + .../src/cpu/mips/vm/stubGenerator_mips_64.cpp | 2147 +++ + .../src/cpu/mips/vm/stubRoutines_mips_64.cpp | 35 + + .../src/cpu/mips/vm/stubRoutines_mips_64.hpp | 59 + + .../vm/templateInterpreterGenerator_mips.hpp | 35 + + .../cpu/mips/vm/templateInterpreter_mips.hpp | 41 + + .../mips/vm/templateInterpreter_mips_64.cpp | 2306 +++ + .../src/cpu/mips/vm/templateTable_mips.hpp | 34 + + .../src/cpu/mips/vm/templateTable_mips_64.cpp | 4623 +++++ + .../src/cpu/mips/vm/templateTable_mips_64.hpp | 44 + + hotspot/src/cpu/mips/vm/vmStructs_mips.hpp | 68 + + .../src/cpu/mips/vm/vm_version_ext_mips.cpp | 89 + + .../src/cpu/mips/vm/vm_version_ext_mips.hpp | 54 + + hotspot/src/cpu/mips/vm/vm_version_mips.cpp | 510 + + hotspot/src/cpu/mips/vm/vm_version_mips.hpp | 221 + + hotspot/src/cpu/mips/vm/vmreg_mips.cpp | 51 + + hotspot/src/cpu/mips/vm/vmreg_mips.hpp | 35 + + hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp | 68 + + .../src/cpu/mips/vm/vtableStubs_mips_64.cpp | 301 + + .../src/cpu/x86/vm/c1_LIRAssembler_x86.cpp | 10 + + .../src/cpu/x86/vm/c1_LIRGenerator_x86.cpp | 21 +- + hotspot/src/os/linux/vm/os_linux.cpp | 27 +- + hotspot/src/os/linux/vm/os_perf_linux.cpp | 6 + + .../vm/assembler_linux_loongarch.cpp | 92 + + .../vm/atomic_linux_loongarch.inline.hpp | 206 + + .../vm/bytes_linux_loongarch.inline.hpp | 37 + + .../vm/copy_linux_loongarch.inline.hpp | 125 + + .../vm/globals_linux_loongarch.hpp | 43 + + .../vm/orderAccess_linux_loongarch.inline.hpp | 115 + + .../linux_loongarch/vm/os_linux_loongarch.cpp | 750 + + .../linux_loongarch/vm/os_linux_loongarch.hpp | 39 + + .../vm/prefetch_linux_loongarch.inline.hpp | 56 + + .../vm/threadLS_linux_loongarch.cpp | 84 + + .../vm/threadLS_linux_loongarch.hpp | 61 + + .../vm/thread_linux_loongarch.cpp | 99 + + .../vm/thread_linux_loongarch.hpp | 75 + + .../vm/vmStructs_linux_loongarch.hpp | 55 + + .../vm/vm_version_linux_loongarch.cpp | 29 + + .../linux_mips/vm/assembler_linux_mips.cpp | 111 + + .../vm/atomic_linux_mips.inline.hpp | 258 + + .../linux_mips/vm/bytes_linux_mips.inline.hpp | 37 + + .../linux_mips/vm/copy_linux_mips.inline.hpp | 125 + + .../linux_mips/vm/globals_linux_mips.hpp | 51 + + .../src/os_cpu/linux_mips/vm/linux_mips.ad | 153 + + hotspot/src/os_cpu/linux_mips/vm/linux_mips.s | 25 + + .../src/os_cpu/linux_mips/vm/linux_mips_64.ad | 50 + + .../vm/orderAccess_linux_mips.inline.hpp | 115 + + .../os_cpu/linux_mips/vm/os_linux_mips.cpp | 1015 ++ + .../os_cpu/linux_mips/vm/os_linux_mips.hpp | 39 + + .../vm/prefetch_linux_mips.inline.hpp | 58 + + .../linux_mips/vm/threadLS_linux_mips.cpp | 84 + + .../linux_mips/vm/threadLS_linux_mips.hpp | 61 + + .../linux_mips/vm/thread_linux_mips.cpp | 99 + + .../linux_mips/vm/thread_linux_mips.hpp | 75 + + .../linux_mips/vm/vmStructs_linux_mips.hpp | 55 + + .../linux_mips/vm/vm_version_linux_mips.cpp | 28 + + hotspot/src/share/tools/hsdis/Makefile | 13 + + hotspot/src/share/tools/hsdis/hsdis.c | 10 + + hotspot/src/share/vm/adlc/main.cpp | 14 + + hotspot/src/share/vm/asm/assembler.hpp | 20 + + hotspot/src/share/vm/asm/assembler.inline.hpp | 12 + + hotspot/src/share/vm/asm/codeBuffer.cpp | 7 + + hotspot/src/share/vm/asm/codeBuffer.hpp | 12 + + hotspot/src/share/vm/asm/macroAssembler.hpp | 13 +- + .../share/vm/asm/macroAssembler.inline.hpp | 12 + + hotspot/src/share/vm/asm/register.hpp | 12 + + hotspot/src/share/vm/c1/c1_Defs.hpp | 12 + + hotspot/src/share/vm/c1/c1_FpuStackSim.hpp | 9 + + hotspot/src/share/vm/c1/c1_FrameMap.cpp | 9 + + hotspot/src/share/vm/c1/c1_FrameMap.hpp | 9 + + hotspot/src/share/vm/c1/c1_LIR.cpp | 220 +- + hotspot/src/share/vm/c1/c1_LIR.hpp | 199 +- + hotspot/src/share/vm/c1/c1_LIRAssembler.cpp | 22 + + hotspot/src/share/vm/c1/c1_LIRAssembler.hpp | 12 + + hotspot/src/share/vm/c1/c1_LIRGenerator.cpp | 114 +- + hotspot/src/share/vm/c1/c1_LIRGenerator.hpp | 17 +- + hotspot/src/share/vm/c1/c1_LinearScan.cpp | 81 +- + hotspot/src/share/vm/c1/c1_LinearScan.hpp | 9 + + hotspot/src/share/vm/c1/c1_MacroAssembler.hpp | 9 + + hotspot/src/share/vm/c1/c1_Runtime1.cpp | 48 + + hotspot/src/share/vm/c1/c1_globals.hpp | 9 + + .../share/vm/classfile/bytecodeAssembler.cpp | 12 + + .../share/vm/classfile/classFileStream.hpp | 12 + + .../src/share/vm/classfile/stackMapTable.hpp | 12 + + hotspot/src/share/vm/classfile/verifier.cpp | 12 + + hotspot/src/share/vm/code/codeBlob.cpp | 12 + + hotspot/src/share/vm/code/compiledIC.hpp | 12 + + hotspot/src/share/vm/code/relocInfo.hpp | 45 +- + hotspot/src/share/vm/code/vmreg.hpp | 18 + + .../src/share/vm/compiler/disassembler.cpp | 12 + + .../src/share/vm/compiler/disassembler.hpp | 12 + + .../parallelScavenge/cardTableExtension.hpp | 3 + + .../parallelScavenge/parMarkBitMap.cpp | 3 + + .../psCompactionManager.inline.hpp | 6 + + .../parallelScavenge/psParallelCompact.cpp | 9 + + .../parallelScavenge/psParallelCompact.hpp | 6 + + .../psPromotionManager.inline.hpp | 24 +- + .../parallelScavenge/psScavenge.inline.hpp | 21 +- + .../vm/interpreter/abstractInterpreter.hpp | 10 + + hotspot/src/share/vm/interpreter/bytecode.hpp | 12 + + .../vm/interpreter/bytecodeInterpreter.hpp | 15 + + .../bytecodeInterpreter.inline.hpp | 12 + + .../share/vm/interpreter/bytecodeStream.hpp | 12 + + .../src/share/vm/interpreter/bytecodes.cpp | 12 + + .../src/share/vm/interpreter/bytecodes.hpp | 12 + + .../share/vm/interpreter/cppInterpreter.hpp | 12 + + .../interpreter/cppInterpreterGenerator.hpp | 12 + + .../src/share/vm/interpreter/interpreter.hpp | 12 + + .../vm/interpreter/interpreterGenerator.hpp | 12 + + .../vm/interpreter/interpreterRuntime.cpp | 14 +- + .../vm/interpreter/interpreterRuntime.hpp | 14 +- + .../vm/interpreter/templateInterpreter.hpp | 12 + + .../templateInterpreterGenerator.hpp | 12 + + .../share/vm/interpreter/templateTable.hpp | 14 + + .../share/vm/jfr/utilities/jfrBigEndian.hpp | 2 +- + .../src/share/vm/jfr/writers/jfrEncoders.hpp | 12 + + hotspot/src/share/vm/memory/barrierSet.hpp | 25 +- + .../src/share/vm/memory/cardTableModRefBS.hpp | 12 +- + hotspot/src/share/vm/memory/cardTableRS.cpp | 10 +- + hotspot/src/share/vm/memory/cardTableRS.hpp | 9 +- + hotspot/src/share/vm/memory/metaspace.cpp | 13 +- + hotspot/src/share/vm/oops/constantPool.hpp | 13 + + hotspot/src/share/vm/oops/klass.hpp | 17 +- + hotspot/src/share/vm/oops/oop.hpp | 8 +- + hotspot/src/share/vm/oops/oop.inline.hpp | 12 + + hotspot/src/share/vm/oops/oop.pcgc.inline.hpp | 8 +- + hotspot/src/share/vm/opto/buildOopMap.cpp | 12 + + hotspot/src/share/vm/opto/bytecodeInfo.cpp | 11 + + hotspot/src/share/vm/opto/c2_globals.hpp | 12 + + hotspot/src/share/vm/opto/c2compiler.cpp | 10 + + hotspot/src/share/vm/opto/chaitin.hpp | 14 + + hotspot/src/share/vm/opto/compile.cpp | 10 + + hotspot/src/share/vm/opto/compile.hpp | 2 +- + hotspot/src/share/vm/opto/gcm.cpp | 10 + + hotspot/src/share/vm/opto/lcm.cpp | 10 + + hotspot/src/share/vm/opto/locknode.hpp | 10 + + hotspot/src/share/vm/opto/matcher.cpp | 10 + + hotspot/src/share/vm/opto/output.cpp | 43 + + hotspot/src/share/vm/opto/output.hpp | 10 + + hotspot/src/share/vm/opto/regmask.cpp | 10 + + hotspot/src/share/vm/opto/regmask.hpp | 10 + + hotspot/src/share/vm/opto/runtime.cpp | 10 + + hotspot/src/share/vm/opto/type.cpp | 16 + + hotspot/src/share/vm/prims/jniCheck.cpp | 12 + + hotspot/src/share/vm/prims/jni_md.h | 12 + + .../vm/prims/jvmtiClassFileReconstituter.cpp | 12 + + hotspot/src/share/vm/prims/methodHandles.hpp | 13 + + .../src/share/vm/runtime/atomic.inline.hpp | 12 + + .../src/share/vm/runtime/deoptimization.cpp | 18 + + hotspot/src/share/vm/runtime/dtraceJSDT.hpp | 12 + + hotspot/src/share/vm/runtime/frame.cpp | 13 + + hotspot/src/share/vm/runtime/frame.hpp | 16 + + hotspot/src/share/vm/runtime/frame.inline.hpp | 18 + + hotspot/src/share/vm/runtime/globals.hpp | 26 +- + hotspot/src/share/vm/runtime/icache.hpp | 13 +- + hotspot/src/share/vm/runtime/java.cpp | 12 + + hotspot/src/share/vm/runtime/javaCalls.hpp | 12 + + .../src/share/vm/runtime/javaFrameAnchor.hpp | 12 + + hotspot/src/share/vm/runtime/os.cpp | 3 +- + hotspot/src/share/vm/runtime/os.hpp | 12 + + .../src/share/vm/runtime/prefetch.inline.hpp | 6 + + hotspot/src/share/vm/runtime/registerMap.hpp | 18 + + hotspot/src/share/vm/runtime/relocator.hpp | 12 + + hotspot/src/share/vm/runtime/safepoint.cpp | 14 + + .../src/share/vm/runtime/sharedRuntime.cpp | 16 +- + .../share/vm/runtime/sharedRuntimeTrig.cpp | 15 + + .../share/vm/runtime/stackValueCollection.cpp | 12 + + hotspot/src/share/vm/runtime/statSampler.cpp | 12 + + hotspot/src/share/vm/runtime/stubRoutines.hpp | 16 + + hotspot/src/share/vm/runtime/thread.cpp | 6 + + hotspot/src/share/vm/runtime/thread.hpp | 12 + + .../share/vm/runtime/threadLocalStorage.hpp | 12 + + hotspot/src/share/vm/runtime/virtualspace.cpp | 16 + + hotspot/src/share/vm/runtime/vmStructs.cpp | 22 + + hotspot/src/share/vm/runtime/vm_version.cpp | 20 + + hotspot/src/share/vm/utilities/copy.hpp | 13 + + hotspot/src/share/vm/utilities/debug.cpp | 1 + + .../share/vm/utilities/globalDefinitions.hpp | 12 + + hotspot/src/share/vm/utilities/macros.hpp | 30 + + hotspot/src/share/vm/utilities/taskqueue.hpp | 74 +- + hotspot/src/share/vm/utilities/vmError.cpp | 14 +- + .../argumentcorruption/Test8167409.sh | 18 + + .../testcases/GenericTestCaseForOtherCPU.java | 5 +- + .../sha/predicate/IntrinsicPredicates.java | 10 +- + hotspot/test/runtime/6929067/Test6929067.sh | 4 + + hotspot/test/runtime/Unsafe/RangeCheck.java | 3 + + hotspot/test/test_env.sh | 23 + + .../com/oracle/java/testlibrary/Platform.java | 8 + + ...stMutuallyExclusivePlatformPredicates.java | 2 +- + jdk/make/Images.gmk | 20 + + jdk/make/gensrc/GensrcMisc.gmk | 13 + + jdk/make/lib/SoundLibraries.gmk | 14 + + .../classes/sun/misc/Version.java.template | 22 +- + jdk/src/solaris/bin/loongarch64/jvm.cfg | 36 + + jdk/src/solaris/bin/mips64/jvm.cfg | 36 + + .../jdk/jfr/event/os/TestCPUInformation.java | 4 +- + .../bootstrap/linux-loongarch64/launcher | 0 + .../bootstrap/linux-mips64el/launcher | 0 + jdk/test/sun/security/pkcs11/PKCS11Test.java | 8 + + 411 files changed, 111201 insertions(+), 216 deletions(-) + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java + create mode 100644 hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java + create mode 100644 hotspot/make/linux/makefiles/loongarch64.make + create mode 100644 hotspot/make/linux/makefiles/mips64.make + create mode 100644 hotspot/make/linux/platform_loongarch64 + create mode 100644 hotspot/make/linux/platform_mips64 + create mode 100644 hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/jni_loongarch.h + create mode 100644 hotspot/src/cpu/loongarch/vm/loongarch.ad + create mode 100644 hotspot/src/cpu/loongarch/vm/loongarch_64.ad + create mode 100644 hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/register_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/register_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp + create mode 100644 hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/assembler_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/assembler_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp + create mode 100644 hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp + create mode 100644 hotspot/src/cpu/mips/vm/bytecodes_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/bytecodes_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/bytes_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/c2_globals_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/c2_init_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/compiledIC_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/copy_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/debug_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/depChecker_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/depChecker_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/disassembler_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/frame_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/frame_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/frame_mips.inline.hpp + create mode 100644 hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/globals_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/icBuffer_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/icache_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/icache_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp + create mode 100644 hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/interpreter_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/jniTypes_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/jni_mips.h + create mode 100644 hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp + create mode 100644 hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/methodHandles_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/methodHandles_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/mips.ad + create mode 100644 hotspot/src/cpu/mips/vm/mips_64.ad + create mode 100644 hotspot/src/cpu/mips/vm/nativeInst_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/nativeInst_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/registerMap_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/register_definitions_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/register_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/register_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/relocInfo_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/relocInfo_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/runtime_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp + create mode 100644 hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/templateTable_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp + create mode 100644 hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp + create mode 100644 hotspot/src/cpu/mips/vm/vmStructs_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/vm_version_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/vm_version_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/vmreg_mips.cpp + create mode 100644 hotspot/src/cpu/mips/vm/vmreg_mips.hpp + create mode 100644 hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp + create mode 100644 hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp + create mode 100644 hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/linux_mips.s + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp + create mode 100644 hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp + create mode 100644 jdk/src/solaris/bin/loongarch64/jvm.cfg + create mode 100644 jdk/src/solaris/bin/mips64/jvm.cfg + create mode 100644 jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher + create mode 100644 jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher + +diff --git a/common/autoconf/build-aux/autoconf-config.guess b/common/autoconf/build-aux/autoconf-config.guess +index 15ee4389..3d7555b5 100644 +--- a/common/autoconf/build-aux/autoconf-config.guess ++++ b/common/autoconf/build-aux/autoconf-config.guess +@@ -977,6 +977,9 @@ EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; @@ -11,10 +666,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo or32:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/common/autoconf/build-aux/autoconf-config.sub b/common/autoconf/build-aux/autoconf-config.sub ---- a/common/autoconf/build-aux/autoconf-config.sub 2024-01-11 09:53:23.000000000 +0800 -+++ b/common/autoconf/build-aux/autoconf-config.sub 2023-12-20 09:23:19.574817100 +0800 -@@ -275,6 +275,7 @@ +diff --git a/common/autoconf/build-aux/autoconf-config.sub b/common/autoconf/build-aux/autoconf-config.sub +index 1aab2b30..bd910bdd 100644 +--- a/common/autoconf/build-aux/autoconf-config.sub ++++ b/common/autoconf/build-aux/autoconf-config.sub +@@ -275,6 +275,7 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ @@ -22,10 +678,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/common/autoconf/build-aux/config.guess b/common/autoconf/build-aux/config.guess ---- a/common/autoconf/build-aux/config.guess 2024-01-11 09:53:23.000000000 +0800 -+++ b/common/autoconf/build-aux/config.guess 2023-12-20 09:23:19.574817100 +0800 -@@ -86,4 +86,15 @@ +diff --git a/common/autoconf/build-aux/config.guess b/common/autoconf/build-aux/config.guess +index 288edb6e..ca6d5871 100644 +--- a/common/autoconf/build-aux/config.guess ++++ b/common/autoconf/build-aux/config.guess +@@ -95,4 +95,15 @@ if [ "x$OUT" = x ]; then fi fi @@ -41,9 +698,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo +fi + echo $OUT -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/common/autoconf/configure.ac b/common/autoconf/configure.ac ---- a/common/autoconf/configure.ac 2024-01-11 09:53:23.000000000 +0800 -+++ b/common/autoconf/configure.ac 2023-12-20 09:23:19.574817100 +0800 +diff --git a/common/autoconf/configure.ac b/common/autoconf/configure.ac +index 151e5a10..5072409d 100644 +--- a/common/autoconf/configure.ac ++++ b/common/autoconf/configure.ac @@ -23,6 +23,12 @@ # questions. # @@ -57,7 +715,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo ############################################################################### # # Includes and boilerplate -@@ -186,6 +192,7 @@ +@@ -186,6 +192,7 @@ FLAGS_SETUP_INIT_FLAGS # Now we can test some aspects on the target using configure macros. PLATFORM_SETUP_OPENJDK_TARGET_BITS PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS @@ -65,10 +723,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo # Configure flags for the tools FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh ---- a/common/autoconf/generated-configure.sh 2024-01-11 09:53:23.000000000 +0800 -+++ b/common/autoconf/generated-configure.sh 2024-01-30 13:54:24.742709461 +0800 -@@ -716,6 +716,9 @@ +diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh +index 85eb8a16..cf57b89f 100644 +--- a/common/autoconf/generated-configure.sh ++++ b/common/autoconf/generated-configure.sh +@@ -716,6 +716,9 @@ SET_EXECUTABLE_ORIGIN SHARED_LIBRARY_FLAGS CXX_FLAG_REORDER C_FLAG_REORDER @@ -78,7 +737,23 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo SYSROOT_LDFLAGS SYSROOT_CFLAGS RC_FLAGS -@@ -4069,6 +4072,12 @@ +@@ -1069,6 +1072,7 @@ with_milestone + with_update_version + with_user_release_suffix + with_build_number ++with_company_name + with_vendor_name + with_vendor_url + with_vendor_bug_url +@@ -1922,6 +1926,7 @@ Optional Packages: + Add a custom string to the version string if build + number isn't set.[username_builddateb00] + --with-build-number Set build number value for build [b00] ++ --with-company-name Set company name. + --with-vendor-name Set vendor name. Among others, used to set the + 'java.vendor' and 'java.vm.vendor' system + properties. [not specified] +@@ -4081,6 +4086,12 @@ fi # questions. # @@ -91,7 +766,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo # Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD. # Converts autoconf style CPU name to OpenJDK style, into # VAR_CPU, VAR_CPU_ARCH, VAR_CPU_BITS and VAR_CPU_ENDIAN. -@@ -13918,6 +13927,18 @@ +@@ -13930,6 +13941,12 @@ test -n "$target_alias" && VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big ;; @@ -101,16 +776,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo + VAR_CPU_BITS=64 + VAR_CPU_ENDIAN=little + ;; -+ loongarch64) -+ VAR_CPU=loongarch64 -+ VAR_CPU_ARCH=loongarch -+ VAR_CPU_BITS=64 -+ VAR_CPU_ENDIAN=little -+ ;; - *) - as_fn_error $? "unsupported cpu $build_cpu" "$LINENO" 5 - ;; -@@ -14056,6 +14077,18 @@ + loongarch64) + VAR_CPU=loongarch64 + VAR_CPU_ARCH=loongarch +@@ -14074,6 +14091,12 @@ $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; } VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big ;; @@ -120,16 +789,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo + VAR_CPU_BITS=64 + VAR_CPU_ENDIAN=little + ;; -+ loongarch64) -+ VAR_CPU=loongarch64 -+ VAR_CPU_ARCH=loongarch -+ VAR_CPU_BITS=64 -+ VAR_CPU_ENDIAN=little -+ ;; - *) - as_fn_error $? "unsupported cpu $host_cpu" "$LINENO" 5 - ;; -@@ -14178,6 +14211,8 @@ + loongarch64) + VAR_CPU=loongarch64 + VAR_CPU_ARCH=loongarch +@@ -14202,6 +14225,8 @@ $as_echo "$COMPILE_TYPE" >&6; } OPENJDK_TARGET_CPU_LEGACY_LIB="i386" elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" @@ -138,7 +801,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo fi -@@ -14211,6 +14246,9 @@ +@@ -14235,6 +14260,9 @@ $as_echo "$COMPILE_TYPE" >&6; } elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # On all platforms except macosx, we replace x86_64 with amd64. OPENJDK_TARGET_CPU_OSARCH="amd64" @@ -148,7 +811,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo fi -@@ -14220,6 +14258,8 @@ +@@ -14244,6 +14272,8 @@ $as_echo "$COMPILE_TYPE" >&6; } elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # On all platforms except macosx, we replace x86_64 with amd64. OPENJDK_TARGET_CPU_JLI="amd64" @@ -157,7 +820,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo fi # Now setup the -D flags for building libjli. OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" -@@ -14232,6 +14272,9 @@ +@@ -14256,6 +14286,9 @@ $as_echo "$COMPILE_TYPE" >&6; } elif test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$TOOLCHAIN_TYPE" = xclang ; then OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -stdlib=libc++ -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" fi @@ -167,7 +830,38 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. -@@ -42412,6 +42455,47 @@ +@@ -20409,18 +20442,21 @@ fi + + # Now set the JDK version, milestone, build number etc. + ++ # The company name, if any + ++# Check whether --with-company-name was given. ++if test "${with_company_name+set}" = set; then : ++ withval=$with_company_name; ++fi + + +- +- +- +- +- +- +- +- +- ++ if test "x$with_company_name" = xyes; then ++ as_fn_error $? "--with-company-name must have a value" "$LINENO" 5 ++ elif ! [[ $with_company_name =~ ^[[:print:]]*$ ]] ; then ++ as_fn_error $? "--with-company-name contains non-printing characters: $with_company_name" "$LINENO" 5 ++ elif test "x$with_company_name" != x; then ++ COMPANY_NAME="$with_company_name" ++ fi + + # The vendor name, if any + +@@ -42436,6 +42472,47 @@ $as_echo "$ac_cv_c_bigendian" >&6; } fi @@ -215,9 +909,33 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo # Configure flags for the tools ############################################################################### -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 ---- a/common/autoconf/platform.m4 2024-01-11 09:53:23.000000000 +0800 -+++ b/common/autoconf/platform.m4 2023-12-20 09:23:19.581483690 +0800 +diff --git a/common/autoconf/jdk-options.m4 b/common/autoconf/jdk-options.m4 +index 18ba5852..42aeb7bd 100644 +--- a/common/autoconf/jdk-options.m4 ++++ b/common/autoconf/jdk-options.m4 +@@ -539,6 +539,18 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_VERSION_NUMBERS], + AC_SUBST(MACOSX_BUNDLE_NAME_BASE) + AC_SUBST(MACOSX_BUNDLE_ID_BASE) + ++ # The company name, if any ++ AC_ARG_WITH(company-name, [AS_HELP_STRING([--with-company-name], ++ [Set company name.])]) ++ if test "x$with_company_name" = xyes; then ++ AC_MSG_ERROR([--with-company-name must have a value]) ++ elif [ ! [[ $with_company_name =~ ^[[:print:]]*$ ]] ]; then ++ AC_MSG_ERROR([--with-company-name contains non-printing characters: $with_company_name]) ++ elif test "x$with_company_name" != x; then ++ COMPANY_NAME="$with_company_name" ++ fi ++ AC_SUBST(COMPANY_NAME) ++ + # The vendor name, if any + AC_ARG_WITH(vendor-name, [AS_HELP_STRING([--with-vendor-name], + [Set vendor name. Among others, used to set the 'java.vendor' +diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 +index f54942ac..51cc28c3 100644 +--- a/common/autoconf/platform.m4 ++++ b/common/autoconf/platform.m4 @@ -23,6 +23,12 @@ # questions. # @@ -231,7 +949,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo # Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD. # Converts autoconf style CPU name to OpenJDK style, into # VAR_CPU, VAR_CPU_ARCH, VAR_CPU_BITS and VAR_CPU_ENDIAN. -@@ -96,6 +102,18 @@ +@@ -96,6 +102,12 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU], VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big ;; @@ -241,16 +959,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo + VAR_CPU_BITS=64 + VAR_CPU_ENDIAN=little + ;; -+ loongarch64) -+ VAR_CPU=loongarch64 -+ VAR_CPU_ARCH=loongarch -+ VAR_CPU_BITS=64 -+ VAR_CPU_ENDIAN=little -+ ;; - *) - AC_MSG_ERROR([unsupported cpu $1]) - ;; -@@ -283,6 +301,8 @@ + loongarch64) + VAR_CPU=loongarch64 + VAR_CPU_ARCH=loongarch +@@ -289,6 +301,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], OPENJDK_TARGET_CPU_LEGACY_LIB="i386" elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" @@ -259,7 +971,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo fi AC_SUBST(OPENJDK_TARGET_CPU_LEGACY_LIB) -@@ -316,6 +336,9 @@ +@@ -322,6 +336,9 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # On all platforms except macosx, we replace x86_64 with amd64. OPENJDK_TARGET_CPU_OSARCH="amd64" @@ -269,7 +981,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo fi AC_SUBST(OPENJDK_TARGET_CPU_OSARCH) -@@ -325,6 +348,8 @@ +@@ -331,6 +348,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # On all platforms except macosx, we replace x86_64 with amd64. OPENJDK_TARGET_CPU_JLI="amd64" @@ -278,7 +990,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo fi # Now setup the -D flags for building libjli. OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" -@@ -337,6 +362,9 @@ +@@ -343,6 +362,9 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], elif test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$TOOLCHAIN_TYPE" = xclang ; then OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -stdlib=libc++ -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" fi @@ -288,7 +1000,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS) # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. -@@ -550,3 +578,46 @@ +@@ -556,3 +578,46 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS], AC_MSG_ERROR([The tested endian in the target ($ENDIAN) differs from the endian expected to be found in the target ($OPENJDK_TARGET_CPU_ENDIAN)]) fi ]) @@ -335,9 +1047,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo +AC_SUBST(BUILDER_NAME) +AC_SUBST(HOST_NAME) +]) -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in ---- a/common/autoconf/spec.gmk.in 2024-01-11 09:53:23.000000000 +0800 -+++ b/common/autoconf/spec.gmk.in 2024-01-30 13:54:24.742709461 +0800 +diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in +index 9573bb2c..1b034770 100644 +--- a/common/autoconf/spec.gmk.in ++++ b/common/autoconf/spec.gmk.in @@ -23,6 +23,12 @@ # questions. # @@ -351,7 +1064,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo # Configured @DATE_WHEN_CONFIGURED@ to build # for target system @OPENJDK_TARGET_OS@-@OPENJDK_TARGET_CPU@ # (called @OPENJDK_TARGET_AUTOCONF_NAME@ by autoconf) -@@ -219,6 +225,23 @@ +@@ -219,6 +225,23 @@ else endif JRE_RELEASE_VERSION:=$(FULL_VERSION) @@ -375,9 +1088,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/commo # How to compile the code: release, fastdebug or slowdebug DEBUG_LEVEL:=@DEBUG_LEVEL@ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/make/saenv.sh b/hotspot/agent/make/saenv.sh ---- a/hotspot/agent/make/saenv.sh 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/make/saenv.sh 2023-12-20 09:23:19.681482545 +0800 +diff --git a/hotspot/agent/make/saenv.sh b/hotspot/agent/make/saenv.sh +index ab9a0a43..a2de3fc3 100644 +--- a/hotspot/agent/make/saenv.sh ++++ b/hotspot/agent/make/saenv.sh @@ -23,6 +23,12 @@ # # @@ -391,7 +1105,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # This file sets common environment variables for all SA scripts OS=`uname` -@@ -42,6 +48,14 @@ +@@ -42,6 +48,14 @@ if [ "$OS" = "Linux" ]; then SA_LIBPATH=$STARTDIR/../src/os/linux/amd64:$STARTDIR/linux/amd64 OPTIONS="-Dsa.library.path=$SA_LIBPATH" CPU=amd64 @@ -406,48 +1120,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp else SA_LIBPATH=$STARTDIR/../src/os/linux/i386:$STARTDIR/linux/i386 OPTIONS="-Dsa.library.path=$SA_LIBPATH" -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/os/linux/libproc.h b/hotspot/agent/src/os/linux/libproc.h ---- a/hotspot/agent/src/os/linux/libproc.h 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/os/linux/libproc.h 2023-12-20 09:23:19.684815841 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2022. These -+ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #ifndef _LIBPROC_H_ - #define _LIBPROC_H_ - -@@ -36,7 +42,7 @@ - - #include - --#if defined(aarch64) -+#if defined(aarch64) || defined(loongarch64) - #include "asm/ptrace.h" - #endif - -@@ -76,7 +82,12 @@ - #include - #define user_regs_struct pt_regs - #endif --#if defined(aarch64) -+ -+#if defined(mips) || defined(mipsel) || defined(mips64) || defined(mips64el) -+#include -+#define user_regs_struct pt_regs -+#endif -+#if defined(aarch64) || defined(loongarch64) - #define user_regs_struct user_pt_regs - #endif - -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c ---- a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c 2023-12-20 09:23:19.684815841 +0800 +diff --git a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c +index d6a0c7d9..b3b1380b 100644 +--- a/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c ++++ b/hotspot/agent/src/os/linux/LinuxDebuggerLocal.c @@ -22,6 +22,13 @@ * */ @@ -481,7 +1157,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp static jfieldID p_ps_prochandle_ID = 0; static jfieldID threadList_ID = 0; static jfieldID loadObjectList_ID = 0; -@@ -337,7 +352,7 @@ +@@ -337,7 +352,7 @@ JNIEXPORT jbyteArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo return (err == PS_OK)? array : 0; } @@ -490,20 +1166,20 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLocal_getThreadIntegerRegisterSet0 (JNIEnv *env, jobject this_obj, jint lwp_id) { -@@ -365,6 +380,12 @@ +@@ -364,6 +379,12 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo + #endif #if defined(sparc) || defined(sparcv9) #define NPRGREG sun_jvm_hotspot_debugger_sparc_SPARCThreadContext_NPRGREG - #endif ++#endif +#ifdef loongarch64 +#define NPRGREG sun_jvm_hotspot_debugger_loongarch64_LOONGARCH64ThreadContext_NPRGREG +#endif +#if defined(mips64) || defined(mips64el) +#define NPRGREG sun_jvm_hotspot_debugger_mips64_MIPS64ThreadContext_NPRGREG -+#endif + #endif array = (*env)->NewLongArray(env, NPRGREG); - CHECK_EXCEPTION_(0); -@@ -470,6 +491,55 @@ +@@ -470,6 +491,55 @@ JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_linux_LinuxDebuggerLo } #endif /* aarch64 */ @@ -559,9 +1235,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp (*env)->ReleaseLongArrayElements(env, array, regs, JNI_COMMIT); return array; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/os/linux/Makefile b/hotspot/agent/src/os/linux/Makefile ---- a/hotspot/agent/src/os/linux/Makefile 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/os/linux/Makefile 2023-12-20 09:23:19.684815841 +0800 +diff --git a/hotspot/agent/src/os/linux/Makefile b/hotspot/agent/src/os/linux/Makefile +index c0b5c869..2cc50b6f 100644 +--- a/hotspot/agent/src/os/linux/Makefile ++++ b/hotspot/agent/src/os/linux/Makefile @@ -22,7 +22,13 @@ # # @@ -577,7 +1254,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp GCC = gcc JAVAH = ${JAVA_HOME}/bin/javah -@@ -53,6 +59,8 @@ +@@ -53,6 +59,8 @@ $(ARCH)/LinuxDebuggerLocal.o: LinuxDebuggerLocal.c $(JAVAH) -jni -classpath ../../../build/classes -d $(ARCH) \ sun.jvm.hotspot.debugger.x86.X86ThreadContext \ sun.jvm.hotspot.debugger.sparc.SPARCThreadContext \ @@ -586,9 +1263,50 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext \ sun.jvm.hotspot.debugger.aarch64.AARCH64ThreadContext $(GCC) $(CFLAGS) $< -o $@ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/os/linux/ps_proc.c b/hotspot/agent/src/os/linux/ps_proc.c ---- a/hotspot/agent/src/os/linux/ps_proc.c 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/os/linux/ps_proc.c 2023-12-20 09:23:19.684815841 +0800 +diff --git a/hotspot/agent/src/os/linux/libproc.h b/hotspot/agent/src/os/linux/libproc.h +index 6b6e41ca..5eb8211a 100644 +--- a/hotspot/agent/src/os/linux/libproc.h ++++ b/hotspot/agent/src/os/linux/libproc.h +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2022. These ++ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ ++ + #ifndef _LIBPROC_H_ + #define _LIBPROC_H_ + +@@ -36,7 +42,7 @@ + + #include + +-#if defined(aarch64) ++#if defined(aarch64) || defined(loongarch64) + #include "asm/ptrace.h" + #endif + +@@ -76,7 +82,12 @@ combination of ptrace and /proc calls. + #include + #define user_regs_struct pt_regs + #endif +-#if defined(aarch64) ++ ++#if defined(mips) || defined(mipsel) || defined(mips64) || defined(mips64el) ++#include ++#define user_regs_struct pt_regs ++#endif ++#if defined(aarch64) || defined(loongarch64) + #define user_regs_struct user_pt_regs + #endif + +diff --git a/hotspot/agent/src/os/linux/ps_proc.c b/hotspot/agent/src/os/linux/ps_proc.c +index c4d6a9ec..7000e927 100644 +--- a/hotspot/agent/src/os/linux/ps_proc.c ++++ b/hotspot/agent/src/os/linux/ps_proc.c @@ -22,6 +22,12 @@ * */ @@ -602,7 +1320,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include #include #include -@@ -141,7 +147,7 @@ +@@ -141,7 +147,7 @@ static bool process_get_lwp_regs(struct ps_prochandle* ph, pid_t pid, struct use #define PTRACE_GETREGS_REQ PT_GETREGS #endif @@ -611,10 +1329,48 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp if (ptrace_getregs(PTRACE_GETREGS_REQ, pid, user, NULL) < 0) { print_debug("ptrace(PTRACE_GETREGS, ...) failed for lwp %d\n", pid); return false; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java 2023-12-20 09:23:19.691482431 +0800 -@@ -94,6 +94,12 @@ +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java +index c9633505..20e6f35b 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2020. These ++ * modifications are Copyright (c) 2018, 2020, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ * ++ */ + package sun.jvm.hotspot; + + import java.rmi.RemoteException; +@@ -37,6 +43,8 @@ import sun.jvm.hotspot.debugger.MachineDescriptionIA64; + import sun.jvm.hotspot.debugger.MachineDescriptionIntelX86; + import sun.jvm.hotspot.debugger.MachineDescriptionSPARC32Bit; + import sun.jvm.hotspot.debugger.MachineDescriptionSPARC64Bit; ++import sun.jvm.hotspot.debugger.MachineDescriptionMIPS64; ++import sun.jvm.hotspot.debugger.MachineDescriptionLOONGARCH64; + import sun.jvm.hotspot.debugger.NoSuchSymbolException; + import sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal; + import sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal; +@@ -594,6 +602,10 @@ public class HotSpotAgent { + } else { + machDesc = new MachineDescriptionSPARC32Bit(); + } ++ } else if (cpu.equals("mips64")) { ++ machDesc = new MachineDescriptionMIPS64(); ++ } else if (cpu.equals("loongarch64")) { ++ machDesc = new MachineDescriptionLOONGARCH64(); + } else { + try { + machDesc = (MachineDescription) +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java +index 993bf7bb..1e075aa5 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/asm/Disassembler.java +@@ -94,6 +94,12 @@ public class Disassembler { } else if (arch.equals("amd64") || arch.equals("x86_64")) { path.append(sep + "lib" + sep + "amd64" + sep); libname += "-amd64.so"; @@ -627,76 +1383,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } else { path.append(sep + "lib" + sep + arch + sep); libname += "-" + arch + ".so"; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java 2023-12-20 09:23:19.704815613 +0800 -@@ -32,11 +32,15 @@ - import sun.jvm.hotspot.debugger.x86.*; - import sun.jvm.hotspot.debugger.amd64.*; - import sun.jvm.hotspot.debugger.sparc.*; -+import sun.jvm.hotspot.debugger.mips64.*; -+import sun.jvm.hotspot.debugger.loongarch64.*; - import sun.jvm.hotspot.debugger.linux.x86.*; - import sun.jvm.hotspot.debugger.linux.amd64.*; - import sun.jvm.hotspot.debugger.aarch64.*; - import sun.jvm.hotspot.debugger.linux.aarch64.*; - import sun.jvm.hotspot.debugger.linux.sparc.*; -+import sun.jvm.hotspot.debugger.linux.mips64.*; -+import sun.jvm.hotspot.debugger.linux.loongarch64.*; - import sun.jvm.hotspot.utilities.*; - - class LinuxCDebugger implements CDebugger { -@@ -106,6 +110,20 @@ - Address pc = context.getRegisterAsAddress(AARCH64ThreadContext.PC); - if (pc == null) return null; - return new LinuxAARCH64CFrame(dbg, fp, pc); -+ } else if (cpu.equals("mips64")) { -+ MIPS64ThreadContext context = (MIPS64ThreadContext) thread.getContext(); -+ Address sp = context.getRegisterAsAddress(MIPS64ThreadContext.SP); -+ if (sp == null) return null; -+ Address pc = context.getRegisterAsAddress(MIPS64ThreadContext.PC); -+ if (pc == null) return null; -+ return new LinuxMIPS64CFrame(dbg, sp, pc); -+ } else if (cpu.equals("loongarch64")) { -+ LOONGARCH64ThreadContext context = (LOONGARCH64ThreadContext) thread.getContext(); -+ Address sp = context.getRegisterAsAddress(LOONGARCH64ThreadContext.SP); -+ if (sp == null) return null; -+ Address pc = context.getRegisterAsAddress(LOONGARCH64ThreadContext.PC); -+ if (pc == null) return null; -+ return new LinuxLOONGARCH64CFrame(dbg, sp, pc); - } else { - // Runtime exception thrown by LinuxThreadContextFactory if unknown cpu - ThreadContext context = (ThreadContext) thread.getContext(); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java 2023-12-20 09:23:19.704815613 +0800 -@@ -30,6 +30,8 @@ - import sun.jvm.hotspot.debugger.linux.ia64.*; - import sun.jvm.hotspot.debugger.linux.x86.*; - import sun.jvm.hotspot.debugger.linux.sparc.*; -+import sun.jvm.hotspot.debugger.linux.mips64.*; -+import sun.jvm.hotspot.debugger.linux.loongarch64.*; - - class LinuxThreadContextFactory { - static ThreadContext createThreadContext(LinuxDebugger dbg) { -@@ -42,6 +44,10 @@ - return new LinuxIA64ThreadContext(dbg); - } else if (cpu.equals("sparc")) { - return new LinuxSPARCThreadContext(dbg); -+ } else if (cpu.equals("mips64")) { -+ return new LinuxMIPS64ThreadContext(dbg); -+ } else if (cpu.equals("loongarch64")) { -+ return new LinuxLOONGARCH64ThreadContext(dbg); - } else { - try { - Class tcc = Class.forName("sun.jvm.hotspot.debugger.linux." + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java 2023-12-20 09:23:19.704815613 +0800 -@@ -0,0 +1,80 @@ +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java +new file mode 100644 +index 00000000..0531427d +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java +@@ -0,0 +1,41 @@ +/* -+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2018, 2020, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -719,68 +1414,229 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+package sun.jvm.hotspot.debugger.linux.loongarch64; -+ -+import sun.jvm.hotspot.debugger.*; -+import sun.jvm.hotspot.debugger.linux.*; -+import sun.jvm.hotspot.debugger.cdbg.*; -+import sun.jvm.hotspot.debugger.cdbg.basic.*; -+import sun.jvm.hotspot.debugger.loongarch64.*; -+ -+final public class LinuxLOONGARCH64CFrame extends BasicCFrame { -+ // package/class internals only -+ public LinuxLOONGARCH64CFrame(LinuxDebugger dbg, Address fp, Address pc) { -+ super(dbg.getCDebugger()); -+ this.fp = fp; -+ this.pc = pc; -+ this.dbg = dbg; -+ } -+ -+ // override base class impl to avoid ELF parsing -+ public ClosestSymbol closestSymbolToPC() { -+ // try native lookup in debugger. -+ return dbg.lookup(dbg.getAddressValue(pc())); -+ } -+ -+ public Address pc() { -+ return pc; -+ } -+ -+ public Address localVariableBase() { -+ return fp; -+ } ++package sun.jvm.hotspot.debugger; + -+ public CFrame sender(ThreadProxy thread) { -+ LOONGARCH64ThreadContext context = (LOONGARCH64ThreadContext) thread.getContext(); -+ Address sp = context.getRegisterAsAddress(LOONGARCH64ThreadContext.SP); ++public class MachineDescriptionLOONGARCH64 extends MachineDescriptionTwosComplement implements MachineDescription { ++ public long getAddressSize() { ++ return 8; ++ } + -+ if ((fp == null) || fp.lessThan(sp)) { -+ return null; -+ } + -+ Address nextFP = fp.getAddressAt(-2 * ADDRESS_SIZE); -+ if (nextFP == null) { -+ return null; -+ } -+ Address nextPC = fp.getAddressAt(-1 * ADDRESS_SIZE); -+ if (nextPC == null) { -+ return null; -+ } -+ return new LinuxLOONGARCH64CFrame(dbg, nextFP, nextPC); -+ } ++ public boolean isBigEndian() { ++ return false; ++ } + -+ private static final int ADDRESS_SIZE = 8; -+ private Address pc; -+ private Address fp; -+ private LinuxDebugger dbg; ++ public boolean isLP64() { ++ return true; ++ } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java 2023-12-20 09:23:19.704815613 +0800 -@@ -0,0 +1,47 @@ +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java +new file mode 100644 +index 00000000..1b49efd2 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java +@@ -0,0 +1,41 @@ +/* -+ * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2018, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++package sun.jvm.hotspot.debugger; ++ ++public class MachineDescriptionMIPS64 extends MachineDescriptionTwosComplement implements MachineDescription { ++ public long getAddressSize() { ++ return 8; ++ } ++ ++ ++ public boolean isBigEndian() { ++ return "big".equals(System.getProperty("sun.cpu.endian")); ++ } ++ ++ public boolean isLP64() { ++ return true; ++ } ++} +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java +index f178d6a6..019e794b 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxCDebugger.java +@@ -32,11 +32,15 @@ import sun.jvm.hotspot.debugger.cdbg.*; + import sun.jvm.hotspot.debugger.x86.*; + import sun.jvm.hotspot.debugger.amd64.*; + import sun.jvm.hotspot.debugger.sparc.*; ++import sun.jvm.hotspot.debugger.mips64.*; ++import sun.jvm.hotspot.debugger.loongarch64.*; + import sun.jvm.hotspot.debugger.linux.x86.*; + import sun.jvm.hotspot.debugger.linux.amd64.*; + import sun.jvm.hotspot.debugger.aarch64.*; + import sun.jvm.hotspot.debugger.linux.aarch64.*; + import sun.jvm.hotspot.debugger.linux.sparc.*; ++import sun.jvm.hotspot.debugger.linux.mips64.*; ++import sun.jvm.hotspot.debugger.linux.loongarch64.*; + import sun.jvm.hotspot.utilities.*; + + class LinuxCDebugger implements CDebugger { +@@ -106,6 +110,20 @@ class LinuxCDebugger implements CDebugger { + Address pc = context.getRegisterAsAddress(AARCH64ThreadContext.PC); + if (pc == null) return null; + return new LinuxAARCH64CFrame(dbg, fp, pc); ++ } else if (cpu.equals("mips64")) { ++ MIPS64ThreadContext context = (MIPS64ThreadContext) thread.getContext(); ++ Address sp = context.getRegisterAsAddress(MIPS64ThreadContext.SP); ++ if (sp == null) return null; ++ Address pc = context.getRegisterAsAddress(MIPS64ThreadContext.PC); ++ if (pc == null) return null; ++ return new LinuxMIPS64CFrame(dbg, sp, pc); ++ } else if (cpu.equals("loongarch64")) { ++ LOONGARCH64ThreadContext context = (LOONGARCH64ThreadContext) thread.getContext(); ++ Address sp = context.getRegisterAsAddress(LOONGARCH64ThreadContext.SP); ++ if (sp == null) return null; ++ Address pc = context.getRegisterAsAddress(LOONGARCH64ThreadContext.PC); ++ if (pc == null) return null; ++ return new LinuxLOONGARCH64CFrame(dbg, sp, pc); + } else { + // Runtime exception thrown by LinuxThreadContextFactory if unknown cpu + ThreadContext context = (ThreadContext) thread.getContext(); +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java +index 44c2265d..3b6747ac 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/LinuxThreadContextFactory.java +@@ -30,6 +30,8 @@ import sun.jvm.hotspot.debugger.linux.amd64.*; + import sun.jvm.hotspot.debugger.linux.ia64.*; + import sun.jvm.hotspot.debugger.linux.x86.*; + import sun.jvm.hotspot.debugger.linux.sparc.*; ++import sun.jvm.hotspot.debugger.linux.mips64.*; ++import sun.jvm.hotspot.debugger.linux.loongarch64.*; + + class LinuxThreadContextFactory { + static ThreadContext createThreadContext(LinuxDebugger dbg) { +@@ -42,6 +44,10 @@ class LinuxThreadContextFactory { + return new LinuxIA64ThreadContext(dbg); + } else if (cpu.equals("sparc")) { + return new LinuxSPARCThreadContext(dbg); ++ } else if (cpu.equals("mips64")) { ++ return new LinuxMIPS64ThreadContext(dbg); ++ } else if (cpu.equals("loongarch64")) { ++ return new LinuxLOONGARCH64ThreadContext(dbg); + } else { + try { + Class tcc = Class.forName("sun.jvm.hotspot.debugger.linux." + +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java +new file mode 100644 +index 00000000..3b20dbbd +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64CFrame.java +@@ -0,0 +1,80 @@ ++/* ++ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++package sun.jvm.hotspot.debugger.linux.loongarch64; ++ ++import sun.jvm.hotspot.debugger.*; ++import sun.jvm.hotspot.debugger.linux.*; ++import sun.jvm.hotspot.debugger.cdbg.*; ++import sun.jvm.hotspot.debugger.cdbg.basic.*; ++import sun.jvm.hotspot.debugger.loongarch64.*; ++ ++final public class LinuxLOONGARCH64CFrame extends BasicCFrame { ++ // package/class internals only ++ public LinuxLOONGARCH64CFrame(LinuxDebugger dbg, Address fp, Address pc) { ++ super(dbg.getCDebugger()); ++ this.fp = fp; ++ this.pc = pc; ++ this.dbg = dbg; ++ } ++ ++ // override base class impl to avoid ELF parsing ++ public ClosestSymbol closestSymbolToPC() { ++ // try native lookup in debugger. ++ return dbg.lookup(dbg.getAddressValue(pc())); ++ } ++ ++ public Address pc() { ++ return pc; ++ } ++ ++ public Address localVariableBase() { ++ return fp; ++ } ++ ++ public CFrame sender(ThreadProxy thread) { ++ LOONGARCH64ThreadContext context = (LOONGARCH64ThreadContext) thread.getContext(); ++ Address sp = context.getRegisterAsAddress(LOONGARCH64ThreadContext.SP); ++ ++ if ((fp == null) || fp.lessThan(sp)) { ++ return null; ++ } ++ ++ Address nextFP = fp.getAddressAt(-2 * ADDRESS_SIZE); ++ if (nextFP == null) { ++ return null; ++ } ++ Address nextPC = fp.getAddressAt(-1 * ADDRESS_SIZE); ++ if (nextPC == null) { ++ return null; ++ } ++ return new LinuxLOONGARCH64CFrame(dbg, nextFP, nextPC); ++ } ++ ++ private static final int ADDRESS_SIZE = 8; ++ private Address pc; ++ private Address fp; ++ private LinuxDebugger dbg; ++} +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java +new file mode 100644 +index 00000000..9f22133e +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/loongarch64/LinuxLOONGARCH64ThreadContext.java +@@ -0,0 +1,47 @@ ++/* ++ * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -825,9 +1681,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return debugger.newAddress(getRegister(index)); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java 2023-12-20 09:23:19.704815613 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java +new file mode 100644 +index 00000000..2e3eb564 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64CFrame.java @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. @@ -909,9 +1767,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + private Address ebp; + private LinuxDebugger dbg; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java 2023-12-20 09:23:19.704815613 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java +new file mode 100644 +index 00000000..98e0f3f0 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/linux/mips64/LinuxMIPS64ThreadContext.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. @@ -960,9 +1820,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return debugger.newAddress(getRegister(index)); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java 2023-12-20 09:23:19.704815613 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java +new file mode 100644 +index 00000000..90b0cf97 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/loongarch64/LOONGARCH64ThreadContext.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. @@ -1087,99 +1949,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + tie the implementation to, for example, the debugging system */ + public abstract Address getRegisterAsAddress(int index); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionLOONGARCH64.java 2023-12-20 09:23:19.698149022 +0800 -@@ -0,0 +1,41 @@ -+/* -+ * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+package sun.jvm.hotspot.debugger; -+ -+public class MachineDescriptionLOONGARCH64 extends MachineDescriptionTwosComplement implements MachineDescription { -+ public long getAddressSize() { -+ return 8; -+ } -+ -+ -+ public boolean isBigEndian() { -+ return false; -+ } -+ -+ public boolean isLP64() { -+ return true; -+ } -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/MachineDescriptionMIPS64.java 2023-12-20 09:23:19.698149022 +0800 -@@ -0,0 +1,41 @@ -+/* -+ * Copyright (c) 2000, 2008, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2018, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+package sun.jvm.hotspot.debugger; -+ -+public class MachineDescriptionMIPS64 extends MachineDescriptionTwosComplement implements MachineDescription { -+ public long getAddressSize() { -+ return 8; -+ } -+ -+ -+ public boolean isBigEndian() { -+ return "big".equals(System.getProperty("sun.cpu.endian")); -+ } -+ -+ public boolean isLP64() { -+ return true; -+ } -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java 2023-12-20 09:23:19.704815613 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java +new file mode 100644 +index 00000000..c57ee9df +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/mips64/MIPS64ThreadContext.java @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. @@ -1304,10 +2078,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + tie the implementation to, for example, the debugging system */ + public abstract Address getRegisterAsAddress(int index); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java 2023-12-20 09:23:19.704815613 +0800 -@@ -63,6 +63,8 @@ +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java +index 7113a3a4..24273888 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/posix/elf/ELFHeader.java +@@ -63,6 +63,8 @@ public interface ELFHeader { public static final int ARCH_i860 = 7; /** MIPS architecture type. */ public static final int ARCH_MIPS = 8; @@ -1316,109 +2091,45 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp /** Returns a file type which is defined by the file type constants. */ public short getFileType(); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java 2023-12-20 09:23:19.708148906 +0800 -@@ -0,0 +1,47 @@ -+/* -+ * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+package sun.jvm.hotspot.debugger.proc.loongarch64; -+ -+import sun.jvm.hotspot.debugger.*; +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java +index ca1a2575..2afa6c55 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java +@@ -34,10 +34,14 @@ import sun.jvm.hotspot.debugger.proc.amd64.*; + import sun.jvm.hotspot.debugger.proc.aarch64.*; + import sun.jvm.hotspot.debugger.proc.sparc.*; + import sun.jvm.hotspot.debugger.proc.x86.*; ++import sun.jvm.hotspot.debugger.proc.mips64.*; ++import sun.jvm.hotspot.debugger.proc.loongarch64.*; + import sun.jvm.hotspot.debugger.amd64.*; + import sun.jvm.hotspot.debugger.aarch64.*; + import sun.jvm.hotspot.debugger.sparc.*; + import sun.jvm.hotspot.debugger.x86.*; ++import sun.jvm.hotspot.debugger.mips64.*; +import sun.jvm.hotspot.debugger.loongarch64.*; -+import sun.jvm.hotspot.debugger.proc.*; -+ -+public class ProcLOONGARCH64ThreadContext extends LOONGARCH64ThreadContext { -+ private ProcDebugger debugger; -+ -+ public ProcLOONGARCH64ThreadContext(ProcDebugger debugger) { -+ super(); -+ this.debugger = debugger; -+ } -+ -+ public void setRegisterAsAddress(int index, Address value) { -+ setRegister(index, debugger.getAddressValue(value)); -+ } -+ -+ public Address getRegisterAsAddress(int index) { -+ return debugger.newAddress(getRegister(index)); -+ } -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java 2023-12-20 09:23:19.708148906 +0800 -@@ -0,0 +1,45 @@ -+/* -+ * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+package sun.jvm.hotspot.debugger.proc.loongarch64; -+ -+import sun.jvm.hotspot.debugger.*; -+import sun.jvm.hotspot.debugger.proc.*; -+ -+public class ProcLOONGARCH64ThreadFactory implements ProcThreadFactory { -+ private ProcDebugger debugger; -+ -+ public ProcLOONGARCH64ThreadFactory(ProcDebugger debugger) { -+ this.debugger = debugger; -+ } -+ -+ public ThreadProxy createThreadWrapper(Address threadIdentifierAddr) { -+ return new ProcLOONGARCH64Thread(debugger, threadIdentifierAddr); -+ } -+ -+ public ThreadProxy createThreadWrapper(long id) { -+ return new ProcLOONGARCH64Thread(debugger, id); -+ } -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java 2023-12-20 09:23:19.708148906 +0800 + import sun.jvm.hotspot.utilities.*; + + /**

An implementation of the JVMDebugger interface which sits on +@@ -92,6 +96,14 @@ public class ProcDebuggerLocal extends DebuggerBase implements ProcDebugger { + threadFactory = new ProcAARCH64ThreadFactory(this); + pcRegIndex = AARCH64ThreadContext.PC; + fpRegIndex = AARCH64ThreadContext.FP; ++ } else if (cpu.equals("mips64") || cpu.equals("mips64el")) { ++ threadFactory = new ProcMIPS64ThreadFactory(this); ++ pcRegIndex = MIPS64ThreadContext.PC; ++ fpRegIndex = MIPS64ThreadContext.FP; ++ } else if (cpu.equals("loongarch64")) { ++ threadFactory = new ProcLOONGARCH64ThreadFactory(this); ++ pcRegIndex = LOONGARCH64ThreadContext.PC; ++ fpRegIndex = LOONGARCH64ThreadContext.FP; + } else { + try { + Class tfc = Class.forName("sun.jvm.hotspot.debugger.proc." + +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java +new file mode 100644 +index 00000000..42a31e34 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64Thread.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. @@ -1512,13 +2223,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return id; + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java +new file mode 100644 +index 00000000..9054f165 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadContext.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2018, Loongson Technology. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -1541,16 +2254,16 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+package sun.jvm.hotspot.debugger.proc.mips64; ++package sun.jvm.hotspot.debugger.proc.loongarch64; + +import sun.jvm.hotspot.debugger.*; -+import sun.jvm.hotspot.debugger.mips64.*; ++import sun.jvm.hotspot.debugger.loongarch64.*; +import sun.jvm.hotspot.debugger.proc.*; + -+public class ProcMIPS64ThreadContext extends MIPS64ThreadContext { ++public class ProcLOONGARCH64ThreadContext extends LOONGARCH64ThreadContext { + private ProcDebugger debugger; + -+ public ProcMIPS64ThreadContext(ProcDebugger debugger) { ++ public ProcLOONGARCH64ThreadContext(ProcDebugger debugger) { + super(); + this.debugger = debugger; + } @@ -1563,13 +2276,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return debugger.newAddress(getRegister(index)); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java +new file mode 100644 +index 00000000..bc643351 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/loongarch64/ProcLOONGARCH64ThreadFactory.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2018, Loongson Technology. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -1592,29 +2307,31 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+package sun.jvm.hotspot.debugger.proc.mips64; ++package sun.jvm.hotspot.debugger.proc.loongarch64; + +import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.debugger.proc.*; + -+public class ProcMIPS64ThreadFactory implements ProcThreadFactory { ++public class ProcLOONGARCH64ThreadFactory implements ProcThreadFactory { + private ProcDebugger debugger; + -+ public ProcMIPS64ThreadFactory(ProcDebugger debugger) { ++ public ProcLOONGARCH64ThreadFactory(ProcDebugger debugger) { + this.debugger = debugger; + } + + public ThreadProxy createThreadWrapper(Address threadIdentifierAddr) { -+ return new ProcMIPS64Thread(debugger, threadIdentifierAddr); ++ return new ProcLOONGARCH64Thread(debugger, threadIdentifierAddr); + } + + public ThreadProxy createThreadWrapper(long id) { -+ return new ProcMIPS64Thread(debugger, id); ++ return new ProcLOONGARCH64Thread(debugger, id); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java +new file mode 100644 +index 00000000..5c1e0be8 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64Thread.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. @@ -1708,46 +2425,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return id; + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/ProcDebuggerLocal.java 2023-12-20 09:23:19.708148906 +0800 -@@ -34,10 +34,14 @@ - import sun.jvm.hotspot.debugger.proc.aarch64.*; - import sun.jvm.hotspot.debugger.proc.sparc.*; - import sun.jvm.hotspot.debugger.proc.x86.*; -+import sun.jvm.hotspot.debugger.proc.mips64.*; -+import sun.jvm.hotspot.debugger.proc.loongarch64.*; - import sun.jvm.hotspot.debugger.amd64.*; - import sun.jvm.hotspot.debugger.aarch64.*; - import sun.jvm.hotspot.debugger.sparc.*; - import sun.jvm.hotspot.debugger.x86.*; -+import sun.jvm.hotspot.debugger.mips64.*; -+import sun.jvm.hotspot.debugger.loongarch64.*; - import sun.jvm.hotspot.utilities.*; - - /**

An implementation of the JVMDebugger interface which sits on -@@ -92,6 +96,14 @@ - threadFactory = new ProcAARCH64ThreadFactory(this); - pcRegIndex = AARCH64ThreadContext.PC; - fpRegIndex = AARCH64ThreadContext.FP; -+ } else if (cpu.equals("mips64") || cpu.equals("mips64el")) { -+ threadFactory = new ProcMIPS64ThreadFactory(this); -+ pcRegIndex = MIPS64ThreadContext.PC; -+ fpRegIndex = MIPS64ThreadContext.FP; -+ } else if (cpu.equals("loongarch64")) { -+ threadFactory = new ProcLOONGARCH64ThreadFactory(this); -+ pcRegIndex = LOONGARCH64ThreadContext.PC; -+ fpRegIndex = LOONGARCH64ThreadContext.FP; - } else { - try { - Class tfc = Class.forName("sun.jvm.hotspot.debugger.proc." + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java 2023-12-20 09:23:19.708148906 +0800 -@@ -0,0 +1,51 @@ +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java +new file mode 100644 +index 00000000..d44223d7 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadContext.java +@@ -0,0 +1,47 @@ +/* -+ * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * Copyright (c) 2002, 2003, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2018, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -1770,39 +2456,37 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+package sun.jvm.hotspot.debugger.remote.loongarch64; ++package sun.jvm.hotspot.debugger.proc.mips64; + +import sun.jvm.hotspot.debugger.*; -+import sun.jvm.hotspot.debugger.loongarch64.*; -+import sun.jvm.hotspot.debugger.remote.*; ++import sun.jvm.hotspot.debugger.mips64.*; ++import sun.jvm.hotspot.debugger.proc.*; + -+public class RemoteLOONGARCH64ThreadContext extends LOONGARCH64ThreadContext { -+ private RemoteDebuggerClient debugger; ++public class ProcMIPS64ThreadContext extends MIPS64ThreadContext { ++ private ProcDebugger debugger; + -+ public RemoteLOONGARCH64ThreadContext(RemoteDebuggerClient debugger) { ++ public ProcMIPS64ThreadContext(ProcDebugger debugger) { + super(); + this.debugger = debugger; + } + -+ /** This can't be implemented in this class since we would have to -+ tie the implementation to, for example, the debugging system */ + public void setRegisterAsAddress(int index, Address value) { + setRegister(index, debugger.getAddressValue(value)); + } + -+ /** This can't be implemented in this class since we would have to -+ tie the implementation to, for example, the debugging system */ + public Address getRegisterAsAddress(int index) { + return debugger.newAddress(getRegister(index)); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java +new file mode 100644 +index 00000000..bad478fc +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/proc/mips64/ProcMIPS64ThreadFactory.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * Copyright (c) 2015, 2018, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -1825,29 +2509,61 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+package sun.jvm.hotspot.debugger.remote.loongarch64; ++package sun.jvm.hotspot.debugger.proc.mips64; + +import sun.jvm.hotspot.debugger.*; -+import sun.jvm.hotspot.debugger.remote.*; ++import sun.jvm.hotspot.debugger.proc.*; + -+public class RemoteLOONGARCH64ThreadFactory implements RemoteThreadFactory { -+ private RemoteDebuggerClient debugger; ++public class ProcMIPS64ThreadFactory implements ProcThreadFactory { ++ private ProcDebugger debugger; + -+ public RemoteLOONGARCH64ThreadFactory(RemoteDebuggerClient debugger) { ++ public ProcMIPS64ThreadFactory(ProcDebugger debugger) { + this.debugger = debugger; + } + + public ThreadProxy createThreadWrapper(Address threadIdentifierAddr) { -+ return new RemoteLOONGARCH64Thread(debugger, threadIdentifierAddr); ++ return new ProcMIPS64Thread(debugger, threadIdentifierAddr); + } + + public ThreadProxy createThreadWrapper(long id) { -+ return new RemoteLOONGARCH64Thread(debugger, id); ++ return new ProcMIPS64Thread(debugger, id); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java +index ffa61b54..9cf3ee2d 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java +@@ -33,6 +33,8 @@ import sun.jvm.hotspot.debugger.cdbg.*; + import sun.jvm.hotspot.debugger.remote.sparc.*; + import sun.jvm.hotspot.debugger.remote.x86.*; + import sun.jvm.hotspot.debugger.remote.amd64.*; ++import sun.jvm.hotspot.debugger.remote.mips64.*; ++import sun.jvm.hotspot.debugger.remote.loongarch64.*; + + /** An implementation of Debugger which wraps a + RemoteDebugger, providing remote debugging via RMI. +@@ -70,6 +72,16 @@ public class RemoteDebuggerClient extends DebuggerBase implements JVMDebugger { + cachePageSize = 4096; + cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize); + unalignedAccessesOkay = true; ++ } else if (cpu.equals("mips64") || cpu.equals("mips64el")) { ++ threadFactory = new RemoteMIPS64ThreadFactory(this); ++ cachePageSize = 4096; ++ cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize); ++ unalignedAccessesOkay = true; ++ } else if (cpu.equals("loongarch64")) { ++ threadFactory = new RemoteLOONGARCH64ThreadFactory(this); ++ cachePageSize = 4096; ++ cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize); ++ unalignedAccessesOkay = true; + } else { + try { + Class tf = Class.forName("sun.jvm.hotspot.debugger.remote." + +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java +new file mode 100644 +index 00000000..01e3f895 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64Thread.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. @@ -1903,13 +2619,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return context; + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java +new file mode 100644 +index 00000000..ad25bccc +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadContext.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2018, Loongson Technology. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -1932,16 +2650,16 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+package sun.jvm.hotspot.debugger.remote.mips64; ++package sun.jvm.hotspot.debugger.remote.loongarch64; + +import sun.jvm.hotspot.debugger.*; -+import sun.jvm.hotspot.debugger.mips64.*; ++import sun.jvm.hotspot.debugger.loongarch64.*; +import sun.jvm.hotspot.debugger.remote.*; + -+public class RemoteMIPS64ThreadContext extends MIPS64ThreadContext { ++public class RemoteLOONGARCH64ThreadContext extends LOONGARCH64ThreadContext { + private RemoteDebuggerClient debugger; + -+ public RemoteMIPS64ThreadContext(RemoteDebuggerClient debugger) { ++ public RemoteLOONGARCH64ThreadContext(RemoteDebuggerClient debugger) { + super(); + this.debugger = debugger; + } @@ -1958,13 +2676,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return debugger.newAddress(getRegister(index)); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java +new file mode 100644 +index 00000000..d8bf50ea +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/loongarch64/RemoteLOONGARCH64ThreadFactory.java @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2018, Loongson Technology. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -1987,29 +2707,31 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+package sun.jvm.hotspot.debugger.remote.mips64; ++package sun.jvm.hotspot.debugger.remote.loongarch64; + +import sun.jvm.hotspot.debugger.*; +import sun.jvm.hotspot.debugger.remote.*; + -+public class RemoteMIPS64ThreadFactory implements RemoteThreadFactory { ++public class RemoteLOONGARCH64ThreadFactory implements RemoteThreadFactory { + private RemoteDebuggerClient debugger; + -+ public RemoteMIPS64ThreadFactory(RemoteDebuggerClient debugger) { ++ public RemoteLOONGARCH64ThreadFactory(RemoteDebuggerClient debugger) { + this.debugger = debugger; + } + + public ThreadProxy createThreadWrapper(Address threadIdentifierAddr) { -+ return new RemoteMIPS64Thread(debugger, threadIdentifierAddr); ++ return new RemoteLOONGARCH64Thread(debugger, threadIdentifierAddr); + } + + public ThreadProxy createThreadWrapper(long id) { -+ return new RemoteMIPS64Thread(debugger, id); ++ return new RemoteLOONGARCH64Thread(debugger, id); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java 2023-12-20 09:23:19.708148906 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java +new file mode 100644 +index 00000000..a9285a3b +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64Thread.java @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. @@ -2065,74 +2787,143 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return context; + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/RemoteDebuggerClient.java 2023-12-20 09:23:19.708148906 +0800 -@@ -33,6 +33,8 @@ - import sun.jvm.hotspot.debugger.remote.sparc.*; - import sun.jvm.hotspot.debugger.remote.x86.*; - import sun.jvm.hotspot.debugger.remote.amd64.*; -+import sun.jvm.hotspot.debugger.remote.mips64.*; -+import sun.jvm.hotspot.debugger.remote.loongarch64.*; - - /** An implementation of Debugger which wraps a - RemoteDebugger, providing remote debugging via RMI. -@@ -70,6 +72,16 @@ - cachePageSize = 4096; - cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize); - unalignedAccessesOkay = true; -+ } else if (cpu.equals("mips64") || cpu.equals("mips64el")) { -+ threadFactory = new RemoteMIPS64ThreadFactory(this); -+ cachePageSize = 4096; -+ cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize); -+ unalignedAccessesOkay = true; -+ } else if (cpu.equals("loongarch64")) { -+ threadFactory = new RemoteLOONGARCH64ThreadFactory(this); -+ cachePageSize = 4096; -+ cacheNumPages = parseCacheNumPagesProperty(cacheSize / cachePageSize); -+ unalignedAccessesOkay = true; - } else { - try { - Class tf = Class.forName("sun.jvm.hotspot.debugger.remote." + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotAgent.java 2023-12-20 09:23:19.691482431 +0800 -@@ -22,6 +22,12 @@ - * - */ - +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java +new file mode 100644 +index 00000000..4d711f9b +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadContext.java +@@ -0,0 +1,51 @@ +/* -+ * This file has been modified by Loongson Technology in 2020. These -+ * modifications are Copyright (c) 2018, 2020, Loongson Technology, and are made -+ * available on the same license terms set forth above. ++ * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2018, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. + * + */ - package sun.jvm.hotspot; - - import java.rmi.RemoteException; -@@ -37,6 +43,8 @@ - import sun.jvm.hotspot.debugger.MachineDescriptionIntelX86; - import sun.jvm.hotspot.debugger.MachineDescriptionSPARC32Bit; - import sun.jvm.hotspot.debugger.MachineDescriptionSPARC64Bit; -+import sun.jvm.hotspot.debugger.MachineDescriptionMIPS64; -+import sun.jvm.hotspot.debugger.MachineDescriptionLOONGARCH64; - import sun.jvm.hotspot.debugger.NoSuchSymbolException; - import sun.jvm.hotspot.debugger.bsd.BsdDebuggerLocal; - import sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal; -@@ -594,6 +602,10 @@ ++ ++package sun.jvm.hotspot.debugger.remote.mips64; ++ ++import sun.jvm.hotspot.debugger.*; ++import sun.jvm.hotspot.debugger.mips64.*; ++import sun.jvm.hotspot.debugger.remote.*; ++ ++public class RemoteMIPS64ThreadContext extends MIPS64ThreadContext { ++ private RemoteDebuggerClient debugger; ++ ++ public RemoteMIPS64ThreadContext(RemoteDebuggerClient debugger) { ++ super(); ++ this.debugger = debugger; ++ } ++ ++ /** This can't be implemented in this class since we would have to ++ tie the implementation to, for example, the debugging system */ ++ public void setRegisterAsAddress(int index, Address value) { ++ setRegister(index, debugger.getAddressValue(value)); ++ } ++ ++ /** This can't be implemented in this class since we would have to ++ tie the implementation to, for example, the debugging system */ ++ public Address getRegisterAsAddress(int index) { ++ return debugger.newAddress(getRegister(index)); ++ } ++} +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java +new file mode 100644 +index 00000000..020a2f1f +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/remote/mips64/RemoteMIPS64ThreadFactory.java +@@ -0,0 +1,45 @@ ++/* ++ * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2018, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++package sun.jvm.hotspot.debugger.remote.mips64; ++ ++import sun.jvm.hotspot.debugger.*; ++import sun.jvm.hotspot.debugger.remote.*; ++ ++public class RemoteMIPS64ThreadFactory implements RemoteThreadFactory { ++ private RemoteDebuggerClient debugger; ++ ++ public RemoteMIPS64ThreadFactory(RemoteDebuggerClient debugger) { ++ this.debugger = debugger; ++ } ++ ++ public ThreadProxy createThreadWrapper(Address threadIdentifierAddr) { ++ return new RemoteMIPS64Thread(debugger, threadIdentifierAddr); ++ } ++ ++ public ThreadProxy createThreadWrapper(long id) { ++ return new RemoteMIPS64Thread(debugger, id); ++ } ++} +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java +index 842a3b35..81efdd02 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java +@@ -34,6 +34,8 @@ import sun.jvm.hotspot.runtime.win32_amd64.Win32AMD64JavaThreadPDAccess; + import sun.jvm.hotspot.runtime.win32_x86.Win32X86JavaThreadPDAccess; + import sun.jvm.hotspot.runtime.linux_x86.LinuxX86JavaThreadPDAccess; + import sun.jvm.hotspot.runtime.linux_amd64.LinuxAMD64JavaThreadPDAccess; ++import sun.jvm.hotspot.runtime.linux_mips64.LinuxMIPS64JavaThreadPDAccess; ++import sun.jvm.hotspot.runtime.linux_loongarch64.LinuxLOONGARCH64JavaThreadPDAccess; + import sun.jvm.hotspot.runtime.linux_sparc.LinuxSPARCJavaThreadPDAccess; + import sun.jvm.hotspot.runtime.linux_aarch64.LinuxAARCH64JavaThreadPDAccess; + import sun.jvm.hotspot.runtime.bsd_x86.BsdX86JavaThreadPDAccess; +@@ -90,6 +92,10 @@ public class Threads { + access = new LinuxSPARCJavaThreadPDAccess(); + } else if (cpu.equals("aarch64")) { + access = new LinuxAARCH64JavaThreadPDAccess(); ++ } else if (cpu.equals("mips64")) { ++ access = new LinuxMIPS64JavaThreadPDAccess(); ++ } else if (cpu.equals("loongarch64")) { ++ access = new LinuxLOONGARCH64JavaThreadPDAccess(); } else { - machDesc = new MachineDescriptionSPARC32Bit(); - } -+ } else if (cpu.equals("mips64")) { -+ machDesc = new MachineDescriptionMIPS64(); -+ } else if (cpu.equals("loongarch64")) { -+ machDesc = new MachineDescriptionLOONGARCH64(); - } else { - try { - machDesc = (MachineDescription) -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java 2023-12-20 09:23:19.738148563 +0800 + try { + access = (JavaThreadPDAccess) +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java +new file mode 100644 +index 00000000..77c45c2e +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_loongarch64/LinuxLOONGARCH64JavaThreadPDAccess.java @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. @@ -2267,9 +3058,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return debugger.getThreadForIdentifierAddress(threadIdAddr); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java +new file mode 100644 +index 00000000..a0fd73fa +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/linux_mips64/LinuxMIPS64JavaThreadPDAccess.java @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. @@ -2403,9 +3196,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return debugger.getThreadForIdentifierAddress(threadIdAddr); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java +new file mode 100644 +index 00000000..0208e6e2 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64CurrentFrameGuess.java @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. @@ -2624,9 +3419,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + pcFound = pc; + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java +new file mode 100644 +index 00000000..fdf0c79c +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64Frame.java @@ -0,0 +1,534 @@ +/* + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. @@ -3162,9 +3959,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java +new file mode 100644 +index 00000000..f7dbbcaa +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64JavaCallWrapper.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. @@ -3223,9 +4022,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return lastJavaFPField.getValue(addr.addOffsetTo(anchorField.getOffset())); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java +new file mode 100644 +index 00000000..021ef523 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/loongarch64/LOONGARCH64RegisterMap.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. @@ -3279,9 +4080,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + protected void initializeFromPD(RegisterMap map) {} + protected Address getLocationPD(VMReg reg) { return null; } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java +new file mode 100644 +index 00000000..21259a4d +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64CurrentFrameGuess.java @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved. @@ -3500,9 +4303,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + pcFound = pc; + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java +new file mode 100644 +index 00000000..0cc5cf4e +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64Frame.java @@ -0,0 +1,547 @@ +/* + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. @@ -4051,9 +4856,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java +new file mode 100644 +index 00000000..81fcb5b5 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64JavaCallWrapper.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2001, 2002, Oracle and/or its affiliates. All rights reserved. @@ -4112,9 +4919,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return lastJavaFPField.getValue(addr.addOffsetTo(anchorField.getOffset())); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java 2023-12-20 09:23:19.738148563 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java +new file mode 100644 +index 00000000..64850379 +--- /dev/null ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/mips64/MIPS64RegisterMap.java @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved. @@ -4168,32 +4977,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + protected void initializeFromPD(RegisterMap map) {} + protected Address getLocationPD(VMReg reg) { return null; } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/Threads.java 2023-12-20 09:23:19.734815268 +0800 -@@ -34,6 +34,8 @@ - import sun.jvm.hotspot.runtime.win32_x86.Win32X86JavaThreadPDAccess; - import sun.jvm.hotspot.runtime.linux_x86.LinuxX86JavaThreadPDAccess; - import sun.jvm.hotspot.runtime.linux_amd64.LinuxAMD64JavaThreadPDAccess; -+import sun.jvm.hotspot.runtime.linux_mips64.LinuxMIPS64JavaThreadPDAccess; -+import sun.jvm.hotspot.runtime.linux_loongarch64.LinuxLOONGARCH64JavaThreadPDAccess; - import sun.jvm.hotspot.runtime.linux_sparc.LinuxSPARCJavaThreadPDAccess; - import sun.jvm.hotspot.runtime.linux_aarch64.LinuxAARCH64JavaThreadPDAccess; - import sun.jvm.hotspot.runtime.bsd_x86.BsdX86JavaThreadPDAccess; -@@ -90,6 +92,10 @@ - access = new LinuxSPARCJavaThreadPDAccess(); - } else if (cpu.equals("aarch64")) { - access = new LinuxAARCH64JavaThreadPDAccess(); -+ } else if (cpu.equals("mips64")) { -+ access = new LinuxMIPS64JavaThreadPDAccess(); -+ } else if (cpu.equals("loongarch64")) { -+ access = new LinuxLOONGARCH64JavaThreadPDAccess(); - } else { - try { - access = (JavaThreadPDAccess) -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java ---- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java 2023-12-20 09:23:19.748148449 +0800 +diff --git a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java +index aa692578..9c97d09b 100644 +--- a/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java ++++ b/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PlatformInfo.java @@ -22,6 +22,13 @@ * */ @@ -4208,7 +4995,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp package sun.jvm.hotspot.utilities; /** Provides canonicalized OS and CPU information for the rest of the -@@ -65,6 +72,10 @@ +@@ -65,6 +72,10 @@ public class PlatformInfo { return cpu; } else if (cpu.equals("aarch64")) { return cpu; @@ -4219,9 +5006,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } else { try { Class pic = Class.forName("sun.jvm.hotspot.utilities.PlatformInfoClosed"); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/defs.make b/hotspot/make/defs.make ---- a/hotspot/make/defs.make 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/defs.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/defs.make b/hotspot/make/defs.make +index a3573da5..6e93182c 100644 +--- a/hotspot/make/defs.make ++++ b/hotspot/make/defs.make @@ -22,6 +22,12 @@ # # @@ -4235,7 +5023,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # The common definitions for hotspot builds. # Optionally include SPEC file generated by configure. -@@ -285,7 +291,7 @@ +@@ -285,7 +291,7 @@ ifneq ($(OSNAME),windows) # Use uname output for SRCARCH, but deal with platform differences. If ARCH # is not explicitly listed below, it is treated as x86. @@ -4244,7 +5032,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp ARCH/ = x86 ARCH/sparc = sparc ARCH/sparc64= sparc -@@ -295,6 +301,10 @@ +@@ -295,6 +301,10 @@ ifneq ($(OSNAME),windows) ARCH/ppc64 = ppc ARCH/ppc64le= ppc ARCH/ppc = ppc @@ -4255,7 +5043,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp ARCH/zero = zero ARCH/aarch64 = aarch64 -@@ -317,6 +327,20 @@ +@@ -317,6 +327,20 @@ ifneq ($(OSNAME),windows) BUILDARCH = ppc64 endif endif @@ -4276,7 +5064,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # LIBARCH is 1:1 mapping from BUILDARCH, except for ARCH=ppc64le ifeq ($(ARCH),ppc64le) -@@ -332,9 +356,18 @@ +@@ -332,9 +356,18 @@ ifneq ($(OSNAME),windows) LIBARCH/sparcv9 = sparcv9 LIBARCH/ia64 = ia64 LIBARCH/ppc64 = ppc64 @@ -4296,10 +5084,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp endif # Required make macro settings for all platforms -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/Makefile b/hotspot/make/linux/Makefile ---- a/hotspot/make/linux/Makefile 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/linux/Makefile 2023-12-20 09:23:19.761481629 +0800 -@@ -74,6 +74,10 @@ +diff --git a/hotspot/make/linux/Makefile b/hotspot/make/linux/Makefile +index e8f20104..5aff01e8 100644 +--- a/hotspot/make/linux/Makefile ++++ b/hotspot/make/linux/Makefile +@@ -74,6 +74,10 @@ ifneq (,$(findstring $(ARCH), ppc ppc64)) FORCE_TIERED=0 endif endif @@ -4310,9 +5099,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp ifdef LP64 ifeq ("$(filter $(LP64_ARCH),$(BUILDARCH))","") -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/makefiles/defs.make b/hotspot/make/linux/makefiles/defs.make ---- a/hotspot/make/linux/makefiles/defs.make 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/linux/makefiles/defs.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/makefiles/defs.make b/hotspot/make/linux/makefiles/defs.make +index ec414639..9ade73ab 100644 +--- a/hotspot/make/linux/makefiles/defs.make ++++ b/hotspot/make/linux/makefiles/defs.make @@ -22,6 +22,12 @@ # # @@ -4326,7 +5116,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # The common definitions for hotspot linux builds. # Include the top level defs.make under make directory instead of this one. # This file is included into make/defs.make. -@@ -39,6 +45,18 @@ +@@ -39,6 +45,18 @@ ifndef ARCH ARCH := ppc64 endif endif @@ -4345,7 +5135,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp PATH_SEP ?= : -@@ -83,6 +101,36 @@ +@@ -83,6 +101,36 @@ ifneq (,$(findstring $(ARCH), sparc)) HS_ARCH = sparc endif @@ -4382,7 +5172,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # i686/i586 and amd64/x86_64 ifneq (,$(findstring $(ARCH), amd64 x86_64 i686 i586)) ifeq ($(ARCH_DATA_MODEL), 64) -@@ -311,16 +359,24 @@ +@@ -311,16 +359,24 @@ ADD_SA_BINARIES/sparc = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ $(EXPORT_LIB_DIR)/sa-jdi.jar ADD_SA_BINARIES/aarch64 = $(EXPORT_JRE_LIB_ARCH_DIR)/libsaproc.$(LIBRARY_SUFFIX) \ $(EXPORT_LIB_DIR)/sa-jdi.jar @@ -4407,9 +5197,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp endif endif endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make ---- a/hotspot/make/linux/makefiles/gcc.make 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/linux/makefiles/gcc.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make +index 7dde7f09..94c6d1d0 100644 +--- a/hotspot/make/linux/makefiles/gcc.make ++++ b/hotspot/make/linux/makefiles/gcc.make @@ -22,6 +22,12 @@ # # @@ -4423,7 +5214,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #------------------------------------------------------------------------ # CC, CXX & AS -@@ -177,6 +183,9 @@ +@@ -177,6 +183,9 @@ ARCHFLAG/aarch64 = ARCHFLAG/ia64 = ARCHFLAG/sparc = -m32 -mcpu=v9 ARCHFLAG/sparcv9 = -m64 -mcpu=v9 @@ -4433,7 +5224,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp ARCHFLAG/zero = $(ZERO_ARCHFLAG) ARCHFLAG/ppc64 = -m64 -@@ -202,7 +211,7 @@ +@@ -202,7 +211,7 @@ else endif # Compiler warnings are treated as errors @@ -4442,9 +5233,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp ifeq ($(USE_CLANG), true) # However we need to clean the code up before we can unrestrictedly enable this option with Clang -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/makefiles/loongarch64.make b/hotspot/make/linux/makefiles/loongarch64.make ---- a/hotspot/make/linux/makefiles/loongarch64.make 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/make/linux/makefiles/loongarch64.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/makefiles/loongarch64.make b/hotspot/make/linux/makefiles/loongarch64.make +new file mode 100644 +index 00000000..9e3cdb6f +--- /dev/null ++++ b/hotspot/make/linux/makefiles/loongarch64.make @@ -0,0 +1,43 @@ +# +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. @@ -4489,9 +5282,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +CFLAGS += -fno-omit-frame-pointer + +OPT_CFLAGS/compactingPermGenGen.o = -O1 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/makefiles/mips64.make b/hotspot/make/linux/makefiles/mips64.make ---- a/hotspot/make/linux/makefiles/mips64.make 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/make/linux/makefiles/mips64.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/makefiles/mips64.make b/hotspot/make/linux/makefiles/mips64.make +new file mode 100644 +index 00000000..d9af3b13 +--- /dev/null ++++ b/hotspot/make/linux/makefiles/mips64.make @@ -0,0 +1,43 @@ +# +# Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. @@ -4536,9 +5331,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +CFLAGS += -fno-omit-frame-pointer + +OPT_CFLAGS/compactingPermGenGen.o = -O1 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/makefiles/sa.make b/hotspot/make/linux/makefiles/sa.make ---- a/hotspot/make/linux/makefiles/sa.make 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/linux/makefiles/sa.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/makefiles/sa.make b/hotspot/make/linux/makefiles/sa.make +index cdcb16a1..34c71bd6 100644 +--- a/hotspot/make/linux/makefiles/sa.make ++++ b/hotspot/make/linux/makefiles/sa.make @@ -22,6 +22,12 @@ # # @@ -4552,7 +5348,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # This makefile (sa.make) is included from the sa.make in the # build directories. -@@ -109,6 +115,8 @@ +@@ -109,6 +115,8 @@ $(GENERATED)/sa-jdi.jar:: $(AGENT_FILES) $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.x86.X86ThreadContext $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.amd64.AMD64ThreadContext $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.aarch64.AARCH64ThreadContext @@ -4561,9 +5357,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.debugger.sparc.SPARCThreadContext $(QUIETLY) $(REMOTE) $(RUN.JAVAH) -classpath $(SA_CLASSDIR) -d $(GENERATED) -jni sun.jvm.hotspot.asm.Disassembler -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/makefiles/saproc.make b/hotspot/make/linux/makefiles/saproc.make ---- a/hotspot/make/linux/makefiles/saproc.make 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/linux/makefiles/saproc.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/makefiles/saproc.make b/hotspot/make/linux/makefiles/saproc.make +index ffc0ec5c..c04a6765 100644 +--- a/hotspot/make/linux/makefiles/saproc.make ++++ b/hotspot/make/linux/makefiles/saproc.make @@ -21,6 +21,13 @@ # questions. # @@ -4578,7 +5375,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp include $(GAMMADIR)/make/defs.make include $(GAMMADIR)/make/altsrc.make -@@ -81,7 +88,12 @@ +@@ -81,7 +88,12 @@ endif SA_LFLAGS = $(MAPFLAG:FILENAME=$(SAMAPFILE)) $(LDFLAGS_HASH_STYLE) \ $(LDFLAGS_NO_EXEC_STACK) $(EXTRA_LDFLAGS) @@ -4591,9 +5388,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp $(LIBSAPROC): $(SASRCFILES) $(SAMAPFILE) $(QUIETLY) if [ "$(BOOT_JAVA_HOME)" = "" ]; then \ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/makefiles/sparcWorks.make b/hotspot/make/linux/makefiles/sparcWorks.make ---- a/hotspot/make/linux/makefiles/sparcWorks.make 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/linux/makefiles/sparcWorks.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/makefiles/sparcWorks.make b/hotspot/make/linux/makefiles/sparcWorks.make +index e3911602..dbc2ace8 100644 +--- a/hotspot/make/linux/makefiles/sparcWorks.make ++++ b/hotspot/make/linux/makefiles/sparcWorks.make @@ -22,6 +22,12 @@ # # @@ -4607,7 +5405,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #------------------------------------------------------------------------ # CC, CXX & AS -@@ -38,6 +44,7 @@ +@@ -38,6 +44,7 @@ endif ARCHFLAG = $(ARCHFLAG/$(BUILDARCH)) ARCHFLAG/i486 = -m32 ARCHFLAG/amd64 = -m64 @@ -4615,9 +5413,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp CFLAGS += $(ARCHFLAG) AOUT_FLAGS += $(ARCHFLAG) -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make ---- a/hotspot/make/linux/makefiles/vm.make 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/linux/makefiles/vm.make 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/makefiles/vm.make b/hotspot/make/linux/makefiles/vm.make +index 04b7c202..5e428538 100644 +--- a/hotspot/make/linux/makefiles/vm.make ++++ b/hotspot/make/linux/makefiles/vm.make @@ -22,6 +22,12 @@ # # @@ -4631,7 +5430,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # Rules to build JVM and related libraries, included from vm.make in the build # directory. -@@ -99,9 +105,22 @@ +@@ -99,9 +105,22 @@ CXXFLAGS = \ ${HS_LIB_ARCH} \ ${VM_DISTRO} @@ -4654,7 +5453,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp CXXFLAGS/vm_version.o += ${JRE_VERSION} ${VERSION_CFLAGS} CXXFLAGS/arguments.o += ${VERSION_CFLAGS} -@@ -211,6 +230,15 @@ +@@ -211,6 +230,15 @@ endif ifeq ($(Platform_arch_model), x86_64) Src_Files_EXCLUDE += \*x86_32\* endif @@ -4670,9 +5469,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # Alternate vm.make # This has to be included here to allow changes to the source -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/platform_loongarch64 b/hotspot/make/linux/platform_loongarch64 ---- a/hotspot/make/linux/platform_loongarch64 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/make/linux/platform_loongarch64 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/platform_loongarch64 b/hotspot/make/linux/platform_loongarch64 +new file mode 100644 +index 00000000..d704cf38 +--- /dev/null ++++ b/hotspot/make/linux/platform_loongarch64 @@ -0,0 +1,17 @@ +os_family = linux + @@ -4691,9 +5492,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +gnu_dis_arch = loongarch64 + +sysdefs = -DLINUX -D_GNU_SOURCE -DLOONGARCH64 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/linux/platform_mips64 b/hotspot/make/linux/platform_mips64 ---- a/hotspot/make/linux/platform_mips64 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/make/linux/platform_mips64 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/linux/platform_mips64 b/hotspot/make/linux/platform_mips64 +new file mode 100644 +index 00000000..c283671f +--- /dev/null ++++ b/hotspot/make/linux/platform_mips64 @@ -0,0 +1,17 @@ +os_family = linux + @@ -4712,9 +5515,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +gnu_dis_arch = mips64 + +sysdefs = -DLINUX -D_GNU_SOURCE -DMIPS64 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/make/sa.files b/hotspot/make/sa.files ---- a/hotspot/make/sa.files 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/make/sa.files 2023-12-20 09:23:19.761481629 +0800 +diff --git a/hotspot/make/sa.files b/hotspot/make/sa.files +index d6e728a9..43b08e3a 100644 +--- a/hotspot/make/sa.files ++++ b/hotspot/make/sa.files @@ -22,6 +22,12 @@ # # @@ -4728,7 +5532,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # This filelist macro is included in platform specific sa.make # included all packages/*.java. package list can be generated by # $(GAMMADIR)/agent/make/build-pkglist. -@@ -52,14 +58,20 @@ +@@ -52,14 +58,20 @@ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/cdbg/basic/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/dummy/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/linux/amd64/*.java \ @@ -4749,7 +5553,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/proc/sparc/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/proc/x86/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/debugger/remote/*.java \ -@@ -94,8 +106,12 @@ +@@ -94,8 +106,12 @@ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/bsd_x86/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_amd64/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/linux_aarch64/*.java \ @@ -4762,10 +5566,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/posix/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/solaris_amd64/*.java \ $(AGENT_SRC_DIR)/sun/jvm/hotspot/runtime/solaris_sparc/*.java \ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp ---- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp 2023-12-20 09:23:19.774814810 +0800 -@@ -1177,7 +1177,9 @@ +diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +index 35d34a08..3b8cf4a1 100644 +--- a/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp ++++ b/hotspot/src/cpu/aarch64/vm/c1_LIRAssembler_aarch64.cpp +@@ -1177,7 +1177,9 @@ void LIR_Assembler::emit_opBranch(LIR_OpBranch* op) { } } @@ -4776,7 +5581,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) { LIR_Opr src = op->in_opr(); -@@ -1242,7 +1244,7 @@ +@@ -1242,7 +1244,7 @@ void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) { } case Bytecodes::_d2l: { @@ -4785,7 +5590,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ clear_fpsr(); __ fcvtzd(dest->as_register_lo(), src->as_double_reg()); __ get_fpsr(tmp); -@@ -1253,7 +1255,7 @@ +@@ -1253,7 +1255,7 @@ void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) { } case Bytecodes::_f2i: { @@ -4794,7 +5599,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ clear_fpsr(); __ fcvtzsw(dest->as_register(), src->as_float_reg()); __ get_fpsr(tmp); -@@ -1264,7 +1266,7 @@ +@@ -1264,7 +1266,7 @@ void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) { } case Bytecodes::_f2l: { @@ -4803,7 +5608,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ clear_fpsr(); __ fcvtzs(dest->as_register_lo(), src->as_float_reg()); __ get_fpsr(tmp); -@@ -1275,7 +1277,7 @@ +@@ -1275,7 +1277,7 @@ void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) { } case Bytecodes::_d2i: { @@ -4812,7 +5617,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ clear_fpsr(); __ fcvtzdw(dest->as_register(), src->as_double_reg()); __ get_fpsr(tmp); -@@ -1731,6 +1733,11 @@ +@@ -1731,6 +1733,11 @@ void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, L __ csel(result->as_register(), opr1->as_register(), opr2->as_register(), acond); } @@ -4824,10 +5629,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest, CodeEmitInfo* info, bool pop_fpu_stack) { assert(info == NULL, "should never be used, idiv/irem and ldiv/lrem not handled by this method"); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp ---- a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp 2023-12-20 09:23:19.774814810 +0800 -@@ -277,18 +277,29 @@ +diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp +index 4f694b17..c0520983 100644 +--- a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp ++++ b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp +@@ -279,18 +279,29 @@ void LIRGenerator::increment_counter(LIR_Address* addr, int step) { __ store(reg, addr); } @@ -4861,9 +5667,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) { -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp +new file mode 100644 +index 00000000..2996ef7a +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.cpp @@ -0,0 +1,855 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -5720,9 +6528,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp +new file mode 100644 +index 00000000..46b57cfe +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.hpp @@ -0,0 +1,2810 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -8534,9 +9344,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_LOONGARCH_VM_ASSEMBLER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp ---- a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp +new file mode 100644 +index 00000000..601f4afe +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/assembler_loongarch.inline.hpp @@ -0,0 +1,33 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -8571,9 +9383,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#include "code/codeCache.hpp" + +#endif // CPU_LOONGARCH_VM_ASSEMBLER_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp +new file mode 100644 +index 00000000..32775e9b +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.hpp @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -8685,9 +9499,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + ((VMJavaVal64*)(addr))->l) + +#endif // CPU_LOONGARCH_VM_BYTECODEINTERPRETER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp ---- a/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp +new file mode 100644 +index 00000000..07df527e +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/bytecodeInterpreter_loongarch.inline.hpp @@ -0,0 +1,286 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -8975,9 +9791,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // CPU_LOONGARCH_VM_BYTECODEINTERPRETER_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp +new file mode 100644 +index 00000000..86410905 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. @@ -9017,9 +9835,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // No LoongArch specific bytecodes + return code; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp +new file mode 100644 +index 00000000..fbdf5319 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/bytecodes_loongarch.hpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. @@ -9052,9 +9872,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +// No Loongson specific bytecodes + +#endif // CPU_LOONGARCH_VM_BYTECODES_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp +new file mode 100644 +index 00000000..8f766a61 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/bytes_loongarch.hpp @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -9131,9 +9953,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#endif + +#endif // CPU_LOONGARCH_VM_BYTES_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp +new file mode 100644 +index 00000000..5166acfa +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_CodeStubs_loongarch_64.cpp @@ -0,0 +1,387 @@ +/* + * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. @@ -9522,9 +10346,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +///////////////////////////////////////////////////////////////////////////// + +#undef __ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp +new file mode 100644 +index 00000000..1140e444 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_Defs_loongarch.hpp @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. @@ -9605,9 +10431,49 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_LOONGARCH_C1_DEFS_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp +new file mode 100644 +index 00000000..bd8578c7 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp +@@ -0,0 +1,32 @@ ++/* ++ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2021, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_C1_FPUSTACKSIM_LOONGARCH_HPP ++#define CPU_LOONGARCH_C1_FPUSTACKSIM_LOONGARCH_HPP ++ ++// No FPU stack on LoongArch ++class FpuStackSim; ++ ++#endif // CPU_LOONGARCH_C1_FPUSTACKSIM_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp +new file mode 100644 +index 00000000..1a89c437 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch_64.cpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. @@ -9640,13 +10506,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + +// No FPU stack on LoongArch64 +#include "precompiled.hpp" -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_FpuStackSim_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 -@@ -0,0 +1,32 @@ +diff --git a/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp +new file mode 100644 +index 00000000..4f0cf053 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp +@@ -0,0 +1,143 @@ +/* -+ * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2021, 2022, Loongson Technology. All rights reserved. ++ * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2021, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -9669,16 +10537,129 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#ifndef CPU_LOONGARCH_C1_FPUSTACKSIM_LOONGARCH_HPP -+#define CPU_LOONGARCH_C1_FPUSTACKSIM_LOONGARCH_HPP ++#ifndef CPU_LOONGARCH_C1_FRAMEMAP_LOONGARCH_HPP ++#define CPU_LOONGARCH_C1_FRAMEMAP_LOONGARCH_HPP + -+// No FPU stack on LoongArch -+class FpuStackSim; ++// On LoongArch64 the frame looks as follows: ++// ++// +-----------------------------+---------+----------------------------------------+----------------+----------- ++// | size_arguments-nof_reg_args | 2 words | size_locals-size_arguments+numreg_args | _size_monitors | spilling . ++// +-----------------------------+---------+----------------------------------------+----------------+----------- + -+#endif // CPU_LOONGARCH_C1_FPUSTACKSIM_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp 2023-12-20 09:23:19.784814696 +0800 ++ public: ++ static const int pd_c_runtime_reserved_arg_size; ++ ++ enum { ++ first_available_sp_in_frame = 0, ++ frame_pad_in_bytes = 16, ++ nof_reg_args = 8 ++ }; ++ ++ public: ++ static LIR_Opr receiver_opr; ++ ++ static LIR_Opr r0_opr; ++ static LIR_Opr ra_opr; ++ static LIR_Opr tp_opr; ++ static LIR_Opr sp_opr; ++ static LIR_Opr a0_opr; ++ static LIR_Opr a1_opr; ++ static LIR_Opr a2_opr; ++ static LIR_Opr a3_opr; ++ static LIR_Opr a4_opr; ++ static LIR_Opr a5_opr; ++ static LIR_Opr a6_opr; ++ static LIR_Opr a7_opr; ++ static LIR_Opr t0_opr; ++ static LIR_Opr t1_opr; ++ static LIR_Opr t2_opr; ++ static LIR_Opr t3_opr; ++ static LIR_Opr t4_opr; ++ static LIR_Opr t5_opr; ++ static LIR_Opr t6_opr; ++ static LIR_Opr t7_opr; ++ static LIR_Opr t8_opr; ++ static LIR_Opr rx_opr; ++ static LIR_Opr fp_opr; ++ static LIR_Opr s0_opr; ++ static LIR_Opr s1_opr; ++ static LIR_Opr s2_opr; ++ static LIR_Opr s3_opr; ++ static LIR_Opr s4_opr; ++ static LIR_Opr s5_opr; ++ static LIR_Opr s6_opr; ++ static LIR_Opr s7_opr; ++ static LIR_Opr s8_opr; ++ ++ static LIR_Opr ra_oop_opr; ++ static LIR_Opr a0_oop_opr; ++ static LIR_Opr a1_oop_opr; ++ static LIR_Opr a2_oop_opr; ++ static LIR_Opr a3_oop_opr; ++ static LIR_Opr a4_oop_opr; ++ static LIR_Opr a5_oop_opr; ++ static LIR_Opr a6_oop_opr; ++ static LIR_Opr a7_oop_opr; ++ static LIR_Opr t0_oop_opr; ++ static LIR_Opr t1_oop_opr; ++ static LIR_Opr t2_oop_opr; ++ static LIR_Opr t3_oop_opr; ++ static LIR_Opr t4_oop_opr; ++ static LIR_Opr t5_oop_opr; ++ static LIR_Opr t6_oop_opr; ++ static LIR_Opr t7_oop_opr; ++ static LIR_Opr t8_oop_opr; ++ static LIR_Opr fp_oop_opr; ++ static LIR_Opr s0_oop_opr; ++ static LIR_Opr s1_oop_opr; ++ static LIR_Opr s2_oop_opr; ++ static LIR_Opr s3_oop_opr; ++ static LIR_Opr s4_oop_opr; ++ static LIR_Opr s5_oop_opr; ++ static LIR_Opr s6_oop_opr; ++ static LIR_Opr s7_oop_opr; ++ static LIR_Opr s8_oop_opr; ++ ++ static LIR_Opr scr1_opr; ++ static LIR_Opr scr2_opr; ++ static LIR_Opr scr1_long_opr; ++ static LIR_Opr scr2_long_opr; ++ ++ static LIR_Opr a0_metadata_opr; ++ static LIR_Opr a1_metadata_opr; ++ static LIR_Opr a2_metadata_opr; ++ static LIR_Opr a3_metadata_opr; ++ static LIR_Opr a4_metadata_opr; ++ static LIR_Opr a5_metadata_opr; ++ ++ static LIR_Opr long0_opr; ++ static LIR_Opr long1_opr; ++ static LIR_Opr fpu0_float_opr; ++ static LIR_Opr fpu0_double_opr; ++ ++ static LIR_Opr as_long_opr(Register r) { ++ return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r)); ++ } ++ static LIR_Opr as_pointer_opr(Register r) { ++ return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r)); ++ } ++ ++ // VMReg name for spilled physical FPU stack slot n ++ static VMReg fpu_regname (int n); ++ ++ static bool is_caller_save_register(LIR_Opr opr) { return true; } ++ static bool is_caller_save_register(Register r) { return true; } ++ ++ static int nof_caller_save_cpu_regs() { return pd_nof_caller_save_cpu_regs_frame_map; } ++ static int last_cpu_reg() { return pd_last_cpu_reg; } ++ static int last_byte_reg() { return pd_last_byte_reg; } ++ ++#endif // CPU_LOONGARCH_C1_FRAMEMAP_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp +new file mode 100644 +index 00000000..25c90bcf +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch_64.cpp @@ -0,0 +1,362 @@ +/* + * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. @@ -10042,157 +11023,12 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +bool FrameMap::validate_frame() { + return true; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_FrameMap_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 -@@ -0,0 +1,143 @@ -+/* -+ * Copyright (c) 1999, 2019, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_C1_FRAMEMAP_LOONGARCH_HPP -+#define CPU_LOONGARCH_C1_FRAMEMAP_LOONGARCH_HPP -+ -+// On LoongArch64 the frame looks as follows: -+// -+// +-----------------------------+---------+----------------------------------------+----------------+----------- -+// | size_arguments-nof_reg_args | 2 words | size_locals-size_arguments+numreg_args | _size_monitors | spilling . -+// +-----------------------------+---------+----------------------------------------+----------------+----------- -+ -+ public: -+ static const int pd_c_runtime_reserved_arg_size; -+ -+ enum { -+ first_available_sp_in_frame = 0, -+ frame_pad_in_bytes = 16, -+ nof_reg_args = 8 -+ }; -+ -+ public: -+ static LIR_Opr receiver_opr; -+ -+ static LIR_Opr r0_opr; -+ static LIR_Opr ra_opr; -+ static LIR_Opr tp_opr; -+ static LIR_Opr sp_opr; -+ static LIR_Opr a0_opr; -+ static LIR_Opr a1_opr; -+ static LIR_Opr a2_opr; -+ static LIR_Opr a3_opr; -+ static LIR_Opr a4_opr; -+ static LIR_Opr a5_opr; -+ static LIR_Opr a6_opr; -+ static LIR_Opr a7_opr; -+ static LIR_Opr t0_opr; -+ static LIR_Opr t1_opr; -+ static LIR_Opr t2_opr; -+ static LIR_Opr t3_opr; -+ static LIR_Opr t4_opr; -+ static LIR_Opr t5_opr; -+ static LIR_Opr t6_opr; -+ static LIR_Opr t7_opr; -+ static LIR_Opr t8_opr; -+ static LIR_Opr rx_opr; -+ static LIR_Opr fp_opr; -+ static LIR_Opr s0_opr; -+ static LIR_Opr s1_opr; -+ static LIR_Opr s2_opr; -+ static LIR_Opr s3_opr; -+ static LIR_Opr s4_opr; -+ static LIR_Opr s5_opr; -+ static LIR_Opr s6_opr; -+ static LIR_Opr s7_opr; -+ static LIR_Opr s8_opr; -+ -+ static LIR_Opr ra_oop_opr; -+ static LIR_Opr a0_oop_opr; -+ static LIR_Opr a1_oop_opr; -+ static LIR_Opr a2_oop_opr; -+ static LIR_Opr a3_oop_opr; -+ static LIR_Opr a4_oop_opr; -+ static LIR_Opr a5_oop_opr; -+ static LIR_Opr a6_oop_opr; -+ static LIR_Opr a7_oop_opr; -+ static LIR_Opr t0_oop_opr; -+ static LIR_Opr t1_oop_opr; -+ static LIR_Opr t2_oop_opr; -+ static LIR_Opr t3_oop_opr; -+ static LIR_Opr t4_oop_opr; -+ static LIR_Opr t5_oop_opr; -+ static LIR_Opr t6_oop_opr; -+ static LIR_Opr t7_oop_opr; -+ static LIR_Opr t8_oop_opr; -+ static LIR_Opr fp_oop_opr; -+ static LIR_Opr s0_oop_opr; -+ static LIR_Opr s1_oop_opr; -+ static LIR_Opr s2_oop_opr; -+ static LIR_Opr s3_oop_opr; -+ static LIR_Opr s4_oop_opr; -+ static LIR_Opr s5_oop_opr; -+ static LIR_Opr s6_oop_opr; -+ static LIR_Opr s7_oop_opr; -+ static LIR_Opr s8_oop_opr; -+ -+ static LIR_Opr scr1_opr; -+ static LIR_Opr scr2_opr; -+ static LIR_Opr scr1_long_opr; -+ static LIR_Opr scr2_long_opr; -+ -+ static LIR_Opr a0_metadata_opr; -+ static LIR_Opr a1_metadata_opr; -+ static LIR_Opr a2_metadata_opr; -+ static LIR_Opr a3_metadata_opr; -+ static LIR_Opr a4_metadata_opr; -+ static LIR_Opr a5_metadata_opr; -+ -+ static LIR_Opr long0_opr; -+ static LIR_Opr long1_opr; -+ static LIR_Opr fpu0_float_opr; -+ static LIR_Opr fpu0_double_opr; -+ -+ static LIR_Opr as_long_opr(Register r) { -+ return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r)); -+ } -+ static LIR_Opr as_pointer_opr(Register r) { -+ return LIR_OprFact::double_cpu(cpu_reg2rnr(r), cpu_reg2rnr(r)); -+ } -+ -+ // VMReg name for spilled physical FPU stack slot n -+ static VMReg fpu_regname (int n); -+ -+ static bool is_caller_save_register(LIR_Opr opr) { return true; } -+ static bool is_caller_save_register(Register r) { return true; } -+ -+ static int nof_caller_save_cpu_regs() { return pd_nof_caller_save_cpu_regs_frame_map; } -+ static int last_cpu_reg() { return pd_last_cpu_reg; } -+ static int last_byte_reg() { return pd_last_byte_reg; } -+ -+#endif // CPU_LOONGARCH_C1_FRAMEMAP_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,69 @@ +diff --git a/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp +new file mode 100644 +index 00000000..38b0daa0 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp +@@ -0,0 +1,83 @@ +/* + * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2021, Loongson Technology. All rights reserved. @@ -10218,164 +11054,69 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#ifndef CPU_LOONGARCH_C1_GLOBALS_LOONGARCH_HPP -+#define CPU_LOONGARCH_C1_GLOBALS_LOONGARCH_HPP -+ -+#include "utilities/globalDefinitions.hpp" -+#include "utilities/macros.hpp" ++#ifndef CPU_LOONGARCH_C1_LIRASSEMBLER_LOONGARCH_HPP ++#define CPU_LOONGARCH_C1_LIRASSEMBLER_LOONGARCH_HPP + -+// Sets the default values for platform dependent flags used by the client compiler. -+// (see c1_globals.hpp) ++// ArrayCopyStub needs access to bailout ++friend class ArrayCopyStub; + -+#ifndef COMPILER2 -+define_pd_global(bool, BackgroundCompilation, true ); -+define_pd_global(bool, InlineIntrinsics, true ); -+define_pd_global(bool, PreferInterpreterNativeStubs, false); -+define_pd_global(bool, ProfileTraps, false); -+define_pd_global(bool, UseOnStackReplacement, true ); -+define_pd_global(bool, TieredCompilation, false); -+define_pd_global(intx, CompileThreshold, 1500 ); ++ private: ++ int array_element_size(BasicType type) const; + -+define_pd_global(intx, OnStackReplacePercentage, 933 ); -+define_pd_global(intx, NewSizeThreadIncrease, 4*K ); -+define_pd_global(intx, InitialCodeCacheSize, 160*K); -+define_pd_global(intx, ReservedCodeCacheSize, 32*M ); -+define_pd_global(intx, NonProfiledCodeHeapSize, 13*M ); -+define_pd_global(intx, ProfiledCodeHeapSize, 14*M ); -+define_pd_global(intx, NonNMethodCodeHeapSize, 5*M ); -+define_pd_global(bool, ProfileInterpreter, false); -+define_pd_global(intx, CodeCacheExpansionSize, 32*K ); -+define_pd_global(uintx, CodeCacheMinBlockLength, 1); -+define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K); -+define_pd_global(bool, NeverActAsServerClassMachine, true ); -+define_pd_global(uint64_t,MaxRAM, 1ULL*G); -+define_pd_global(bool, CICompileOSR, true ); -+#endif // !COMPILER2 -+define_pd_global(bool, UseTypeProfile, false); -+define_pd_global(bool, RoundFPResults, true ); ++ void arith_fpu_implementation(LIR_Code code, int left_index, int right_index, ++ int dest_index, bool pop_fpu_stack); + -+define_pd_global(bool, LIRFillDelaySlots, false); -+define_pd_global(bool, OptimizeSinglePrecision, true ); -+define_pd_global(bool, CSEArrayLength, false); -+define_pd_global(bool, TwoOperandLIRForm, false ); ++ // helper functions which checks for overflow and sets bailout if it ++ // occurs. Always returns a valid embeddable pointer but in the ++ // bailout case the pointer won't be to unique storage. ++ address float_constant(float f); ++ address double_constant(double d); + -+define_pd_global(intx, SafepointPollOffset, 0 ); ++ address int_constant(jlong n); + -+#endif // CPU_LOONGARCH_C1_GLOBALS_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp 2023-12-20 09:23:19.784814696 +0800 -@@ -0,0 +1,33 @@ -+/* -+ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. All rights reserved. -+ * Copyright (c) 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ ++ bool is_literal_address(LIR_Address* addr); + -+#include "precompiled.hpp" -+#include "c1/c1_Instruction.hpp" -+#include "c1/c1_LinearScan.hpp" -+#include "utilities/bitMap.inline.hpp" ++ // Ensure we have a valid Address (base+offset) to a stack-slot. ++ Address stack_slot_address(int index, uint shift, int adjust = 0); + -+void LinearScan::allocate_fpu_stack() { -+ // No FPU stack on LoongArch64 -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 -@@ -0,0 +1,70 @@ -+/* -+ * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ ++ // Record the type of the receiver in ReceiverTypeData ++ void type_profile_helper(Register mdo, ciMethodData *md, ciProfileData *data, ++ Register recv, Label* update_done); ++ void add_debug_info_for_branch(address adr, CodeEmitInfo* info); + -+#ifndef CPU_LOONGARCH_C1_LINEARSCAN_LOONGARCH_HPP -+#define CPU_LOONGARCH_C1_LINEARSCAN_LOONGARCH_HPP ++ void casw(Register addr, Register newval, Register cmpval, bool sign); ++ void casl(Register addr, Register newval, Register cmpval); + -+inline bool LinearScan::is_processed_reg_num(int reg_num) { -+ return reg_num <= FrameMap::last_cpu_reg() || reg_num >= pd_nof_cpu_regs_frame_map; -+} ++ void poll_for_safepoint(relocInfo::relocType rtype, CodeEmitInfo* info = NULL); + -+inline int LinearScan::num_physical_regs(BasicType type) { -+ return 1; -+} ++ static const int max_tableswitches = 20; ++ struct tableswitch switches[max_tableswitches]; ++ int tableswitch_count; + -+inline bool LinearScan::requires_adjacent_regs(BasicType type) { -+ return false; -+} ++ void init() { tableswitch_count = 0; } + -+inline bool LinearScan::is_caller_save(int assigned_reg) { -+ assert(assigned_reg >= 0 && assigned_reg < nof_regs, "should call this only for registers"); -+ if (assigned_reg < pd_first_callee_saved_reg) -+ return true; -+ if (assigned_reg > pd_last_callee_saved_reg && assigned_reg < pd_first_callee_saved_fpu_reg) -+ return true; -+ if (assigned_reg > pd_last_callee_saved_fpu_reg && assigned_reg < pd_last_fpu_reg) -+ return true; -+ return false; -+} ++ void deoptimize_trap(CodeEmitInfo *info); + -+inline void LinearScan::pd_add_temps(LIR_Op* op) {} ++public: ++ void store_parameter(Register r, int offset_from_sp_in_words); ++ void store_parameter(jint c, int offset_from_sp_in_words); ++ void store_parameter(jobject c, int offset_from_sp_in_words); + -+// Implementation of LinearScanWalker -+inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) { -+ if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::callee_saved)) { -+ assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only"); -+ _first_reg = pd_first_callee_saved_reg; -+ _last_reg = pd_last_callee_saved_reg; -+ return true; -+ } else if (cur->type() == T_INT || cur->type() == T_LONG || cur->type() == T_OBJECT || -+ cur->type() == T_ADDRESS || cur->type() == T_METADATA) { -+ _first_reg = pd_first_cpu_reg; -+ _last_reg = pd_last_allocatable_cpu_reg; -+ return true; -+ } -+ return false; -+} ++ enum { ++ // call stub: CompiledStaticCall::to_interp_stub_size() + ++ // NativeInstruction::nop_instruction_size + ++ // NativeCallTrampolineStub::instruction_size ++ call_stub_size = 13 * NativeInstruction::nop_instruction_size, ++ exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(175), ++ deopt_handler_size = 7 * NativeInstruction::nop_instruction_size ++ }; + -+#endif // CPU_LOONGARCH_C1_LINEARSCAN_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp 2023-12-20 09:23:19.784814696 +0800 ++#endif // CPU_LOONGARCH_C1_LIRASSEMBLER_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp +new file mode 100644 +index 00000000..ee48326b +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch_64.cpp @@ -0,0 +1,3377 @@ +/* + * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. @@ -13754,96 +14495,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#undef __ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_LIRAssembler_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 -@@ -0,0 +1,83 @@ -+/* -+ * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_C1_LIRASSEMBLER_LOONGARCH_HPP -+#define CPU_LOONGARCH_C1_LIRASSEMBLER_LOONGARCH_HPP -+ -+// ArrayCopyStub needs access to bailout -+friend class ArrayCopyStub; -+ -+ private: -+ int array_element_size(BasicType type) const; -+ -+ void arith_fpu_implementation(LIR_Code code, int left_index, int right_index, -+ int dest_index, bool pop_fpu_stack); -+ -+ // helper functions which checks for overflow and sets bailout if it -+ // occurs. Always returns a valid embeddable pointer but in the -+ // bailout case the pointer won't be to unique storage. -+ address float_constant(float f); -+ address double_constant(double d); -+ -+ address int_constant(jlong n); -+ -+ bool is_literal_address(LIR_Address* addr); -+ -+ // Ensure we have a valid Address (base+offset) to a stack-slot. -+ Address stack_slot_address(int index, uint shift, int adjust = 0); -+ -+ // Record the type of the receiver in ReceiverTypeData -+ void type_profile_helper(Register mdo, ciMethodData *md, ciProfileData *data, -+ Register recv, Label* update_done); -+ void add_debug_info_for_branch(address adr, CodeEmitInfo* info); -+ -+ void casw(Register addr, Register newval, Register cmpval, bool sign); -+ void casl(Register addr, Register newval, Register cmpval); -+ -+ void poll_for_safepoint(relocInfo::relocType rtype, CodeEmitInfo* info = NULL); -+ -+ static const int max_tableswitches = 20; -+ struct tableswitch switches[max_tableswitches]; -+ int tableswitch_count; -+ -+ void init() { tableswitch_count = 0; } -+ -+ void deoptimize_trap(CodeEmitInfo *info); -+ -+public: -+ void store_parameter(Register r, int offset_from_sp_in_words); -+ void store_parameter(jint c, int offset_from_sp_in_words); -+ void store_parameter(jobject c, int offset_from_sp_in_words); -+ -+ enum { -+ // call stub: CompiledStaticCall::to_interp_stub_size() + -+ // NativeInstruction::nop_instruction_size + -+ // NativeCallTrampolineStub::instruction_size -+ call_stub_size = 13 * NativeInstruction::nop_instruction_size, -+ exception_handler_size = DEBUG_ONLY(1*K) NOT_DEBUG(175), -+ deopt_handler_size = 7 * NativeInstruction::nop_instruction_size -+ }; -+ -+#endif // CPU_LOONGARCH_C1_LIRASSEMBLER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp +new file mode 100644 +index 00000000..7cb15f68 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp @@ -0,0 +1,1442 @@ +/* + * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. @@ -15287,9 +15943,244 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp +new file mode 100644 +index 00000000..f15dacaf +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch.hpp +@@ -0,0 +1,70 @@ ++/* ++ * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2021, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_C1_LINEARSCAN_LOONGARCH_HPP ++#define CPU_LOONGARCH_C1_LINEARSCAN_LOONGARCH_HPP ++ ++inline bool LinearScan::is_processed_reg_num(int reg_num) { ++ return reg_num <= FrameMap::last_cpu_reg() || reg_num >= pd_nof_cpu_regs_frame_map; ++} ++ ++inline int LinearScan::num_physical_regs(BasicType type) { ++ return 1; ++} ++ ++inline bool LinearScan::requires_adjacent_regs(BasicType type) { ++ return false; ++} ++ ++inline bool LinearScan::is_caller_save(int assigned_reg) { ++ assert(assigned_reg >= 0 && assigned_reg < nof_regs, "should call this only for registers"); ++ if (assigned_reg < pd_first_callee_saved_reg) ++ return true; ++ if (assigned_reg > pd_last_callee_saved_reg && assigned_reg < pd_first_callee_saved_fpu_reg) ++ return true; ++ if (assigned_reg > pd_last_callee_saved_fpu_reg && assigned_reg < pd_last_fpu_reg) ++ return true; ++ return false; ++} ++ ++inline void LinearScan::pd_add_temps(LIR_Op* op) {} ++ ++// Implementation of LinearScanWalker ++inline bool LinearScanWalker::pd_init_regs_for_alloc(Interval* cur) { ++ if (allocator()->gen()->is_vreg_flag_set(cur->reg_num(), LIRGenerator::callee_saved)) { ++ assert(cur->type() != T_FLOAT && cur->type() != T_DOUBLE, "cpu regs only"); ++ _first_reg = pd_first_callee_saved_reg; ++ _last_reg = pd_last_callee_saved_reg; ++ return true; ++ } else if (cur->type() == T_INT || cur->type() == T_LONG || cur->type() == T_OBJECT || ++ cur->type() == T_ADDRESS || cur->type() == T_METADATA) { ++ _first_reg = pd_first_cpu_reg; ++ _last_reg = pd_last_allocatable_cpu_reg; ++ return true; ++ } ++ return false; ++} ++ ++#endif // CPU_LOONGARCH_C1_LINEARSCAN_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp +new file mode 100644 +index 00000000..219b2e36 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_LinearScan_loongarch_64.cpp +@@ -0,0 +1,33 @@ ++/* ++ * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved. All rights reserved. ++ * Copyright (c) 2021, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include "precompiled.hpp" ++#include "c1/c1_Instruction.hpp" ++#include "c1/c1_LinearScan.hpp" ++#include "utilities/bitMap.inline.hpp" ++ ++void LinearScan::allocate_fpu_stack() { ++ // No FPU stack on LoongArch64 ++} +diff --git a/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp +new file mode 100644 +index 00000000..38ff4c58 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp +@@ -0,0 +1,112 @@ ++/* ++ * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2021, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_C1_MACROASSEMBLER_LOONGARCH_HPP ++#define CPU_LOONGARCH_C1_MACROASSEMBLER_LOONGARCH_HPP ++ ++using MacroAssembler::build_frame; ++using MacroAssembler::null_check; ++ ++// C1_MacroAssembler contains high-level macros for C1 ++ ++ private: ++ int _rsp_offset; // track rsp changes ++ // initialization ++ void pd_init() { _rsp_offset = 0; } ++ ++ public: ++ void try_allocate( ++ Register obj, // result: pointer to object after successful allocation ++ Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise ++ int con_size_in_bytes, // object size in bytes if known at compile time ++ Register t1, // temp register ++ Register t2, // temp register ++ Label& slow_case // continuation point if fast allocation fails ++ ); ++ ++ void initialize_header(Register obj, Register klass, Register len, Register t1, Register t2); ++ void initialize_body(Register obj, Register len_in_bytes, int hdr_size_in_bytes, Register t1, Register t2); ++ ++ // locking ++ // hdr : must be A0, contents destroyed ++ // obj : must point to the object to lock, contents preserved ++ // disp_hdr: must point to the displaced header location, contents preserved ++ // scratch : scratch register, contents destroyed ++ // returns code offset at which to add null check debug information ++ int lock_object (Register swap, Register obj, Register disp_hdr, Register scratch, Label& slow_case); ++ ++ // unlocking ++ // hdr : contents destroyed ++ // obj : must point to the object to lock, contents preserved ++ // disp_hdr: must be A0 & must point to the displaced header location, contents destroyed ++ void unlock_object(Register swap, Register obj, Register lock, Label& slow_case); ++ ++ void initialize_object( ++ Register obj, // result: pointer to object after successful allocation ++ Register klass, // object klass ++ Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise ++ int con_size_in_bytes, // object size in bytes if known at compile time ++ Register t1, // temp register ++ Register t2, // temp register ++ bool is_tlab_allocated // the object was allocated in a TLAB; relevant for the implementation of ZeroTLAB ++ ); ++ ++ // allocation of fixed-size objects ++ // (can also be used to allocate fixed-size arrays, by setting ++ // hdr_size correctly and storing the array length afterwards) ++ // obj : will contain pointer to allocated object ++ // t1, t2 : scratch registers - contents destroyed ++ // header_size: size of object header in words ++ // object_size: total size of object in words ++ // slow_case : exit to slow case implementation if fast allocation fails ++ void allocate_object(Register obj, Register t1, Register t2, int header_size, ++ int object_size, Register klass, Label& slow_case); ++ ++ enum { ++ max_array_allocation_length = 0x00FFFFFF ++ }; ++ ++ // allocation of arrays ++ // obj : will contain pointer to allocated object ++ // len : array length in number of elements ++ // t : scratch register - contents destroyed ++ // header_size: size of object header in words ++ // f : element scale factor ++ // slow_case : exit to slow case implementation if fast allocation fails ++ void allocate_array(Register obj, Register len, Register t, Register t2, int header_size, ++ int f, Register klass, Label& slow_case); ++ ++ int rsp_offset() const { return _rsp_offset; } ++ void set_rsp_offset(int n) { _rsp_offset = n; } ++ ++ void invalidate_registers(bool inv_a0, bool inv_s0, bool inv_a2, bool inv_a3, ++ bool inv_a4, bool inv_a5) PRODUCT_RETURN; ++ ++ // This platform only uses signal-based null checks. The Label is not needed. ++ void null_check(Register r, Label *Lnull = NULL) { MacroAssembler::null_check(r); } ++ ++ void load_parameter(int offset_in_words, Register reg); ++ ++#endif // CPU_LOONGARCH_C1_MACROASSEMBLER_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp +new file mode 100644 +index 00000000..b75126fb +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch_64.cpp @@ -0,0 +1,346 @@ +/* + * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. @@ -15637,125 +16528,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#endif +} +#endif // ifndef PRODUCT -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_MacroAssembler_loongarch.hpp 2023-12-20 09:23:19.784814696 +0800 -@@ -0,0 +1,112 @@ -+/* -+ * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_C1_MACROASSEMBLER_LOONGARCH_HPP -+#define CPU_LOONGARCH_C1_MACROASSEMBLER_LOONGARCH_HPP -+ -+using MacroAssembler::build_frame; -+using MacroAssembler::null_check; -+ -+// C1_MacroAssembler contains high-level macros for C1 -+ -+ private: -+ int _rsp_offset; // track rsp changes -+ // initialization -+ void pd_init() { _rsp_offset = 0; } -+ -+ public: -+ void try_allocate( -+ Register obj, // result: pointer to object after successful allocation -+ Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise -+ int con_size_in_bytes, // object size in bytes if known at compile time -+ Register t1, // temp register -+ Register t2, // temp register -+ Label& slow_case // continuation point if fast allocation fails -+ ); -+ -+ void initialize_header(Register obj, Register klass, Register len, Register t1, Register t2); -+ void initialize_body(Register obj, Register len_in_bytes, int hdr_size_in_bytes, Register t1, Register t2); -+ -+ // locking -+ // hdr : must be A0, contents destroyed -+ // obj : must point to the object to lock, contents preserved -+ // disp_hdr: must point to the displaced header location, contents preserved -+ // scratch : scratch register, contents destroyed -+ // returns code offset at which to add null check debug information -+ int lock_object (Register swap, Register obj, Register disp_hdr, Register scratch, Label& slow_case); -+ -+ // unlocking -+ // hdr : contents destroyed -+ // obj : must point to the object to lock, contents preserved -+ // disp_hdr: must be A0 & must point to the displaced header location, contents destroyed -+ void unlock_object(Register swap, Register obj, Register lock, Label& slow_case); -+ -+ void initialize_object( -+ Register obj, // result: pointer to object after successful allocation -+ Register klass, // object klass -+ Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise -+ int con_size_in_bytes, // object size in bytes if known at compile time -+ Register t1, // temp register -+ Register t2, // temp register -+ bool is_tlab_allocated // the object was allocated in a TLAB; relevant for the implementation of ZeroTLAB -+ ); -+ -+ // allocation of fixed-size objects -+ // (can also be used to allocate fixed-size arrays, by setting -+ // hdr_size correctly and storing the array length afterwards) -+ // obj : will contain pointer to allocated object -+ // t1, t2 : scratch registers - contents destroyed -+ // header_size: size of object header in words -+ // object_size: total size of object in words -+ // slow_case : exit to slow case implementation if fast allocation fails -+ void allocate_object(Register obj, Register t1, Register t2, int header_size, -+ int object_size, Register klass, Label& slow_case); -+ -+ enum { -+ max_array_allocation_length = 0x00FFFFFF -+ }; -+ -+ // allocation of arrays -+ // obj : will contain pointer to allocated object -+ // len : array length in number of elements -+ // t : scratch register - contents destroyed -+ // header_size: size of object header in words -+ // f : element scale factor -+ // slow_case : exit to slow case implementation if fast allocation fails -+ void allocate_array(Register obj, Register len, Register t, Register t2, int header_size, -+ int f, Register klass, Label& slow_case); -+ -+ int rsp_offset() const { return _rsp_offset; } -+ void set_rsp_offset(int n) { _rsp_offset = n; } -+ -+ void invalidate_registers(bool inv_a0, bool inv_s0, bool inv_a2, bool inv_a3, -+ bool inv_a4, bool inv_a5) PRODUCT_RETURN; -+ -+ // This platform only uses signal-based null checks. The Label is not needed. -+ void null_check(Register r, Label *Lnull = NULL) { MacroAssembler::null_check(r); } -+ -+ void load_parameter(int offset_in_words, Register reg); -+ -+#endif // CPU_LOONGARCH_C1_MACROASSEMBLER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp 2023-12-20 09:23:19.784814696 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp +new file mode 100644 +index 00000000..a750dca3 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_Runtime1_loongarch_64.cpp @@ -0,0 +1,1252 @@ +/* + * Copyright (c) 1999, 2021, Oracle and/or its affiliates. All rights reserved. @@ -17009,9 +17786,86 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + Unimplemented(); + return 0; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp +new file mode 100644 +index 00000000..df052a05 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c1_globals_loongarch.hpp +@@ -0,0 +1,69 @@ ++/* ++ * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2021, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_C1_GLOBALS_LOONGARCH_HPP ++#define CPU_LOONGARCH_C1_GLOBALS_LOONGARCH_HPP ++ ++#include "utilities/globalDefinitions.hpp" ++#include "utilities/macros.hpp" ++ ++// Sets the default values for platform dependent flags used by the client compiler. ++// (see c1_globals.hpp) ++ ++#ifndef COMPILER2 ++define_pd_global(bool, BackgroundCompilation, true ); ++define_pd_global(bool, InlineIntrinsics, true ); ++define_pd_global(bool, PreferInterpreterNativeStubs, false); ++define_pd_global(bool, ProfileTraps, false); ++define_pd_global(bool, UseOnStackReplacement, true ); ++define_pd_global(bool, TieredCompilation, false); ++define_pd_global(intx, CompileThreshold, 1500 ); ++ ++define_pd_global(intx, OnStackReplacePercentage, 933 ); ++define_pd_global(intx, NewSizeThreadIncrease, 4*K ); ++define_pd_global(intx, InitialCodeCacheSize, 160*K); ++define_pd_global(intx, ReservedCodeCacheSize, 32*M ); ++define_pd_global(intx, NonProfiledCodeHeapSize, 13*M ); ++define_pd_global(intx, ProfiledCodeHeapSize, 14*M ); ++define_pd_global(intx, NonNMethodCodeHeapSize, 5*M ); ++define_pd_global(bool, ProfileInterpreter, false); ++define_pd_global(intx, CodeCacheExpansionSize, 32*K ); ++define_pd_global(uintx, CodeCacheMinBlockLength, 1); ++define_pd_global(uintx, CodeCacheMinimumUseSpace, 400*K); ++define_pd_global(bool, NeverActAsServerClassMachine, true ); ++define_pd_global(uint64_t,MaxRAM, 1ULL*G); ++define_pd_global(bool, CICompileOSR, true ); ++#endif // !COMPILER2 ++define_pd_global(bool, UseTypeProfile, false); ++define_pd_global(bool, RoundFPResults, true ); ++ ++define_pd_global(bool, LIRFillDelaySlots, false); ++define_pd_global(bool, OptimizeSinglePrecision, true ); ++define_pd_global(bool, CSEArrayLength, false); ++define_pd_global(bool, TwoOperandLIRForm, false ); ++ ++define_pd_global(intx, SafepointPollOffset, 0 ); ++ ++#endif // CPU_LOONGARCH_C1_GLOBALS_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp +new file mode 100644 +index 00000000..044b0d25 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c2_globals_loongarch.hpp @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -17100,9 +17954,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +define_pd_global(bool, NeverActAsServerClassMachine, false); + +#endif // CPU_LOONGARCH_VM_C2_GLOBALS_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp +new file mode 100644 +index 00000000..c7bf590b +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/c2_init_loongarch.cpp @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. @@ -17138,9 +17994,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +void Compile::pd_compiler2_init() { + guarantee(CodeEntryAlignment >= InteriorEntryAlignment, "" ); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp +new file mode 100644 +index 00000000..652f6c10 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/codeBuffer_loongarch.hpp @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -17177,9 +18035,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + void flush_bundle(bool start_new_bundle) {} + +#endif // CPU_LOONGARCH_VM_CODEBUFFER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp +new file mode 100644 +index 00000000..70a47fc7 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/compiledIC_loongarch.cpp @@ -0,0 +1,167 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -17348,9 +18208,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // !PRODUCT -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp 2024-01-30 13:54:24.776042456 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp +new file mode 100644 +index 00000000..cb655401 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -17442,9 +18304,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif //CPU_LOONGARCH_VM_COPY_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp +new file mode 100644 +index 00000000..45d86f5b +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. @@ -17499,9 +18363,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + bool native); // C++ interpreter only + +#endif // CPU_LOONGARCH_VM_CPPINTERPRETERGENERATOR_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp +new file mode 100644 +index 00000000..d6c0df3b +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/cppInterpreter_loongarch.cpp @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. @@ -17718,9 +18584,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // CC_INTERP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp +new file mode 100644 +index 00000000..50de0365 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/debug_loongarch.cpp @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. @@ -17773,9 +18641,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +void pd_obfuscate_location(char *buf,int buflen) {} + +#endif // PRODUCT -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp +new file mode 100644 +index 00000000..62478be3 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -17807,9 +18677,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#include "depChecker_loongarch.hpp" + +// Nothing to do on LoongArch -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp +new file mode 100644 +index 00000000..598be0ee +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/depChecker_loongarch.hpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -17842,9 +18714,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +// Nothing to do on LoongArch + +#endif // CPU_LOONGARCH_VM_DEPCHECKER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp +new file mode 100644 +index 00000000..ccd89e8d +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/disassembler_loongarch.hpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -17883,9 +18757,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } + +#endif // CPU_LOONGARCH_VM_DISASSEMBLER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp +new file mode 100644 +index 00000000..0f50a571 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/frame_loongarch.cpp @@ -0,0 +1,711 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -18598,9 +19474,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + init((intptr_t*)sp, (intptr_t*)fp, (address)pc); +} +#endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp +new file mode 100644 +index 00000000..964026e6 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/frame_loongarch.hpp @@ -0,0 +1,229 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -18831,9 +19709,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#endif // CC_INTERP + +#endif // CPU_LOONGARCH_VM_FRAME_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp ---- a/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp +new file mode 100644 +index 00000000..3d22339a +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/frame_loongarch.inline.hpp @@ -0,0 +1,312 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -19147,9 +20027,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // CPU_LOONGARCH_VM_FRAME_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp +new file mode 100644 +index 00000000..f9f93b9e +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/globalDefinitions_loongarch.hpp @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. @@ -19192,9 +20074,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#define SUPPORTS_NATIVE_CX8 + +#endif // CPU_LOONGARCH_VM_GLOBALDEFINITIONS_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp +new file mode 100644 +index 00000000..182be608 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/globals_loongarch.hpp @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -19299,100 +20183,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + "Eliminate barriers for single active cpu") + +#endif // CPU_LOONGARCH_VM_GLOBALS_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,42 @@ -+/* -+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#include "precompiled.hpp" -+#include "asm/macroAssembler.hpp" -+#include "runtime/icache.hpp" -+ -+void ICacheStubGenerator::generate_icache_flush(ICache::flush_icache_stub_t* flush_icache_stub) -+{ -+#define __ _masm-> -+ StubCodeMark mark(this, "ICache", "flush_icache_stub"); -+ address start = __ pc(); -+ -+ __ ibar(0); -+ __ ori(V0, RA2, 0); -+ __ jr(RA); -+ -+ *flush_icache_stub = (ICache::flush_icache_stub_t)start; -+#undef __ -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,41 @@ -+/* -+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_VM_ICACHE_LOONGARCH_HPP -+#define CPU_LOONGARCH_VM_ICACHE_LOONGARCH_HPP -+ -+// Interface for updating the instruction cache. Whenever the VM modifies -+// code, part of the processor instruction cache potentially has to be flushed. -+ -+class ICache : public AbstractICache { -+ public: -+ enum { -+ stub_size = 3 * BytesPerInstWord, // Size of the icache flush stub in bytes -+ line_size = 32, // flush instruction affects a dword -+ log2_line_size = 5 // log2(line_size) -+ }; -+}; -+ -+#endif // CPU_LOONGARCH_VM_ICACHE_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp +new file mode 100644 +index 00000000..8c782253 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/icBuffer_loongarch.cpp @@ -0,0 +1,101 @@ +/* + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. @@ -19495,9 +20290,106 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + void* o= (void*)move->data(); + return o; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp +new file mode 100644 +index 00000000..d577e41f +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/icache_loongarch.cpp +@@ -0,0 +1,42 @@ ++/* ++ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include "precompiled.hpp" ++#include "asm/macroAssembler.hpp" ++#include "runtime/icache.hpp" ++ ++void ICacheStubGenerator::generate_icache_flush(ICache::flush_icache_stub_t* flush_icache_stub) ++{ ++#define __ _masm-> ++ StubCodeMark mark(this, "ICache", "flush_icache_stub"); ++ address start = __ pc(); ++ ++ __ ibar(0); ++ __ ori(V0, RA2, 0); ++ __ jr(RA); ++ ++ *flush_icache_stub = (ICache::flush_icache_stub_t)start; ++#undef __ ++} +diff --git a/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp +new file mode 100644 +index 00000000..15e45cb3 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/icache_loongarch.hpp +@@ -0,0 +1,41 @@ ++/* ++ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_VM_ICACHE_LOONGARCH_HPP ++#define CPU_LOONGARCH_VM_ICACHE_LOONGARCH_HPP ++ ++// Interface for updating the instruction cache. Whenever the VM modifies ++// code, part of the processor instruction cache potentially has to be flushed. ++ ++class ICache : public AbstractICache { ++ public: ++ enum { ++ stub_size = 3 * BytesPerInstWord, // Size of the icache flush stub in bytes ++ line_size = 32, // flush instruction affects a dword ++ log2_line_size = 5 // log2(line_size) ++ }; ++}; ++ ++#endif // CPU_LOONGARCH_VM_ICACHE_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp +new file mode 100644 +index 00000000..8c84f215 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.cpp @@ -0,0 +1,1960 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -21459,9 +22351,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + unimplemented(); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp ---- a/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp +new file mode 100644 +index 00000000..9113da54 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/interp_masm_loongarch_64.hpp @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -21732,9 +22626,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_LOONGARCH_VM_INTERP_MASM_LOONGARCH_64_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp +new file mode 100644 +index 00000000..7f253b2d +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/interpreterGenerator_loongarch.hpp @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -21787,13 +22683,87 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + void generate_counter_overflow(Label* do_continue); + +#endif // CPU_LOONGARCH_VM_INTERPRETERGENERATOR_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,277 @@ +diff --git a/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp +new file mode 100644 +index 00000000..052eb997 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp +@@ -0,0 +1,66 @@ +/* -+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_VM_INTERPRETERRT_LOONGARCH_HPP ++#define CPU_LOONGARCH_VM_INTERPRETERRT_LOONGARCH_HPP ++ ++#include "memory/allocation.hpp" ++ ++// native method calls ++ ++class SignatureHandlerGenerator: public NativeSignatureIterator { ++ private: ++ MacroAssembler* _masm; ++ unsigned int _num_fp_args; ++ unsigned int _num_int_args; ++ int _stack_offset; ++ ++ void move(int from_offset, int to_offset); ++ void box(int from_offset, int to_offset); ++ void pass_int(); ++ void pass_long(); ++ void pass_object(); ++ void pass_float(); ++ void pass_double(); ++ ++ public: ++ // Creation ++ SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer) : NativeSignatureIterator(method) { ++ _masm = new MacroAssembler(buffer); ++ _num_int_args = (method->is_static() ? 1 : 0); ++ _num_fp_args = 0; ++ _stack_offset = 0; ++ } ++ ++ // Code generation ++ void generate(uint64_t fingerprint); ++ ++ // Code generation support ++ static Register from(); ++ static Register to(); ++ static Register temp(); ++}; ++ ++#endif // CPU_LOONGARCH_VM_INTERPRETERRT_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp +new file mode 100644 +index 00000000..0c9df4aa +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp +@@ -0,0 +1,274 @@ ++/* ++ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -21817,351 +22787,16 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + */ + +#include "precompiled.hpp" -+#include "asm/macroAssembler.hpp" -+#include "interpreter/bytecodeHistogram.hpp" +#include "interpreter/interpreter.hpp" -+#include "interpreter/interpreterGenerator.hpp" +#include "interpreter/interpreterRuntime.hpp" -+#include "interpreter/templateTable.hpp" -+#include "oops/arrayOop.hpp" -+#include "oops/methodData.hpp" ++#include "memory/allocation.inline.hpp" ++#include "memory/universe.inline.hpp" +#include "oops/method.hpp" +#include "oops/oop.inline.hpp" -+#include "prims/jvmtiExport.hpp" -+#include "prims/jvmtiThreadState.hpp" -+#include "prims/methodHandles.hpp" -+#include "runtime/arguments.hpp" -+#include "runtime/deoptimization.hpp" -+#include "runtime/frame.inline.hpp" -+#include "runtime/sharedRuntime.hpp" -+#include "runtime/stubRoutines.hpp" -+#include "runtime/synchronizer.hpp" -+#include "runtime/timer.hpp" -+#include "runtime/vframeArray.hpp" -+#include "utilities/debug.hpp" -+ -+#define __ _masm-> -+ -+#define A0 RA0 -+#define A1 RA1 -+#define A2 RA2 -+#define A3 RA3 -+#define A4 RA4 -+#define A5 RA5 -+#define A6 RA6 -+#define A7 RA7 -+#define T0 RT0 -+#define T1 RT1 -+#define T2 RT2 -+#define T3 RT3 -+#define T4 RT4 -+#define T5 RT5 -+#define T6 RT6 -+#define T7 RT7 -+#define T8 RT8 -+ -+address AbstractInterpreterGenerator::generate_slow_signature_handler() { -+ address entry = __ pc(); -+ // Rmethod: method -+ // LVP: pointer to locals -+ // A3: first stack arg -+ __ move(A3, SP); -+ __ addi_d(SP, SP, -18 * wordSize); -+ __ st_d(RA, SP, 0); -+ __ call_VM(noreg, -+ CAST_FROM_FN_PTR(address, -+ InterpreterRuntime::slow_signature_handler), -+ Rmethod, LVP, A3); -+ -+ // V0: result handler -+ -+ // Stack layout: -+ // ... -+ // 18 stack arg0 <--- old sp -+ // 17 floatReg arg7 -+ // ... -+ // 10 floatReg arg0 -+ // 9 float/double identifiers -+ // 8 IntReg arg7 -+ // ... -+ // 2 IntReg arg1 -+ // 1 aligned slot -+ // SP: 0 return address -+ -+ // Do FP first so we can use A3 as temp -+ __ ld_d(A3, Address(SP, 9 * wordSize)); // float/double identifiers -+ -+ for (int i= 0; i < Argument::n_float_register_parameters; i++) { -+ FloatRegister floatreg = as_FloatRegister(i + FA0->encoding()); -+ Label isdouble, done; -+ -+ __ andi(AT, A3, 1 << i); -+ __ bnez(AT, isdouble); -+ __ fld_s(floatreg, SP, (10 + i) * wordSize); -+ __ b(done); -+ __ bind(isdouble); -+ __ fld_d(floatreg, SP, (10 + i) * wordSize); -+ __ bind(done); -+ } -+ -+ // A0 is for env. -+ // If the mothed is not static, A1 will be corrected in generate_native_entry. -+ for (int i= 1; i < Argument::n_register_parameters; i++) { -+ Register reg = as_Register(i + A0->encoding()); -+ -+ __ ld_d(reg, SP, (1 + i) * wordSize); -+ } -+ -+ // A0/V0 contains the result from the call of -+ // InterpreterRuntime::slow_signature_handler so we don't touch it -+ // here. It will be loaded with the JNIEnv* later. -+ __ ld_d(RA, SP, 0); -+ __ addi_d(SP, SP, 18 * wordSize); -+ __ jr(RA); -+ return entry; -+} -+ -+ -+// -+// Various method entries -+// -+ -+address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { -+ -+ // Rmethod: methodOop -+ // V0: scratrch -+ // Rsender: send 's sp -+ -+ if (!InlineIntrinsics) return NULL; // Generate a vanilla entry -+ -+ address entry_point = __ pc(); -+ //guarantee(0, "LA not implemented yet"); -+ // These don't need a safepoint check because they aren't virtually -+ // callable. We won't enter these intrinsics from compiled code. -+ // If in the future we added an intrinsic which was virtually callable -+ // we'd have to worry about how to safepoint so that this code is used. -+ -+ // mathematical functions inlined by compiler -+ // (interpreter must provide identical implementation -+ // in order to avoid monotonicity bugs when switching -+ // from interpreter to compiler in the middle of some -+ // computation) -+ // -+ // stack: [ lo(arg) ] <-- sp -+ // [ hi(arg) ] -+ { -+ // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are -+ // java methods. Interpreter::method_kind(...) will select -+ // this entry point for the corresponding methods in JDK 1.3. -+ __ fld_d(FA0, SP, 0 * wordSize); -+ __ fld_d(FA1, SP, 1 * wordSize); -+ __ push2(RA, FP); -+ __ addi_d(FP, SP, 2 * wordSize); -+ -+ // [ fp ] <-- sp -+ // [ ra ] -+ // [ lo ] <-- fp -+ // [ hi ] -+ //FIXME, need consider this -+ switch (kind) { -+ case Interpreter::java_lang_math_sin : -+ __ trigfunc('s'); -+ break; -+ case Interpreter::java_lang_math_cos : -+ __ trigfunc('c'); -+ break; -+ case Interpreter::java_lang_math_tan : -+ __ trigfunc('t'); -+ break; -+ case Interpreter::java_lang_math_sqrt: -+ __ fsqrt_d(F0, FA0); -+ break; -+ case Interpreter::java_lang_math_abs: -+ __ fabs_d(F0, FA0); -+ break; -+ case Interpreter::java_lang_math_log: -+ // Store to stack to convert 80bit precision back to 64bits -+ break; -+ case Interpreter::java_lang_math_log10: -+ // Store to stack to convert 80bit precision back to 64bits -+ break; -+ case Interpreter::java_lang_math_pow: -+ break; -+ case Interpreter::java_lang_math_exp: -+ break; -+ -+ default : -+ ShouldNotReachHere(); -+ } -+ -+ // must maintain return value in F0:F1 -+ __ ld_d(RA, FP, (-1) * wordSize); -+ //FIXME -+ __ ld_d(FP, FP, (-2) * wordSize); -+ __ move(SP, Rsender); -+ __ jr(RA); -+ } -+ return entry_point; -+} -+ -+ -+// Abstract method entry -+// Attempt to execute abstract method. Throw exception -+address InterpreterGenerator::generate_abstract_entry(void) { -+ -+ // Rmethod: methodOop -+ // V0: receiver (unused) -+ // Rsender : sender 's sp -+ address entry_point = __ pc(); -+ -+ // abstract method entry -+ // throw exception -+ // adjust stack to what a normal return would do -+ __ empty_expression_stack(); -+ __ restore_bcp(); -+ __ restore_locals(); -+ __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); -+ // the call_VM checks for exception, so we should never return here. -+ __ should_not_reach_here(); -+ -+ return entry_point; -+} -+ -+ -+// Empty method, generate a very fast return. -+ -+address InterpreterGenerator::generate_empty_entry(void) { -+ -+ // Rmethod: methodOop -+ // V0: receiver (unused) -+ // Rsender: sender 's sp, must set sp to this value on return, on LoongArch, now use T0, as it right? -+ if (!UseFastEmptyMethods) return NULL; -+ -+ address entry_point = __ pc(); -+ //TODO: LA -+ //guarantee(0, "LA not implemented yet"); -+ Label slow_path; -+ __ li(RT0, SafepointSynchronize::address_of_state()); -+ __ ld_w(AT, RT0, 0); -+ __ li(RT0, (SafepointSynchronize::_not_synchronized)); -+ __ bne(AT, RT0,slow_path); -+ __ move(SP, Rsender); -+ __ jr(RA); -+ __ bind(slow_path); -+ (void) generate_normal_entry(false); -+ return entry_point; -+ -+} -+ -+void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) { -+ -+ // This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in -+ // the days we had adapter frames. When we deoptimize a situation where a -+ // compiled caller calls a compiled caller will have registers it expects -+ // to survive the call to the callee. If we deoptimize the callee the only -+ // way we can restore these registers is to have the oldest interpreter -+ // frame that we create restore these values. That is what this routine -+ // will accomplish. -+ -+ // At the moment we have modified c2 to not have any callee save registers -+ // so this problem does not exist and this routine is just a place holder. -+ -+ assert(f->is_interpreted_frame(), "must be interpreted"); -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,50 @@ -+/* -+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_VM_INTERPRETER_LOONGARCH_HPP -+#define CPU_LOONGARCH_VM_INTERPRETER_LOONGARCH_HPP -+ -+ public: -+ -+ // Sentinel placed in the code for interpreter returns so -+ // that i2c adapters and osr code can recognize an interpreter -+ // return address and convert the return to a specialized -+ // block of code to handle compiedl return values and cleaning -+ // the fpu stack. -+ static const int return_sentinel; -+ -+ static Address::ScaleFactor stackElementScale() { -+ return Address::times_8; -+ } -+ -+ // Offset from sp (which points to the last stack element) -+ static int expr_offset_in_bytes(int i) { return stackElementSize * i; } -+ // Size of interpreter code. Increase if too small. Interpreter will -+ // fail with a guarantee ("not enough space for interpreter generation"); -+ // if too small. -+ // Run with +PrintInterpreterSize to get the VM to print out the size. -+ // Max size with JVMTI and TaggedStackInterpreter -+ const static int InterpreterCodeSize = 168 * 1024; -+#endif // CPU_LOONGARCH_VM_INTERPRETER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch_64.cpp 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,274 @@ -+/* -+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#include "precompiled.hpp" -+#include "interpreter/interpreter.hpp" -+#include "interpreter/interpreterRuntime.hpp" -+#include "memory/allocation.inline.hpp" -+#include "memory/universe.inline.hpp" -+#include "oops/method.hpp" -+#include "oops/oop.inline.hpp" -+#include "runtime/handles.inline.hpp" -+#include "runtime/icache.hpp" -+#include "runtime/interfaceSupport.hpp" -+#include "runtime/signature.hpp" ++#include "runtime/handles.inline.hpp" ++#include "runtime/icache.hpp" ++#include "runtime/interfaceSupport.hpp" ++#include "runtime/signature.hpp" + +#define __ _masm-> + @@ -22400,13 +23035,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // return result handler + return Interpreter::result_handler(m->result_type()); +IRT_END -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/interpreterRT_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,66 @@ +diff --git a/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp +new file mode 100644 +index 00000000..c83afbda +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch.hpp +@@ -0,0 +1,50 @@ +/* -+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. ++ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -22429,50 +23066,319 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#ifndef CPU_LOONGARCH_VM_INTERPRETERRT_LOONGARCH_HPP -+#define CPU_LOONGARCH_VM_INTERPRETERRT_LOONGARCH_HPP ++#ifndef CPU_LOONGARCH_VM_INTERPRETER_LOONGARCH_HPP ++#define CPU_LOONGARCH_VM_INTERPRETER_LOONGARCH_HPP + -+#include "memory/allocation.hpp" ++ public: + -+// native method calls ++ // Sentinel placed in the code for interpreter returns so ++ // that i2c adapters and osr code can recognize an interpreter ++ // return address and convert the return to a specialized ++ // block of code to handle compiedl return values and cleaning ++ // the fpu stack. ++ static const int return_sentinel; + -+class SignatureHandlerGenerator: public NativeSignatureIterator { -+ private: -+ MacroAssembler* _masm; -+ unsigned int _num_fp_args; -+ unsigned int _num_int_args; -+ int _stack_offset; ++ static Address::ScaleFactor stackElementScale() { ++ return Address::times_8; ++ } + -+ void move(int from_offset, int to_offset); -+ void box(int from_offset, int to_offset); -+ void pass_int(); -+ void pass_long(); -+ void pass_object(); -+ void pass_float(); -+ void pass_double(); ++ // Offset from sp (which points to the last stack element) ++ static int expr_offset_in_bytes(int i) { return stackElementSize * i; } ++ // Size of interpreter code. Increase if too small. Interpreter will ++ // fail with a guarantee ("not enough space for interpreter generation"); ++ // if too small. ++ // Run with +PrintInterpreterSize to get the VM to print out the size. ++ // Max size with JVMTI and TaggedStackInterpreter ++ const static int InterpreterCodeSize = 168 * 1024; ++#endif // CPU_LOONGARCH_VM_INTERPRETER_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp +new file mode 100644 +index 00000000..5a4f102c +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/interpreter_loongarch_64.cpp +@@ -0,0 +1,277 @@ ++/* ++ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ + -+ public: -+ // Creation -+ SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer) : NativeSignatureIterator(method) { -+ _masm = new MacroAssembler(buffer); -+ _num_int_args = (method->is_static() ? 1 : 0); -+ _num_fp_args = 0; -+ _stack_offset = 0; ++#include "precompiled.hpp" ++#include "asm/macroAssembler.hpp" ++#include "interpreter/bytecodeHistogram.hpp" ++#include "interpreter/interpreter.hpp" ++#include "interpreter/interpreterGenerator.hpp" ++#include "interpreter/interpreterRuntime.hpp" ++#include "interpreter/templateTable.hpp" ++#include "oops/arrayOop.hpp" ++#include "oops/methodData.hpp" ++#include "oops/method.hpp" ++#include "oops/oop.inline.hpp" ++#include "prims/jvmtiExport.hpp" ++#include "prims/jvmtiThreadState.hpp" ++#include "prims/methodHandles.hpp" ++#include "runtime/arguments.hpp" ++#include "runtime/deoptimization.hpp" ++#include "runtime/frame.inline.hpp" ++#include "runtime/sharedRuntime.hpp" ++#include "runtime/stubRoutines.hpp" ++#include "runtime/synchronizer.hpp" ++#include "runtime/timer.hpp" ++#include "runtime/vframeArray.hpp" ++#include "utilities/debug.hpp" ++ ++#define __ _masm-> ++ ++#define A0 RA0 ++#define A1 RA1 ++#define A2 RA2 ++#define A3 RA3 ++#define A4 RA4 ++#define A5 RA5 ++#define A6 RA6 ++#define A7 RA7 ++#define T0 RT0 ++#define T1 RT1 ++#define T2 RT2 ++#define T3 RT3 ++#define T4 RT4 ++#define T5 RT5 ++#define T6 RT6 ++#define T7 RT7 ++#define T8 RT8 ++ ++address AbstractInterpreterGenerator::generate_slow_signature_handler() { ++ address entry = __ pc(); ++ // Rmethod: method ++ // LVP: pointer to locals ++ // A3: first stack arg ++ __ move(A3, SP); ++ __ addi_d(SP, SP, -18 * wordSize); ++ __ st_d(RA, SP, 0); ++ __ call_VM(noreg, ++ CAST_FROM_FN_PTR(address, ++ InterpreterRuntime::slow_signature_handler), ++ Rmethod, LVP, A3); ++ ++ // V0: result handler ++ ++ // Stack layout: ++ // ... ++ // 18 stack arg0 <--- old sp ++ // 17 floatReg arg7 ++ // ... ++ // 10 floatReg arg0 ++ // 9 float/double identifiers ++ // 8 IntReg arg7 ++ // ... ++ // 2 IntReg arg1 ++ // 1 aligned slot ++ // SP: 0 return address ++ ++ // Do FP first so we can use A3 as temp ++ __ ld_d(A3, Address(SP, 9 * wordSize)); // float/double identifiers ++ ++ for (int i= 0; i < Argument::n_float_register_parameters; i++) { ++ FloatRegister floatreg = as_FloatRegister(i + FA0->encoding()); ++ Label isdouble, done; ++ ++ __ andi(AT, A3, 1 << i); ++ __ bnez(AT, isdouble); ++ __ fld_s(floatreg, SP, (10 + i) * wordSize); ++ __ b(done); ++ __ bind(isdouble); ++ __ fld_d(floatreg, SP, (10 + i) * wordSize); ++ __ bind(done); + } + -+ // Code generation -+ void generate(uint64_t fingerprint); ++ // A0 is for env. ++ // If the mothed is not static, A1 will be corrected in generate_native_entry. ++ for (int i= 1; i < Argument::n_register_parameters; i++) { ++ Register reg = as_Register(i + A0->encoding()); + -+ // Code generation support -+ static Register from(); -+ static Register to(); -+ static Register temp(); -+}; ++ __ ld_d(reg, SP, (1 + i) * wordSize); ++ } + -+#endif // CPU_LOONGARCH_VM_INTERPRETERRT_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 ++ // A0/V0 contains the result from the call of ++ // InterpreterRuntime::slow_signature_handler so we don't touch it ++ // here. It will be loaded with the JNIEnv* later. ++ __ ld_d(RA, SP, 0); ++ __ addi_d(SP, SP, 18 * wordSize); ++ __ jr(RA); ++ return entry; ++} ++ ++ ++// ++// Various method entries ++// ++ ++address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { ++ ++ // Rmethod: methodOop ++ // V0: scratrch ++ // Rsender: send 's sp ++ ++ if (!InlineIntrinsics) return NULL; // Generate a vanilla entry ++ ++ address entry_point = __ pc(); ++ //guarantee(0, "LA not implemented yet"); ++ // These don't need a safepoint check because they aren't virtually ++ // callable. We won't enter these intrinsics from compiled code. ++ // If in the future we added an intrinsic which was virtually callable ++ // we'd have to worry about how to safepoint so that this code is used. ++ ++ // mathematical functions inlined by compiler ++ // (interpreter must provide identical implementation ++ // in order to avoid monotonicity bugs when switching ++ // from interpreter to compiler in the middle of some ++ // computation) ++ // ++ // stack: [ lo(arg) ] <-- sp ++ // [ hi(arg) ] ++ { ++ // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are ++ // java methods. Interpreter::method_kind(...) will select ++ // this entry point for the corresponding methods in JDK 1.3. ++ __ fld_d(FA0, SP, 0 * wordSize); ++ __ fld_d(FA1, SP, 1 * wordSize); ++ __ push2(RA, FP); ++ __ addi_d(FP, SP, 2 * wordSize); ++ ++ // [ fp ] <-- sp ++ // [ ra ] ++ // [ lo ] <-- fp ++ // [ hi ] ++ //FIXME, need consider this ++ switch (kind) { ++ case Interpreter::java_lang_math_sin : ++ __ trigfunc('s'); ++ break; ++ case Interpreter::java_lang_math_cos : ++ __ trigfunc('c'); ++ break; ++ case Interpreter::java_lang_math_tan : ++ __ trigfunc('t'); ++ break; ++ case Interpreter::java_lang_math_sqrt: ++ __ fsqrt_d(F0, FA0); ++ break; ++ case Interpreter::java_lang_math_abs: ++ __ fabs_d(F0, FA0); ++ break; ++ case Interpreter::java_lang_math_log: ++ // Store to stack to convert 80bit precision back to 64bits ++ break; ++ case Interpreter::java_lang_math_log10: ++ // Store to stack to convert 80bit precision back to 64bits ++ break; ++ case Interpreter::java_lang_math_pow: ++ break; ++ case Interpreter::java_lang_math_exp: ++ break; ++ ++ default : ++ ShouldNotReachHere(); ++ } ++ ++ // must maintain return value in F0:F1 ++ __ ld_d(RA, FP, (-1) * wordSize); ++ //FIXME ++ __ ld_d(FP, FP, (-2) * wordSize); ++ __ move(SP, Rsender); ++ __ jr(RA); ++ } ++ return entry_point; ++} ++ ++ ++// Abstract method entry ++// Attempt to execute abstract method. Throw exception ++address InterpreterGenerator::generate_abstract_entry(void) { ++ ++ // Rmethod: methodOop ++ // V0: receiver (unused) ++ // Rsender : sender 's sp ++ address entry_point = __ pc(); ++ ++ // abstract method entry ++ // throw exception ++ // adjust stack to what a normal return would do ++ __ empty_expression_stack(); ++ __ restore_bcp(); ++ __ restore_locals(); ++ __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); ++ // the call_VM checks for exception, so we should never return here. ++ __ should_not_reach_here(); ++ ++ return entry_point; ++} ++ ++ ++// Empty method, generate a very fast return. ++ ++address InterpreterGenerator::generate_empty_entry(void) { ++ ++ // Rmethod: methodOop ++ // V0: receiver (unused) ++ // Rsender: sender 's sp, must set sp to this value on return, on LoongArch, now use T0, as it right? ++ if (!UseFastEmptyMethods) return NULL; ++ ++ address entry_point = __ pc(); ++ //TODO: LA ++ //guarantee(0, "LA not implemented yet"); ++ Label slow_path; ++ __ li(RT0, SafepointSynchronize::address_of_state()); ++ __ ld_w(AT, RT0, 0); ++ __ li(RT0, (SafepointSynchronize::_not_synchronized)); ++ __ bne(AT, RT0,slow_path); ++ __ move(SP, Rsender); ++ __ jr(RA); ++ __ bind(slow_path); ++ (void) generate_normal_entry(false); ++ return entry_point; ++ ++} ++ ++void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) { ++ ++ // This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in ++ // the days we had adapter frames. When we deoptimize a situation where a ++ // compiled caller calls a compiled caller will have registers it expects ++ // to survive the call to the callee. If we deoptimize the callee the only ++ // way we can restore these registers is to have the oldest interpreter ++ // frame that we create restore these values. That is what this routine ++ // will accomplish. ++ ++ // At the moment we have modified c2 to not have any callee save registers ++ // so this problem does not exist and this routine is just a place holder. ++ ++ assert(f->is_interpreted_frame(), "must be interpreted"); ++} +diff --git a/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp +new file mode 100644 +index 00000000..de97de58 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/javaFrameAnchor_loongarch.hpp @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -22561,9 +23467,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + void set_last_Java_fp(intptr_t* fp) { _last_Java_fp = fp; } + +#endif // CPU_LOONGARCH_VM_JAVAFRAMEANCHOR_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp +new file mode 100644 +index 00000000..5b52e54e +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/jniFastGetField_loongarch_64.cpp @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. @@ -22734,64 +23642,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +address JNI_FastGetField::generate_fast_get_double_field() { + return generate_fast_get_int_field0(T_DOUBLE); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/jni_loongarch.h b/hotspot/src/cpu/loongarch/vm/jni_loongarch.h ---- a/hotspot/src/cpu/loongarch/vm/jni_loongarch.h 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/jni_loongarch.h 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,51 @@ -+/* -+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. Oracle designates this -+ * particular file as subject to the "Classpath" exception as provided -+ * by Oracle in the LICENSE file that accompanied this code. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+#ifndef _JAVASOFT_JNI_MD_H_ -+#define _JAVASOFT_JNI_MD_H_ -+ -+// Note: please do not change these without also changing jni_md.h in the JDK -+// repository -+#ifndef __has_attribute -+ #define __has_attribute(x) 0 -+#endif -+#if (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2))) || __has_attribute(visibility) -+ #define JNIEXPORT __attribute__((visibility("default"))) -+ #define JNIIMPORT __attribute__((visibility("default"))) -+#else -+ #define JNIEXPORT -+ #define JNIIMPORT -+#endif -+ -+#define JNICALL -+ -+typedef int jint; -+ -+ typedef long jlong; -+ -+typedef signed char jbyte; -+ -+#endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp 2023-12-20 09:23:19.788147991 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp +new file mode 100644 +index 00000000..554ff216 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/jniTypes_loongarch.hpp @@ -0,0 +1,144 @@ +/* + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. @@ -22937,9 +23792,98 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_LOONGARCH_VM_JNITYPES_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/loongarch_64.ad b/hotspot/src/cpu/loongarch/vm/loongarch_64.ad ---- a/hotspot/src/cpu/loongarch/vm/loongarch_64.ad 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/loongarch_64.ad 2024-01-30 13:54:24.792708955 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/jni_loongarch.h b/hotspot/src/cpu/loongarch/vm/jni_loongarch.h +new file mode 100644 +index 00000000..eb25cbc3 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/jni_loongarch.h +@@ -0,0 +1,51 @@ ++/* ++ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. Oracle designates this ++ * particular file as subject to the "Classpath" exception as provided ++ * by Oracle in the LICENSE file that accompanied this code. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ */ ++ ++#ifndef _JAVASOFT_JNI_MD_H_ ++#define _JAVASOFT_JNI_MD_H_ ++ ++// Note: please do not change these without also changing jni_md.h in the JDK ++// repository ++#ifndef __has_attribute ++ #define __has_attribute(x) 0 ++#endif ++#if (defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4) && (__GNUC_MINOR__ > 2))) || __has_attribute(visibility) ++ #define JNIEXPORT __attribute__((visibility("default"))) ++ #define JNIIMPORT __attribute__((visibility("default"))) ++#else ++ #define JNIEXPORT ++ #define JNIIMPORT ++#endif ++ ++#define JNICALL ++ ++typedef int jint; ++ ++ typedef long jlong; ++ ++typedef signed char jbyte; ++ ++#endif +diff --git a/hotspot/src/cpu/loongarch/vm/loongarch.ad b/hotspot/src/cpu/loongarch/vm/loongarch.ad +new file mode 100644 +index 00000000..48c44779 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/loongarch.ad +@@ -0,0 +1,24 @@ ++// ++// Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. ++// Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++// ++// This code is free software; you can redistribute it and/or modify it ++// under the terms of the GNU General Public License version 2 only, as ++// published by the Free Software Foundation. ++// ++// This code is distributed in the hope that it will be useful, but WITHOUT ++// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++// version 2 for more details (a copy is included in the LICENSE file that ++// accompanied this code). ++// ++// You should have received a copy of the GNU General Public License version ++// 2 along with this work; if not, write to the Free Software Foundation, ++// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++// or visit www.oracle.com if you need additional information or have any ++// questions. ++// ++// +diff --git a/hotspot/src/cpu/loongarch/vm/loongarch_64.ad b/hotspot/src/cpu/loongarch/vm/loongarch_64.ad +new file mode 100644 +index 00000000..fa4bf6e1 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/loongarch_64.ad @@ -0,0 +1,12861 @@ +// +// Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -35802,37 +36746,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +// These must follow all instruction definitions as they use the names +// defined in the instructions definitions. + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/loongarch.ad b/hotspot/src/cpu/loongarch/vm/loongarch.ad ---- a/hotspot/src/cpu/loongarch/vm/loongarch.ad 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/loongarch.ad 2023-12-20 09:23:19.788147991 +0800 -@@ -0,0 +1,24 @@ -+// -+// Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. -+// Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+// -+// This code is free software; you can redistribute it and/or modify it -+// under the terms of the GNU General Public License version 2 only, as -+// published by the Free Software Foundation. -+// -+// This code is distributed in the hope that it will be useful, but WITHOUT -+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+// version 2 for more details (a copy is included in the LICENSE file that -+// accompanied this code). -+// -+// You should have received a copy of the GNU General Public License version -+// 2 along with this work; if not, write to the Free Software Foundation, -+// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+// -+// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+// or visit www.oracle.com if you need additional information or have any -+// questions. -+// -+// -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp +new file mode 100644 +index 00000000..89295343 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.cpp @@ -0,0 +1,3895 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -39729,9 +40647,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + bind(L_exit); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp +new file mode 100644 +index 00000000..8b123c29 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.hpp @@ -0,0 +1,771 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -40504,9 +41424,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_LOONGARCH_VM_MACROASSEMBLER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp ---- a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp +new file mode 100644 +index 00000000..0b265a4d +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/macroAssembler_loongarch.inline.hpp @@ -0,0 +1,34 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -40542,9 +41464,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#include "code/codeCache.hpp" + +#endif // CPU_LOONGARCH_VM_MACROASSEMBLER_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp +new file mode 100644 +index 00000000..b36216c5 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/metaspaceShared_loongarch_64.cpp @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. @@ -40666,9 +41590,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + *mc_top = (char*)__ pc(); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp +new file mode 100644 +index 00000000..cb31ca5a +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.cpp @@ -0,0 +1,566 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -41236,9 +42162,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adaptername) { +} +#endif //PRODUCT -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp +new file mode 100644 +index 00000000..f8433742 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/methodHandles_loongarch.hpp @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. @@ -41302,9 +42230,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // Should be in sharedRuntime, not here. + return R3; + } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp +new file mode 100644 +index 00000000..639ac6cd +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.cpp @@ -0,0 +1,485 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -41791,9 +42721,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return Assembler::high(insn_word(), 10) == Assembler::ld_w_op && + Assembler::low(insn_word(), 5) == AT->encoding(); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp +new file mode 100644 +index 00000000..49323992 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/nativeInst_loongarch.hpp @@ -0,0 +1,513 @@ +/* + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. @@ -42308,9 +43240,62 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return (NativeCallTrampolineStub*)addr; +} +#endif // CPU_LOONGARCH_VM_NATIVEINST_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp +new file mode 100644 +index 00000000..5ff7555d +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp +@@ -0,0 +1,45 @@ ++/* ++ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_VM_REGISTERMAP_LOONGARCH_HPP ++#define CPU_LOONGARCH_VM_REGISTERMAP_LOONGARCH_HPP ++ ++// machine-dependent implemention for register maps ++ friend class frame; ++ ++ private: ++ // This is the hook for finding a register in an "well-known" location, ++ // such as a register block of a predetermined format. ++ // Since there is none, we just return NULL. ++ // See registerMap_sparc.hpp for an example of grabbing registers ++ // from register save areas of a standard layout. ++ address pd_location(VMReg reg) const {return NULL;} ++ ++ // no PD state to clear or copy: ++ void pd_clear() {} ++ void pd_initialize() {} ++ void pd_initialize_from(const RegisterMap* map) {} ++ ++#endif // CPU_LOONGARCH_VM_REGISTERMAP_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp +new file mode 100644 +index 00000000..c6424c32 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/register_definitions_loongarch.cpp @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. @@ -42415,9 +43400,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +REGISTER_DEFINITION(FloatRegister, f29); +REGISTER_DEFINITION(FloatRegister, f30); +REGISTER_DEFINITION(FloatRegister, f31); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp +new file mode 100644 +index 00000000..3104cd1c +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/register_loongarch.cpp @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. @@ -42478,9 +43465,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + }; + return is_valid() ? names[encoding()] : "fccnoreg"; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp +new file mode 100644 +index 00000000..37b39f91 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/register_loongarch.hpp @@ -0,0 +1,436 @@ +/* + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. @@ -42918,58 +43907,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif //CPU_LOONGARCH_VM_REGISTER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/registerMap_loongarch.hpp 2023-12-20 09:23:19.791481286 +0800 -@@ -0,0 +1,45 @@ -+/* -+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_VM_REGISTERMAP_LOONGARCH_HPP -+#define CPU_LOONGARCH_VM_REGISTERMAP_LOONGARCH_HPP -+ -+// machine-dependent implemention for register maps -+ friend class frame; -+ -+ private: -+ // This is the hook for finding a register in an "well-known" location, -+ // such as a register block of a predetermined format. -+ // Since there is none, we just return NULL. -+ // See registerMap_sparc.hpp for an example of grabbing registers -+ // from register save areas of a standard layout. -+ address pd_location(VMReg reg) const {return NULL;} -+ -+ // no PD state to clear or copy: -+ void pd_clear() {} -+ void pd_initialize() {} -+ void pd_initialize_from(const RegisterMap* map) {} -+ -+#endif // CPU_LOONGARCH_VM_REGISTERMAP_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp +new file mode 100644 +index 00000000..bf4498dc +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.cpp @@ -0,0 +1,130 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. @@ -43101,9 +44043,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + +void metadata_Relocation::pd_fix_value(address x) { +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp +new file mode 100644 +index 00000000..211242f3 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/relocInfo_loongarch.hpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -43145,9 +44089,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + }; + +#endif // CPU_LOONGARCH_VM_RELOCINFO_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp +new file mode 100644 +index 00000000..e6ee65f3 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/runtime_loongarch_64.cpp @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -43348,9 +44294,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + masm->flush(); + _exception_blob = ExceptionBlob::create(&buffer, oop_maps, framesize); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp +new file mode 100644 +index 00000000..36786b53 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp @@ -0,0 +1,3453 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -46805,9 +47753,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +extern "C" int SpinPause() {return 0;} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp +new file mode 100644 +index 00000000..361b7751 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp @@ -0,0 +1,3445 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -50254,9 +51204,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +void StubGenerator_generate(CodeBuffer* code, bool all) { + StubGenerator g(code, all); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp +new file mode 100644 +index 00000000..f0f3d55a +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.cpp @@ -0,0 +1,264 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -50522,9 +51474,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + 0x02D578EDUL, 0x7DAEED62UL, // word swap + 0xD502ED78UL, 0xAE7D62EDUL, // byte swap of word swap +}; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp ---- a/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp 2023-12-20 09:23:19.791481286 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp +new file mode 100644 +index 00000000..d020a527 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/stubRoutines_loongarch_64.hpp @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -50586,9 +51540,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_LOONGARCH_VM_STUBROUTINES_LOONGARCH_64_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp +new file mode 100644 +index 00000000..213e69b0 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/templateInterpreterGenerator_loongarch.hpp @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -50625,9 +51581,58 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // address generate_asm_interpreter_entry(bool synchronized); + +#endif // CPU_LOONGARCH_VM_TEMPLATEINTERPRETERGENERATOR_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp +new file mode 100644 +index 00000000..39e3ad7b +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp +@@ -0,0 +1,41 @@ ++/* ++ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_VM_TEMPLATEINTERPRETER_LOONGARCH_HPP ++#define CPU_LOONGARCH_VM_TEMPLATEINTERPRETER_LOONGARCH_HPP ++ ++ ++ protected: ++ ++ // Size of interpreter code. Increase if too small. Interpreter will ++ // fail with a guarantee ("not enough space for interpreter generation"); ++ // if too small. ++ // Run with +PrintInterpreter to get the VM to print out the size. ++ // Max size with JVMTI ++ // The sethi() instruction generates lots more instructions when shell ++ // stack limit is unlimited, so that's why this is much bigger. ++ const static int InterpreterCodeSize = 500 * K; ++ ++#endif // CPU_LOONGARCH_VM_TEMPLATEINTERPRETER_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp +new file mode 100644 +index 00000000..b25086a3 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch_64.cpp @@ -0,0 +1,2335 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -52964,54 +53969,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} +#endif // !PRODUCT +#endif // ! CC_INTERP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/templateInterpreter_loongarch.hpp 2023-12-20 09:23:19.794814582 +0800 -@@ -0,0 +1,41 @@ -+/* -+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_VM_TEMPLATEINTERPRETER_LOONGARCH_HPP -+#define CPU_LOONGARCH_VM_TEMPLATEINTERPRETER_LOONGARCH_HPP -+ -+ -+ protected: -+ -+ // Size of interpreter code. Increase if too small. Interpreter will -+ // fail with a guarantee ("not enough space for interpreter generation"); -+ // if too small. -+ // Run with +PrintInterpreter to get the VM to print out the size. -+ // Max size with JVMTI -+ // The sethi() instruction generates lots more instructions when shell -+ // stack limit is unlimited, so that's why this is much bigger. -+ const static int InterpreterCodeSize = 500 * K; -+ -+#endif // CPU_LOONGARCH_VM_TEMPLATEINTERPRETER_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp +new file mode 100644 +index 00000000..228217f0 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.cpp @@ -0,0 +1,4024 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -57037,9 +57999,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + __ membar(__ AnyAny);//no membar here for aarch64 +} +#endif // !CC_INTERP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp ---- a/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp +new file mode 100644 +index 00000000..c48d76e0 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/templateTable_loongarch_64.hpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. @@ -57085,173 +58049,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + static void index_check_without_pop(Register array, Register index); + +#endif // CPU_LOONGARCH_VM_TEMPLATETABLE_LOONGARCH_64_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp 2023-12-20 09:23:19.794814582 +0800 -@@ -0,0 +1,51 @@ -+/* -+ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#include "precompiled.hpp" -+#include "asm/assembler.hpp" -+#include "code/vmreg.hpp" -+ -+ -+ -+void VMRegImpl::set_regName() { -+ Register reg = ::as_Register(0); -+ int i; -+ for (i = 0; i < ConcreteRegisterImpl::max_gpr ; ) { -+ regName[i++] = reg->name(); -+ regName[i++] = reg->name(); -+ reg = reg->successor(); -+ } -+ -+ FloatRegister freg = ::as_FloatRegister(0); -+ for ( ; i < ConcreteRegisterImpl::max_fpr ; ) { -+ regName[i++] = freg->name(); -+ regName[i++] = freg->name(); -+ freg = freg->successor(); -+ } -+ -+ for ( ; i < ConcreteRegisterImpl::number_of_registers ; i ++ ) { -+ regName[i] = "NON-GPR-FPR"; -+ } -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp 2023-12-20 09:23:19.794814582 +0800 -@@ -0,0 +1,35 @@ -+/* -+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_VM_VMREG_LOONGARCH_HPP -+#define CPU_LOONGARCH_VM_VMREG_LOONGARCH_HPP -+ -+bool is_Register(); -+Register as_Register(); -+ -+bool is_FloatRegister(); -+FloatRegister as_FloatRegister(); -+ -+#endif // CPU_LOONGARCH_VM_VMREG_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp ---- a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp 2023-12-20 09:23:19.794814582 +0800 -@@ -0,0 +1,66 @@ -+/* -+ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_VM_VMREG_LOONGARCH_INLINE_HPP -+#define CPU_LOONGARCH_VM_VMREG_LOONGARCH_INLINE_HPP -+ -+inline VMReg RegisterImpl::as_VMReg() { -+ if( this==noreg ) return VMRegImpl::Bad(); -+ return VMRegImpl::as_VMReg(encoding() << 1 ); -+} -+ -+inline VMReg FloatRegisterImpl::as_VMReg() { -+ return VMRegImpl::as_VMReg((encoding() << 1) + ConcreteRegisterImpl::max_gpr); -+} -+ -+inline bool VMRegImpl::is_Register() { -+ return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr; -+} -+ -+inline bool VMRegImpl::is_FloatRegister() { -+ return value() >= ConcreteRegisterImpl::max_gpr && value() < ConcreteRegisterImpl::max_fpr; -+} -+ -+inline Register VMRegImpl::as_Register() { -+ -+ assert( is_Register(), "must be"); -+ return ::as_Register(value() >> 1); -+} -+ -+inline FloatRegister VMRegImpl::as_FloatRegister() { -+ assert( is_FloatRegister(), "must be" ); -+ assert( is_even(value()), "must be" ); -+ return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); -+} -+ -+inline bool VMRegImpl::is_concrete() { -+ assert(is_reg(), "must be"); -+ if(is_Register()) return true; -+ if(is_FloatRegister()) return true; -+ assert(false, "what register?"); -+ return false; -+} -+ -+#endif // CPU_LOONGARCH_VM_VMREG_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp +new file mode 100644 +index 00000000..7c3ce680 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vmStructs_loongarch.hpp @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. @@ -57321,9 +58123,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + /* be present there) */ + +#endif // CPU_LOONGARCH_VM_VMSTRUCTS_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp +new file mode 100644 +index 00000000..c71f64e1 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.cpp @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. @@ -57409,9 +58213,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + strncpy(tmp, _cpu_desc, CPU_DETAILED_DESC_BUF_SIZE); + return tmp; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp +new file mode 100644 +index 00000000..682dd9c7 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vm_version_ext_loongarch.hpp @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. @@ -57467,9 +58273,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_LOONGARCH_VM_VM_VERSION_EXT_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp ---- a/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp +new file mode 100644 +index 00000000..81ea3b23 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.cpp @@ -0,0 +1,443 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -57914,9 +58722,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + get_processor_features(); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp ---- a/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp +new file mode 100644 +index 00000000..3b5f907a +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vm_version_loongarch.hpp @@ -0,0 +1,299 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -58217,9 +59027,181 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_LOONGARCH_VM_VM_VERSION_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp ---- a/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp +new file mode 100644 +index 00000000..52bccfc1 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.cpp +@@ -0,0 +1,51 @@ ++/* ++ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include "precompiled.hpp" ++#include "asm/assembler.hpp" ++#include "code/vmreg.hpp" ++ ++ ++ ++void VMRegImpl::set_regName() { ++ Register reg = ::as_Register(0); ++ int i; ++ for (i = 0; i < ConcreteRegisterImpl::max_gpr ; ) { ++ regName[i++] = reg->name(); ++ regName[i++] = reg->name(); ++ reg = reg->successor(); ++ } ++ ++ FloatRegister freg = ::as_FloatRegister(0); ++ for ( ; i < ConcreteRegisterImpl::max_fpr ; ) { ++ regName[i++] = freg->name(); ++ regName[i++] = freg->name(); ++ freg = freg->successor(); ++ } ++ ++ for ( ; i < ConcreteRegisterImpl::number_of_registers ; i ++ ) { ++ regName[i] = "NON-GPR-FPR"; ++ } ++} +diff --git a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp +new file mode 100644 +index 00000000..80a1fc57 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.hpp +@@ -0,0 +1,35 @@ ++/* ++ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_VM_VMREG_LOONGARCH_HPP ++#define CPU_LOONGARCH_VM_VMREG_LOONGARCH_HPP ++ ++bool is_Register(); ++Register as_Register(); ++ ++bool is_FloatRegister(); ++FloatRegister as_FloatRegister(); ++ ++#endif // CPU_LOONGARCH_VM_VMREG_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp +new file mode 100644 +index 00000000..f822d4c3 +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vmreg_loongarch.inline.hpp +@@ -0,0 +1,66 @@ ++/* ++ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_VM_VMREG_LOONGARCH_INLINE_HPP ++#define CPU_LOONGARCH_VM_VMREG_LOONGARCH_INLINE_HPP ++ ++inline VMReg RegisterImpl::as_VMReg() { ++ if( this==noreg ) return VMRegImpl::Bad(); ++ return VMRegImpl::as_VMReg(encoding() << 1 ); ++} ++ ++inline VMReg FloatRegisterImpl::as_VMReg() { ++ return VMRegImpl::as_VMReg((encoding() << 1) + ConcreteRegisterImpl::max_gpr); ++} ++ ++inline bool VMRegImpl::is_Register() { ++ return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr; ++} ++ ++inline bool VMRegImpl::is_FloatRegister() { ++ return value() >= ConcreteRegisterImpl::max_gpr && value() < ConcreteRegisterImpl::max_fpr; ++} ++ ++inline Register VMRegImpl::as_Register() { ++ ++ assert( is_Register(), "must be"); ++ return ::as_Register(value() >> 1); ++} ++ ++inline FloatRegister VMRegImpl::as_FloatRegister() { ++ assert( is_FloatRegister(), "must be" ); ++ assert( is_even(value()), "must be" ); ++ return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); ++} ++ ++inline bool VMRegImpl::is_concrete() { ++ assert(is_reg(), "must be"); ++ if(is_Register()) return true; ++ if(is_FloatRegister()) return true; ++ assert(false, "what register?"); ++ return false; ++} ++ ++#endif // CPU_LOONGARCH_VM_VMREG_LOONGARCH_INLINE_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp +new file mode 100644 +index 00000000..df0d176b +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/vtableStubs_loongarch_64.cpp @@ -0,0 +1,300 @@ +/* + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. @@ -58521,9 +59503,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +int VtableStub::pd_code_alignment() { + return wordSize; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/assembler_mips.cpp b/hotspot/src/cpu/mips/vm/assembler_mips.cpp ---- a/hotspot/src/cpu/mips/vm/assembler_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/assembler_mips.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/assembler_mips.cpp b/hotspot/src/cpu/mips/vm/assembler_mips.cpp +new file mode 100644 +index 00000000..6c720972 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/assembler_mips.cpp @@ -0,0 +1,774 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -59299,9 +60283,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + delay_state = no_delay; +#endif +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/assembler_mips.hpp b/hotspot/src/cpu/mips/vm/assembler_mips.hpp ---- a/hotspot/src/cpu/mips/vm/assembler_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/assembler_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/assembler_mips.hpp b/hotspot/src/cpu/mips/vm/assembler_mips.hpp +new file mode 100644 +index 00000000..e91b9db2 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/assembler_mips.hpp @@ -0,0 +1,1789 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -61092,9 +62078,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + +#endif // CPU_MIPS_VM_ASSEMBLER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp b/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp ---- a/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp b/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp +new file mode 100644 +index 00000000..39aeb550 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/assembler_mips.inline.hpp @@ -0,0 +1,33 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -61129,9 +62117,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#include "code/codeCache.hpp" + +#endif // CPU_MIPS_VM_ASSEMBLER_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp ---- a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp +new file mode 100644 +index 00000000..a4a1b28c +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. @@ -61186,9 +62176,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#ifdef CC_INTERP + +#endif // CC_INTERP (all) -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp ---- a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp +new file mode 100644 +index 00000000..aac8b7a2 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.hpp @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -61300,9 +62292,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + ((VMJavaVal64*)(addr))->l) + +#endif // CPU_MIPS_VM_BYTECODEINTERPRETER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp ---- a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp +new file mode 100644 +index 00000000..8ce77ab9 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/bytecodeInterpreter_mips.inline.hpp @@ -0,0 +1,286 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -61590,9 +62584,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // CPU_MIPS_VM_BYTECODEINTERPRETER_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp b/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp ---- a/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp b/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp +new file mode 100644 +index 00000000..61efd1f5 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/bytecodes_mips.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. @@ -61632,9 +62628,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // No mips specific bytecodes + return code; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp b/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp ---- a/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp b/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp +new file mode 100644 +index 00000000..25a9562a +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/bytecodes_mips.hpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. @@ -61667,9 +62665,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +// No Loongson specific bytecodes + +#endif // CPU_MIPS_VM_BYTECODES_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/bytes_mips.hpp b/hotspot/src/cpu/mips/vm/bytes_mips.hpp ---- a/hotspot/src/cpu/mips/vm/bytes_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/bytes_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/bytes_mips.hpp b/hotspot/src/cpu/mips/vm/bytes_mips.hpp +new file mode 100644 +index 00000000..515ffad4 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/bytes_mips.hpp @@ -0,0 +1,193 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -61864,9 +62864,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + +#endif // CPU_MIPS_VM_BYTES_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp b/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp ---- a/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp b/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp +new file mode 100644 +index 00000000..f254e07a +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/c2_globals_mips.hpp @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -61968,9 +62970,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +define_pd_global(bool, NeverActAsServerClassMachine, false); + +#endif // CPU_MIPS_VM_C2_GLOBALS_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/c2_init_mips.cpp b/hotspot/src/cpu/mips/vm/c2_init_mips.cpp ---- a/hotspot/src/cpu/mips/vm/c2_init_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/c2_init_mips.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/c2_init_mips.cpp b/hotspot/src/cpu/mips/vm/c2_init_mips.cpp +new file mode 100644 +index 00000000..e6d5815f +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/c2_init_mips.cpp @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. @@ -62006,9 +63010,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +void Compile::pd_compiler2_init() { + guarantee(CodeEntryAlignment >= InteriorEntryAlignment, "" ); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp b/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp ---- a/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp b/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp +new file mode 100644 +index 00000000..1836b7a9 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/codeBuffer_mips.hpp @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -62045,9 +63051,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + void flush_bundle(bool start_new_bundle) {} + +#endif // CPU_MIPS_VM_CODEBUFFER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp b/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp ---- a/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp b/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp +new file mode 100644 +index 00000000..8ffaaaf8 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/compiledIC_mips.cpp @@ -0,0 +1,173 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -62222,9 +63230,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // !PRODUCT -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/copy_mips.hpp b/hotspot/src/cpu/mips/vm/copy_mips.hpp ---- a/hotspot/src/cpu/mips/vm/copy_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/copy_mips.hpp 2024-01-30 13:54:24.792708955 +0800 +diff --git a/hotspot/src/cpu/mips/vm/copy_mips.hpp b/hotspot/src/cpu/mips/vm/copy_mips.hpp +new file mode 100644 +index 00000000..4442e1dc +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/copy_mips.hpp @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -62316,9 +63326,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif //CPU_MIPS_VM_COPY_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp b/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp ---- a/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp b/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp +new file mode 100644 +index 00000000..37bd03b0 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/cppInterpreterGenerator_mips.hpp @@ -0,0 +1,53 @@ +/* + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. @@ -62373,9 +63385,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + bool native); // C++ interpreter only + +#endif // CPU_MIPS_VM_CPPINTERPRETERGENERATOR_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp ---- a/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp +new file mode 100644 +index 00000000..1f8d75d5 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.cpp @@ -0,0 +1,215 @@ +/* + * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. @@ -62592,9 +63606,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // CC_INTERP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp ---- a/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp +new file mode 100644 +index 00000000..49c47330 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/cppInterpreter_mips.hpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -62636,9 +63652,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + const static int InterpreterCodeSize = 210 * K; + +#endif // CPU_MIPS_VM_CPPINTERPRETER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/debug_mips.cpp b/hotspot/src/cpu/mips/vm/debug_mips.cpp ---- a/hotspot/src/cpu/mips/vm/debug_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/debug_mips.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/debug_mips.cpp b/hotspot/src/cpu/mips/vm/debug_mips.cpp +new file mode 100644 +index 00000000..50de0365 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/debug_mips.cpp @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. @@ -62691,9 +63709,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +void pd_obfuscate_location(char *buf,int buflen) {} + +#endif // PRODUCT -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/depChecker_mips.cpp b/hotspot/src/cpu/mips/vm/depChecker_mips.cpp ---- a/hotspot/src/cpu/mips/vm/depChecker_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/depChecker_mips.cpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/depChecker_mips.cpp b/hotspot/src/cpu/mips/vm/depChecker_mips.cpp +new file mode 100644 +index 00000000..756ccb68 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/depChecker_mips.cpp @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -62725,9 +63745,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#include "depChecker_mips.hpp" + +// Nothing to do on mips -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/depChecker_mips.hpp b/hotspot/src/cpu/mips/vm/depChecker_mips.hpp ---- a/hotspot/src/cpu/mips/vm/depChecker_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/depChecker_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/depChecker_mips.hpp b/hotspot/src/cpu/mips/vm/depChecker_mips.hpp +new file mode 100644 +index 00000000..11e52b4e +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/depChecker_mips.hpp @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -62760,9 +63782,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +// Nothing to do on MIPS + +#endif // CPU_MIPS_VM_DEPCHECKER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/disassembler_mips.hpp b/hotspot/src/cpu/mips/vm/disassembler_mips.hpp ---- a/hotspot/src/cpu/mips/vm/disassembler_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/disassembler_mips.hpp 2023-12-20 09:23:19.794814582 +0800 +diff --git a/hotspot/src/cpu/mips/vm/disassembler_mips.hpp b/hotspot/src/cpu/mips/vm/disassembler_mips.hpp +new file mode 100644 +index 00000000..c5f3a888 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/disassembler_mips.hpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -62801,9 +63825,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } + +#endif // CPU_MIPS_VM_DISASSEMBLER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/frame_mips.cpp b/hotspot/src/cpu/mips/vm/frame_mips.cpp ---- a/hotspot/src/cpu/mips/vm/frame_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/frame_mips.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/frame_mips.cpp b/hotspot/src/cpu/mips/vm/frame_mips.cpp +new file mode 100644 +index 00000000..1c928976 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/frame_mips.cpp @@ -0,0 +1,711 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -63516,9 +64542,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + init((intptr_t*)sp, (intptr_t*)fp, (address)pc); +} +#endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/frame_mips.hpp b/hotspot/src/cpu/mips/vm/frame_mips.hpp ---- a/hotspot/src/cpu/mips/vm/frame_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/frame_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/frame_mips.hpp b/hotspot/src/cpu/mips/vm/frame_mips.hpp +new file mode 100644 +index 00000000..9e684a8d +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/frame_mips.hpp @@ -0,0 +1,229 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -63749,9 +64777,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#endif // CC_INTERP + +#endif // CPU_MIPS_VM_FRAME_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp b/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp ---- a/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp b/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp +new file mode 100644 +index 00000000..60e56ac7 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/frame_mips.inline.hpp @@ -0,0 +1,312 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -64065,9 +65095,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // CPU_MIPS_VM_FRAME_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp b/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp ---- a/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp b/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp +new file mode 100644 +index 00000000..bd00a8d4 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/globalDefinitions_mips.hpp @@ -0,0 +1,41 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. @@ -64110,9 +65142,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#define SUPPORTS_NATIVE_CX8 + +#endif // CPU_MIPS_VM_GLOBALDEFINITIONS_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/globals_mips.hpp b/hotspot/src/cpu/mips/vm/globals_mips.hpp ---- a/hotspot/src/cpu/mips/vm/globals_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/globals_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/globals_mips.hpp b/hotspot/src/cpu/mips/vm/globals_mips.hpp +new file mode 100644 +index 00000000..988bc351 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/globals_mips.hpp @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -64238,99 +65272,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + "Eliminate barriers for single active cpu") + +#endif // CPU_MIPS_VM_GLOBALS_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/icache_mips.cpp b/hotspot/src/cpu/mips/vm/icache_mips.cpp ---- a/hotspot/src/cpu/mips/vm/icache_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/icache_mips.cpp 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,41 @@ -+/* -+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#include "precompiled.hpp" -+#include "asm/macroAssembler.hpp" -+#include "runtime/icache.hpp" -+ -+void ICacheStubGenerator::generate_icache_flush(ICache::flush_icache_stub_t* flush_icache_stub) -+{ -+#define __ _masm-> -+ StubCodeMark mark(this, "ICache", "flush_icache_stub"); -+ address start = __ pc(); -+ -+ __ jr_hb(RA); -+ __ delayed()->ori(V0, RA2, 0); -+ -+ *flush_icache_stub = (ICache::flush_icache_stub_t)start; -+#undef __ -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/icache_mips.hpp b/hotspot/src/cpu/mips/vm/icache_mips.hpp ---- a/hotspot/src/cpu/mips/vm/icache_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/icache_mips.hpp 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,41 @@ -+/* -+ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_MIPS_VM_ICACHE_MIPS_HPP -+#define CPU_MIPS_VM_ICACHE_MIPS_HPP -+ -+// Interface for updating the instruction cache. Whenever the VM modifies -+// code, part of the processor instruction cache potentially has to be flushed. -+ -+class ICache : public AbstractICache { -+ public: -+ enum { -+ stub_size = 2 * BytesPerInstWord, // Size of the icache flush stub in bytes -+ line_size = 32, // flush instruction affects a dword -+ log2_line_size = 5 // log2(line_size) -+ }; -+}; -+ -+#endif // CPU_MIPS_VM_ICACHE_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp b/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp ---- a/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp b/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp +new file mode 100644 +index 00000000..96ea3453 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/icBuffer_mips.cpp @@ -0,0 +1,97 @@ +/* + * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. @@ -64429,9 +65375,105 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + void* o= (void*)move->data(); + return o; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/icache_mips.cpp b/hotspot/src/cpu/mips/vm/icache_mips.cpp +new file mode 100644 +index 00000000..848964b6 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/icache_mips.cpp +@@ -0,0 +1,41 @@ ++/* ++ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include "precompiled.hpp" ++#include "asm/macroAssembler.hpp" ++#include "runtime/icache.hpp" ++ ++void ICacheStubGenerator::generate_icache_flush(ICache::flush_icache_stub_t* flush_icache_stub) ++{ ++#define __ _masm-> ++ StubCodeMark mark(this, "ICache", "flush_icache_stub"); ++ address start = __ pc(); ++ ++ __ jr_hb(RA); ++ __ delayed()->ori(V0, RA2, 0); ++ ++ *flush_icache_stub = (ICache::flush_icache_stub_t)start; ++#undef __ ++} +diff --git a/hotspot/src/cpu/mips/vm/icache_mips.hpp b/hotspot/src/cpu/mips/vm/icache_mips.hpp +new file mode 100644 +index 00000000..78ee11cc +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/icache_mips.hpp +@@ -0,0 +1,41 @@ ++/* ++ * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2021, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_MIPS_VM_ICACHE_MIPS_HPP ++#define CPU_MIPS_VM_ICACHE_MIPS_HPP ++ ++// Interface for updating the instruction cache. Whenever the VM modifies ++// code, part of the processor instruction cache potentially has to be flushed. ++ ++class ICache : public AbstractICache { ++ public: ++ enum { ++ stub_size = 2 * BytesPerInstWord, // Size of the icache flush stub in bytes ++ line_size = 32, // flush instruction affects a dword ++ log2_line_size = 5 // log2(line_size) ++ }; ++}; ++ ++#endif // CPU_MIPS_VM_ICACHE_MIPS_HPP +diff --git a/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp +new file mode 100644 +index 00000000..ed2d931e +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.cpp @@ -0,0 +1,2084 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -66517,9 +67559,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + unimplemented(); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp ---- a/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp +new file mode 100644 +index 00000000..a2ebdec3 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/interp_masm_mips_64.hpp @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -66790,9 +67834,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_MIPS_VM_INTERP_MASM_MIPS_64_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp b/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp ---- a/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp b/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp +new file mode 100644 +index 00000000..26fced49 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/interpreterGenerator_mips.hpp @@ -0,0 +1,49 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -66843,12 +67889,14 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + void generate_counter_overflow(Label* do_continue); + +#endif // CPU_MIPS_VM_INTERPRETERGENERATOR_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp b/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,286 @@ +diff --git a/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp b/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp +new file mode 100644 +index 00000000..8dec2007 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp +@@ -0,0 +1,61 @@ +/* -+ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * @@ -66872,324 +67920,47 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#include "precompiled.hpp" -+#include "asm/macroAssembler.hpp" -+#include "interpreter/bytecodeHistogram.hpp" -+#include "interpreter/interpreter.hpp" -+#include "interpreter/interpreterGenerator.hpp" -+#include "interpreter/interpreterRuntime.hpp" -+#include "interpreter/templateTable.hpp" -+#include "oops/arrayOop.hpp" -+#include "oops/methodData.hpp" -+#include "oops/method.hpp" -+#include "oops/oop.inline.hpp" -+#include "prims/jvmtiExport.hpp" -+#include "prims/jvmtiThreadState.hpp" -+#include "prims/methodHandles.hpp" -+#include "runtime/arguments.hpp" -+#include "runtime/deoptimization.hpp" -+#include "runtime/frame.inline.hpp" -+#include "runtime/sharedRuntime.hpp" -+#include "runtime/stubRoutines.hpp" -+#include "runtime/synchronizer.hpp" -+#include "runtime/timer.hpp" -+#include "runtime/vframeArray.hpp" -+#include "utilities/debug.hpp" -+ -+#define __ _masm-> -+ -+#define A0 RA0 -+#define A1 RA1 -+#define A2 RA2 -+#define A3 RA3 -+#define A4 RA4 -+#define A5 RA5 -+#define A6 RA6 -+#define A7 RA7 -+#define T0 RT0 -+#define T1 RT1 -+#define T2 RT2 -+#define T3 RT3 -+#define T8 RT8 -+#define T9 RT9 -+ -+ -+address AbstractInterpreterGenerator::generate_slow_signature_handler() { -+ address entry = __ pc(); -+ -+ // Rmethod: method -+ // LVP: pointer to locals -+ // A3: first stack arg -+ __ move(A3, SP); -+ __ daddiu(SP, SP, -10 * wordSize); -+ __ sd(RA, SP, 0); -+ __ call_VM(noreg, -+ CAST_FROM_FN_PTR(address, -+ InterpreterRuntime::slow_signature_handler), -+ Rmethod, LVP, A3); -+ -+ // V0: result handler -+ -+ // Stack layout: -+ // ... -+ // 10 stack arg0 <--- old sp -+ // 9 float/double identifiers -+ // 8 register arg7 -+ // ... -+ // 2 register arg1 -+ // 1 aligned slot -+ // SP: 0 return address -+ -+ // Do FP first so we can use T3 as temp -+ __ ld(T3, Address(SP, 9 * wordSize)); // float/double identifiers -+ -+ // A0 is for env. -+ // If the mothed is not static, A1 will be corrected in generate_native_entry. -+ for ( int i = 1; i < Argument::n_register_parameters; i++ ) { -+ Register reg = as_Register(i + A0->encoding()); -+ FloatRegister floatreg = as_FloatRegister(i + F12->encoding()); -+ Label isfloatordouble, isdouble, next; -+ -+ __ andi(AT, T3, 1 << (i*2)); // Float or Double? -+ __ bne(AT, R0, isfloatordouble); -+ __ delayed()->nop(); -+ -+ // Do Int register here -+ __ ld(reg, SP, (1 + i) * wordSize); -+ __ b (next); -+ __ delayed()->nop(); -+ -+ __ bind(isfloatordouble); -+ __ andi(AT, T3, 1 << ((i*2)+1)); // Double? -+ __ bne(AT, R0, isdouble); -+ __ delayed()->nop(); -+ -+ // Do Float Here -+ __ lwc1(floatreg, SP, (1 + i) * wordSize); -+ __ b(next); -+ __ delayed()->nop(); -+ -+ // Do Double here -+ __ bind(isdouble); -+ __ ldc1(floatreg, SP, (1 + i) * wordSize); -+ -+ __ bind(next); -+ } -+ -+ __ ld(RA, SP, 0); -+ __ daddiu(SP, SP, 10 * wordSize); -+ __ jr(RA); -+ __ delayed()->nop(); -+ return entry; -+} -+ -+ -+// -+// Various method entries -+// -+ -+address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { -+ -+ // Rmethod: methodOop -+ // V0: scratrch -+ // Rsender: send 's sp -+ -+ if (!InlineIntrinsics) return NULL; // Generate a vanilla entry -+ -+ address entry_point = __ pc(); -+ -+ // These don't need a safepoint check because they aren't virtually -+ // callable. We won't enter these intrinsics from compiled code. -+ // If in the future we added an intrinsic which was virtually callable -+ // we'd have to worry about how to safepoint so that this code is used. -+ -+ // mathematical functions inlined by compiler -+ // (interpreter must provide identical implementation -+ // in order to avoid monotonicity bugs when switching -+ // from interpreter to compiler in the middle of some -+ // computation) -+ // -+ // stack: [ lo(arg) ] <-- sp -+ // [ hi(arg) ] -+ { -+ // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are -+ // java methods. Interpreter::method_kind(...) will select -+ // this entry point for the corresponding methods in JDK 1.3. -+ __ ldc1(F12, SP, 0 * wordSize); -+ __ ldc1(F13, SP, 1 * wordSize); -+ __ push2(RA, FP); -+ __ daddiu(FP, SP, 2 * wordSize); -+ -+ // [ fp ] <-- sp -+ // [ ra ] -+ // [ lo ] <-- fp -+ // [ hi ] -+ //FIXME, need consider this -+ switch (kind) { -+ case Interpreter::java_lang_math_sin : -+ __ trigfunc('s'); -+ break; -+ case Interpreter::java_lang_math_cos : -+ __ trigfunc('c'); -+ break; -+ case Interpreter::java_lang_math_tan : -+ __ trigfunc('t'); -+ break; -+ case Interpreter::java_lang_math_sqrt: -+ __ sqrt_d(F0, F12); -+ break; -+ case Interpreter::java_lang_math_abs: -+ __ abs_d(F0, F12); -+ break; -+ case Interpreter::java_lang_math_log: -+ // Store to stack to convert 80bit precision back to 64bits -+ break; -+ case Interpreter::java_lang_math_log10: -+ // Store to stack to convert 80bit precision back to 64bits -+ break; -+ case Interpreter::java_lang_math_pow: -+ break; -+ case Interpreter::java_lang_math_exp: -+ break; -+ -+ default : -+ ShouldNotReachHere(); -+ } -+ -+ // must maintain return value in F0:F1 -+ __ ld(RA, FP, (-1) * wordSize); -+ //FIXME -+ __ ld(FP, FP, (-2) * wordSize); -+ __ move(SP, Rsender); -+ __ jr(RA); -+ __ delayed()->nop(); -+ } -+ return entry_point; -+} -+ -+ -+// Abstract method entry -+// Attempt to execute abstract method. Throw exception -+address InterpreterGenerator::generate_abstract_entry(void) { -+ -+ // Rmethod: methodOop -+ // V0: receiver (unused) -+ // Rsender : sender 's sp -+ address entry_point = __ pc(); -+ -+ // abstract method entry -+ // throw exception -+ // adjust stack to what a normal return would do -+ __ empty_expression_stack(); -+ __ restore_bcp(); -+ __ restore_locals(); -+ __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); -+ // the call_VM checks for exception, so we should never return here. -+ __ should_not_reach_here(); -+ -+ return entry_point; -+} -+ -+ -+// Empty method, generate a very fast return. -+ -+address InterpreterGenerator::generate_empty_entry(void) { -+ -+ // Rmethod: methodOop -+ // V0: receiver (unused) -+ // Rsender: sender 's sp , must set sp to this value on return , on mips ,now use T0,as it right? -+ if (!UseFastEmptyMethods) return NULL; -+ -+ address entry_point = __ pc(); -+ -+ Label slow_path; -+ __ li(RT0, SafepointSynchronize::address_of_state()); -+ __ lw(AT, RT0, 0); -+ __ move(RT0, (SafepointSynchronize::_not_synchronized)); -+ __ bne(AT, RT0,slow_path); -+ __ delayed()->nop(); -+ __ move(SP, Rsender); -+ __ jr(RA); -+ __ delayed()->nop(); -+ __ bind(slow_path); -+ (void) generate_normal_entry(false); -+ -+ return entry_point; -+ -+} ++#ifndef CPU_MIPS_VM_INTERPRETERRT_MIPS_HPP ++#define CPU_MIPS_VM_INTERPRETERRT_MIPS_HPP + -+void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) { ++#include "memory/allocation.hpp" + -+ // This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in -+ // the days we had adapter frames. When we deoptimize a situation where a -+ // compiled caller calls a compiled caller will have registers it expects -+ // to survive the call to the callee. If we deoptimize the callee the only -+ // way we can restore these registers is to have the oldest interpreter -+ // frame that we create restore these values. That is what this routine -+ // will accomplish. ++// native method calls + -+ // At the moment we have modified c2 to not have any callee save registers -+ // so this problem does not exist and this routine is just a place holder. ++class SignatureHandlerGenerator: public NativeSignatureIterator { ++ private: ++ MacroAssembler* _masm; + -+ assert(f->is_interpreted_frame(), "must be interpreted"); -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/interpreter_mips.hpp b/hotspot/src/cpu/mips/vm/interpreter_mips.hpp ---- a/hotspot/src/cpu/mips/vm/interpreter_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/interpreter_mips.hpp 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,50 @@ -+/* -+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ ++ void move(int from_offset, int to_offset); + -+#ifndef CPU_MIPS_VM_INTERPRETER_MIPS_HPP -+#define CPU_MIPS_VM_INTERPRETER_MIPS_HPP ++ void box(int from_offset, int to_offset); ++ void pass_int(); ++ void pass_long(); ++ void pass_object(); ++ void pass_float(); ++ void pass_double(); + + public: ++ // Creation ++ SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer) : NativeSignatureIterator(method) { ++ _masm = new MacroAssembler(buffer); ++ } + -+ // Sentinel placed in the code for interpreter returns so -+ // that i2c adapters and osr code can recognize an interpreter -+ // return address and convert the return to a specialized -+ // block of code to handle compiedl return values and cleaning -+ // the fpu stack. -+ static const int return_sentinel; ++ // Code generation ++ void generate(uint64_t fingerprint); + -+ static Address::ScaleFactor stackElementScale() { -+ return Address::times_8; -+ } ++ // Code generation support ++ static Register from(); ++ static Register to(); ++ static Register temp(); ++}; + -+ // Offset from sp (which points to the last stack element) -+ static int expr_offset_in_bytes(int i) { return stackElementSize * i; } -+ // Size of interpreter code. Increase if too small. Interpreter will -+ // fail with a guarantee ("not enough space for interpreter generation"); -+ // if too small. -+ // Run with +PrintInterpreterSize to get the VM to print out the size. -+ // Max size with JVMTI and TaggedStackInterpreter -+ const static int InterpreterCodeSize = 168 * 1024; -+#endif // CPU_MIPS_VM_INTERPRETER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp b/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp 2023-12-20 09:23:19.798147877 +0800 ++#endif // CPU_MIPS_VM_INTERPRETERRT_MIPS_HPP +diff --git a/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp b/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp +new file mode 100644 +index 00000000..14b7e39a +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/interpreterRT_mips_64.cpp @@ -0,0 +1,259 @@ +/* + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. @@ -67450,12 +68221,14 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // return result handler + return Interpreter::result_handler(m->result_type()); +IRT_END -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp b/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp ---- a/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/interpreterRT_mips.hpp 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,61 @@ +diff --git a/hotspot/src/cpu/mips/vm/interpreter_mips.hpp b/hotspot/src/cpu/mips/vm/interpreter_mips.hpp +new file mode 100644 +index 00000000..9a21d704 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/interpreter_mips.hpp +@@ -0,0 +1,50 @@ +/* -+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * @@ -67479,45 +68252,328 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#ifndef CPU_MIPS_VM_INTERPRETERRT_MIPS_HPP -+#define CPU_MIPS_VM_INTERPRETERRT_MIPS_HPP ++#ifndef CPU_MIPS_VM_INTERPRETER_MIPS_HPP ++#define CPU_MIPS_VM_INTERPRETER_MIPS_HPP + -+#include "memory/allocation.hpp" ++ public: + -+// native method calls ++ // Sentinel placed in the code for interpreter returns so ++ // that i2c adapters and osr code can recognize an interpreter ++ // return address and convert the return to a specialized ++ // block of code to handle compiedl return values and cleaning ++ // the fpu stack. ++ static const int return_sentinel; + -+class SignatureHandlerGenerator: public NativeSignatureIterator { -+ private: -+ MacroAssembler* _masm; ++ static Address::ScaleFactor stackElementScale() { ++ return Address::times_8; ++ } + -+ void move(int from_offset, int to_offset); ++ // Offset from sp (which points to the last stack element) ++ static int expr_offset_in_bytes(int i) { return stackElementSize * i; } ++ // Size of interpreter code. Increase if too small. Interpreter will ++ // fail with a guarantee ("not enough space for interpreter generation"); ++ // if too small. ++ // Run with +PrintInterpreterSize to get the VM to print out the size. ++ // Max size with JVMTI and TaggedStackInterpreter ++ const static int InterpreterCodeSize = 168 * 1024; ++#endif // CPU_MIPS_VM_INTERPRETER_MIPS_HPP +diff --git a/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp b/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp +new file mode 100644 +index 00000000..014c8127 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/interpreter_mips_64.cpp +@@ -0,0 +1,286 @@ ++/* ++ * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ + -+ void box(int from_offset, int to_offset); -+ void pass_int(); -+ void pass_long(); -+ void pass_object(); -+ void pass_float(); -+ void pass_double(); ++#include "precompiled.hpp" ++#include "asm/macroAssembler.hpp" ++#include "interpreter/bytecodeHistogram.hpp" ++#include "interpreter/interpreter.hpp" ++#include "interpreter/interpreterGenerator.hpp" ++#include "interpreter/interpreterRuntime.hpp" ++#include "interpreter/templateTable.hpp" ++#include "oops/arrayOop.hpp" ++#include "oops/methodData.hpp" ++#include "oops/method.hpp" ++#include "oops/oop.inline.hpp" ++#include "prims/jvmtiExport.hpp" ++#include "prims/jvmtiThreadState.hpp" ++#include "prims/methodHandles.hpp" ++#include "runtime/arguments.hpp" ++#include "runtime/deoptimization.hpp" ++#include "runtime/frame.inline.hpp" ++#include "runtime/sharedRuntime.hpp" ++#include "runtime/stubRoutines.hpp" ++#include "runtime/synchronizer.hpp" ++#include "runtime/timer.hpp" ++#include "runtime/vframeArray.hpp" ++#include "utilities/debug.hpp" + -+ public: -+ // Creation -+ SignatureHandlerGenerator(methodHandle method, CodeBuffer* buffer) : NativeSignatureIterator(method) { -+ _masm = new MacroAssembler(buffer); ++#define __ _masm-> ++ ++#define A0 RA0 ++#define A1 RA1 ++#define A2 RA2 ++#define A3 RA3 ++#define A4 RA4 ++#define A5 RA5 ++#define A6 RA6 ++#define A7 RA7 ++#define T0 RT0 ++#define T1 RT1 ++#define T2 RT2 ++#define T3 RT3 ++#define T8 RT8 ++#define T9 RT9 ++ ++ ++address AbstractInterpreterGenerator::generate_slow_signature_handler() { ++ address entry = __ pc(); ++ ++ // Rmethod: method ++ // LVP: pointer to locals ++ // A3: first stack arg ++ __ move(A3, SP); ++ __ daddiu(SP, SP, -10 * wordSize); ++ __ sd(RA, SP, 0); ++ __ call_VM(noreg, ++ CAST_FROM_FN_PTR(address, ++ InterpreterRuntime::slow_signature_handler), ++ Rmethod, LVP, A3); ++ ++ // V0: result handler ++ ++ // Stack layout: ++ // ... ++ // 10 stack arg0 <--- old sp ++ // 9 float/double identifiers ++ // 8 register arg7 ++ // ... ++ // 2 register arg1 ++ // 1 aligned slot ++ // SP: 0 return address ++ ++ // Do FP first so we can use T3 as temp ++ __ ld(T3, Address(SP, 9 * wordSize)); // float/double identifiers ++ ++ // A0 is for env. ++ // If the mothed is not static, A1 will be corrected in generate_native_entry. ++ for ( int i = 1; i < Argument::n_register_parameters; i++ ) { ++ Register reg = as_Register(i + A0->encoding()); ++ FloatRegister floatreg = as_FloatRegister(i + F12->encoding()); ++ Label isfloatordouble, isdouble, next; ++ ++ __ andi(AT, T3, 1 << (i*2)); // Float or Double? ++ __ bne(AT, R0, isfloatordouble); ++ __ delayed()->nop(); ++ ++ // Do Int register here ++ __ ld(reg, SP, (1 + i) * wordSize); ++ __ b (next); ++ __ delayed()->nop(); ++ ++ __ bind(isfloatordouble); ++ __ andi(AT, T3, 1 << ((i*2)+1)); // Double? ++ __ bne(AT, R0, isdouble); ++ __ delayed()->nop(); ++ ++ // Do Float Here ++ __ lwc1(floatreg, SP, (1 + i) * wordSize); ++ __ b(next); ++ __ delayed()->nop(); ++ ++ // Do Double here ++ __ bind(isdouble); ++ __ ldc1(floatreg, SP, (1 + i) * wordSize); ++ ++ __ bind(next); + } + -+ // Code generation -+ void generate(uint64_t fingerprint); ++ __ ld(RA, SP, 0); ++ __ daddiu(SP, SP, 10 * wordSize); ++ __ jr(RA); ++ __ delayed()->nop(); ++ return entry; ++} + -+ // Code generation support -+ static Register from(); -+ static Register to(); -+ static Register temp(); -+}; + -+#endif // CPU_MIPS_VM_INTERPRETERRT_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp b/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp ---- a/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp 2023-12-20 09:23:19.798147877 +0800 ++// ++// Various method entries ++// ++ ++address InterpreterGenerator::generate_math_entry(AbstractInterpreter::MethodKind kind) { ++ ++ // Rmethod: methodOop ++ // V0: scratrch ++ // Rsender: send 's sp ++ ++ if (!InlineIntrinsics) return NULL; // Generate a vanilla entry ++ ++ address entry_point = __ pc(); ++ ++ // These don't need a safepoint check because they aren't virtually ++ // callable. We won't enter these intrinsics from compiled code. ++ // If in the future we added an intrinsic which was virtually callable ++ // we'd have to worry about how to safepoint so that this code is used. ++ ++ // mathematical functions inlined by compiler ++ // (interpreter must provide identical implementation ++ // in order to avoid monotonicity bugs when switching ++ // from interpreter to compiler in the middle of some ++ // computation) ++ // ++ // stack: [ lo(arg) ] <-- sp ++ // [ hi(arg) ] ++ { ++ // Note: For JDK 1.3 StrictMath exists and Math.sin/cos/sqrt are ++ // java methods. Interpreter::method_kind(...) will select ++ // this entry point for the corresponding methods in JDK 1.3. ++ __ ldc1(F12, SP, 0 * wordSize); ++ __ ldc1(F13, SP, 1 * wordSize); ++ __ push2(RA, FP); ++ __ daddiu(FP, SP, 2 * wordSize); ++ ++ // [ fp ] <-- sp ++ // [ ra ] ++ // [ lo ] <-- fp ++ // [ hi ] ++ //FIXME, need consider this ++ switch (kind) { ++ case Interpreter::java_lang_math_sin : ++ __ trigfunc('s'); ++ break; ++ case Interpreter::java_lang_math_cos : ++ __ trigfunc('c'); ++ break; ++ case Interpreter::java_lang_math_tan : ++ __ trigfunc('t'); ++ break; ++ case Interpreter::java_lang_math_sqrt: ++ __ sqrt_d(F0, F12); ++ break; ++ case Interpreter::java_lang_math_abs: ++ __ abs_d(F0, F12); ++ break; ++ case Interpreter::java_lang_math_log: ++ // Store to stack to convert 80bit precision back to 64bits ++ break; ++ case Interpreter::java_lang_math_log10: ++ // Store to stack to convert 80bit precision back to 64bits ++ break; ++ case Interpreter::java_lang_math_pow: ++ break; ++ case Interpreter::java_lang_math_exp: ++ break; ++ ++ default : ++ ShouldNotReachHere(); ++ } ++ ++ // must maintain return value in F0:F1 ++ __ ld(RA, FP, (-1) * wordSize); ++ //FIXME ++ __ ld(FP, FP, (-2) * wordSize); ++ __ move(SP, Rsender); ++ __ jr(RA); ++ __ delayed()->nop(); ++ } ++ return entry_point; ++} ++ ++ ++// Abstract method entry ++// Attempt to execute abstract method. Throw exception ++address InterpreterGenerator::generate_abstract_entry(void) { ++ ++ // Rmethod: methodOop ++ // V0: receiver (unused) ++ // Rsender : sender 's sp ++ address entry_point = __ pc(); ++ ++ // abstract method entry ++ // throw exception ++ // adjust stack to what a normal return would do ++ __ empty_expression_stack(); ++ __ restore_bcp(); ++ __ restore_locals(); ++ __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodError)); ++ // the call_VM checks for exception, so we should never return here. ++ __ should_not_reach_here(); ++ ++ return entry_point; ++} ++ ++ ++// Empty method, generate a very fast return. ++ ++address InterpreterGenerator::generate_empty_entry(void) { ++ ++ // Rmethod: methodOop ++ // V0: receiver (unused) ++ // Rsender: sender 's sp , must set sp to this value on return , on mips ,now use T0,as it right? ++ if (!UseFastEmptyMethods) return NULL; ++ ++ address entry_point = __ pc(); ++ ++ Label slow_path; ++ __ li(RT0, SafepointSynchronize::address_of_state()); ++ __ lw(AT, RT0, 0); ++ __ move(RT0, (SafepointSynchronize::_not_synchronized)); ++ __ bne(AT, RT0,slow_path); ++ __ delayed()->nop(); ++ __ move(SP, Rsender); ++ __ jr(RA); ++ __ delayed()->nop(); ++ __ bind(slow_path); ++ (void) generate_normal_entry(false); ++ ++ return entry_point; ++ ++} ++ ++void Deoptimization::unwind_callee_save_values(frame* f, vframeArray* vframe_array) { ++ ++ // This code is sort of the equivalent of C2IAdapter::setup_stack_frame back in ++ // the days we had adapter frames. When we deoptimize a situation where a ++ // compiled caller calls a compiled caller will have registers it expects ++ // to survive the call to the callee. If we deoptimize the callee the only ++ // way we can restore these registers is to have the oldest interpreter ++ // frame that we create restore these values. That is what this routine ++ // will accomplish. ++ ++ // At the moment we have modified c2 to not have any callee save registers ++ // so this problem does not exist and this routine is just a place holder. ++ ++ assert(f->is_interpreted_frame(), "must be interpreted"); ++} +diff --git a/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp b/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp +new file mode 100644 +index 00000000..dccdf6a0 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/javaFrameAnchor_mips.hpp @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. @@ -67606,9 +68662,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + void set_last_Java_fp(intptr_t* fp) { _last_Java_fp = fp; } + +#endif // CPU_MIPS_VM_JAVAFRAMEANCHOR_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp b/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp b/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp +new file mode 100644 +index 00000000..0f7dd942 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/jniFastGetField_mips_64.cpp @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. @@ -67782,9 +68840,161 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +address JNI_FastGetField::generate_fast_get_double_field() { + return generate_fast_get_int_field0(T_DOUBLE); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/jni_mips.h b/hotspot/src/cpu/mips/vm/jni_mips.h ---- a/hotspot/src/cpu/mips/vm/jni_mips.h 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/jni_mips.h 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp b/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp +new file mode 100644 +index 00000000..dfcd47b4 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp +@@ -0,0 +1,144 @@ ++/* ++ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_MIPS_VM_JNITYPES_MIPS_HPP ++#define CPU_MIPS_VM_JNITYPES_MIPS_HPP ++ ++#include "memory/allocation.hpp" ++#include "oops/oop.hpp" ++#include "prims/jni.h" ++ ++// This file holds platform-dependent routines used to write primitive jni ++// types to the array of arguments passed into JavaCalls::call ++ ++class JNITypes : AllStatic { ++ // These functions write a java primitive type (in native format) ++ // to a java stack slot array to be passed as an argument to JavaCalls:calls. ++ // I.e., they are functionally 'push' operations if they have a 'pos' ++ // formal parameter. Note that jlong's and jdouble's are written ++ // _in reverse_ of the order in which they appear in the interpreter ++ // stack. This is because call stubs (see stubGenerator_sparc.cpp) ++ // reverse the argument list constructed by JavaCallArguments (see ++ // javaCalls.hpp). ++ ++private: ++ ++ // 32bit Helper routines. ++ static inline void put_int2r(jint *from, intptr_t *to) { *(jint *)(to++) = from[1]; ++ *(jint *)(to ) = from[0]; } ++ static inline void put_int2r(jint *from, intptr_t *to, int& pos) { put_int2r(from, to + pos); pos += 2; } ++ ++public: ++ // In MIPS64, the sizeof intptr_t is 8 bytes, and each unit in JavaCallArguments::_value_buffer[] ++ // is 8 bytes. ++ // If we only write the low 4 bytes with (jint *), the high 4-bits will be left with uncertain values. ++ // Then, in JavaCallArguments::parameters(), the whole 8 bytes of a T_INT parameter is loaded. ++ // This error occurs in ReflectInvoke.java ++ // The parameter of DD(int) should be 4 instead of 0x550000004. ++ // ++ // See: [runtime/javaCalls.hpp] ++ ++ static inline void put_int(jint from, intptr_t *to) { *(intptr_t *)(to + 0 ) = from; } ++ static inline void put_int(jint from, intptr_t *to, int& pos) { *(intptr_t *)(to + pos++) = from; } ++ static inline void put_int(jint *from, intptr_t *to, int& pos) { *(intptr_t *)(to + pos++) = *from; } ++ ++ // Longs are stored in native format in one JavaCallArgument slot at ++ // *(to). ++ // In theory, *(to + 1) is an empty slot. But, for several Java2D testing programs (TestBorderLayout, SwingTest), ++ // *(to + 1) must contains a copy of the long value. Otherwise it will corrupts. ++ static inline void put_long(jlong from, intptr_t *to) { ++ *(jlong*) (to + 1) = from; ++ *(jlong*) (to) = from; ++ } ++ ++ // A long parameter occupies two slot. ++ // It must fit the layout rule in methodHandle. ++ // ++ // See: [runtime/reflection.cpp] Reflection::invoke() ++ // assert(java_args.size_of_parameters() == method->size_of_parameters(), "just checking"); ++ ++ static inline void put_long(jlong from, intptr_t *to, int& pos) { ++ *(jlong*) (to + 1 + pos) = from; ++ *(jlong*) (to + pos) = from; ++ pos += 2; ++ } ++ ++ static inline void put_long(jlong *from, intptr_t *to, int& pos) { ++ *(jlong*) (to + 1 + pos) = *from; ++ *(jlong*) (to + pos) = *from; ++ pos += 2; ++ } ++ ++ // Oops are stored in native format in one JavaCallArgument slot at *to. ++ static inline void put_obj(oop from, intptr_t *to) { *(oop *)(to + 0 ) = from; } ++ static inline void put_obj(oop from, intptr_t *to, int& pos) { *(oop *)(to + pos++) = from; } ++ static inline void put_obj(oop *from, intptr_t *to, int& pos) { *(oop *)(to + pos++) = *from; } ++ ++ // Floats are stored in native format in one JavaCallArgument slot at *to. ++ static inline void put_float(jfloat from, intptr_t *to) { *(jfloat *)(to + 0 ) = from; } ++ static inline void put_float(jfloat from, intptr_t *to, int& pos) { *(jfloat *)(to + pos++) = from; } ++ static inline void put_float(jfloat *from, intptr_t *to, int& pos) { *(jfloat *)(to + pos++) = *from; } ++ ++#undef _JNI_SLOT_OFFSET ++#define _JNI_SLOT_OFFSET 0 ++ ++ // Longs are stored in native format in one JavaCallArgument slot at ++ // *(to). ++ // In theory, *(to + 1) is an empty slot. But, for several Java2D testing programs (TestBorderLayout, SwingTest), ++ // *(to + 1) must contains a copy of the long value. Otherwise it will corrupts. ++ static inline void put_double(jdouble from, intptr_t *to) { ++ *(jdouble*) (to + 1) = from; ++ *(jdouble*) (to) = from; ++ } ++ ++ // A long parameter occupies two slot. ++ // It must fit the layout rule in methodHandle. ++ // ++ // See: [runtime/reflection.cpp] Reflection::invoke() ++ // assert(java_args.size_of_parameters() == method->size_of_parameters(), "just checking"); ++ ++ static inline void put_double(jdouble from, intptr_t *to, int& pos) { ++ *(jdouble*) (to + 1 + pos) = from; ++ *(jdouble*) (to + pos) = from; ++ pos += 2; ++ } ++ ++ static inline void put_double(jdouble *from, intptr_t *to, int& pos) { ++ *(jdouble*) (to + 1 + pos) = *from; ++ *(jdouble*) (to + pos) = *from; ++ pos += 2; ++ } ++ ++ // The get_xxx routines, on the other hand, actually _do_ fetch ++ // java primitive types from the interpreter stack. ++ static inline jint get_int (intptr_t *from) { return *(jint *) from; } ++ static inline jlong get_long (intptr_t *from) { return *(jlong *) (from + _JNI_SLOT_OFFSET); } ++ static inline oop get_obj (intptr_t *from) { return *(oop *) from; } ++ static inline jfloat get_float (intptr_t *from) { return *(jfloat *) from; } ++ static inline jdouble get_double(intptr_t *from) { return *(jdouble *)(from + _JNI_SLOT_OFFSET); } ++#undef _JNI_SLOT_OFFSET ++}; ++ ++#endif // CPU_MIPS_VM_JNITYPES_MIPS_HPP +diff --git a/hotspot/src/cpu/mips/vm/jni_mips.h b/hotspot/src/cpu/mips/vm/jni_mips.h +new file mode 100644 +index 00000000..6714f51d +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/jni_mips.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -67837,157 +69047,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +typedef signed char jbyte; + +#endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp b/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp ---- a/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/jniTypes_mips.hpp 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,144 @@ -+/* -+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_MIPS_VM_JNITYPES_MIPS_HPP -+#define CPU_MIPS_VM_JNITYPES_MIPS_HPP -+ -+#include "memory/allocation.hpp" -+#include "oops/oop.hpp" -+#include "prims/jni.h" -+ -+// This file holds platform-dependent routines used to write primitive jni -+// types to the array of arguments passed into JavaCalls::call -+ -+class JNITypes : AllStatic { -+ // These functions write a java primitive type (in native format) -+ // to a java stack slot array to be passed as an argument to JavaCalls:calls. -+ // I.e., they are functionally 'push' operations if they have a 'pos' -+ // formal parameter. Note that jlong's and jdouble's are written -+ // _in reverse_ of the order in which they appear in the interpreter -+ // stack. This is because call stubs (see stubGenerator_sparc.cpp) -+ // reverse the argument list constructed by JavaCallArguments (see -+ // javaCalls.hpp). -+ -+private: -+ -+ // 32bit Helper routines. -+ static inline void put_int2r(jint *from, intptr_t *to) { *(jint *)(to++) = from[1]; -+ *(jint *)(to ) = from[0]; } -+ static inline void put_int2r(jint *from, intptr_t *to, int& pos) { put_int2r(from, to + pos); pos += 2; } -+ -+public: -+ // In MIPS64, the sizeof intptr_t is 8 bytes, and each unit in JavaCallArguments::_value_buffer[] -+ // is 8 bytes. -+ // If we only write the low 4 bytes with (jint *), the high 4-bits will be left with uncertain values. -+ // Then, in JavaCallArguments::parameters(), the whole 8 bytes of a T_INT parameter is loaded. -+ // This error occurs in ReflectInvoke.java -+ // The parameter of DD(int) should be 4 instead of 0x550000004. -+ // -+ // See: [runtime/javaCalls.hpp] -+ -+ static inline void put_int(jint from, intptr_t *to) { *(intptr_t *)(to + 0 ) = from; } -+ static inline void put_int(jint from, intptr_t *to, int& pos) { *(intptr_t *)(to + pos++) = from; } -+ static inline void put_int(jint *from, intptr_t *to, int& pos) { *(intptr_t *)(to + pos++) = *from; } -+ -+ // Longs are stored in native format in one JavaCallArgument slot at -+ // *(to). -+ // In theory, *(to + 1) is an empty slot. But, for several Java2D testing programs (TestBorderLayout, SwingTest), -+ // *(to + 1) must contains a copy of the long value. Otherwise it will corrupts. -+ static inline void put_long(jlong from, intptr_t *to) { -+ *(jlong*) (to + 1) = from; -+ *(jlong*) (to) = from; -+ } -+ -+ // A long parameter occupies two slot. -+ // It must fit the layout rule in methodHandle. -+ // -+ // See: [runtime/reflection.cpp] Reflection::invoke() -+ // assert(java_args.size_of_parameters() == method->size_of_parameters(), "just checking"); -+ -+ static inline void put_long(jlong from, intptr_t *to, int& pos) { -+ *(jlong*) (to + 1 + pos) = from; -+ *(jlong*) (to + pos) = from; -+ pos += 2; -+ } -+ -+ static inline void put_long(jlong *from, intptr_t *to, int& pos) { -+ *(jlong*) (to + 1 + pos) = *from; -+ *(jlong*) (to + pos) = *from; -+ pos += 2; -+ } -+ -+ // Oops are stored in native format in one JavaCallArgument slot at *to. -+ static inline void put_obj(oop from, intptr_t *to) { *(oop *)(to + 0 ) = from; } -+ static inline void put_obj(oop from, intptr_t *to, int& pos) { *(oop *)(to + pos++) = from; } -+ static inline void put_obj(oop *from, intptr_t *to, int& pos) { *(oop *)(to + pos++) = *from; } -+ -+ // Floats are stored in native format in one JavaCallArgument slot at *to. -+ static inline void put_float(jfloat from, intptr_t *to) { *(jfloat *)(to + 0 ) = from; } -+ static inline void put_float(jfloat from, intptr_t *to, int& pos) { *(jfloat *)(to + pos++) = from; } -+ static inline void put_float(jfloat *from, intptr_t *to, int& pos) { *(jfloat *)(to + pos++) = *from; } -+ -+#undef _JNI_SLOT_OFFSET -+#define _JNI_SLOT_OFFSET 0 -+ -+ // Longs are stored in native format in one JavaCallArgument slot at -+ // *(to). -+ // In theory, *(to + 1) is an empty slot. But, for several Java2D testing programs (TestBorderLayout, SwingTest), -+ // *(to + 1) must contains a copy of the long value. Otherwise it will corrupts. -+ static inline void put_double(jdouble from, intptr_t *to) { -+ *(jdouble*) (to + 1) = from; -+ *(jdouble*) (to) = from; -+ } -+ -+ // A long parameter occupies two slot. -+ // It must fit the layout rule in methodHandle. -+ // -+ // See: [runtime/reflection.cpp] Reflection::invoke() -+ // assert(java_args.size_of_parameters() == method->size_of_parameters(), "just checking"); -+ -+ static inline void put_double(jdouble from, intptr_t *to, int& pos) { -+ *(jdouble*) (to + 1 + pos) = from; -+ *(jdouble*) (to + pos) = from; -+ pos += 2; -+ } -+ -+ static inline void put_double(jdouble *from, intptr_t *to, int& pos) { -+ *(jdouble*) (to + 1 + pos) = *from; -+ *(jdouble*) (to + pos) = *from; -+ pos += 2; -+ } -+ -+ // The get_xxx routines, on the other hand, actually _do_ fetch -+ // java primitive types from the interpreter stack. -+ static inline jint get_int (intptr_t *from) { return *(jint *) from; } -+ static inline jlong get_long (intptr_t *from) { return *(jlong *) (from + _JNI_SLOT_OFFSET); } -+ static inline oop get_obj (intptr_t *from) { return *(oop *) from; } -+ static inline jfloat get_float (intptr_t *from) { return *(jfloat *) from; } -+ static inline jdouble get_double(intptr_t *from) { return *(jdouble *)(from + _JNI_SLOT_OFFSET); } -+#undef _JNI_SLOT_OFFSET -+}; -+ -+#endif // CPU_MIPS_VM_JNITYPES_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp b/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp ---- a/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp b/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp +new file mode 100644 +index 00000000..2b8840ae +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/macroAssembler_mips.cpp @@ -0,0 +1,4332 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -72321,9 +73385,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + Unimplemented(); + } +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp b/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp ---- a/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp b/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp +new file mode 100644 +index 00000000..ab972779 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/macroAssembler_mips.hpp @@ -0,0 +1,701 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -73026,9 +74092,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + +#endif // CPU_MIPS_VM_MACROASSEMBLER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp b/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp ---- a/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp b/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp +new file mode 100644 +index 00000000..92c05fb7 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/macroAssembler_mips.inline.hpp @@ -0,0 +1,34 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -73064,9 +74132,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#include "code/codeCache.hpp" + +#endif // CPU_MIPS_VM_MACROASSEMBLER_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp b/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp b/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp +new file mode 100644 +index 00000000..0c467df2 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/metaspaceShared_mips_64.cpp @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. @@ -73191,9 +74261,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + *mc_top = (char*)__ pc(); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp b/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp ---- a/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp b/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp +new file mode 100644 +index 00000000..428c2713 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/methodHandles_mips.cpp @@ -0,0 +1,576 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -73771,9 +74843,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +void MethodHandles::trace_method_handle(MacroAssembler* _masm, const char* adaptername) { +} +#endif //PRODUCT -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp b/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp ---- a/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp b/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp +new file mode 100644 +index 00000000..03b65fc8 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/methodHandles_mips.hpp @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. @@ -73837,9 +74911,42 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // Should be in sharedRuntime, not here. + return I29; + } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/mips_64.ad b/hotspot/src/cpu/mips/vm/mips_64.ad ---- a/hotspot/src/cpu/mips/vm/mips_64.ad 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/mips_64.ad 2024-01-30 13:54:24.792708955 +0800 +diff --git a/hotspot/src/cpu/mips/vm/mips.ad b/hotspot/src/cpu/mips/vm/mips.ad +new file mode 100644 +index 00000000..3563bbe0 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/mips.ad +@@ -0,0 +1,25 @@ ++// ++// Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. ++// Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. ++// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++// ++// This code is free software; you can redistribute it and/or modify it ++// under the terms of the GNU General Public License version 2 only, as ++// published by the Free Software Foundation. ++// ++// This code is distributed in the hope that it will be useful, but WITHOUT ++// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++// version 2 for more details (a copy is included in the LICENSE file that ++// accompanied this code). ++// ++// You should have received a copy of the GNU General Public License version ++// 2 along with this work; if not, write to the Free Software Foundation, ++// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++// ++// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++// or visit www.oracle.com if you need additional information or have any ++// questions. ++// ++// ++ +diff --git a/hotspot/src/cpu/mips/vm/mips_64.ad b/hotspot/src/cpu/mips/vm/mips_64.ad +new file mode 100644 +index 00000000..29125913 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/mips_64.ad @@ -0,0 +1,14036 @@ +// +// Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -87877,38 +88984,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +// These must follow all instruction definitions as they use the names +// defined in the instructions definitions. + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/mips.ad b/hotspot/src/cpu/mips/vm/mips.ad ---- a/hotspot/src/cpu/mips/vm/mips.ad 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/mips.ad 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,25 @@ -+// -+// Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. -+// Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. -+// DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+// -+// This code is free software; you can redistribute it and/or modify it -+// under the terms of the GNU General Public License version 2 only, as -+// published by the Free Software Foundation. -+// -+// This code is distributed in the hope that it will be useful, but WITHOUT -+// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+// version 2 for more details (a copy is included in the LICENSE file that -+// accompanied this code). -+// -+// You should have received a copy of the GNU General Public License version -+// 2 along with this work; if not, write to the Free Software Foundation, -+// Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+// -+// Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+// or visit www.oracle.com if you need additional information or have any -+// questions. -+// -+// -+ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp b/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp ---- a/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp b/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp +new file mode 100644 +index 00000000..e1f7cd94 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/nativeInst_mips.cpp @@ -0,0 +1,1829 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -89739,9 +90819,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // we check the safepoint instruction like the this. + return is_op(Assembler::lw_op) && is_rt(AT); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp b/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp ---- a/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp b/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp +new file mode 100644 +index 00000000..13a4cb4e +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/nativeInst_mips.hpp @@ -0,0 +1,735 @@ +/* + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. @@ -90478,9 +91560,64 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // CPU_MIPS_VM_NATIVEINST_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp b/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp ---- a/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/registerMap_mips.hpp b/hotspot/src/cpu/mips/vm/registerMap_mips.hpp +new file mode 100644 +index 00000000..7f800eb1 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/registerMap_mips.hpp +@@ -0,0 +1,47 @@ ++/* ++ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_MIPS_VM_REGISTERMAP_MIPS_HPP ++#define CPU_MIPS_VM_REGISTERMAP_MIPS_HPP ++ ++// machine-dependent implemention for register maps ++ friend class frame; ++ ++ private: ++#ifndef CORE ++ // This is the hook for finding a register in an "well-known" location, ++ // such as a register block of a predetermined format. ++ // Since there is none, we just return NULL. ++ // See registerMap_sparc.hpp for an example of grabbing registers ++ // from register save areas of a standard layout. ++ address pd_location(VMReg reg) const {return NULL;} ++#endif ++ ++ // no PD state to clear or copy: ++ void pd_clear() {} ++ void pd_initialize() {} ++ void pd_initialize_from(const RegisterMap* map) {} ++ ++#endif // CPU_MIPS_VM_REGISTERMAP_MIPS_HPP +diff --git a/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp b/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp +new file mode 100644 +index 00000000..4af25318 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/register_definitions_mips.cpp @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. @@ -90585,60 +91722,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +REGISTER_DEFINITION(FloatRegister, f29); +REGISTER_DEFINITION(FloatRegister, f30); +REGISTER_DEFINITION(FloatRegister, f31); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/registerMap_mips.hpp b/hotspot/src/cpu/mips/vm/registerMap_mips.hpp ---- a/hotspot/src/cpu/mips/vm/registerMap_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/registerMap_mips.hpp 2023-12-20 09:23:19.798147877 +0800 -@@ -0,0 +1,47 @@ -+/* -+ * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_MIPS_VM_REGISTERMAP_MIPS_HPP -+#define CPU_MIPS_VM_REGISTERMAP_MIPS_HPP -+ -+// machine-dependent implemention for register maps -+ friend class frame; -+ -+ private: -+#ifndef CORE -+ // This is the hook for finding a register in an "well-known" location, -+ // such as a register block of a predetermined format. -+ // Since there is none, we just return NULL. -+ // See registerMap_sparc.hpp for an example of grabbing registers -+ // from register save areas of a standard layout. -+ address pd_location(VMReg reg) const {return NULL;} -+#endif -+ -+ // no PD state to clear or copy: -+ void pd_clear() {} -+ void pd_initialize() {} -+ void pd_initialize_from(const RegisterMap* map) {} -+ -+#endif // CPU_MIPS_VM_REGISTERMAP_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/register_mips.cpp b/hotspot/src/cpu/mips/vm/register_mips.cpp ---- a/hotspot/src/cpu/mips/vm/register_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/register_mips.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/register_mips.cpp b/hotspot/src/cpu/mips/vm/register_mips.cpp +new file mode 100644 +index 00000000..4a9b22bf +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/register_mips.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. @@ -90692,9 +91780,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + return is_valid() ? names[encoding()] : "fnoreg"; +} + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/register_mips.hpp b/hotspot/src/cpu/mips/vm/register_mips.hpp ---- a/hotspot/src/cpu/mips/vm/register_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/register_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/register_mips.hpp b/hotspot/src/cpu/mips/vm/register_mips.hpp +new file mode 100644 +index 00000000..88bf2d68 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/register_mips.hpp @@ -0,0 +1,346 @@ +/* + * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. @@ -91042,9 +92132,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif //CPU_MIPS_VM_REGISTER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp b/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp ---- a/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp b/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp +new file mode 100644 +index 00000000..cae43b2d +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/relocInfo_mips.cpp @@ -0,0 +1,156 @@ +/* + * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. @@ -91202,9 +92294,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + +void metadata_Relocation::pd_fix_value(address x) { +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp b/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp ---- a/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp b/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp +new file mode 100644 +index 00000000..04ad5dac +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/relocInfo_mips.hpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -91246,9 +92340,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + }; + +#endif // CPU_MIPS_VM_RELOCINFO_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp b/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp 2023-12-20 09:23:19.798147877 +0800 +diff --git a/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp b/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp +new file mode 100644 +index 00000000..bb9269b4 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/runtime_mips_64.cpp @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -91456,9 +92552,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + _exception_blob = ExceptionBlob::create(&buffer, oop_maps, framesize); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp b/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp b/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp +new file mode 100644 +index 00000000..daf04c44 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/sharedRuntime_mips_64.cpp @@ -0,0 +1,3816 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -95276,9 +96374,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + reverse_words(m, (unsigned long *)m_ints, longwords); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp b/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp b/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp +new file mode 100644 +index 00000000..aeb797fa +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/stubGenerator_mips_64.cpp @@ -0,0 +1,2147 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -97427,9 +98527,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +void StubGenerator_generate(CodeBuffer* code, bool all) { + StubGenerator g(code, all); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp +new file mode 100644 +index 00000000..733a48b8 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.cpp @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -97466,9 +98568,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + +//find the last fp value +address StubRoutines::gs2::_call_stub_compiled_return = NULL; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp ---- a/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp +new file mode 100644 +index 00000000..920c0884 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/stubRoutines_mips_64.hpp @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -97529,9 +98633,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_MIPS_VM_STUBROUTINES_MIPS_64_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp b/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp ---- a/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp b/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp +new file mode 100644 +index 00000000..a83c3728 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/templateInterpreterGenerator_mips.hpp @@ -0,0 +1,35 @@ +/* + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. @@ -97568,9 +98674,58 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + // address generate_asm_interpreter_entry(bool synchronized); + +#endif // CPU_MIPS_VM_TEMPLATEINTERPRETERGENERATOR_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp b/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp b/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp +new file mode 100644 +index 00000000..204f1b2f +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp +@@ -0,0 +1,41 @@ ++/* ++ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_MIPS_VM_TEMPLATEINTERPRETER_MIPS_HPP ++#define CPU_MIPS_VM_TEMPLATEINTERPRETER_MIPS_HPP ++ ++ ++ protected: ++ ++ // Size of interpreter code. Increase if too small. Interpreter will ++ // fail with a guarantee ("not enough space for interpreter generation"); ++ // if too small. ++ // Run with +PrintInterpreter to get the VM to print out the size. ++ // Max size with JVMTI ++ // The sethi() instruction generates lots more instructions when shell ++ // stack limit is unlimited, so that's why this is much bigger. ++ const static int InterpreterCodeSize = 500 * K; ++ ++#endif // CPU_MIPS_VM_TEMPLATEINTERPRETER_MIPS_HPP +diff --git a/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp b/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp +new file mode 100644 +index 00000000..0cc5d330 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/templateInterpreter_mips_64.cpp @@ -0,0 +1,2306 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -99878,13 +101033,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} +#endif // !PRODUCT +#endif // ! CC_INTERP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp b/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp ---- a/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/templateInterpreter_mips.hpp 2023-12-20 09:23:19.801481172 +0800 -@@ -0,0 +1,41 @@ +diff --git a/hotspot/src/cpu/mips/vm/templateTable_mips.hpp b/hotspot/src/cpu/mips/vm/templateTable_mips.hpp +new file mode 100644 +index 00000000..d879e6dc +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/templateTable_mips.hpp +@@ -0,0 +1,34 @@ +/* -+ * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it @@ -99907,25 +101064,20 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#ifndef CPU_MIPS_VM_TEMPLATEINTERPRETER_MIPS_HPP -+#define CPU_MIPS_VM_TEMPLATEINTERPRETER_MIPS_HPP -+ -+ -+ protected: -+ -+ // Size of interpreter code. Increase if too small. Interpreter will -+ // fail with a guarantee ("not enough space for interpreter generation"); -+ // if too small. -+ // Run with +PrintInterpreter to get the VM to print out the size. -+ // Max size with JVMTI -+ // The sethi() instruction generates lots more instructions when shell -+ // stack limit is unlimited, so that's why this is much bigger. -+ const static int InterpreterCodeSize = 500 * K; ++ static void prepare_invoke(Register method, Register index, int byte_no, ++ Bytecodes::Code code); ++ static void invokevirtual_helper(Register index, Register recv, ++ Register flags); ++ static void volatile_barrier(); + -+#endif // CPU_MIPS_VM_TEMPLATEINTERPRETER_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp b/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp 2023-12-20 09:23:19.801481172 +0800 ++ // Helpers ++ static void index_check(Register array, Register index); ++ static void index_check_without_pop(Register array, Register index); +diff --git a/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp b/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp +new file mode 100644 +index 00000000..7415511b +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/templateTable_mips_64.cpp @@ -0,0 +1,4623 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -104550,9 +105702,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + __ sync(); +} +#endif // !CC_INTERP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp b/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp ---- a/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp b/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp +new file mode 100644 +index 00000000..b63274a2 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/templateTable_mips_64.hpp @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. @@ -104598,213 +105752,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + static void index_check_without_pop(Register array, Register index); + +#endif // CPU_MIPS_VM_TEMPLATETABLE_MIPS_64_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/templateTable_mips.hpp b/hotspot/src/cpu/mips/vm/templateTable_mips.hpp ---- a/hotspot/src/cpu/mips/vm/templateTable_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/templateTable_mips.hpp 2023-12-20 09:23:19.801481172 +0800 -@@ -0,0 +1,34 @@ -+/* -+ * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+ static void prepare_invoke(Register method, Register index, int byte_no, -+ Bytecodes::Code code); -+ static void invokevirtual_helper(Register index, Register recv, -+ Register flags); -+ static void volatile_barrier(); -+ -+ // Helpers -+ static void index_check(Register array, Register index); -+ static void index_check_without_pop(Register array, Register index); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vmreg_mips.cpp b/hotspot/src/cpu/mips/vm/vmreg_mips.cpp ---- a/hotspot/src/cpu/mips/vm/vmreg_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vmreg_mips.cpp 2023-12-20 09:23:19.801481172 +0800 -@@ -0,0 +1,51 @@ -+/* -+ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#include "precompiled.hpp" -+#include "asm/assembler.hpp" -+#include "code/vmreg.hpp" -+ -+ -+ -+void VMRegImpl::set_regName() { -+ Register reg = ::as_Register(0); -+ int i; -+ for (i = 0; i < ConcreteRegisterImpl::max_gpr ; ) { -+ regName[i++] = reg->name(); -+ regName[i++] = reg->name(); -+ reg = reg->successor(); -+ } -+ -+ FloatRegister freg = ::as_FloatRegister(0); -+ for ( ; i < ConcreteRegisterImpl::max_fpr ; ) { -+ regName[i++] = freg->name(); -+ regName[i++] = freg->name(); -+ freg = freg->successor(); -+ } -+ -+ for ( ; i < ConcreteRegisterImpl::number_of_registers ; i ++ ) { -+ regName[i] = "NON-GPR-FPR"; -+ } -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vmreg_mips.hpp b/hotspot/src/cpu/mips/vm/vmreg_mips.hpp ---- a/hotspot/src/cpu/mips/vm/vmreg_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vmreg_mips.hpp 2023-12-20 09:23:19.801481172 +0800 -@@ -0,0 +1,35 @@ -+/* -+ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2019, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_MIPS_VM_VMREG_MIPS_HPP -+#define CPU_MIPS_VM_VMREG_MIPS_HPP -+ -+bool is_Register(); -+Register as_Register(); -+ -+bool is_FloatRegister(); -+FloatRegister as_FloatRegister(); -+ -+#endif // CPU_MIPS_VM_VMREG_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp b/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp ---- a/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp 2023-12-20 09:23:19.801481172 +0800 -@@ -0,0 +1,68 @@ -+/* -+ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_MIPS_VM_VMREG_MIPS_INLINE_HPP -+#define CPU_MIPS_VM_VMREG_MIPS_INLINE_HPP -+ -+inline VMReg RegisterImpl::as_VMReg() { -+ if( this==noreg ) return VMRegImpl::Bad(); -+ return VMRegImpl::as_VMReg(encoding() << 1 ); -+} -+ -+inline VMReg FloatRegisterImpl::as_VMReg() { -+ return VMRegImpl::as_VMReg((encoding() << 1) + ConcreteRegisterImpl::max_gpr); -+} -+ -+inline bool VMRegImpl::is_Register() { -+ return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr; -+} -+ -+inline bool VMRegImpl::is_FloatRegister() { -+ return value() >= ConcreteRegisterImpl::max_gpr && value() < ConcreteRegisterImpl::max_fpr; -+} -+ -+inline Register VMRegImpl::as_Register() { -+ -+ assert( is_Register(), "must be"); -+ // Yuk -+ return ::as_Register(value() >> 1); -+} -+ -+inline FloatRegister VMRegImpl::as_FloatRegister() { -+ assert( is_FloatRegister(), "must be" ); -+ // Yuk -+ assert( is_even(value()), "must be" ); -+ return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); -+} -+ -+inline bool VMRegImpl::is_concrete() { -+ assert(is_reg(), "must be"); -+ if(is_Register()) return true; -+ if(is_FloatRegister()) return true; -+ assert(false, "what register?"); -+ return false; -+} -+ -+#endif // CPU_MIPS_VM_VMREG_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp b/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp ---- a/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp b/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp +new file mode 100644 +index 00000000..69399143 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vmStructs_mips.hpp @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. @@ -104874,9 +105826,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + /* be present there) */ + +#endif // CPU_MIPS_VM_VMSTRUCTS_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp ---- a/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp +new file mode 100644 +index 00000000..a98f70d9 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.cpp @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. @@ -104967,9 +105921,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + strncpy(tmp, _cpu_desc, CPU_DETAILED_DESC_BUF_SIZE); + return tmp; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp ---- a/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp +new file mode 100644 +index 00000000..a240fcc2 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vm_version_ext_mips.hpp @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. @@ -105025,9 +105981,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_MIPS_VM_VM_VERSION_EXT_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vm_version_mips.cpp b/hotspot/src/cpu/mips/vm/vm_version_mips.cpp ---- a/hotspot/src/cpu/mips/vm/vm_version_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vm_version_mips.cpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/vm_version_mips.cpp b/hotspot/src/cpu/mips/vm/vm_version_mips.cpp +new file mode 100644 +index 00000000..aef8f074 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vm_version_mips.cpp @@ -0,0 +1,510 @@ +/* + * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -105539,9 +106497,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + + get_processor_features(); +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vm_version_mips.hpp b/hotspot/src/cpu/mips/vm/vm_version_mips.hpp ---- a/hotspot/src/cpu/mips/vm/vm_version_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vm_version_mips.hpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/vm_version_mips.hpp b/hotspot/src/cpu/mips/vm/vm_version_mips.hpp +new file mode 100644 +index 00000000..0de01e5f +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vm_version_mips.hpp @@ -0,0 +1,221 @@ +/* + * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. @@ -105764,9 +106724,183 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +}; + +#endif // CPU_MIPS_VM_VM_VERSION_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp b/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp ---- a/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp 2023-12-20 09:23:19.801481172 +0800 +diff --git a/hotspot/src/cpu/mips/vm/vmreg_mips.cpp b/hotspot/src/cpu/mips/vm/vmreg_mips.cpp +new file mode 100644 +index 00000000..86bd74d4 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vmreg_mips.cpp +@@ -0,0 +1,51 @@ ++/* ++ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include "precompiled.hpp" ++#include "asm/assembler.hpp" ++#include "code/vmreg.hpp" ++ ++ ++ ++void VMRegImpl::set_regName() { ++ Register reg = ::as_Register(0); ++ int i; ++ for (i = 0; i < ConcreteRegisterImpl::max_gpr ; ) { ++ regName[i++] = reg->name(); ++ regName[i++] = reg->name(); ++ reg = reg->successor(); ++ } ++ ++ FloatRegister freg = ::as_FloatRegister(0); ++ for ( ; i < ConcreteRegisterImpl::max_fpr ; ) { ++ regName[i++] = freg->name(); ++ regName[i++] = freg->name(); ++ freg = freg->successor(); ++ } ++ ++ for ( ; i < ConcreteRegisterImpl::number_of_registers ; i ++ ) { ++ regName[i] = "NON-GPR-FPR"; ++ } ++} +diff --git a/hotspot/src/cpu/mips/vm/vmreg_mips.hpp b/hotspot/src/cpu/mips/vm/vmreg_mips.hpp +new file mode 100644 +index 00000000..6a970ea9 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vmreg_mips.hpp +@@ -0,0 +1,35 @@ ++/* ++ * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2019, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_MIPS_VM_VMREG_MIPS_HPP ++#define CPU_MIPS_VM_VMREG_MIPS_HPP ++ ++bool is_Register(); ++Register as_Register(); ++ ++bool is_FloatRegister(); ++FloatRegister as_FloatRegister(); ++ ++#endif // CPU_MIPS_VM_VMREG_MIPS_HPP +diff --git a/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp b/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp +new file mode 100644 +index 00000000..77e18ce5 +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vmreg_mips.inline.hpp +@@ -0,0 +1,68 @@ ++/* ++ * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_MIPS_VM_VMREG_MIPS_INLINE_HPP ++#define CPU_MIPS_VM_VMREG_MIPS_INLINE_HPP ++ ++inline VMReg RegisterImpl::as_VMReg() { ++ if( this==noreg ) return VMRegImpl::Bad(); ++ return VMRegImpl::as_VMReg(encoding() << 1 ); ++} ++ ++inline VMReg FloatRegisterImpl::as_VMReg() { ++ return VMRegImpl::as_VMReg((encoding() << 1) + ConcreteRegisterImpl::max_gpr); ++} ++ ++inline bool VMRegImpl::is_Register() { ++ return (unsigned int) value() < (unsigned int) ConcreteRegisterImpl::max_gpr; ++} ++ ++inline bool VMRegImpl::is_FloatRegister() { ++ return value() >= ConcreteRegisterImpl::max_gpr && value() < ConcreteRegisterImpl::max_fpr; ++} ++ ++inline Register VMRegImpl::as_Register() { ++ ++ assert( is_Register(), "must be"); ++ // Yuk ++ return ::as_Register(value() >> 1); ++} ++ ++inline FloatRegister VMRegImpl::as_FloatRegister() { ++ assert( is_FloatRegister(), "must be" ); ++ // Yuk ++ assert( is_even(value()), "must be" ); ++ return ::as_FloatRegister((value() - ConcreteRegisterImpl::max_gpr) >> 1); ++} ++ ++inline bool VMRegImpl::is_concrete() { ++ assert(is_reg(), "must be"); ++ if(is_Register()) return true; ++ if(is_FloatRegister()) return true; ++ assert(false, "what register?"); ++ return false; ++} ++ ++#endif // CPU_MIPS_VM_VMREG_MIPS_INLINE_HPP +diff --git a/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp b/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp +new file mode 100644 +index 00000000..7779c58e +--- /dev/null ++++ b/hotspot/src/cpu/mips/vm/vtableStubs_mips_64.cpp @@ -0,0 +1,301 @@ +/* + * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. @@ -106069,10 +107203,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +int VtableStub::pd_code_alignment() { + return wordSize; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp ---- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp 2023-12-20 09:23:19.824814237 +0800 -@@ -1513,6 +1513,10 @@ +diff --git a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +index c1c053e6..5c90df10 100644 +--- a/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp ++++ b/hotspot/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +@@ -1513,6 +1513,10 @@ void LIR_Assembler::emit_opBranch(LIR_OpBranch* op) { } } @@ -106083,7 +107218,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_Assembler::emit_opConvert(LIR_OpConvert* op) { LIR_Opr src = op->in_opr(); LIR_Opr dest = op->result_opr(); -@@ -2102,6 +2106,12 @@ +@@ -2102,6 +2106,12 @@ void LIR_Assembler::cmove(LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, L } @@ -106096,10 +107231,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_Assembler::arith_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr dest, CodeEmitInfo* info, bool pop_fpu_stack) { assert(info == NULL, "should never be used, idiv/irem and ldiv/lrem not handled by this method"); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp ---- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp 2023-12-20 09:23:19.824814237 +0800 -@@ -242,20 +242,27 @@ +diff --git a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +index 92b73e1c..45da327e 100644 +--- a/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp ++++ b/hotspot/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +@@ -242,20 +242,27 @@ void LIRGenerator::increment_counter(LIR_Address* addr, int step) { __ add((LIR_Opr)addr, LIR_OprFact::intConst(step), (LIR_Opr)addr); } @@ -106134,9 +107270,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, jint c, LIR_Opr result, LIR_Opr tmp) { if (tmp->is_valid() && c > 0 && c < max_jint) { -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp ---- a/hotspot/src/os/linux/vm/os_linux.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/os/linux/vm/os_linux.cpp 2023-12-20 09:23:19.851480600 +0800 +diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp +index 54cfcdd1..c3d22ba5 100644 +--- a/hotspot/src/os/linux/vm/os_linux.cpp ++++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -22,6 +22,12 @@ * */ @@ -106150,19 +107287,15 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // no precompiled headers #include "classfile/classLoader.hpp" #include "classfile/systemDictionary.hpp" -@@ -1969,7 +1975,11 @@ +@@ -1972,6 +1978,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {EM_ALPHA, EM_ALPHA, ELFCLASS64, ELFDATA2LSB, (char*)"Alpha"}, {EM_MIPS_RS3_LE, EM_MIPS_RS3_LE, ELFCLASS32, ELFDATA2LSB, (char*)"MIPSel"}, {EM_MIPS, EM_MIPS, ELFCLASS32, ELFDATA2MSB, (char*)"MIPS"}, + {EM_MIPS, EM_MIPS, ELFCLASS64, ELFDATA2LSB, (char*)"MIPS64 LE"}, {EM_PARISC, EM_PARISC, ELFCLASS32, ELFDATA2MSB, (char*)"PARISC"}, -+#if defined (LOONGARCH64) -+ {EM_LOONGARCH, EM_LOONGARCH, ELFCLASS64, ELFDATA2LSB, (char*)"LOONGARCH64"}, -+#endif {EM_68K, EM_68K, ELFCLASS32, ELFDATA2MSB, (char*)"M68k"}, {EM_AARCH64, EM_AARCH64, ELFCLASS64, ELFDATA2LSB, (char*)"AARCH64"}, - }; -@@ -1984,6 +1994,8 @@ +@@ -1988,6 +1995,8 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) static Elf32_Half running_arch_code=EM_SPARCV9; #elif (defined __sparc) && (!defined _LP64) static Elf32_Half running_arch_code=EM_SPARC; @@ -106171,20 +107304,16 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #elif (defined __powerpc64__) static Elf32_Half running_arch_code=EM_PPC64; #elif (defined __powerpc__) -@@ -2004,9 +2016,11 @@ - static Elf32_Half running_arch_code=EM_68K; - #elif (defined AARCH64) - static Elf32_Half running_arch_code=EM_AARCH64; -+ #elif (defined LOONGARCH64) -+ static Elf32_Half running_arch_code=EM_LOONGARCH; +@@ -2012,7 +2021,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) + static Elf32_Half running_arch_code=EM_LOONGARCH; #else #error Method os::dll_load requires that one of following is defined:\ -- IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64 -+ IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, __mips64, PARISC, M68K, AARCH64 +- IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64, LOONGARCH ++ IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, __mips64, PARISC, M68K, AARCH64, LOONGARCH #endif // Identify compatability class for VM's architecture and library's architecture -@@ -3513,7 +3527,7 @@ +@@ -3519,7 +3528,7 @@ size_t os::Linux::find_large_page_size() { #ifndef ZERO large_page_size = IA32_ONLY(4 * M) AMD64_ONLY(2 * M) IA64_ONLY(256 * M) SPARC_ONLY(4 * M) @@ -106193,7 +107322,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif // ZERO FILE *fp = fopen("/proc/meminfo", "r"); -@@ -5120,7 +5134,12 @@ +@@ -5126,7 +5135,12 @@ jint os::init_2(void) Linux::fast_thread_clock_init(); // Allocate a single page and mark it as readable for safepoint polling @@ -106206,7 +107335,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp guarantee( polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page" ); os::set_polling_page( polling_page ); -@@ -5155,13 +5174,20 @@ +@@ -5161,13 +5175,20 @@ jint os::init_2(void) // size. Add a page for compiler2 recursion in main thread. // Add in 2*BytesPerWord times page size to account for VM stack during // class initialization depending on 32 or 64 bit VM. @@ -106228,9 +107357,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp tty->print_cr("\nThe stack size specified is too small, " "Specify at least %dk", os::Linux::min_stack_allowed/ K); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os/linux/vm/os_perf_linux.cpp b/hotspot/src/os/linux/vm/os_perf_linux.cpp ---- a/hotspot/src/os/linux/vm/os_perf_linux.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/os/linux/vm/os_perf_linux.cpp 2023-12-20 09:23:19.851480600 +0800 +diff --git a/hotspot/src/os/linux/vm/os_perf_linux.cpp b/hotspot/src/os/linux/vm/os_perf_linux.cpp +index 0d1f7581..cbc6c075 100644 +--- a/hotspot/src/os/linux/vm/os_perf_linux.cpp ++++ b/hotspot/src/os/linux/vm/os_perf_linux.cpp @@ -50,6 +50,12 @@ #ifdef TARGET_ARCH_ppc # include "vm_version_ext_ppc.hpp" @@ -106244,9 +107374,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include #include -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp +new file mode 100644 +index 00000000..5ee0965f +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/assembler_linux_loongarch.cpp @@ -0,0 +1,92 @@ +/* + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. @@ -106340,9 +107472,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } +#endif // MINIMIZE_RAM_USAGE +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp +new file mode 100644 +index 00000000..69590ba5 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/atomic_linux_loongarch.inline.hpp @@ -0,0 +1,206 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. @@ -106550,9 +107684,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // OS_CPU_LINUX_LOONGARCH_VM_ATOMIC_LINUX_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp +new file mode 100644 +index 00000000..4e205c46 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/bytes_linux_loongarch.inline.hpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. @@ -106591,9 +107727,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +inline u8 Bytes::swap_u8(u8 x) { return bswap_64(x); } + +#endif // OS_CPU_LINUX_LOONGARCH_VM_BYTES_LINUX_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp +new file mode 100644 +index 00000000..7d6e11a9 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/copy_linux_loongarch.inline.hpp @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -106720,9 +107858,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // OS_CPU_LINUX_LOONGARCH_VM_COPY_LINUX_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp +new file mode 100644 +index 00000000..8ec3fa82 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/globals_linux_loongarch.hpp @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -106767,9 +107907,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +define_pd_global(uintx,HeapBaseMinAddress, 2*G); + +#endif // OS_CPU_LINUX_LOONGARCH_VM_GLOBALS_LINUX_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp +new file mode 100644 +index 00000000..3e050c8d +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/orderAccess_linux_loongarch.inline.hpp @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -106886,9 +108028,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#undef inlasm_sync + +#endif // OS_CPU_LINUX_LOONGARCH_VM_ORDERACCESS_LINUX_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp +new file mode 100644 +index 00000000..f2c3df84 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.cpp @@ -0,0 +1,750 @@ +/* + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. @@ -107640,9 +108784,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +bool os::is_ActiveCoresMP() { + return UseActiveCoresMP && _initial_active_processor_count == 1; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp +new file mode 100644 +index 00000000..a7321ae0 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/os_linux_loongarch.hpp @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. @@ -107683,9 +108829,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + static bool is_ActiveCoresMP(); + +#endif // OS_CPU_LINUX_LOONGARCH_VM_OS_LINUX_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp +new file mode 100644 +index 00000000..a1cedcd8 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/prefetch_linux_loongarch.inline.hpp @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -107743,9 +108891,168 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // OS_CPU_LINUX_LOONGARCH_VM_PREFETCH_LINUX_LOONGARCH_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp +new file mode 100644 +index 00000000..be28a562 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp +@@ -0,0 +1,84 @@ ++/* ++ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include "precompiled.hpp" ++#include "runtime/thread.inline.hpp" ++#include "runtime/threadLocalStorage.hpp" ++ ++// Map stack pointer (%esp) to thread pointer for faster TLS access ++// ++// Here we use a flat table for better performance. Getting current thread ++// is down to one memory access (read _sp_map[%esp>>12]) in generated code ++// and two in runtime code (-fPIC code needs an extra load for _sp_map). ++// ++// This code assumes stack page is not shared by different threads. It works ++// in 32-bit VM when page size is 4K (or a multiple of 4K, if that matters). ++// ++// Notice that _sp_map is allocated in the bss segment, which is ZFOD ++// (zero-fill-on-demand). While it reserves 4M address space upfront, ++// actual memory pages are committed on demand. ++// ++// If an application creates and destroys a lot of threads, usually the ++// stack space freed by a thread will soon get reused by new thread ++// (this is especially true in NPTL or LinuxThreads in fixed-stack mode). ++// No memory page in _sp_map is wasted. ++// ++// However, it's still possible that we might end up populating & ++// committing a large fraction of the 4M table over time, but the actual ++// amount of live data in the table could be quite small. The max wastage ++// is less than 4M bytes. If it becomes an issue, we could use madvise() ++// with MADV_DONTNEED to reclaim unused (i.e. all-zero) pages in _sp_map. ++// MADV_DONTNEED on Linux keeps the virtual memory mapping, but zaps the ++// physical memory page (i.e. similar to MADV_FREE on Solaris). ++ ++#ifdef MINIMIZE_RAM_USAGE ++Thread* ThreadLocalStorage::_sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; ++#endif // MINIMIZE_RAM_USAGE ++ ++void ThreadLocalStorage::generate_code_for_get_thread() { ++ // nothing we can do here for user-level thread ++} ++ ++void ThreadLocalStorage::pd_init() { ++#ifdef MINIMIZE_RAM_USAGE ++ assert(align_size_down(os::vm_page_size(), PAGE_SIZE) == os::vm_page_size(), ++ "page size must be multiple of PAGE_SIZE"); ++#endif // MINIMIZE_RAM_USAGE ++} ++ ++void ThreadLocalStorage::pd_set_thread(Thread* thread) { ++ os::thread_local_storage_at_put(ThreadLocalStorage::thread_index(), thread); ++#ifdef MINIMIZE_RAM_USAGE ++ address stack_top = os::current_stack_base(); ++ size_t stack_size = os::current_stack_size(); ++ ++ for (address p = stack_top - stack_size; p < stack_top; p += PAGE_SIZE) { ++ int index = ((uintptr_t)p >> PAGE_SHIFT) & ((1UL << (SP_BITLENGTH - PAGE_SHIFT)) - 1); ++ assert(thread == NULL || _sp_map[index] == NULL || thread == _sp_map[index], ++ "thread exited without detaching from VM??"); ++ _sp_map[index] = thread; ++ } ++#endif // MINIMIZE_RAM_USAGE ++} +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp +new file mode 100644 +index 00000000..4fab788a +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp +@@ -0,0 +1,61 @@ ++/* ++ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef OS_CPU_LINUX_LOONGARCH_VM_THREADLS_LINUX_LOONGARCH_HPP ++#define OS_CPU_LINUX_LOONGARCH_VM_THREADLS_LINUX_LOONGARCH_HPP ++ ++#ifdef MINIMIZE_RAM_USAGE ++ // Processor dependent parts of ThreadLocalStorage ++ //only the low 2G space for user program in Linux ++ ++ #define SP_BITLENGTH 34 ++ #define PAGE_SHIFT 14 ++ #define PAGE_SIZE (1UL << PAGE_SHIFT) ++ ++ static Thread* _sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; ++ static int _sp_map_low; ++ static int _sp_map_high; ++#endif // MINIMIZE_RAM_USAGE ++ ++public: ++#ifdef MINIMIZE_RAM_USAGE ++ static Thread** sp_map_addr() { return _sp_map; } ++#endif // MINIMIZE_RAM_USAGE ++ ++ static Thread* thread() { ++#ifdef MINIMIZE_RAM_USAGE ++ /* Thread::thread() can also be optimized in the same way as __get_thread() */ ++ //return (Thread*) os::thread_local_storage_at(thread_index()); ++ uintptr_t sp; ++ uintptr_t mask = (1UL << (SP_BITLENGTH - PAGE_SHIFT)) - 1; ++ ++ __asm__ __volatile__ ("addi.d %0, $r29, 0 " : "=r" (sp)); ++ ++ return _sp_map[(sp >> PAGE_SHIFT) & mask]; ++#else ++ return (Thread*) os::thread_local_storage_at(thread_index()); ++#endif // MINIMIZE_RAM_USAGE ++ } ++#endif // OS_CPU_LINUX_LOONGARCH_VM_THREADLS_LINUX_LOONGARCH_HPP +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp +new file mode 100644 +index 00000000..44f666d6 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.cpp @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -107846,9 +109153,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + +void JavaThread::cache_global_variables() { } + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp +new file mode 100644 +index 00000000..d6dd2521 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/thread_linux_loongarch.hpp @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -107875,212 +109184,61 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#ifndef OS_CPU_LINUX_LOONGARCH_VM_THREAD_LINUX_LOONGARCH_HPP -+#define OS_CPU_LINUX_LOONGARCH_VM_THREAD_LINUX_LOONGARCH_HPP -+ -+ private: -+ void pd_initialize(); -+ -+ frame pd_last_frame() { -+ assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); -+ if (_anchor.last_Java_pc() != NULL) { -+ return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); -+ } else { -+ // This will pick up pc from sp -+ return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp()); -+ } -+ } -+ -+ -+ public: -+ // Mutators are highly dangerous.... -+ intptr_t* last_Java_fp() { return _anchor.last_Java_fp(); } -+ void set_last_Java_fp(intptr_t* fp) { _anchor.set_last_Java_fp(fp); } -+ -+ void set_base_of_stack_pointer(intptr_t* base_sp) { -+ } -+ -+ static ByteSize last_Java_fp_offset() { -+ return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_fp_offset(); -+ } -+ -+ intptr_t* base_of_stack_pointer() { -+ return NULL; -+ } -+ void record_base_of_stack_pointer() { -+ } -+ -+ bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, -+ bool isInJava); -+ -+ 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); -+public: -+ -+ // These routines are only used on cpu architectures that -+ // have separate register stacks (Itanium). -+ static bool register_stack_overflow() { return false; } -+ static void enable_register_stack_guard() {} -+ static void disable_register_stack_guard() {} -+ -+#endif // OS_CPU_LINUX_LOONGARCH_VM_THREAD_LINUX_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.cpp 2023-12-20 09:23:19.868147074 +0800 -@@ -0,0 +1,84 @@ -+/* -+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#include "precompiled.hpp" -+#include "runtime/thread.inline.hpp" -+#include "runtime/threadLocalStorage.hpp" -+ -+// Map stack pointer (%esp) to thread pointer for faster TLS access -+// -+// Here we use a flat table for better performance. Getting current thread -+// is down to one memory access (read _sp_map[%esp>>12]) in generated code -+// and two in runtime code (-fPIC code needs an extra load for _sp_map). -+// -+// This code assumes stack page is not shared by different threads. It works -+// in 32-bit VM when page size is 4K (or a multiple of 4K, if that matters). -+// -+// Notice that _sp_map is allocated in the bss segment, which is ZFOD -+// (zero-fill-on-demand). While it reserves 4M address space upfront, -+// actual memory pages are committed on demand. -+// -+// If an application creates and destroys a lot of threads, usually the -+// stack space freed by a thread will soon get reused by new thread -+// (this is especially true in NPTL or LinuxThreads in fixed-stack mode). -+// No memory page in _sp_map is wasted. -+// -+// However, it's still possible that we might end up populating & -+// committing a large fraction of the 4M table over time, but the actual -+// amount of live data in the table could be quite small. The max wastage -+// is less than 4M bytes. If it becomes an issue, we could use madvise() -+// with MADV_DONTNEED to reclaim unused (i.e. all-zero) pages in _sp_map. -+// MADV_DONTNEED on Linux keeps the virtual memory mapping, but zaps the -+// physical memory page (i.e. similar to MADV_FREE on Solaris). ++#ifndef OS_CPU_LINUX_LOONGARCH_VM_THREAD_LINUX_LOONGARCH_HPP ++#define OS_CPU_LINUX_LOONGARCH_VM_THREAD_LINUX_LOONGARCH_HPP + -+#ifdef MINIMIZE_RAM_USAGE -+Thread* ThreadLocalStorage::_sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; -+#endif // MINIMIZE_RAM_USAGE ++ private: ++ void pd_initialize(); + -+void ThreadLocalStorage::generate_code_for_get_thread() { -+ // nothing we can do here for user-level thread -+} ++ frame pd_last_frame() { ++ assert(has_last_Java_frame(), "must have last_Java_sp() when suspended"); ++ if (_anchor.last_Java_pc() != NULL) { ++ return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp(), _anchor.last_Java_pc()); ++ } else { ++ // This will pick up pc from sp ++ return frame(_anchor.last_Java_sp(), _anchor.last_Java_fp()); ++ } ++ } + -+void ThreadLocalStorage::pd_init() { -+#ifdef MINIMIZE_RAM_USAGE -+ assert(align_size_down(os::vm_page_size(), PAGE_SIZE) == os::vm_page_size(), -+ "page size must be multiple of PAGE_SIZE"); -+#endif // MINIMIZE_RAM_USAGE -+} + -+void ThreadLocalStorage::pd_set_thread(Thread* thread) { -+ os::thread_local_storage_at_put(ThreadLocalStorage::thread_index(), thread); -+#ifdef MINIMIZE_RAM_USAGE -+ address stack_top = os::current_stack_base(); -+ size_t stack_size = os::current_stack_size(); ++ public: ++ // Mutators are highly dangerous.... ++ intptr_t* last_Java_fp() { return _anchor.last_Java_fp(); } ++ void set_last_Java_fp(intptr_t* fp) { _anchor.set_last_Java_fp(fp); } + -+ for (address p = stack_top - stack_size; p < stack_top; p += PAGE_SIZE) { -+ int index = ((uintptr_t)p >> PAGE_SHIFT) & ((1UL << (SP_BITLENGTH - PAGE_SHIFT)) - 1); -+ assert(thread == NULL || _sp_map[index] == NULL || thread == _sp_map[index], -+ "thread exited without detaching from VM??"); -+ _sp_map[index] = thread; ++ void set_base_of_stack_pointer(intptr_t* base_sp) { + } -+#endif // MINIMIZE_RAM_USAGE -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/threadLS_linux_loongarch.hpp 2023-12-20 09:23:19.868147074 +0800 -@@ -0,0 +1,61 @@ -+/* -+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ + -+#ifndef OS_CPU_LINUX_LOONGARCH_VM_THREADLS_LINUX_LOONGARCH_HPP -+#define OS_CPU_LINUX_LOONGARCH_VM_THREADLS_LINUX_LOONGARCH_HPP -+ -+#ifdef MINIMIZE_RAM_USAGE -+ // Processor dependent parts of ThreadLocalStorage -+ //only the low 2G space for user program in Linux ++ static ByteSize last_Java_fp_offset() { ++ return byte_offset_of(JavaThread, _anchor) + JavaFrameAnchor::last_Java_fp_offset(); ++ } + -+ #define SP_BITLENGTH 34 -+ #define PAGE_SHIFT 14 -+ #define PAGE_SIZE (1UL << PAGE_SHIFT) ++ intptr_t* base_of_stack_pointer() { ++ return NULL; ++ } ++ void record_base_of_stack_pointer() { ++ } + -+ static Thread* _sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; -+ static int _sp_map_low; -+ static int _sp_map_high; -+#endif // MINIMIZE_RAM_USAGE ++ bool pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, ++ bool isInJava); + ++ 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); +public: -+#ifdef MINIMIZE_RAM_USAGE -+ static Thread** sp_map_addr() { return _sp_map; } -+#endif // MINIMIZE_RAM_USAGE + -+ static Thread* thread() { -+#ifdef MINIMIZE_RAM_USAGE -+ /* Thread::thread() can also be optimized in the same way as __get_thread() */ -+ //return (Thread*) os::thread_local_storage_at(thread_index()); -+ uintptr_t sp; -+ uintptr_t mask = (1UL << (SP_BITLENGTH - PAGE_SHIFT)) - 1; -+ -+ __asm__ __volatile__ ("addi.d %0, $r29, 0 " : "=r" (sp)); ++ // These routines are only used on cpu architectures that ++ // have separate register stacks (Itanium). ++ static bool register_stack_overflow() { return false; } ++ static void enable_register_stack_guard() {} ++ static void disable_register_stack_guard() {} + -+ return _sp_map[(sp >> PAGE_SHIFT) & mask]; -+#else -+ return (Thread*) os::thread_local_storage_at(thread_index()); -+#endif // MINIMIZE_RAM_USAGE -+ } -+#endif // OS_CPU_LINUX_LOONGARCH_VM_THREADLS_LINUX_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp 2023-12-20 09:23:19.868147074 +0800 ++#endif // OS_CPU_LINUX_LOONGARCH_VM_THREAD_LINUX_LOONGARCH_HPP +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp b/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp +new file mode 100644 +index 00000000..0097cadc +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/vmStructs_linux_loongarch.hpp @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -108137,9 +109295,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) + +#endif // OS_CPU_LINUX_LOONGARCH_VM_VMSTRUCTS_LINUX_LOONGARCH_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp ---- a/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp b/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp +new file mode 100644 +index 00000000..80a1538d +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_loongarch/vm/vm_version_linux_loongarch.cpp @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. @@ -108170,9 +109330,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#include "runtime/os.hpp" +#include "vm_version_loongarch.hpp" + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp ---- a/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp +new file mode 100644 +index 00000000..4ba53d93 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/assembler_linux_mips.cpp @@ -0,0 +1,111 @@ +/* + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. @@ -108285,9 +109447,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + } +#endif // MINIMIZE_RAM_USAGE +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp +new file mode 100644 +index 00000000..1c7ad605 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/atomic_linux_mips.inline.hpp @@ -0,0 +1,258 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. @@ -108547,9 +109711,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // OS_CPU_LINUX_MIPS_VM_ATOMIC_LINUX_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp +new file mode 100644 +index 00000000..5b5cd10a +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/bytes_linux_mips.inline.hpp @@ -0,0 +1,37 @@ +/* + * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. @@ -108588,9 +109754,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +inline u8 Bytes::swap_u8(u8 x) { return bswap_64(x); } + +#endif // OS_CPU_LINUX_MIPS_VM_BYTES_LINUX_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp +new file mode 100644 +index 00000000..73ac3450 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/copy_linux_mips.inline.hpp @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -108717,9 +109885,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + +#endif // OS_CPU_LINUX_MIPS_VM_COPY_LINUX_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp +new file mode 100644 +index 00000000..f1599ac5 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/globals_linux_mips.hpp @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -108772,10 +109942,12 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +define_pd_global(uintx,HeapBaseMinAddress, 2*G); + +#endif // OS_CPU_LINUX_MIPS_VM_GLOBALS_LINUX_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad b/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad ---- a/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad 2023-12-20 09:23:19.868147074 +0800 -@@ -0,0 +1,50 @@ +diff --git a/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad +new file mode 100644 +index 00000000..5e38996f +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad +@@ -0,0 +1,153 @@ +// +// Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. @@ -108801,7 +109973,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +// +// + -+// AMD64 Linux Architecture Description File ++// mips32/godson2 Linux Architecture Description File + +//----------OS-DEPENDENT ENCODING BLOCK---------------------------------------- +// This block specifies the encoding classes used by the compiler to @@ -108826,10 +109998,146 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +// primary, secondary, and tertiary opcode. Only the opcode sections +// which a particular instruction needs for encoding need to be +// specified. -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad ---- a/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.ad 2023-12-20 09:23:19.868147074 +0800 -@@ -0,0 +1,153 @@ ++encode %{ ++ // Build emit functions for each basic byte or larger field in the intel ++ // encoding scheme (opcode, rm, sib, immediate), and call them from C++ ++ // code in the enc_class source block. Emit functions will live in the ++ // main source block for now. In future, we can generalize this by ++ // adding a syntax that specifies the sizes of fields in an order, ++ // so that the adlc can build the emit functions automagically ++ ++ enc_class linux_breakpoint ++ %{ ++ MacroAssembler* masm = new MacroAssembler(&cbuf); ++ masm->call(CAST_FROM_FN_PTR(address, os::breakpoint), relocInfo::runtime_call_type); ++ %} ++ ++ enc_class call_epilog ++ %{ ++ if (VerifyStackAtCalls) { ++ // Check that stack depth is unchanged: find majik cookie on stack ++ int framesize = ra_->reg2offset_unchecked(OptoReg::add(ra_->_matcher._old_SP,-2)); ++ if(framesize >= 128) { ++ emit_opcode(cbuf, 0x81); // cmp [esp+0],0xbadb1ood ++ emit_d8(cbuf,0xBC); ++ emit_d8(cbuf,0x24); ++ emit_d32(cbuf,framesize); // Find majik cookie from ESP ++ emit_d32(cbuf, 0xbadb100d); ++ } ++ else { ++ emit_opcode(cbuf, 0x81); // cmp [esp+0],0xbadb1ood ++ emit_d8(cbuf,0x7C); ++ emit_d8(cbuf,0x24); ++ emit_d8(cbuf,framesize); // Find majik cookie from ESP ++ emit_d32(cbuf, 0xbadb100d); ++ } ++ // jmp EQ around INT3 ++ // QQQ TODO ++ const int jump_around = 5; // size of call to breakpoint, 1 for CC ++ emit_opcode(cbuf, 0x74); ++ emit_d8(cbuf, jump_around); ++ // QQQ temporary ++ emit_break(cbuf); ++ // Die if stack mismatch ++ // emit_opcode(cbuf,0xCC); ++ } ++ %} ++ ++%} ++ ++// INSTRUCTIONS -- Platform dependent ++ ++//----------OS and Locking Instructions---------------------------------------- ++ ++// This name is KNOWN by the ADLC and cannot be changed. ++// The ADLC forces a 'TypeRawPtr::BOTTOM' output type ++// for this guy. ++instruct tlsLoadP(eAXRegP dst, eFlagsReg cr) %{ ++%{ ++ match(Set dst (ThreadLocal)); ++ effect(DEF dst, KILL cr); ++ ++ format %{ "MOV EAX, Thread::current()" %} ++ ins_encode( linux_tlsencode(dst) ); ++ ins_pipe( ialu_reg_fat ); ++%} ++ ++// Die now ++instruct ShouldNotReachHere() ++%{ ++ match(Halt); ++ ++ // Use the following format syntax ++ format %{ "int3\t# ShouldNotReachHere" %} ++ // QQQ TODO for now call breakpoint ++ // opcode(0xCC); ++ // ins_encode(Opc); ++ ins_encode(linux_breakpoint); ++ ins_pipe(pipe_slow); ++%} ++ ++ ++// Platform dependent source ++ ++source ++%{ ++// emit an interrupt that is caught by the debugger ++void emit_break(CodeBuffer& cbuf) { ++ // Debugger doesn't really catch this but best we can do so far QQQ ++#define __ masm. ++ __ lui(T9, Assembler::split_high((int)os::breakpoint)); ++ __ addiu(T9, T9, Assembler::split_low((int)os::breakpoint)); ++ __ jalr(T9); ++ __ delayed()->nop(); ++} ++ ++void MachBreakpointNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const { ++ emit_break(cbuf); ++} ++ ++uint MachBreakpointNode::size(PhaseRegAlloc* ra_) const { ++ //return 5; ++ return 16; ++} ++ ++%} +diff --git a/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s +new file mode 100644 +index 00000000..f87fbf26 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s +@@ -0,0 +1,25 @@ ++# ++# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. ++# Copyright (c) 2015, 2017, Loongson Technology. All rights reserved. ++# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++# ++# This code is free software; you can redistribute it and/or modify it ++# under the terms of the GNU General Public License version 2 only, as ++# published by the Free Software Foundation. ++# ++# This code is distributed in the hope that it will be useful, but WITHOUT ++# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++# version 2 for more details (a copy is included in the LICENSE file that ++# accompanied this code). ++# ++# You should have received a copy of the GNU General Public License version ++# 2 along with this work; if not, write to the Free Software Foundation, ++# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++# ++# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++# or visit www.oracle.com if you need additional information or have any ++# questions. ++# ++ ++ +diff --git a/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad b/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad +new file mode 100644 +index 00000000..ca4d0947 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/linux_mips_64.ad +@@ -0,0 +1,50 @@ +// +// Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. @@ -108855,7 +110163,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +// +// + -+// mips32/godson2 Linux Architecture Description File ++// AMD64 Linux Architecture Description File + +//----------OS-DEPENDENT ENCODING BLOCK---------------------------------------- +// This block specifies the encoding classes used by the compiler to @@ -108880,141 +110188,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +// primary, secondary, and tertiary opcode. Only the opcode sections +// which a particular instruction needs for encoding need to be +// specified. -+encode %{ -+ // Build emit functions for each basic byte or larger field in the intel -+ // encoding scheme (opcode, rm, sib, immediate), and call them from C++ -+ // code in the enc_class source block. Emit functions will live in the -+ // main source block for now. In future, we can generalize this by -+ // adding a syntax that specifies the sizes of fields in an order, -+ // so that the adlc can build the emit functions automagically -+ -+ enc_class linux_breakpoint -+ %{ -+ MacroAssembler* masm = new MacroAssembler(&cbuf); -+ masm->call(CAST_FROM_FN_PTR(address, os::breakpoint), relocInfo::runtime_call_type); -+ %} -+ -+ enc_class call_epilog -+ %{ -+ if (VerifyStackAtCalls) { -+ // Check that stack depth is unchanged: find majik cookie on stack -+ int framesize = ra_->reg2offset_unchecked(OptoReg::add(ra_->_matcher._old_SP,-2)); -+ if(framesize >= 128) { -+ emit_opcode(cbuf, 0x81); // cmp [esp+0],0xbadb1ood -+ emit_d8(cbuf,0xBC); -+ emit_d8(cbuf,0x24); -+ emit_d32(cbuf,framesize); // Find majik cookie from ESP -+ emit_d32(cbuf, 0xbadb100d); -+ } -+ else { -+ emit_opcode(cbuf, 0x81); // cmp [esp+0],0xbadb1ood -+ emit_d8(cbuf,0x7C); -+ emit_d8(cbuf,0x24); -+ emit_d8(cbuf,framesize); // Find majik cookie from ESP -+ emit_d32(cbuf, 0xbadb100d); -+ } -+ // jmp EQ around INT3 -+ // QQQ TODO -+ const int jump_around = 5; // size of call to breakpoint, 1 for CC -+ emit_opcode(cbuf, 0x74); -+ emit_d8(cbuf, jump_around); -+ // QQQ temporary -+ emit_break(cbuf); -+ // Die if stack mismatch -+ // emit_opcode(cbuf,0xCC); -+ } -+ %} -+ -+%} -+ -+// INSTRUCTIONS -- Platform dependent -+ -+//----------OS and Locking Instructions---------------------------------------- -+ -+// This name is KNOWN by the ADLC and cannot be changed. -+// The ADLC forces a 'TypeRawPtr::BOTTOM' output type -+// for this guy. -+instruct tlsLoadP(eAXRegP dst, eFlagsReg cr) %{ -+%{ -+ match(Set dst (ThreadLocal)); -+ effect(DEF dst, KILL cr); -+ -+ format %{ "MOV EAX, Thread::current()" %} -+ ins_encode( linux_tlsencode(dst) ); -+ ins_pipe( ialu_reg_fat ); -+%} -+ -+// Die now -+instruct ShouldNotReachHere() -+%{ -+ match(Halt); -+ -+ // Use the following format syntax -+ format %{ "int3\t# ShouldNotReachHere" %} -+ // QQQ TODO for now call breakpoint -+ // opcode(0xCC); -+ // ins_encode(Opc); -+ ins_encode(linux_breakpoint); -+ ins_pipe(pipe_slow); -+%} -+ -+ -+// Platform dependent source -+ -+source -+%{ -+// emit an interrupt that is caught by the debugger -+void emit_break(CodeBuffer& cbuf) { -+ // Debugger doesn't really catch this but best we can do so far QQQ -+#define __ masm. -+ __ lui(T9, Assembler::split_high((int)os::breakpoint)); -+ __ addiu(T9, T9, Assembler::split_low((int)os::breakpoint)); -+ __ jalr(T9); -+ __ delayed()->nop(); -+} -+ -+void MachBreakpointNode::emit(CodeBuffer& cbuf, PhaseRegAlloc* ra_) const { -+ emit_break(cbuf); -+} -+ -+uint MachBreakpointNode::size(PhaseRegAlloc* ra_) const { -+ //return 5; -+ return 16; -+} -+ -+%} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s ---- a/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/linux_mips.s 2023-12-20 09:23:19.868147074 +0800 -@@ -0,0 +1,25 @@ -+# -+# Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. -+# Copyright (c) 2015, 2017, Loongson Technology. All rights reserved. -+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+# -+# This code is free software; you can redistribute it and/or modify it -+# under the terms of the GNU General Public License version 2 only, as -+# published by the Free Software Foundation. -+# -+# This code is distributed in the hope that it will be useful, but WITHOUT -+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+# version 2 for more details (a copy is included in the LICENSE file that -+# accompanied this code). -+# -+# You should have received a copy of the GNU General Public License version -+# 2 along with this work; if not, write to the Free Software Foundation, -+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+# -+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+# or visit www.oracle.com if you need additional information or have any -+# questions. -+# -+ -+ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp +new file mode 100644 +index 00000000..c9bc169a +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/orderAccess_linux_mips.inline.hpp @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -109131,9 +110309,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#undef inlasm_sync + +#endif // OS_CPU_LINUX_MIPS_VM_ORDERACCESS_LINUX_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp ---- a/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp +new file mode 100644 +index 00000000..43487dab +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.cpp @@ -0,0 +1,1015 @@ +/* + * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. @@ -110150,9 +111330,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +bool os::is_ActiveCoresMP() { + return UseActiveCoresMP && _initial_active_processor_count == 1; +} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp +new file mode 100644 +index 00000000..c07d0815 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/os_linux_mips.hpp @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. @@ -110193,9 +111375,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + static bool is_ActiveCoresMP(); + +#endif // OS_CPU_LINUX_MIPS_VM_OS_LINUX_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp b/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp +new file mode 100644 +index 00000000..93490345 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/prefetch_linux_mips.inline.hpp @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. @@ -110222,42 +111406,201 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * + */ + -+#ifndef OS_CPU_LINUX_MIPS_VM_PREFETCH_LINUX_MIPS_INLINE_HPP -+#define OS_CPU_LINUX_MIPS_VM_PREFETCH_LINUX_MIPS_INLINE_HPP ++#ifndef OS_CPU_LINUX_MIPS_VM_PREFETCH_LINUX_MIPS_INLINE_HPP ++#define OS_CPU_LINUX_MIPS_VM_PREFETCH_LINUX_MIPS_INLINE_HPP ++ ++ ++inline void Prefetch::read (void *loc, intx interval) { ++ // 'pref' is implemented as NOP in Loongson 3A ++ __asm__ __volatile__ ( ++ " .set push\n" ++ " .set mips32\n" ++ " .set noreorder\n" ++ " pref 0, 0(%[__loc]) \n" ++ " .set pop\n" ++ : [__loc] "=&r"(loc) ++ : ++ : "memory" ++ ); ++} ++ ++inline void Prefetch::write(void *loc, intx interval) { ++ __asm__ __volatile__ ( ++ " .set push\n" ++ " .set mips32\n" ++ " .set noreorder\n" ++ " pref 1, 0(%[__loc]) \n" ++ " .set pop\n" ++ : [__loc] "=&r"(loc) ++ : ++ : "memory" ++ ); ++ ++} ++ ++#endif // OS_CPU_LINUX_MIPS_VM_PREFETCH_LINUX_MIPS_INLINE_HPP +diff --git a/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp +new file mode 100644 +index 00000000..be28a562 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp +@@ -0,0 +1,84 @@ ++/* ++ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#include "precompiled.hpp" ++#include "runtime/thread.inline.hpp" ++#include "runtime/threadLocalStorage.hpp" ++ ++// Map stack pointer (%esp) to thread pointer for faster TLS access ++// ++// Here we use a flat table for better performance. Getting current thread ++// is down to one memory access (read _sp_map[%esp>>12]) in generated code ++// and two in runtime code (-fPIC code needs an extra load for _sp_map). ++// ++// This code assumes stack page is not shared by different threads. It works ++// in 32-bit VM when page size is 4K (or a multiple of 4K, if that matters). ++// ++// Notice that _sp_map is allocated in the bss segment, which is ZFOD ++// (zero-fill-on-demand). While it reserves 4M address space upfront, ++// actual memory pages are committed on demand. ++// ++// If an application creates and destroys a lot of threads, usually the ++// stack space freed by a thread will soon get reused by new thread ++// (this is especially true in NPTL or LinuxThreads in fixed-stack mode). ++// No memory page in _sp_map is wasted. ++// ++// However, it's still possible that we might end up populating & ++// committing a large fraction of the 4M table over time, but the actual ++// amount of live data in the table could be quite small. The max wastage ++// is less than 4M bytes. If it becomes an issue, we could use madvise() ++// with MADV_DONTNEED to reclaim unused (i.e. all-zero) pages in _sp_map. ++// MADV_DONTNEED on Linux keeps the virtual memory mapping, but zaps the ++// physical memory page (i.e. similar to MADV_FREE on Solaris). ++ ++#ifdef MINIMIZE_RAM_USAGE ++Thread* ThreadLocalStorage::_sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; ++#endif // MINIMIZE_RAM_USAGE ++ ++void ThreadLocalStorage::generate_code_for_get_thread() { ++ // nothing we can do here for user-level thread ++} ++ ++void ThreadLocalStorage::pd_init() { ++#ifdef MINIMIZE_RAM_USAGE ++ assert(align_size_down(os::vm_page_size(), PAGE_SIZE) == os::vm_page_size(), ++ "page size must be multiple of PAGE_SIZE"); ++#endif // MINIMIZE_RAM_USAGE ++} ++ ++void ThreadLocalStorage::pd_set_thread(Thread* thread) { ++ os::thread_local_storage_at_put(ThreadLocalStorage::thread_index(), thread); ++#ifdef MINIMIZE_RAM_USAGE ++ address stack_top = os::current_stack_base(); ++ size_t stack_size = os::current_stack_size(); ++ ++ for (address p = stack_top - stack_size; p < stack_top; p += PAGE_SIZE) { ++ int index = ((uintptr_t)p >> PAGE_SHIFT) & ((1UL << (SP_BITLENGTH - PAGE_SHIFT)) - 1); ++ assert(thread == NULL || _sp_map[index] == NULL || thread == _sp_map[index], ++ "thread exited without detaching from VM??"); ++ _sp_map[index] = thread; ++ } ++#endif // MINIMIZE_RAM_USAGE ++} +diff --git a/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp +new file mode 100644 +index 00000000..e595195e +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp +@@ -0,0 +1,61 @@ ++/* ++ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ++ * ++ * This code is free software; you can redistribute it and/or modify it ++ * under the terms of the GNU General Public License version 2 only, as ++ * published by the Free Software Foundation. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef OS_CPU_LINUX_MIPS_VM_THREADLS_LINUX_MIPS_HPP ++#define OS_CPU_LINUX_MIPS_VM_THREADLS_LINUX_MIPS_HPP + ++#ifdef MINIMIZE_RAM_USAGE ++ // Processor dependent parts of ThreadLocalStorage ++ //only the low 2G space for user program in Linux + -+inline void Prefetch::read (void *loc, intx interval) { -+ // 'pref' is implemented as NOP in Loongson 3A -+ __asm__ __volatile__ ( -+ " .set push\n" -+ " .set mips32\n" -+ " .set noreorder\n" -+ " pref 0, 0(%[__loc]) \n" -+ " .set pop\n" -+ : [__loc] "=&r"(loc) -+ : -+ : "memory" -+ ); -+} ++ #define SP_BITLENGTH 34 ++ #define PAGE_SHIFT 14 ++ #define PAGE_SIZE (1UL << PAGE_SHIFT) + -+inline void Prefetch::write(void *loc, intx interval) { -+ __asm__ __volatile__ ( -+ " .set push\n" -+ " .set mips32\n" -+ " .set noreorder\n" -+ " pref 1, 0(%[__loc]) \n" -+ " .set pop\n" -+ : [__loc] "=&r"(loc) -+ : -+ : "memory" -+ ); ++ static Thread* _sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; ++ static int _sp_map_low; ++ static int _sp_map_high; ++#endif // MINIMIZE_RAM_USAGE + -+} ++public: ++#ifdef MINIMIZE_RAM_USAGE ++ static Thread** sp_map_addr() { return _sp_map; } ++#endif // MINIMIZE_RAM_USAGE + -+#endif // OS_CPU_LINUX_MIPS_VM_PREFETCH_LINUX_MIPS_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp ---- a/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp 2023-12-20 09:23:19.868147074 +0800 ++ static Thread* thread() { ++#ifdef MINIMIZE_RAM_USAGE ++ /* Thread::thread() can also be optimized in the same way as __get_thread() */ ++ //return (Thread*) os::thread_local_storage_at(thread_index()); ++ uintptr_t sp; ++ uintptr_t mask = (1UL << (SP_BITLENGTH - PAGE_SHIFT)) - 1; ++ ++ __asm__ __volatile__ ("daddiu %0, $29, 0 " : "=r" (sp)); ++ ++ return _sp_map[(sp >> PAGE_SHIFT) & mask]; ++#else ++ return (Thread*) os::thread_local_storage_at(thread_index()); ++#endif // MINIMIZE_RAM_USAGE ++ } ++#endif // OS_CPU_LINUX_MIPS_VM_THREADLS_LINUX_MIPS_HPP +diff --git a/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp +new file mode 100644 +index 00000000..44f666d6 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.cpp @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. @@ -110358,9 +111701,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + +void JavaThread::cache_global_variables() { } + -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp +new file mode 100644 +index 00000000..cb11c36a +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/thread_linux_mips.hpp @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -110437,162 +111782,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + static void disable_register_stack_guard() {} + +#endif // OS_CPU_LINUX_MIPS_VM_THREAD_LINUX_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp ---- a/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.cpp 2023-12-20 09:23:19.868147074 +0800 -@@ -0,0 +1,84 @@ -+/* -+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#include "precompiled.hpp" -+#include "runtime/thread.inline.hpp" -+#include "runtime/threadLocalStorage.hpp" -+ -+// Map stack pointer (%esp) to thread pointer for faster TLS access -+// -+// Here we use a flat table for better performance. Getting current thread -+// is down to one memory access (read _sp_map[%esp>>12]) in generated code -+// and two in runtime code (-fPIC code needs an extra load for _sp_map). -+// -+// This code assumes stack page is not shared by different threads. It works -+// in 32-bit VM when page size is 4K (or a multiple of 4K, if that matters). -+// -+// Notice that _sp_map is allocated in the bss segment, which is ZFOD -+// (zero-fill-on-demand). While it reserves 4M address space upfront, -+// actual memory pages are committed on demand. -+// -+// If an application creates and destroys a lot of threads, usually the -+// stack space freed by a thread will soon get reused by new thread -+// (this is especially true in NPTL or LinuxThreads in fixed-stack mode). -+// No memory page in _sp_map is wasted. -+// -+// However, it's still possible that we might end up populating & -+// committing a large fraction of the 4M table over time, but the actual -+// amount of live data in the table could be quite small. The max wastage -+// is less than 4M bytes. If it becomes an issue, we could use madvise() -+// with MADV_DONTNEED to reclaim unused (i.e. all-zero) pages in _sp_map. -+// MADV_DONTNEED on Linux keeps the virtual memory mapping, but zaps the -+// physical memory page (i.e. similar to MADV_FREE on Solaris). -+ -+#ifdef MINIMIZE_RAM_USAGE -+Thread* ThreadLocalStorage::_sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; -+#endif // MINIMIZE_RAM_USAGE -+ -+void ThreadLocalStorage::generate_code_for_get_thread() { -+ // nothing we can do here for user-level thread -+} -+ -+void ThreadLocalStorage::pd_init() { -+#ifdef MINIMIZE_RAM_USAGE -+ assert(align_size_down(os::vm_page_size(), PAGE_SIZE) == os::vm_page_size(), -+ "page size must be multiple of PAGE_SIZE"); -+#endif // MINIMIZE_RAM_USAGE -+} -+ -+void ThreadLocalStorage::pd_set_thread(Thread* thread) { -+ os::thread_local_storage_at_put(ThreadLocalStorage::thread_index(), thread); -+#ifdef MINIMIZE_RAM_USAGE -+ address stack_top = os::current_stack_base(); -+ size_t stack_size = os::current_stack_size(); -+ -+ for (address p = stack_top - stack_size; p < stack_top; p += PAGE_SIZE) { -+ int index = ((uintptr_t)p >> PAGE_SHIFT) & ((1UL << (SP_BITLENGTH - PAGE_SHIFT)) - 1); -+ assert(thread == NULL || _sp_map[index] == NULL || thread == _sp_map[index], -+ "thread exited without detaching from VM??"); -+ _sp_map[index] = thread; -+ } -+#endif // MINIMIZE_RAM_USAGE -+} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/threadLS_linux_mips.hpp 2023-12-20 09:23:19.868147074 +0800 -@@ -0,0 +1,61 @@ -+/* -+ * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. -+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -+ * -+ * This code is free software; you can redistribute it and/or modify it -+ * under the terms of the GNU General Public License version 2 only, as -+ * published by the Free Software Foundation. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef OS_CPU_LINUX_MIPS_VM_THREADLS_LINUX_MIPS_HPP -+#define OS_CPU_LINUX_MIPS_VM_THREADLS_LINUX_MIPS_HPP -+ -+#ifdef MINIMIZE_RAM_USAGE -+ // Processor dependent parts of ThreadLocalStorage -+ //only the low 2G space for user program in Linux -+ -+ #define SP_BITLENGTH 34 -+ #define PAGE_SHIFT 14 -+ #define PAGE_SIZE (1UL << PAGE_SHIFT) -+ -+ static Thread* _sp_map[1UL << (SP_BITLENGTH - PAGE_SHIFT)]; -+ static int _sp_map_low; -+ static int _sp_map_high; -+#endif // MINIMIZE_RAM_USAGE -+ -+public: -+#ifdef MINIMIZE_RAM_USAGE -+ static Thread** sp_map_addr() { return _sp_map; } -+#endif // MINIMIZE_RAM_USAGE -+ -+ static Thread* thread() { -+#ifdef MINIMIZE_RAM_USAGE -+ /* Thread::thread() can also be optimized in the same way as __get_thread() */ -+ //return (Thread*) os::thread_local_storage_at(thread_index()); -+ uintptr_t sp; -+ uintptr_t mask = (1UL << (SP_BITLENGTH - PAGE_SHIFT)) - 1; -+ -+ __asm__ __volatile__ ("daddiu %0, $29, 0 " : "=r" (sp)); -+ -+ return _sp_map[(sp >> PAGE_SHIFT) & mask]; -+#else -+ return (Thread*) os::thread_local_storage_at(thread_index()); -+#endif // MINIMIZE_RAM_USAGE -+ } -+#endif // OS_CPU_LINUX_MIPS_VM_THREADLS_LINUX_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp ---- a/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp b/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp +new file mode 100644 +index 00000000..b7454bf0 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/vmStructs_linux_mips.hpp @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. @@ -110649,9 +111843,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#define VM_LONG_CONSTANTS_OS_CPU(declare_constant, declare_preprocessor_constant, declare_c1_constant, declare_c2_constant, declare_c2_preprocessor_constant) + +#endif // OS_CPU_LINUX_MIPS_VM_VMSTRUCTS_LINUX_MIPS_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp ---- a/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp 1970-01-01 08:00:00.000000000 +0800 -+++ b/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp 2023-12-20 09:23:19.868147074 +0800 +diff --git a/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp b/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp +new file mode 100644 +index 00000000..ce697823 +--- /dev/null ++++ b/hotspot/src/os_cpu/linux_mips/vm/vm_version_linux_mips.cpp @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved. @@ -110681,30 +111877,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +#include "precompiled.hpp" +#include "runtime/os.hpp" +#include "vm_version_mips.hpp" -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/tools/hsdis/hsdis.c b/hotspot/src/share/tools/hsdis/hsdis.c ---- a/hotspot/src/share/tools/hsdis/hsdis.c 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/tools/hsdis/hsdis.c 2023-12-20 09:23:19.908146618 +0800 -@@ -493,6 +493,16 @@ - #if defined(LIBARCH_ppc64) || defined(LIBARCH_ppc64le) - res = "powerpc:common64"; - #endif -+#ifdef LIBARCH_mips64 -+#ifdef LOONGSON -+ res = "mips:loongson_3a"; -+#else -+ res = "mips:isa64"; -+#endif -+#endif -+#ifdef LIBARCH_loongarch64 -+ res = "loongarch"; -+#endif - #ifdef LIBARCH_aarch64 - res = "aarch64"; - #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/tools/hsdis/Makefile b/hotspot/src/share/tools/hsdis/Makefile ---- a/hotspot/src/share/tools/hsdis/Makefile 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/tools/hsdis/Makefile 2023-12-20 09:23:19.904813322 +0800 -@@ -105,12 +105,25 @@ +diff --git a/hotspot/src/share/tools/hsdis/Makefile b/hotspot/src/share/tools/hsdis/Makefile +index 0d1b6089..a9754ce2 100644 +--- a/hotspot/src/share/tools/hsdis/Makefile ++++ b/hotspot/src/share/tools/hsdis/Makefile +@@ -105,12 +105,25 @@ CFLAGS/sparc += -m32 endif CFLAGS += $(CFLAGS/$(ARCH)) CFLAGS += -fPIC @@ -110730,9 +111907,31 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp LDFLAGS += -ldl OUTFLAGS += -o $@ else -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/adlc/main.cpp b/hotspot/src/share/vm/adlc/main.cpp ---- a/hotspot/src/share/vm/adlc/main.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/adlc/main.cpp 2023-12-20 09:23:19.908146618 +0800 +diff --git a/hotspot/src/share/tools/hsdis/hsdis.c b/hotspot/src/share/tools/hsdis/hsdis.c +index 4fb49648..f6ef5bea 100644 +--- a/hotspot/src/share/tools/hsdis/hsdis.c ++++ b/hotspot/src/share/tools/hsdis/hsdis.c +@@ -493,6 +493,16 @@ static const char* native_arch_name() { + #if defined(LIBARCH_ppc64) || defined(LIBARCH_ppc64le) + res = "powerpc:common64"; + #endif ++#ifdef LIBARCH_mips64 ++#ifdef LOONGSON ++ res = "mips:loongson_3a"; ++#else ++ res = "mips:isa64"; ++#endif ++#endif ++#ifdef LIBARCH_loongarch64 ++ res = "loongarch"; ++#endif + #ifdef LIBARCH_aarch64 + res = "aarch64"; + #endif +diff --git a/hotspot/src/share/vm/adlc/main.cpp b/hotspot/src/share/vm/adlc/main.cpp +index 52044f12..50c58587 100644 +--- a/hotspot/src/share/vm/adlc/main.cpp ++++ b/hotspot/src/share/vm/adlc/main.cpp @@ -22,6 +22,12 @@ * */ @@ -110746,7 +111945,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // MAIN.CPP - Entry point for the Architecture Description Language Compiler #include "adlc.hpp" -@@ -234,6 +240,14 @@ +@@ -234,6 +240,14 @@ int main(int argc, char *argv[]) AD.addInclude(AD._CPP_file, "nativeInst_x86.hpp"); AD.addInclude(AD._CPP_file, "vmreg_x86.inline.hpp"); #endif @@ -110761,9 +111960,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 AD.addInclude(AD._CPP_file, "assembler_aarch64.inline.hpp"); AD.addInclude(AD._CPP_file, "nativeInst_aarch64.hpp"); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/asm/assembler.hpp b/hotspot/src/share/vm/asm/assembler.hpp ---- a/hotspot/src/share/vm/asm/assembler.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/asm/assembler.hpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/asm/assembler.hpp b/hotspot/src/share/vm/asm/assembler.hpp +index f7f1ae1d..572aa997 100644 +--- a/hotspot/src/share/vm/asm/assembler.hpp ++++ b/hotspot/src/share/vm/asm/assembler.hpp @@ -22,6 +22,12 @@ * */ @@ -110792,7 +111992,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "register_aarch64.hpp" # include "vm_version_aarch64.hpp" -@@ -468,6 +482,12 @@ +@@ -468,6 +482,12 @@ class AbstractAssembler : public ResourceObj { #ifdef TARGET_ARCH_ppc # include "assembler_ppc.hpp" #endif @@ -110805,9 +112005,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif // SHARE_VM_ASM_ASSEMBLER_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/asm/assembler.inline.hpp b/hotspot/src/share/vm/asm/assembler.inline.hpp ---- a/hotspot/src/share/vm/asm/assembler.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/asm/assembler.inline.hpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/asm/assembler.inline.hpp b/hotspot/src/share/vm/asm/assembler.inline.hpp +index 1a48cb31..8ac90e14 100644 +--- a/hotspot/src/share/vm/asm/assembler.inline.hpp ++++ b/hotspot/src/share/vm/asm/assembler.inline.hpp @@ -22,6 +22,12 @@ * */ @@ -110834,9 +112035,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "assembler_aarch64.inline.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp ---- a/hotspot/src/share/vm/asm/codeBuffer.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/asm/codeBuffer.cpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/asm/codeBuffer.cpp b/hotspot/src/share/vm/asm/codeBuffer.cpp +index d94ac406..f6b57811 100644 +--- a/hotspot/src/share/vm/asm/codeBuffer.cpp ++++ b/hotspot/src/share/vm/asm/codeBuffer.cpp @@ -22,6 +22,12 @@ * */ @@ -110850,7 +112052,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "asm/codeBuffer.hpp" #include "compiler/disassembler.hpp" -@@ -323,6 +329,7 @@ +@@ -323,6 +329,7 @@ void CodeSection::relocate(address at, RelocationHolder const& spec, int format) assert(rtype == relocInfo::none || rtype == relocInfo::runtime_call_type || rtype == relocInfo::internal_word_type|| @@ -110858,9 +112060,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp rtype == relocInfo::section_word_type || rtype == relocInfo::external_word_type, "code needs relocation information"); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/asm/codeBuffer.hpp b/hotspot/src/share/vm/asm/codeBuffer.hpp ---- a/hotspot/src/share/vm/asm/codeBuffer.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/asm/codeBuffer.hpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/asm/codeBuffer.hpp b/hotspot/src/share/vm/asm/codeBuffer.hpp +index 02b619ad..c04560a0 100644 +--- a/hotspot/src/share/vm/asm/codeBuffer.hpp ++++ b/hotspot/src/share/vm/asm/codeBuffer.hpp @@ -22,6 +22,12 @@ * */ @@ -110874,7 +112077,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_ASM_CODEBUFFER_HPP #define SHARE_VM_ASM_CODEBUFFER_HPP -@@ -635,6 +641,12 @@ +@@ -635,6 +641,12 @@ class CodeBuffer: public StackObj { #ifdef TARGET_ARCH_ppc # include "codeBuffer_ppc.hpp" #endif @@ -110887,9 +112090,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp }; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/asm/macroAssembler.hpp b/hotspot/src/share/vm/asm/macroAssembler.hpp ---- a/hotspot/src/share/vm/asm/macroAssembler.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/asm/macroAssembler.hpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/asm/macroAssembler.hpp b/hotspot/src/share/vm/asm/macroAssembler.hpp +index 1482eb63..0be415b6 100644 +--- a/hotspot/src/share/vm/asm/macroAssembler.hpp ++++ b/hotspot/src/share/vm/asm/macroAssembler.hpp @@ -22,6 +22,12 @@ * */ @@ -110915,9 +112119,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +# include "macroAssembler_loongarch.hpp" +#endif #endif // SHARE_VM_ASM_MACROASSEMBLER_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/asm/macroAssembler.inline.hpp b/hotspot/src/share/vm/asm/macroAssembler.inline.hpp ---- a/hotspot/src/share/vm/asm/macroAssembler.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/asm/macroAssembler.inline.hpp 2023-12-20 09:23:19.911479913 +0800 +diff --git a/hotspot/src/share/vm/asm/macroAssembler.inline.hpp b/hotspot/src/share/vm/asm/macroAssembler.inline.hpp +index db3daa52..6f4e523c 100644 +--- a/hotspot/src/share/vm/asm/macroAssembler.inline.hpp ++++ b/hotspot/src/share/vm/asm/macroAssembler.inline.hpp @@ -22,6 +22,12 @@ * */ @@ -110944,325 +112149,77 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "macroAssembler_aarch64.inline.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/asm/register.hpp b/hotspot/src/share/vm/asm/register.hpp ---- a/hotspot/src/share/vm/asm/register.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/asm/register.hpp 2023-12-20 09:23:19.911479913 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2020. These -+ * modifications are Copyright (c) 2015, 2020, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #ifndef SHARE_VM_ASM_REGISTER_HPP - #define SHARE_VM_ASM_REGISTER_HPP - -@@ -108,6 +114,12 @@ - #ifdef TARGET_ARCH_ppc - # include "register_ppc.hpp" - #endif -+#ifdef TARGET_ARCH_mips -+# include "register_mips.hpp" -+#endif -+#ifdef TARGET_ARCH_loongarch -+# include "register_loongarch.hpp" -+#endif - #ifdef TARGET_ARCH_aarch64 - # include "register_aarch64.hpp" - #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_Defs.hpp b/hotspot/src/share/vm/c1/c1_Defs.hpp ---- a/hotspot/src/share/vm/c1/c1_Defs.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_Defs.hpp 2023-12-20 09:23:19.911479913 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2022. These -+ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #ifndef SHARE_VM_C1_C1_DEFS_HPP - #define SHARE_VM_C1_C1_DEFS_HPP - -@@ -29,6 +35,9 @@ - #ifdef TARGET_ARCH_x86 - # include "register_x86.hpp" - #endif -+#ifdef TARGET_ARCH_loongarch -+# include "register_loongarch.hpp" -+#endif - #ifdef TARGET_ARCH_aarch64 - # include "register_aarch64.hpp" - #endif -@@ -56,6 +65,9 @@ - #ifdef TARGET_ARCH_x86 - # include "c1_Defs_x86.hpp" - #endif -+#ifdef TARGET_ARCH_loongarch -+# include "c1_Defs_loongarch.hpp" -+#endif - #ifdef TARGET_ARCH_aarch64 - # include "c1_Defs_aarch64.hpp" - #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp b/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp ---- a/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp 2023-12-20 09:23:19.911479913 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2022. These -+ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #ifndef SHARE_VM_C1_C1_FPUSTACKSIM_HPP - #define SHARE_VM_C1_C1_FPUSTACKSIM_HPP - -@@ -35,6 +41,9 @@ - #ifdef TARGET_ARCH_x86 - # include "c1_FpuStackSim_x86.hpp" - #endif -+#ifdef TARGET_ARCH_loongarch -+# include "c1_FpuStackSim_loongarch.hpp" -+#endif - #ifdef TARGET_ARCH_aarch64 - # include "c1_FpuStackSim_aarch64.hpp" - #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_FrameMap.cpp b/hotspot/src/share/vm/c1/c1_FrameMap.cpp ---- a/hotspot/src/share/vm/c1/c1_FrameMap.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp 2023-12-20 09:23:19.911479913 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2022. These -+ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #include "precompiled.hpp" - #include "c1/c1_FrameMap.hpp" - #include "c1/c1_LIR.hpp" -@@ -29,6 +35,9 @@ - #ifdef TARGET_ARCH_x86 - # include "vmreg_x86.inline.hpp" - #endif -+#ifdef TARGET_ARCH_loongarch -+# include "vmreg_loongarch.inline.hpp" -+#endif - #ifdef TARGET_ARCH_aarch64 - # include "vmreg_aarch64.inline.hpp" - #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_FrameMap.hpp b/hotspot/src/share/vm/c1/c1_FrameMap.hpp ---- a/hotspot/src/share/vm/c1/c1_FrameMap.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_FrameMap.hpp 2023-12-20 09:23:19.911479913 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2022. These -+ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #ifndef SHARE_VM_C1_C1_FRAMEMAP_HPP - #define SHARE_VM_C1_C1_FRAMEMAP_HPP - -@@ -85,6 +91,9 @@ - #ifdef TARGET_ARCH_x86 - # include "c1_FrameMap_x86.hpp" - #endif -+#ifdef TARGET_ARCH_loongarch -+# include "c1_FrameMap_loongarch.hpp" -+#endif - #ifdef TARGET_ARCH_aarch64 - # include "c1_FrameMap_aarch64.hpp" - #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_globals.hpp b/hotspot/src/share/vm/c1/c1_globals.hpp ---- a/hotspot/src/share/vm/c1/c1_globals.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_globals.hpp 2023-12-20 09:23:19.921479797 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2022. These -+ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #ifndef SHARE_VM_C1_C1_GLOBALS_HPP - #define SHARE_VM_C1_C1_GLOBALS_HPP - -@@ -29,6 +35,9 @@ - #ifdef TARGET_ARCH_x86 - # include "c1_globals_x86.hpp" - #endif -+#ifdef TARGET_ARCH_loongarch -+# include "c1_globals_loongarch.hpp" -+#endif - #ifdef TARGET_ARCH_aarch64 - # include "c1_globals_aarch64.hpp" - #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp ---- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp 2023-12-20 09:23:19.918146502 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2022. These -+ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #include "precompiled.hpp" - #include "c1/c1_CFGPrinter.hpp" - #include "c1/c1_CodeStubs.hpp" -@@ -35,6 +41,9 @@ - #ifdef TARGET_ARCH_x86 - # include "vmreg_x86.inline.hpp" - #endif -+#ifdef TARGET_ARCH_loongarch -+# include "vmreg_loongarch.inline.hpp" -+#endif - #ifdef TARGET_ARCH_aarch64 - # include "vmreg_aarch64.inline.hpp" - #endif -@@ -1266,6 +1275,23 @@ - } - break; - } -+ case lir_cmp_cmove: { -+ assert(op->as_Op4() != NULL, "lir_cmp_cmove must be LIR_Op4"); -+ LIR_Op4* cmove = (LIR_Op4*)op; -+ -+ LIR_Opr move_from = cmove->in_opr3(); -+ LIR_Opr move_to = cmove->result_opr(); -+ -+ if (move_to->is_register() && move_from->is_register()) { -+ Interval* from = interval_at(reg_num(move_from)); -+ Interval* to = interval_at(reg_num(move_to)); -+ if (from != NULL && to != NULL) { -+ to->set_register_hint(from); -+ TRACE_LINEAR_SCAN(4, tty->print_cr("operation at op_id %d: added hint from interval %d to %d", cmove->id(), from->reg_num(), to->reg_num())); -+ } -+ } -+ break; -+ } - } - } - -@@ -2104,7 +2130,7 @@ - #ifdef _LP64 - return LIR_OprFact::double_cpu(assigned_reg, assigned_reg); - #else --#if defined(SPARC) || defined(PPC) -+#if defined(SPARC) || defined(PPC) || defined(LOONGARCH) - return LIR_OprFact::double_cpu(assigned_regHi, assigned_reg); - #else - return LIR_OprFact::double_cpu(assigned_reg, assigned_regHi); -@@ -3285,7 +3311,9 @@ - check_live = (move->patch_code() == lir_patch_none); - } - LIR_OpBranch* branch = op->as_OpBranch(); -- if (branch != NULL && branch->stub() != NULL && branch->stub()->is_exception_throw_stub()) { -+ LIR_OpCmpBranch* cmp_branch = op->as_OpCmpBranch(); -+ if ((branch != NULL && branch->stub() != NULL && branch->stub()->is_exception_throw_stub()) || -+ (cmp_branch != NULL && cmp_branch->stub() != NULL && cmp_branch->stub()->is_exception_throw_stub())) { - // Don't bother checking the stub in this case since the - // exception stub will never return to normal control flow. - check_live = false; -@@ -6148,6 +6176,16 @@ - if (branch->ublock() == target_from) { - branch->change_ublock(target_to); - } -+ } else if (op->code() == lir_cmp_branch || op->code() == lir_cmp_float_branch) { -+ assert(op->as_OpCmpBranch() != NULL, "branch must be of type LIR_OpCmpBranch"); -+ LIR_OpCmpBranch* branch = (LIR_OpCmpBranch*)op; -+ -+ if (branch->block() == target_from) { -+ branch->change_block(target_to); -+ } -+ if (branch->ublock() == target_from) { -+ branch->change_ublock(target_to); -+ } - } - } - } -@@ -6252,6 +6290,20 @@ - instructions->truncate(instructions->length() - 1); - } - } -+ } else if (prev_op->code() == lir_cmp_branch || prev_op->code() == lir_cmp_float_branch) { -+ assert(prev_op->as_OpCmpBranch() != NULL, "branch must be of type LIR_OpCmpBranch"); -+ LIR_OpCmpBranch* prev_branch = (LIR_OpCmpBranch*)prev_op; -+ -+ if (prev_branch->stub() == NULL) { -+ if (prev_branch->block() == code->at(i + 1) && prev_branch->info() == NULL) { -+ TRACE_LINEAR_SCAN(3, tty->print_cr("Negating conditional branch and deleting unconditional branch at end of block B%d", block->block_id())); -+ -+ // eliminate a conditional branch to the immediate successor -+ prev_branch->change_block(last_branch->block()); -+ prev_branch->negate_cond(); -+ instructions->trunc_to(instructions->length() - 1); -+ } -+ } - } - } - } -@@ -6328,6 +6380,13 @@ - assert(op_branch->block() == NULL || code->index_of(op_branch->block()) != -1, "branch target not valid"); - assert(op_branch->ublock() == NULL || code->index_of(op_branch->ublock()) != -1, "branch target not valid"); - } -+ -+ LIR_OpCmpBranch* op_cmp_branch = instructions->at(j)->as_OpCmpBranch(); -+ -+ if (op_cmp_branch != NULL) { -+ assert(op_cmp_branch->block() == NULL || code->find(op_cmp_branch->block()) != -1, "branch target not valid"); -+ assert(op_cmp_branch->ublock() == NULL || code->find(op_cmp_branch->ublock()) != -1, "branch target not valid"); -+ } - } - - for (j = 0; j < block->number_of_sux() - 1; j++) { -@@ -6571,6 +6630,24 @@ - break; - } - -+ case lir_cmp_branch: -+ case lir_cmp_float_branch: { -+ LIR_OpCmpBranch* branch = op->as_OpCmpBranch(); -+ if (branch->block() == NULL) { -+ inc_counter(counter_stub_branch); -+ } else { -+ inc_counter(counter_cond_branch); -+ } -+ inc_counter(counter_cmp); -+ break; -+ } +diff --git a/hotspot/src/share/vm/asm/register.hpp b/hotspot/src/share/vm/asm/register.hpp +index c5008901..6a20929e 100644 +--- a/hotspot/src/share/vm/asm/register.hpp ++++ b/hotspot/src/share/vm/asm/register.hpp +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2020. These ++ * modifications are Copyright (c) 2015, 2020, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ + -+ case lir_cmp_cmove: { -+ inc_counter(counter_misc_inst); -+ inc_counter(counter_cmp); -+ break; -+ } + #ifndef SHARE_VM_ASM_REGISTER_HPP + #define SHARE_VM_ASM_REGISTER_HPP + +@@ -108,6 +114,12 @@ const type name = ((type)name##_##type##EnumValue) + #ifdef TARGET_ARCH_ppc + # include "register_ppc.hpp" + #endif ++#ifdef TARGET_ARCH_mips ++# include "register_mips.hpp" ++#endif ++#ifdef TARGET_ARCH_loongarch ++# include "register_loongarch.hpp" ++#endif + #ifdef TARGET_ARCH_aarch64 + # include "register_aarch64.hpp" + #endif +diff --git a/hotspot/src/share/vm/c1/c1_Defs.hpp b/hotspot/src/share/vm/c1/c1_Defs.hpp +index b0cd7637..b42b9de1 100644 +--- a/hotspot/src/share/vm/c1/c1_Defs.hpp ++++ b/hotspot/src/share/vm/c1/c1_Defs.hpp +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2022. These ++ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ + - case lir_neg: - case lir_add: - case lir_sub: -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_LinearScan.hpp b/hotspot/src/share/vm/c1/c1_LinearScan.hpp ---- a/hotspot/src/share/vm/c1/c1_LinearScan.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_LinearScan.hpp 2023-12-20 09:23:19.918146502 +0800 + #ifndef SHARE_VM_C1_C1_DEFS_HPP + #define SHARE_VM_C1_C1_DEFS_HPP + +@@ -29,6 +35,9 @@ + #ifdef TARGET_ARCH_x86 + # include "register_x86.hpp" + #endif ++#ifdef TARGET_ARCH_loongarch ++# include "register_loongarch.hpp" ++#endif + #ifdef TARGET_ARCH_aarch64 + # include "register_aarch64.hpp" + #endif +@@ -56,6 +65,9 @@ enum { + #ifdef TARGET_ARCH_x86 + # include "c1_Defs_x86.hpp" + #endif ++#ifdef TARGET_ARCH_loongarch ++# include "c1_Defs_loongarch.hpp" ++#endif + #ifdef TARGET_ARCH_aarch64 + # include "c1_Defs_aarch64.hpp" + #endif +diff --git a/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp b/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp +index f07e97a4..6bc367a8 100644 +--- a/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp ++++ b/hotspot/src/share/vm/c1/c1_FpuStackSim.hpp @@ -22,6 +22,12 @@ * */ @@ -111273,22 +112230,23 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * available on the same license terms set forth above. + */ + - #ifndef SHARE_VM_C1_C1_LINEARSCAN_HPP - #define SHARE_VM_C1_C1_LINEARSCAN_HPP + #ifndef SHARE_VM_C1_C1_FPUSTACKSIM_HPP + #define SHARE_VM_C1_C1_FPUSTACKSIM_HPP -@@ -976,6 +982,9 @@ +@@ -35,6 +41,9 @@ class FpuStackSim; #ifdef TARGET_ARCH_x86 - # include "c1_LinearScan_x86.hpp" + # include "c1_FpuStackSim_x86.hpp" #endif +#ifdef TARGET_ARCH_loongarch -+# include "c1_LinearScan_loongarch.hpp" ++# include "c1_FpuStackSim_loongarch.hpp" +#endif #ifdef TARGET_ARCH_aarch64 - # include "c1_LinearScan_aarch64.hpp" + # include "c1_FpuStackSim_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp ---- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp 2023-12-20 09:23:19.914813209 +0800 +diff --git a/hotspot/src/share/vm/c1/c1_FrameMap.cpp b/hotspot/src/share/vm/c1/c1_FrameMap.cpp +index 1dac94d5..b1e37ec4 100644 +--- a/hotspot/src/share/vm/c1/c1_FrameMap.cpp ++++ b/hotspot/src/share/vm/c1/c1_FrameMap.cpp @@ -22,6 +22,12 @@ * */ @@ -111300,41 +112258,22 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + */ + #include "precompiled.hpp" - #include "c1/c1_Compilation.hpp" - #include "c1/c1_Instruction.hpp" -@@ -34,6 +40,10 @@ - # include "nativeInst_x86.hpp" + #include "c1/c1_FrameMap.hpp" + #include "c1/c1_LIR.hpp" +@@ -29,6 +35,9 @@ + #ifdef TARGET_ARCH_x86 # include "vmreg_x86.inline.hpp" #endif +#ifdef TARGET_ARCH_loongarch -+# include "nativeInst_loongarch.hpp" +# include "vmreg_loongarch.inline.hpp" +#endif #ifdef TARGET_ARCH_aarch64 - # include "nativeInst_aarch64.hpp" # include "vmreg_aarch64.inline.hpp" -@@ -811,6 +821,18 @@ - } - - -+void LIR_Assembler::emit_op4(LIR_Op4* op) { -+ switch (op->code()) { -+ case lir_cmp_cmove: -+ cmp_cmove(op->condition(), op->in_opr1(), op->in_opr2(), op->in_opr3(), op->in_opr4(), op->result_opr(), op->type()); -+ break; -+ -+ default: -+ Unimplemented(); -+ break; -+ } -+} -+ - void LIR_Assembler::build_frame() { - _masm->build_frame(initial_frame_size_in_bytes(), bang_size_in_bytes()); - } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp ---- a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp 2023-12-20 09:23:19.914813209 +0800 + #endif +diff --git a/hotspot/src/share/vm/c1/c1_FrameMap.hpp b/hotspot/src/share/vm/c1/c1_FrameMap.hpp +index 41571e3d..c0e7b28e 100644 +--- a/hotspot/src/share/vm/c1/c1_FrameMap.hpp ++++ b/hotspot/src/share/vm/c1/c1_FrameMap.hpp @@ -22,6 +22,12 @@ * */ @@ -111345,40 +112284,23 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * available on the same license terms set forth above. + */ + - #ifndef SHARE_VM_C1_C1_LIRASSEMBLER_HPP - #define SHARE_VM_C1_C1_LIRASSEMBLER_HPP - -@@ -195,7 +201,9 @@ - void emit_op1(LIR_Op1* op); - void emit_op2(LIR_Op2* op); - void emit_op3(LIR_Op3* op); -+ void emit_op4(LIR_Op4* op); - void emit_opBranch(LIR_OpBranch* op); -+ void emit_opCmpBranch(LIR_OpCmpBranch* op); - void emit_opLabel(LIR_OpLabel* op); - void emit_arraycopy(LIR_OpArrayCopy* op); - void emit_updatecrc32(LIR_OpUpdateCRC32* op); -@@ -227,6 +235,7 @@ - void volatile_move_op(LIR_Opr src, LIR_Opr result, BasicType type, CodeEmitInfo* info); - void comp_mem_op(LIR_Opr src, LIR_Opr result, BasicType type, CodeEmitInfo* info); // info set for null exceptions - void comp_fl2i(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr result, LIR_Op2* op); -+ void cmp_cmove(LIR_Condition code, LIR_Opr left, LIR_Opr right, LIR_Opr src1, LIR_Opr src2, LIR_Opr result, BasicType type); - void cmove(LIR_Condition code, LIR_Opr left, LIR_Opr right, LIR_Opr result, BasicType type); + #ifndef SHARE_VM_C1_C1_FRAMEMAP_HPP + #define SHARE_VM_C1_C1_FRAMEMAP_HPP - void call( LIR_OpJavaCall* op, relocInfo::relocType rtype); -@@ -265,6 +274,9 @@ +@@ -85,6 +91,9 @@ class FrameMap : public CompilationResourceObj { #ifdef TARGET_ARCH_x86 - # include "c1_LIRAssembler_x86.hpp" + # include "c1_FrameMap_x86.hpp" #endif +#ifdef TARGET_ARCH_loongarch -+# include "c1_LIRAssembler_loongarch.hpp" ++# include "c1_FrameMap_loongarch.hpp" +#endif #ifdef TARGET_ARCH_aarch64 - # include "c1_LIRAssembler_aarch64.hpp" + # include "c1_FrameMap_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp ---- a/hotspot/src/share/vm/c1/c1_LIR.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_LIR.cpp 2023-12-20 09:23:19.914813209 +0800 +diff --git a/hotspot/src/share/vm/c1/c1_LIR.cpp b/hotspot/src/share/vm/c1/c1_LIR.cpp +index fa37e7a0..5d33d3f7 100644 +--- a/hotspot/src/share/vm/c1/c1_LIR.cpp ++++ b/hotspot/src/share/vm/c1/c1_LIR.cpp @@ -22,6 +22,12 @@ * */ @@ -111392,7 +112314,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "c1/c1_InstructionPrinter.hpp" #include "c1/c1_LIR.hpp" -@@ -79,6 +85,17 @@ +@@ -79,6 +85,17 @@ FloatRegister LIR_OprDesc::as_double_reg() const { #endif @@ -111410,7 +112332,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp LIR_Opr LIR_OprFact::illegalOpr = LIR_OprFact::illegal(); -@@ -149,13 +166,19 @@ +@@ -149,13 +166,19 @@ void LIR_Address::verify0() const { #endif #ifdef _LP64 assert(base()->is_cpu_register(), "wrong base operand"); @@ -111431,7 +112353,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #else assert(base()->is_single_cpu(), "wrong base operand"); assert(index()->is_illegal() || index()->is_single_cpu(), "wrong index operand"); -@@ -258,8 +281,6 @@ +@@ -258,8 +281,6 @@ bool LIR_OprDesc::is_oop() const { } } @@ -111440,7 +112362,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_Op2::verify() const { #ifdef ASSERT switch (code()) { -@@ -301,6 +322,18 @@ +@@ -301,6 +322,18 @@ void LIR_Op2::verify() const { #endif } @@ -111459,7 +112381,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp LIR_OpBranch::LIR_OpBranch(LIR_Condition cond, BasicType type, BlockBegin* block) : LIR_Op(lir_branch, LIR_OprFact::illegalOpr, (CodeEmitInfo*)NULL) -@@ -358,6 +391,55 @@ +@@ -358,6 +391,55 @@ void LIR_OpBranch::negate_cond() { } } @@ -111515,7 +112437,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp LIR_OpTypeCheck::LIR_OpTypeCheck(LIR_Code code, LIR_Opr result, LIR_Opr object, ciKlass* klass, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, -@@ -560,10 +642,7 @@ +@@ -560,10 +642,7 @@ void LIR_OpVisitState::visit(LIR_Op* op) { assert(opConvert->_info == NULL, "must be"); if (opConvert->_opr->is_valid()) do_input(opConvert->_opr); if (opConvert->_result->is_valid()) do_output(opConvert->_result); @@ -111527,7 +112449,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp do_stub(opConvert->_stub); break; -@@ -661,6 +740,25 @@ +@@ -661,6 +740,25 @@ void LIR_OpVisitState::visit(LIR_Op* op) { break; } @@ -111553,7 +112475,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // special handling for cmove: right input operand must not be equal // to the result operand, otherwise the backend fails case lir_cmove: -@@ -806,6 +904,29 @@ +@@ -806,6 +904,29 @@ void LIR_OpVisitState::visit(LIR_Op* op) { break; } @@ -111583,7 +112505,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // LIR_OpJavaCall case lir_static_call: -@@ -1121,6 +1242,13 @@ +@@ -1121,6 +1242,13 @@ void LIR_Op2::emit_code(LIR_Assembler* masm) { masm->emit_op2(this); } @@ -111597,7 +112519,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_OpAllocArray::emit_code(LIR_Assembler* masm) { masm->emit_alloc_array(this); masm->append_code_stub(stub()); -@@ -1141,6 +1269,10 @@ +@@ -1141,6 +1269,10 @@ void LIR_Op3::emit_code(LIR_Assembler* masm) { masm->emit_op3(this); } @@ -111608,7 +112530,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_OpLock::emit_code(LIR_Assembler* masm) { masm->emit_lock(this); if (stub()) { -@@ -1381,7 +1513,6 @@ +@@ -1381,7 +1513,6 @@ void LIR_List::cmp_mem_int(LIR_Condition condition, LIR_Opr base, int disp, int info)); } @@ -111616,7 +112538,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_List::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Address* addr, CodeEmitInfo* info) { append(new LIR_Op2( lir_cmp, -@@ -1391,6 +1522,17 @@ +@@ -1391,6 +1522,17 @@ void LIR_List::cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Address* ad info)); } @@ -111634,7 +112556,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_List::allocate_object(LIR_Opr dst, LIR_Opr t1, LIR_Opr t2, LIR_Opr t3, LIR_Opr t4, int header_size, int object_size, LIR_Opr klass, bool init_check, CodeStub* stub) { append(new LIR_OpAllocObj( -@@ -1520,18 +1662,6 @@ +@@ -1520,18 +1662,6 @@ void LIR_List::store_check(LIR_Opr object, LIR_Opr array, LIR_Opr tmp1, LIR_Opr append(c); } @@ -111653,7 +112575,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_List::cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, LIR_Opr t1, LIR_Opr t2, LIR_Opr result) { append(new LIR_OpCompareAndSwap(lir_cas_long, addr, cmp_value, new_value, t1, t2, result)); -@@ -1780,6 +1910,8 @@ +@@ -1780,6 +1910,8 @@ const char * LIR_Op::name() const { case lir_cmp_l2i: s = "cmp_l2i"; break; case lir_ucmp_fd2i: s = "ucomp_fd2i"; break; case lir_cmp_fd2i: s = "comp_fd2i"; break; @@ -111662,7 +112584,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp case lir_cmove: s = "cmove"; break; case lir_add: s = "add"; break; case lir_sub: s = "sub"; break; -@@ -1809,6 +1941,8 @@ +@@ -1809,6 +1941,8 @@ const char * LIR_Op::name() const { // LIR_Op3 case lir_idiv: s = "idiv"; break; case lir_irem: s = "irem"; break; @@ -111671,7 +112593,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // LIR_OpJavaCall case lir_static_call: s = "static"; break; case lir_optvirtual_call: s = "optvirtual"; break; -@@ -1960,6 +2094,26 @@ +@@ -1960,6 +2094,26 @@ void LIR_OpBranch::print_instr(outputStream* out) const { } } @@ -111698,7 +112620,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void LIR_Op::print_condition(outputStream* out, LIR_Condition cond) { switch(cond) { case lir_cond_equal: out->print("[EQ]"); break; -@@ -1980,12 +2134,9 @@ +@@ -1980,12 +2134,9 @@ void LIR_OpConvert::print_instr(outputStream* out) const { print_bytecode(out, bytecode()); in_opr()->print(out); out->print(" "); result_opr()->print(out); out->print(" "); @@ -111713,7 +112635,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } void LIR_OpConvert::print_bytecode(outputStream* out, Bytecodes::Code code) { -@@ -2031,9 +2182,6 @@ +@@ -2031,9 +2182,6 @@ void LIR_OpRoundFP::print_instr(outputStream* out) const { // LIR_Op2 void LIR_Op2::print_instr(outputStream* out) const { @@ -111723,7 +112645,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp in_opr1()->print(out); out->print(" "); in_opr2()->print(out); out->print(" "); if (tmp1_opr()->is_valid()) { tmp1_opr()->print(out); out->print(" "); } -@@ -2082,6 +2230,18 @@ +@@ -2082,6 +2230,18 @@ void LIR_Op3::print_instr(outputStream* out) const { result_opr()->print(out); } @@ -111740,26 +112662,468 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp +} + - void LIR_OpLock::print_instr(outputStream* out) const { - hdr_opr()->print(out); out->print(" "); -@@ -2095,10 +2255,14 @@ + void LIR_OpLock::print_instr(outputStream* out) const { + hdr_opr()->print(out); out->print(" "); +@@ -2095,10 +2255,14 @@ void LIR_OpLock::print_instr(outputStream* out) const { + + #ifdef ASSERT + void LIR_OpAssert::print_instr(outputStream* out) const { ++ tty->print_cr("function LIR_OpAssert::print_instr unimplemented yet! "); ++ Unimplemented(); ++ /* + print_condition(out, condition()); out->print(" "); + in_opr1()->print(out); out->print(" "); + in_opr2()->print(out); out->print(", \""); + out->print("%s", msg()); out->print("\""); ++ */ + } + #endif + +diff --git a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp +index 24b86202..aec77afe 100644 +--- a/hotspot/src/share/vm/c1/c1_LIR.hpp ++++ b/hotspot/src/share/vm/c1/c1_LIR.hpp +@@ -22,6 +22,11 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2022. These ++ * modifications are Copyright (c) 2018, 2022, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ + #ifndef SHARE_VM_C1_C1_LIR_HPP + #define SHARE_VM_C1_C1_LIR_HPP + +@@ -452,7 +457,7 @@ class LIR_OprDesc: public CompilationResourceObj { + // for compatibility with RInfo + int fpu () const { return lo_reg_half(); } + #endif +-#if defined(SPARC) || defined(ARM) || defined(PPC) || defined(AARCH64) ++#if defined(SPARC) || defined(ARM) || defined(PPC) || defined(AARCH64) || defined(LOONGARCH) + FloatRegister as_float_reg () const; + FloatRegister as_double_reg () const; + #endif +@@ -542,7 +547,7 @@ class LIR_Address: public LIR_OprPtr { + , _type(type) + , _disp(0) { verify(); } + +-#if defined(X86) || defined(ARM) || defined(AARCH64) ++#if defined(X86) || defined(ARM) || defined(AARCH64) || defined(LOONGARCH) + LIR_Address(LIR_Opr base, LIR_Opr index, Scale scale, intx disp, BasicType type): + _base(base) + , _index(index) +@@ -658,7 +663,13 @@ class LIR_OprFact: public AllStatic { + LIR_OprDesc::double_type | + LIR_OprDesc::cpu_register | + LIR_OprDesc::double_size); } +-#endif // PPC ++#elif defined(LOONGARCH) ++ static LIR_Opr double_fpu(int reg) { return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | ++ (reg << LIR_OprDesc::reg2_shift) | ++ LIR_OprDesc::double_type | ++ LIR_OprDesc::fpu_register | ++ LIR_OprDesc::double_size); } ++#endif // LOONGARCH + + static LIR_Opr virtual_register(int index, BasicType type) { + LIR_Opr res; +@@ -872,9 +883,11 @@ class LIR_OpConvert; + class LIR_OpAllocObj; + class LIR_OpRoundFP; + class LIR_Op2; ++class LIR_OpCmpBranch; + class LIR_OpDelay; + class LIR_Op3; + class LIR_OpAllocArray; ++class LIR_Op4; + class LIR_OpCall; + class LIR_OpJavaCall; + class LIR_OpRTCall; +@@ -943,6 +956,8 @@ enum LIR_Code { + , lir_cmp_l2i + , lir_ucmp_fd2i + , lir_cmp_fd2i ++ , lir_cmp_branch ++ , lir_cmp_float_branch + , lir_cmove + , lir_add + , lir_sub +@@ -976,6 +991,9 @@ enum LIR_Code { + , lir_idiv + , lir_irem + , end_op3 ++ , begin_op4 ++ , lir_cmp_cmove ++ , end_op4 + , begin_opJavaCall + , lir_static_call + , lir_optvirtual_call +@@ -1139,12 +1157,14 @@ class LIR_Op: public CompilationResourceObj { + virtual LIR_OpAllocObj* as_OpAllocObj() { return NULL; } + virtual LIR_OpRoundFP* as_OpRoundFP() { return NULL; } + virtual LIR_OpBranch* as_OpBranch() { return NULL; } ++ virtual LIR_OpCmpBranch* as_OpCmpBranch() { return NULL; } + virtual LIR_OpRTCall* as_OpRTCall() { return NULL; } + virtual LIR_OpConvert* as_OpConvert() { return NULL; } + virtual LIR_Op0* as_Op0() { return NULL; } + virtual LIR_Op1* as_Op1() { return NULL; } + virtual LIR_Op2* as_Op2() { return NULL; } + virtual LIR_Op3* as_Op3() { return NULL; } ++ virtual LIR_Op4* as_Op4() { return NULL; } + virtual LIR_OpArrayCopy* as_OpArrayCopy() { return NULL; } + virtual LIR_OpUpdateCRC32* as_OpUpdateCRC32() { return NULL; } + virtual LIR_OpTypeCheck* as_OpTypeCheck() { return NULL; } +@@ -1474,37 +1494,18 @@ class LIR_OpConvert: public LIR_Op1 { + private: + Bytecodes::Code _bytecode; + ConversionStub* _stub; +-#if defined(PPC) || defined(AARCH64) +- LIR_Opr _tmp1; +- LIR_Opr _tmp2; +-#endif ++ LIR_Opr _tmp; + + public: +- LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub) ++ LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub, LIR_Opr tmp) + : LIR_Op1(lir_convert, opr, result) + , _stub(stub) +-#ifdef PPC +- , _tmp1(LIR_OprDesc::illegalOpr()) +- , _tmp2(LIR_OprDesc::illegalOpr()) +-#endif ++ , _tmp(tmp) + , _bytecode(code) {} + +-#if defined(PPC) || defined(AARCH64) +- LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub +- ,LIR_Opr tmp1, LIR_Opr tmp2) +- : LIR_Op1(lir_convert, opr, result) +- , _stub(stub) +- , _tmp1(tmp1) +- , _tmp2(tmp2) +- , _bytecode(code) {} +-#endif +- + Bytecodes::Code bytecode() const { return _bytecode; } + ConversionStub* stub() const { return _stub; } +-#if defined(PPC) || defined(AARCH64) +- LIR_Opr tmp1() const { return _tmp1; } +- LIR_Opr tmp2() const { return _tmp2; } +-#endif ++ LIR_Opr tmp() const { return _tmp; } + + virtual void emit_code(LIR_Assembler* masm); + virtual LIR_OpConvert* as_OpConvert() { return this; } +@@ -1659,7 +1660,7 @@ class LIR_Op2: public LIR_Op { + , _tmp3(LIR_OprFact::illegalOpr) + , _tmp4(LIR_OprFact::illegalOpr) + , _tmp5(LIR_OprFact::illegalOpr) { +- assert(code == lir_cmp || code == lir_assert, "code check"); ++ assert(code == lir_cmp || code == lir_cmp_branch || code == lir_cmp_float_branch || code == lir_assert, "code check"); + } + + LIR_Op2(LIR_Code code, LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) +@@ -1691,7 +1692,7 @@ class LIR_Op2: public LIR_Op { + , _tmp3(LIR_OprFact::illegalOpr) + , _tmp4(LIR_OprFact::illegalOpr) + , _tmp5(LIR_OprFact::illegalOpr) { +- assert(code != lir_cmp && is_in_range(code, begin_op2, end_op2), "code check"); ++ assert((code != lir_cmp && code != lir_cmp_branch && code != lir_cmp_float_branch) && is_in_range(code, begin_op2, end_op2), "code check"); + } + + LIR_Op2(LIR_Code code, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, LIR_Opr tmp1, LIR_Opr tmp2 = LIR_OprFact::illegalOpr, +@@ -1707,7 +1708,7 @@ class LIR_Op2: public LIR_Op { + , _tmp3(tmp3) + , _tmp4(tmp4) + , _tmp5(tmp5) { +- assert(code != lir_cmp && is_in_range(code, begin_op2, end_op2), "code check"); ++ assert((code != lir_cmp && code != lir_cmp_branch && code != lir_cmp_float_branch) && is_in_range(code, begin_op2, end_op2), "code check"); + } + + LIR_Opr in_opr1() const { return _opr1; } +@@ -1719,10 +1720,12 @@ class LIR_Op2: public LIR_Op { + LIR_Opr tmp4_opr() const { return _tmp4; } + LIR_Opr tmp5_opr() const { return _tmp5; } + LIR_Condition condition() const { +- assert(code() == lir_cmp || code() == lir_cmove || code() == lir_assert, "only valid for cmp and cmove and assert"); return _condition; ++ assert(code() == lir_cmp || code() == lir_cmp_branch || code() == lir_cmp_float_branch || code() == lir_cmove || code() == lir_assert, "only valid for cmp and cmove and assert"); ++ return _condition; + } + void set_condition(LIR_Condition condition) { +- assert(code() == lir_cmp || code() == lir_cmove, "only valid for cmp and cmove"); _condition = condition; ++ assert(code() == lir_cmp || code() == lir_cmp_branch || code() == lir_cmp_float_branch || code() == lir_cmove, "only valid for cmp and cmove"); ++ _condition = condition; + } + + void set_fpu_stack_size(int size) { _fpu_stack_size = size; } +@@ -1736,6 +1739,43 @@ class LIR_Op2: public LIR_Op { + virtual void print_instr(outputStream* out) const PRODUCT_RETURN; + }; + ++class LIR_OpCmpBranch: public LIR_Op2 { ++ friend class LIR_OpVisitState; ++ ++ private: ++ Label* _label; ++ BlockBegin* _block; // if this is a branch to a block, this is the block ++ BlockBegin* _ublock; // if this is a float-branch, this is the unorderd block ++ CodeStub* _stub; // if this is a branch to a stub, this is the stub ++ ++ public: ++ LIR_OpCmpBranch(LIR_Condition cond, LIR_Opr left, LIR_Opr right, Label* lbl, CodeEmitInfo* info = NULL) ++ : LIR_Op2(lir_cmp_branch, cond, left, right, info) ++ , _label(lbl) ++ , _block(NULL) ++ , _ublock(NULL) ++ , _stub(NULL) { } ++ ++ LIR_OpCmpBranch(LIR_Condition cond, LIR_Opr left, LIR_Opr right, CodeStub* stub, CodeEmitInfo* info = NULL); ++ LIR_OpCmpBranch(LIR_Condition cond, LIR_Opr left, LIR_Opr right, BlockBegin* block, CodeEmitInfo* info = NULL); ++ ++ // for unordered comparisons ++ LIR_OpCmpBranch(LIR_Condition cond, LIR_Opr left, LIR_Opr right, BlockBegin* block, BlockBegin* ublock, CodeEmitInfo* info = NULL); ++ ++ Label* label() const { return _label; } ++ BlockBegin* block() const { return _block; } ++ BlockBegin* ublock() const { return _ublock; } ++ CodeStub* stub() const { return _stub; } ++ ++ void change_block(BlockBegin* b); ++ void change_ublock(BlockBegin* b); ++ void negate_cond(); ++ ++ virtual void emit_code(LIR_Assembler* masm); ++ virtual LIR_OpCmpBranch* as_OpCmpBranch() { return this; } ++ virtual void print_instr(outputStream* out) const PRODUCT_RETURN; ++}; ++ + class LIR_OpAllocArray : public LIR_Op { + friend class LIR_OpVisitState; + +@@ -1776,7 +1816,6 @@ class LIR_OpAllocArray : public LIR_Op { + virtual void print_instr(outputStream* out) const PRODUCT_RETURN; + }; + +- + class LIR_Op3: public LIR_Op { + friend class LIR_OpVisitState; + +@@ -1800,6 +1839,48 @@ class LIR_Op3: public LIR_Op { + }; + + ++class LIR_Op4: public LIR_Op { ++ friend class LIR_OpVisitState; ++ ++ private: ++ LIR_Opr _opr1; ++ LIR_Opr _opr2; ++ LIR_Opr _opr3; ++ LIR_Opr _opr4; ++ BasicType _type; ++ LIR_Condition _condition; ++ ++ void verify() const; ++ ++ public: ++ LIR_Op4(LIR_Code code, LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr opr3, LIR_Opr opr4, LIR_Opr result, BasicType type) ++ : LIR_Op(code, result, NULL) ++ , _opr1(opr1) ++ , _opr2(opr2) ++ , _opr3(opr3) ++ , _opr4(opr4) ++ , _type(type) ++ , _condition(condition) { ++ assert(is_in_range(code, begin_op4, end_op4), "code check"); ++ assert(type != T_ILLEGAL, "cmove should have type"); ++ } ++ LIR_Opr in_opr1() const { return _opr1; } ++ LIR_Opr in_opr2() const { return _opr2; } ++ LIR_Opr in_opr3() const { return _opr3; } ++ LIR_Opr in_opr4() const { return _opr4; } ++ BasicType type() const { return _type; } ++ LIR_Condition condition() const { ++ assert(code() == lir_cmp_cmove, "only valid for cmp cmove"); return _condition; ++ } ++ void set_condition(LIR_Condition condition) { ++ assert(code() == lir_cmp_cmove, "only valid for cmp cmove"); _condition = condition; ++ } ++ ++ virtual void emit_code(LIR_Assembler* masm); ++ virtual LIR_Op4* as_Op4() { return this; } ++ virtual void print_instr(outputStream* out) const PRODUCT_RETURN; ++}; ++ + //-------------------------------- + class LabelObj: public CompilationResourceObj { + private: +@@ -2141,17 +2222,9 @@ class LIR_List: public CompilationResourceObj { + + void safepoint(LIR_Opr tmp, CodeEmitInfo* info) { append(new LIR_Op1(lir_safepoint, tmp, info)); } + +-#ifdef PPC +- void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_OpConvert(code, left, dst, NULL, tmp1, tmp2)); } +-#endif +-#if defined(AARCH64) +- void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, +- ConversionStub* stub = NULL, LIR_Opr tmp1 = LIR_OprDesc::illegalOpr()) { +- append(new LIR_OpConvert(code, left, dst, stub, tmp1, LIR_OprDesc::illegalOpr())); ++ void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, ConversionStub* stub = NULL, LIR_Opr tmp = LIR_OprFact::illegalOpr) { ++ append(new LIR_OpConvert(code, left, dst, stub, tmp)); + } +-#else +- void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, ConversionStub* stub = NULL/*, bool is_32bit = false*/) { append(new LIR_OpConvert(code, left, dst, stub)); } +-#endif + + void logical_and (LIR_Opr left, LIR_Opr right, LIR_Opr dst) { append(new LIR_Op2(lir_logic_and, left, right, dst)); } + void logical_or (LIR_Opr left, LIR_Opr right, LIR_Opr dst) { append(new LIR_Op2(lir_logic_or, left, right, dst)); } +@@ -2256,6 +2329,48 @@ class LIR_List: public CompilationResourceObj { + append(new LIR_OpBranch(cond, type, block, unordered)); + } + ++#if defined(X86) || defined(AARCH64) ++ ++ template ++ void cmp_branch(LIR_Condition condition, LIR_Opr left, LIR_Opr right, BasicType type, T tgt, CodeEmitInfo* info = NULL) { ++ cmp(condition, left, right, info); ++ branch(condition, type, tgt); ++ } ++ ++ void cmp_branch(LIR_Condition condition, LIR_Opr left, LIR_Opr right, BasicType type, BlockBegin* block, BlockBegin* unordered) { ++ cmp(condition, left, right); ++ branch(condition, type, block, unordered); ++ } ++ ++ void cmp_cmove(LIR_Condition condition, LIR_Opr left, LIR_Opr right, LIR_Opr src1, LIR_Opr src2, LIR_Opr dst, BasicType type) { ++ cmp(condition, left, right); ++ cmove(condition, src1, src2, dst, type); ++ } ++ ++#endif ++ ++#ifdef LOONGARCH ++ ++ template ++ void cmp_branch(LIR_Condition condition, LIR_Opr left, LIR_Opr right, BasicType type, T tgt, CodeEmitInfo* info = NULL) { ++ append(new LIR_OpCmpBranch(condition, left, right, tgt, info)); ++ } ++ ++ void cmp_branch(LIR_Condition condition, LIR_Opr left, LIR_Opr right, BasicType type, BlockBegin* block, BlockBegin* unordered) { ++ append(new LIR_OpCmpBranch(condition, left, right, block, unordered)); ++ } ++ ++ void cmp_cmove(LIR_Condition condition, LIR_Opr left, LIR_Opr right, LIR_Opr src1, LIR_Opr src2, LIR_Opr dst, BasicType type) { ++ append(new LIR_Op4(lir_cmp_cmove, condition, left, right, src1, src2, dst, type)); ++ } ++ ++#endif ++ ++ template ++ void cmp_branch(LIR_Condition condition, LIR_Opr left, int right, BasicType type, T tgt, CodeEmitInfo* info = NULL) { ++ cmp_branch(condition, left, LIR_OprFact::intConst(right), type, tgt, info); ++ } ++ + void shift_left(LIR_Opr value, LIR_Opr count, LIR_Opr dst, LIR_Opr tmp); + void shift_right(LIR_Opr value, LIR_Opr count, LIR_Opr dst, LIR_Opr tmp); + void unsigned_shift_right(LIR_Opr value, LIR_Opr count, LIR_Opr dst, LIR_Opr tmp); +diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp +index e5cd19f1..a18c5300 100644 +--- a/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp ++++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.cpp +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2022. These ++ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ ++ + #include "precompiled.hpp" + #include "c1/c1_Compilation.hpp" + #include "c1/c1_Instruction.hpp" +@@ -34,6 +40,10 @@ + # include "nativeInst_x86.hpp" + # include "vmreg_x86.inline.hpp" + #endif ++#ifdef TARGET_ARCH_loongarch ++# include "nativeInst_loongarch.hpp" ++# include "vmreg_loongarch.inline.hpp" ++#endif + #ifdef TARGET_ARCH_aarch64 + # include "nativeInst_aarch64.hpp" + # include "vmreg_aarch64.inline.hpp" +@@ -811,6 +821,18 @@ void LIR_Assembler::emit_op2(LIR_Op2* op) { + } + + ++void LIR_Assembler::emit_op4(LIR_Op4* op) { ++ switch (op->code()) { ++ case lir_cmp_cmove: ++ cmp_cmove(op->condition(), op->in_opr1(), op->in_opr2(), op->in_opr3(), op->in_opr4(), op->result_opr(), op->type()); ++ break; ++ ++ default: ++ Unimplemented(); ++ break; ++ } ++} ++ + void LIR_Assembler::build_frame() { + _masm->build_frame(initial_frame_size_in_bytes(), bang_size_in_bytes()); + } +diff --git a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp +index 1a68d458..ac0f4e7a 100644 +--- a/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp ++++ b/hotspot/src/share/vm/c1/c1_LIRAssembler.hpp +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2022. These ++ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ ++ + #ifndef SHARE_VM_C1_C1_LIRASSEMBLER_HPP + #define SHARE_VM_C1_C1_LIRASSEMBLER_HPP - #ifdef ASSERT - void LIR_OpAssert::print_instr(outputStream* out) const { -+ tty->print_cr("function LIR_OpAssert::print_instr unimplemented yet! "); -+ Unimplemented(); -+ /* - print_condition(out, condition()); out->print(" "); - in_opr1()->print(out); out->print(" "); - in_opr2()->print(out); out->print(", \""); - out->print("%s", msg()); out->print("\""); -+ */ - } - #endif +@@ -195,7 +201,9 @@ class LIR_Assembler: public CompilationResourceObj { + void emit_op1(LIR_Op1* op); + void emit_op2(LIR_Op2* op); + void emit_op3(LIR_Op3* op); ++ void emit_op4(LIR_Op4* op); + void emit_opBranch(LIR_OpBranch* op); ++ void emit_opCmpBranch(LIR_OpCmpBranch* op); + void emit_opLabel(LIR_OpLabel* op); + void emit_arraycopy(LIR_OpArrayCopy* op); + void emit_updatecrc32(LIR_OpUpdateCRC32* op); +@@ -227,6 +235,7 @@ class LIR_Assembler: public CompilationResourceObj { + void volatile_move_op(LIR_Opr src, LIR_Opr result, BasicType type, CodeEmitInfo* info); + void comp_mem_op(LIR_Opr src, LIR_Opr result, BasicType type, CodeEmitInfo* info); // info set for null exceptions + void comp_fl2i(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr result, LIR_Op2* op); ++ void cmp_cmove(LIR_Condition code, LIR_Opr left, LIR_Opr right, LIR_Opr src1, LIR_Opr src2, LIR_Opr result, BasicType type); + void cmove(LIR_Condition code, LIR_Opr left, LIR_Opr right, LIR_Opr result, BasicType type); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp ---- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp 2024-01-30 13:54:24.796042252 +0800 + void call( LIR_OpJavaCall* op, relocInfo::relocType rtype); +@@ -265,6 +274,9 @@ class LIR_Assembler: public CompilationResourceObj { + #ifdef TARGET_ARCH_x86 + # include "c1_LIRAssembler_x86.hpp" + #endif ++#ifdef TARGET_ARCH_loongarch ++# include "c1_LIRAssembler_loongarch.hpp" ++#endif + #ifdef TARGET_ARCH_aarch64 + # include "c1_LIRAssembler_aarch64.hpp" + #endif +diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +index e98834d0..d1a987c6 100644 +--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp ++++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -22,6 +22,12 @@ * */ @@ -111773,26 +113137,25 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "c1/c1_Defs.hpp" #include "c1/c1_Compilation.hpp" -@@ -483,13 +489,11 @@ +@@ -483,13 +489,11 @@ void LIRGenerator::array_range_check(LIR_Opr array, LIR_Opr index, CodeEmitInfo* null_check_info, CodeEmitInfo* range_check_info) { CodeStub* stub = new RangeCheckStub(range_check_info, index); if (index->is_constant()) { - cmp_mem_int(lir_cond_belowEqual, array, arrayOopDesc::length_offset_in_bytes(), - index->as_jint(), null_check_info); - __ branch(lir_cond_belowEqual, T_INT, stub); // forward branch -- } else { ++ cmp_mem_int_branch(lir_cond_belowEqual, array, arrayOopDesc::length_offset_in_bytes(), ++ index->as_jint(), stub, null_check_info); // forward branch + } else { - cmp_reg_mem(lir_cond_aboveEqual, index, array, - arrayOopDesc::length_offset_in_bytes(), T_INT, null_check_info); - __ branch(lir_cond_aboveEqual, T_INT, stub); // forward branch -+ cmp_mem_int_branch(lir_cond_belowEqual, array, arrayOopDesc::length_offset_in_bytes(), -+ index->as_jint(), stub, null_check_info); // forward branch -+ } else { + cmp_reg_mem_branch(lir_cond_aboveEqual, index, array, arrayOopDesc::length_offset_in_bytes(), + T_INT, stub, null_check_info); // forward branch } } -@@ -497,12 +501,10 @@ +@@ -497,12 +501,10 @@ void LIRGenerator::array_range_check(LIR_Opr array, LIR_Opr index, void LIRGenerator::nio_range_check(LIR_Opr buffer, LIR_Opr index, LIR_Opr result, CodeEmitInfo* info) { CodeStub* stub = new RangeCheckStub(info, index, true); if (index->is_constant()) { @@ -111808,7 +113171,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } __ move(index, result); } -@@ -935,7 +937,7 @@ +@@ -935,7 +937,7 @@ LIR_Opr LIRGenerator::force_to_spill(LIR_Opr value, BasicType t) { return tmp; } @@ -111817,7 +113180,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp if (if_instr->should_profile()) { ciMethod* method = if_instr->profiled_method(); assert(method != NULL, "method should be set if branch is profiled"); -@@ -956,10 +958,17 @@ +@@ -956,10 +958,17 @@ void LIRGenerator::profile_branch(If* if_instr, If::Condition cond) { __ metadata2reg(md->constant_encoding(), md_reg); LIR_Opr data_offset_reg = new_pointer_register(); @@ -111839,7 +113202,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // MDO cells are intptr_t, so the data_reg width is arch-dependent. LIR_Opr data_reg = new_pointer_register(); -@@ -1306,8 +1315,8 @@ +@@ -1306,8 +1315,8 @@ void LIRGenerator::do_isPrimitive(Intrinsic* x) { } __ move(new LIR_Address(rcvr.result(), java_lang_Class::klass_offset_in_bytes(), T_ADDRESS), temp, info); @@ -111850,7 +113213,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } // Example: Thread.currentThread() -@@ -1500,7 +1509,6 @@ +@@ -1500,7 +1509,6 @@ void LIRGenerator::G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, LIR_Opr p // Read the marking-in-progress flag. LIR_Opr flag_val = new_register(T_INT); __ load(mark_active_flag_addr, flag_val); @@ -111858,7 +113221,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp LIR_PatchCode pre_val_patch_code = lir_patch_none; -@@ -1529,7 +1537,7 @@ +@@ -1529,7 +1537,7 @@ void LIRGenerator::G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, LIR_Opr p slow = new G1PreBarrierStub(pre_val); } @@ -111867,7 +113230,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ branch_destination(slow->continuation()); } -@@ -1587,10 +1595,8 @@ +@@ -1587,10 +1595,8 @@ void LIRGenerator::G1SATBCardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_Opr } assert(new_val->is_register(), "must be a register at this point"); @@ -111879,7 +113242,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ branch_destination(slow->continuation()); } -@@ -1860,12 +1866,10 @@ +@@ -1860,12 +1866,10 @@ void LIRGenerator::do_NIOCheckIndex(Intrinsic* x) { CodeEmitInfo* info = state_for(x); CodeStub* stub = new RangeCheckStub(info, index.result(), true); if (index.result()->is_constant()) { @@ -111895,7 +113258,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } __ move(index.result(), result); } else { -@@ -1946,8 +1950,8 @@ +@@ -1946,8 +1950,8 @@ void LIRGenerator::do_LoadIndexed(LoadIndexed* x) { } else if (use_length) { // TODO: use a (modified) version of array_range_check that does not require a // constant length to be loaded to a register @@ -111906,7 +113269,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } else { array_range_check(array.result(), index.result(), null_check_info, range_check_info); // The range check performs the null check, so clear it out for the load -@@ -2129,7 +2133,7 @@ +@@ -2129,7 +2133,7 @@ void LIRGenerator::do_UnsafeGetRaw(UnsafeGetRaw* x) { assert(index_op->type() == T_INT, "only int constants supported"); addr = new LIR_Address(base_op, index_op->as_jint(), dst_type); } else { @@ -111915,7 +113278,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp addr = new LIR_Address(base_op, index_op, LIR_Address::Scale(log2_scale), 0, dst_type); #elif defined(GENERATE_ADDRESS_IS_PREFERRED) addr = generate_address(base_op, index_op, log2_scale, 0, dst_type); -@@ -2344,19 +2348,18 @@ +@@ -2344,19 +2348,18 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) { if (off.type()->is_int()) { referent_off = LIR_OprFact::intConst(java_lang_ref_Reference::referent_offset); @@ -111938,7 +113301,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } LIR_Opr src_klass = new_register(T_METADATA); if (gen_type_check) { -@@ -2366,8 +2369,7 @@ +@@ -2366,8 +2369,7 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) { LIR_Address* reference_type_addr = new LIR_Address(src_klass, in_bytes(InstanceKlass::reference_type_offset()), T_BYTE); LIR_Opr reference_type = new_register(T_INT); __ move(reference_type_addr, reference_type); @@ -111948,7 +113311,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } { // We have determined that src->_klass->_reference_type != REF_NONE -@@ -2447,19 +2449,14 @@ +@@ -2447,19 +2449,14 @@ void LIRGenerator::do_SwitchRanges(SwitchRangeArray* x, LIR_Opr value, BlockBegi int high_key = one_range->high_key(); BlockBegin* dest = one_range->sux(); if (low_key == high_key) { @@ -111973,7 +113336,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ branch_destination(L->label()); } } -@@ -2546,8 +2543,7 @@ +@@ -2546,8 +2543,7 @@ void LIRGenerator::do_TableSwitch(TableSwitch* x) { do_SwitchRanges(create_lookup_ranges(x), value, x->default_sux()); } else { for (int i = 0; i < len; i++) { @@ -111983,7 +113346,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } __ jump(x->default_sux()); } -@@ -2572,8 +2568,7 @@ +@@ -2572,8 +2568,7 @@ void LIRGenerator::do_LookupSwitch(LookupSwitch* x) { } else { int len = x->length(); for (int i = 0; i < len; i++) { @@ -111993,7 +113356,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } __ jump(x->default_sux()); } -@@ -2625,7 +2620,6 @@ +@@ -2625,7 +2620,6 @@ void LIRGenerator::do_Goto(Goto* x) { } LIR_Opr md_reg = new_register(T_METADATA); __ metadata2reg(md->constant_encoding(), md_reg); @@ -112001,7 +113364,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp increment_counter(new LIR_Address(md_reg, offset, NOT_LP64(T_INT) LP64_ONLY(T_LONG)), DataLayout::counter_increment); } -@@ -3079,8 +3073,8 @@ +@@ -3079,8 +3073,8 @@ void LIRGenerator::do_IfOp(IfOp* x) { f_val.dont_load_item(); LIR_Opr reg = rlock_result(x); @@ -112012,7 +113375,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } #ifdef JFR_HAVE_INTRINSICS -@@ -3120,8 +3114,7 @@ +@@ -3120,8 +3114,7 @@ void LIRGenerator::do_getEventWriter(Intrinsic* x) { T_OBJECT); LIR_Opr result = rlock_result(x); __ move_wide(jobj_addr, result); @@ -112022,7 +113385,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ move_wide(new LIR_Address(result, T_OBJECT), result); __ branch_destination(L_end->label()); -@@ -3485,10 +3478,9 @@ +@@ -3485,10 +3478,9 @@ void LIRGenerator::increment_event_counter_impl(CodeEmitInfo* info, LIR_Opr meth = new_register(T_METADATA); __ metadata2reg(method->constant_encoding(), meth); __ logical_and(result, mask, result); @@ -112034,7 +113397,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp __ branch_destination(overflow->continuation()); } } -@@ -3600,8 +3592,7 @@ +@@ -3600,8 +3592,7 @@ void LIRGenerator::do_RangeCheckPredicate(RangeCheckPredicate *x) { CodeEmitInfo *info = state_for(x, x->state()); CodeStub* stub = new PredicateFailedStub(info); @@ -112044,7 +113407,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } } -@@ -3749,8 +3740,7 @@ +@@ -3749,8 +3740,7 @@ LIR_Opr LIRGenerator::maybe_mask_boolean(StoreIndexed* x, LIR_Opr array, LIR_Opr __ move(new LIR_Address(klass, in_bytes(Klass::layout_helper_offset()), T_INT), layout); int diffbit = Klass::layout_helper_boolean_diffbit(); __ logical_and(layout, LIR_OprFact::intConst(diffbit), layout); @@ -112054,9 +113417,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp value = value_fixed; } return value; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp ---- a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp 2023-12-20 09:23:19.918146502 +0800 +diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp +index 27be79fe..57c253db 100644 +--- a/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp ++++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.hpp @@ -22,6 +22,12 @@ * */ @@ -112070,7 +113434,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_C1_C1_LIRGENERATOR_HPP #define SHARE_VM_C1_C1_LIRGENERATOR_HPP -@@ -246,6 +252,9 @@ +@@ -246,6 +252,9 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { void do_getClass(Intrinsic* x); void do_currentThread(Intrinsic* x); void do_MathIntrinsic(Intrinsic* x); @@ -112080,7 +113444,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void do_ArrayCopy(Intrinsic* x); void do_CompareAndSwap(Intrinsic* x, ValueType* type); void do_NIOCheckIndex(Intrinsic* x); -@@ -335,8 +344,10 @@ +@@ -335,8 +344,10 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { void new_instance (LIR_Opr dst, ciInstanceKlass* klass, bool is_unresolved, LIR_Opr scratch1, LIR_Opr scratch2, LIR_Opr scratch3, LIR_Opr scratch4, LIR_Opr klass_reg, CodeEmitInfo* info); // machine dependent @@ -112093,7 +113457,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void cmp_reg_mem(LIR_Condition condition, LIR_Opr reg, LIR_Opr base, LIR_Opr disp, BasicType type, CodeEmitInfo* info); void arraycopy_helper(Intrinsic* x, int* flags, ciArrayKlass** expected_type); -@@ -364,7 +375,7 @@ +@@ -364,7 +375,7 @@ class LIRGenerator: public InstructionVisitor, public BlockClosure { LIR_Opr safepoint_poll_register(); @@ -112102,357 +113466,185 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void increment_event_counter_impl(CodeEmitInfo* info, ciMethod *method, int frequency, int bci, bool backedge, bool notify); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_LIR.hpp b/hotspot/src/share/vm/c1/c1_LIR.hpp ---- a/hotspot/src/share/vm/c1/c1_LIR.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_LIR.hpp 2023-12-20 09:23:19.914813209 +0800 -@@ -22,6 +22,11 @@ +diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.cpp b/hotspot/src/share/vm/c1/c1_LinearScan.cpp +index 1f6281bf..4549ff09 100644 +--- a/hotspot/src/share/vm/c1/c1_LinearScan.cpp ++++ b/hotspot/src/share/vm/c1/c1_LinearScan.cpp +@@ -22,6 +22,12 @@ * */ +/* + * This file has been modified by Loongson Technology in 2022. These -+ * modifications are Copyright (c) 2018, 2022, Loongson Technology, and are made ++ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made + * available on the same license terms set forth above. + */ - #ifndef SHARE_VM_C1_C1_LIR_HPP - #define SHARE_VM_C1_C1_LIR_HPP - -@@ -452,7 +457,7 @@ - // for compatibility with RInfo - int fpu () const { return lo_reg_half(); } ++ + #include "precompiled.hpp" + #include "c1/c1_CFGPrinter.hpp" + #include "c1/c1_CodeStubs.hpp" +@@ -35,6 +41,9 @@ + #ifdef TARGET_ARCH_x86 + # include "vmreg_x86.inline.hpp" #endif --#if defined(SPARC) || defined(ARM) || defined(PPC) || defined(AARCH64) -+#if defined(SPARC) || defined(ARM) || defined(PPC) || defined(AARCH64) || defined(LOONGARCH) - FloatRegister as_float_reg () const; - FloatRegister as_double_reg () const; ++#ifdef TARGET_ARCH_loongarch ++# include "vmreg_loongarch.inline.hpp" ++#endif + #ifdef TARGET_ARCH_aarch64 + # include "vmreg_aarch64.inline.hpp" #endif -@@ -542,7 +547,7 @@ - , _type(type) - , _disp(0) { verify(); } - --#if defined(X86) || defined(ARM) || defined(AARCH64) -+#if defined(X86) || defined(ARM) || defined(AARCH64) || defined(LOONGARCH) - LIR_Address(LIR_Opr base, LIR_Opr index, Scale scale, intx disp, BasicType type): - _base(base) - , _index(index) -@@ -658,7 +663,13 @@ - LIR_OprDesc::double_type | - LIR_OprDesc::cpu_register | - LIR_OprDesc::double_size); } --#endif // PPC -+#elif defined(LOONGARCH) -+ static LIR_Opr double_fpu(int reg) { return (LIR_Opr)(intptr_t)((reg << LIR_OprDesc::reg1_shift) | -+ (reg << LIR_OprDesc::reg2_shift) | -+ LIR_OprDesc::double_type | -+ LIR_OprDesc::fpu_register | -+ LIR_OprDesc::double_size); } -+#endif // LOONGARCH - - static LIR_Opr virtual_register(int index, BasicType type) { - LIR_Opr res; -@@ -872,9 +883,11 @@ - class LIR_OpAllocObj; - class LIR_OpRoundFP; - class LIR_Op2; -+class LIR_OpCmpBranch; - class LIR_OpDelay; - class LIR_Op3; - class LIR_OpAllocArray; -+class LIR_Op4; - class LIR_OpCall; - class LIR_OpJavaCall; - class LIR_OpRTCall; -@@ -943,6 +956,8 @@ - , lir_cmp_l2i - , lir_ucmp_fd2i - , lir_cmp_fd2i -+ , lir_cmp_branch -+ , lir_cmp_float_branch - , lir_cmove - , lir_add - , lir_sub -@@ -976,6 +991,9 @@ - , lir_idiv - , lir_irem - , end_op3 -+ , begin_op4 -+ , lir_cmp_cmove -+ , end_op4 - , begin_opJavaCall - , lir_static_call - , lir_optvirtual_call -@@ -1139,12 +1157,14 @@ - virtual LIR_OpAllocObj* as_OpAllocObj() { return NULL; } - virtual LIR_OpRoundFP* as_OpRoundFP() { return NULL; } - virtual LIR_OpBranch* as_OpBranch() { return NULL; } -+ virtual LIR_OpCmpBranch* as_OpCmpBranch() { return NULL; } - virtual LIR_OpRTCall* as_OpRTCall() { return NULL; } - virtual LIR_OpConvert* as_OpConvert() { return NULL; } - virtual LIR_Op0* as_Op0() { return NULL; } - virtual LIR_Op1* as_Op1() { return NULL; } - virtual LIR_Op2* as_Op2() { return NULL; } - virtual LIR_Op3* as_Op3() { return NULL; } -+ virtual LIR_Op4* as_Op4() { return NULL; } - virtual LIR_OpArrayCopy* as_OpArrayCopy() { return NULL; } - virtual LIR_OpUpdateCRC32* as_OpUpdateCRC32() { return NULL; } - virtual LIR_OpTypeCheck* as_OpTypeCheck() { return NULL; } -@@ -1474,37 +1494,18 @@ - private: - Bytecodes::Code _bytecode; - ConversionStub* _stub; --#if defined(PPC) || defined(AARCH64) -- LIR_Opr _tmp1; -- LIR_Opr _tmp2; --#endif -+ LIR_Opr _tmp; - - public: -- LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub) -+ LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub, LIR_Opr tmp) - : LIR_Op1(lir_convert, opr, result) - , _stub(stub) --#ifdef PPC -- , _tmp1(LIR_OprDesc::illegalOpr()) -- , _tmp2(LIR_OprDesc::illegalOpr()) --#endif -+ , _tmp(tmp) - , _bytecode(code) {} - --#if defined(PPC) || defined(AARCH64) -- LIR_OpConvert(Bytecodes::Code code, LIR_Opr opr, LIR_Opr result, ConversionStub* stub -- ,LIR_Opr tmp1, LIR_Opr tmp2) -- : LIR_Op1(lir_convert, opr, result) -- , _stub(stub) -- , _tmp1(tmp1) -- , _tmp2(tmp2) -- , _bytecode(code) {} --#endif -- - Bytecodes::Code bytecode() const { return _bytecode; } - ConversionStub* stub() const { return _stub; } --#if defined(PPC) || defined(AARCH64) -- LIR_Opr tmp1() const { return _tmp1; } -- LIR_Opr tmp2() const { return _tmp2; } --#endif -+ LIR_Opr tmp() const { return _tmp; } - - virtual void emit_code(LIR_Assembler* masm); - virtual LIR_OpConvert* as_OpConvert() { return this; } -@@ -1659,7 +1660,7 @@ - , _tmp3(LIR_OprFact::illegalOpr) - , _tmp4(LIR_OprFact::illegalOpr) - , _tmp5(LIR_OprFact::illegalOpr) { -- assert(code == lir_cmp || code == lir_assert, "code check"); -+ assert(code == lir_cmp || code == lir_cmp_branch || code == lir_cmp_float_branch || code == lir_assert, "code check"); - } - - LIR_Op2(LIR_Code code, LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, BasicType type) -@@ -1691,7 +1692,7 @@ - , _tmp3(LIR_OprFact::illegalOpr) - , _tmp4(LIR_OprFact::illegalOpr) - , _tmp5(LIR_OprFact::illegalOpr) { -- assert(code != lir_cmp && is_in_range(code, begin_op2, end_op2), "code check"); -+ assert((code != lir_cmp && code != lir_cmp_branch && code != lir_cmp_float_branch) && is_in_range(code, begin_op2, end_op2), "code check"); - } - - LIR_Op2(LIR_Code code, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr result, LIR_Opr tmp1, LIR_Opr tmp2 = LIR_OprFact::illegalOpr, -@@ -1707,7 +1708,7 @@ - , _tmp3(tmp3) - , _tmp4(tmp4) - , _tmp5(tmp5) { -- assert(code != lir_cmp && is_in_range(code, begin_op2, end_op2), "code check"); -+ assert((code != lir_cmp && code != lir_cmp_branch && code != lir_cmp_float_branch) && is_in_range(code, begin_op2, end_op2), "code check"); - } - - LIR_Opr in_opr1() const { return _opr1; } -@@ -1719,10 +1720,12 @@ - LIR_Opr tmp4_opr() const { return _tmp4; } - LIR_Opr tmp5_opr() const { return _tmp5; } - LIR_Condition condition() const { -- assert(code() == lir_cmp || code() == lir_cmove || code() == lir_assert, "only valid for cmp and cmove and assert"); return _condition; -+ assert(code() == lir_cmp || code() == lir_cmp_branch || code() == lir_cmp_float_branch || code() == lir_cmove || code() == lir_assert, "only valid for cmp and cmove and assert"); -+ return _condition; - } - void set_condition(LIR_Condition condition) { -- assert(code() == lir_cmp || code() == lir_cmove, "only valid for cmp and cmove"); _condition = condition; -+ assert(code() == lir_cmp || code() == lir_cmp_branch || code() == lir_cmp_float_branch || code() == lir_cmove, "only valid for cmp and cmove"); -+ _condition = condition; - } - - void set_fpu_stack_size(int size) { _fpu_stack_size = size; } -@@ -1736,6 +1739,43 @@ - virtual void print_instr(outputStream* out) const PRODUCT_RETURN; - }; +@@ -1256,6 +1265,23 @@ void LinearScan::add_register_hints(LIR_Op* op) { + LIR_Opr move_from = cmove->in_opr1(); + LIR_Opr move_to = cmove->result_opr(); -+class LIR_OpCmpBranch: public LIR_Op2 { -+ friend class LIR_OpVisitState; -+ -+ private: -+ Label* _label; -+ BlockBegin* _block; // if this is a branch to a block, this is the block -+ BlockBegin* _ublock; // if this is a float-branch, this is the unorderd block -+ CodeStub* _stub; // if this is a branch to a stub, this is the stub -+ -+ public: -+ LIR_OpCmpBranch(LIR_Condition cond, LIR_Opr left, LIR_Opr right, Label* lbl, CodeEmitInfo* info = NULL) -+ : LIR_Op2(lir_cmp_branch, cond, left, right, info) -+ , _label(lbl) -+ , _block(NULL) -+ , _ublock(NULL) -+ , _stub(NULL) { } -+ -+ LIR_OpCmpBranch(LIR_Condition cond, LIR_Opr left, LIR_Opr right, CodeStub* stub, CodeEmitInfo* info = NULL); -+ LIR_OpCmpBranch(LIR_Condition cond, LIR_Opr left, LIR_Opr right, BlockBegin* block, CodeEmitInfo* info = NULL); -+ -+ // for unordered comparisons -+ LIR_OpCmpBranch(LIR_Condition cond, LIR_Opr left, LIR_Opr right, BlockBegin* block, BlockBegin* ublock, CodeEmitInfo* info = NULL); -+ -+ Label* label() const { return _label; } -+ BlockBegin* block() const { return _block; } -+ BlockBegin* ublock() const { return _ublock; } -+ CodeStub* stub() const { return _stub; } -+ -+ void change_block(BlockBegin* b); -+ void change_ublock(BlockBegin* b); -+ void negate_cond(); ++ if (move_to->is_register() && move_from->is_register()) { ++ Interval* from = interval_at(reg_num(move_from)); ++ Interval* to = interval_at(reg_num(move_to)); ++ if (from != NULL && to != NULL) { ++ to->set_register_hint(from); ++ TRACE_LINEAR_SCAN(4, tty->print_cr("operation at op_id %d: added hint from interval %d to %d", cmove->id(), from->reg_num(), to->reg_num())); ++ } ++ } ++ break; ++ } ++ case lir_cmp_cmove: { ++ assert(op->as_Op4() != NULL, "lir_cmp_cmove must be LIR_Op4"); ++ LIR_Op4* cmove = (LIR_Op4*)op; + -+ virtual void emit_code(LIR_Assembler* masm); -+ virtual LIR_OpCmpBranch* as_OpCmpBranch() { return this; } -+ virtual void print_instr(outputStream* out) const PRODUCT_RETURN; -+}; ++ LIR_Opr move_from = cmove->in_opr3(); ++ LIR_Opr move_to = cmove->result_opr(); + - class LIR_OpAllocArray : public LIR_Op { - friend class LIR_OpVisitState; - -@@ -1776,7 +1816,6 @@ - virtual void print_instr(outputStream* out) const PRODUCT_RETURN; - }; - -- - class LIR_Op3: public LIR_Op { - friend class LIR_OpVisitState; - -@@ -1800,6 +1839,48 @@ - }; - + if (move_to->is_register() && move_from->is_register()) { + Interval* from = interval_at(reg_num(move_from)); + Interval* to = interval_at(reg_num(move_to)); +@@ -2104,7 +2130,7 @@ LIR_Opr LinearScan::calc_operand_for_interval(const Interval* interval) { + #ifdef _LP64 + return LIR_OprFact::double_cpu(assigned_reg, assigned_reg); + #else +-#if defined(SPARC) || defined(PPC) ++#if defined(SPARC) || defined(PPC) || defined(LOONGARCH) + return LIR_OprFact::double_cpu(assigned_regHi, assigned_reg); + #else + return LIR_OprFact::double_cpu(assigned_reg, assigned_regHi); +@@ -3285,7 +3311,9 @@ void LinearScan::verify_no_oops_in_fixed_intervals() { + check_live = (move->patch_code() == lir_patch_none); + } + LIR_OpBranch* branch = op->as_OpBranch(); +- if (branch != NULL && branch->stub() != NULL && branch->stub()->is_exception_throw_stub()) { ++ LIR_OpCmpBranch* cmp_branch = op->as_OpCmpBranch(); ++ if ((branch != NULL && branch->stub() != NULL && branch->stub()->is_exception_throw_stub()) || ++ (cmp_branch != NULL && cmp_branch->stub() != NULL && cmp_branch->stub()->is_exception_throw_stub())) { + // Don't bother checking the stub in this case since the + // exception stub will never return to normal control flow. + check_live = false; +@@ -6142,6 +6170,16 @@ void ControlFlowOptimizer::substitute_branch_target(BlockBegin* block, BlockBegi + assert(op->as_OpBranch() != NULL, "branch must be of type LIR_OpBranch"); + LIR_OpBranch* branch = (LIR_OpBranch*)op; -+class LIR_Op4: public LIR_Op { -+ friend class LIR_OpVisitState; ++ if (branch->block() == target_from) { ++ branch->change_block(target_to); ++ } ++ if (branch->ublock() == target_from) { ++ branch->change_ublock(target_to); ++ } ++ } else if (op->code() == lir_cmp_branch || op->code() == lir_cmp_float_branch) { ++ assert(op->as_OpCmpBranch() != NULL, "branch must be of type LIR_OpCmpBranch"); ++ LIR_OpCmpBranch* branch = (LIR_OpCmpBranch*)op; + -+ private: -+ LIR_Opr _opr1; -+ LIR_Opr _opr2; -+ LIR_Opr _opr3; -+ LIR_Opr _opr4; -+ BasicType _type; -+ LIR_Condition _condition; + if (branch->block() == target_from) { + branch->change_block(target_to); + } +@@ -6252,6 +6290,20 @@ void ControlFlowOptimizer::delete_unnecessary_jumps(BlockList* code) { + instructions->truncate(instructions->length() - 1); + } + } ++ } else if (prev_op->code() == lir_cmp_branch || prev_op->code() == lir_cmp_float_branch) { ++ assert(prev_op->as_OpCmpBranch() != NULL, "branch must be of type LIR_OpCmpBranch"); ++ LIR_OpCmpBranch* prev_branch = (LIR_OpCmpBranch*)prev_op; + -+ void verify() const; ++ if (prev_branch->stub() == NULL) { ++ if (prev_branch->block() == code->at(i + 1) && prev_branch->info() == NULL) { ++ TRACE_LINEAR_SCAN(3, tty->print_cr("Negating conditional branch and deleting unconditional branch at end of block B%d", block->block_id())); + -+ public: -+ LIR_Op4(LIR_Code code, LIR_Condition condition, LIR_Opr opr1, LIR_Opr opr2, LIR_Opr opr3, LIR_Opr opr4, LIR_Opr result, BasicType type) -+ : LIR_Op(code, result, NULL) -+ , _opr1(opr1) -+ , _opr2(opr2) -+ , _opr3(opr3) -+ , _opr4(opr4) -+ , _type(type) -+ , _condition(condition) { -+ assert(is_in_range(code, begin_op4, end_op4), "code check"); -+ assert(type != T_ILLEGAL, "cmove should have type"); -+ } -+ LIR_Opr in_opr1() const { return _opr1; } -+ LIR_Opr in_opr2() const { return _opr2; } -+ LIR_Opr in_opr3() const { return _opr3; } -+ LIR_Opr in_opr4() const { return _opr4; } -+ BasicType type() const { return _type; } -+ LIR_Condition condition() const { -+ assert(code() == lir_cmp_cmove, "only valid for cmp cmove"); return _condition; -+ } -+ void set_condition(LIR_Condition condition) { -+ assert(code() == lir_cmp_cmove, "only valid for cmp cmove"); _condition = condition; -+ } ++ // eliminate a conditional branch to the immediate successor ++ prev_branch->change_block(last_branch->block()); ++ prev_branch->negate_cond(); ++ instructions->trunc_to(instructions->length() - 1); ++ } ++ } + } + } + } +@@ -6328,6 +6380,13 @@ void ControlFlowOptimizer::verify(BlockList* code) { + assert(op_branch->block() == NULL || code->index_of(op_branch->block()) != -1, "branch target not valid"); + assert(op_branch->ublock() == NULL || code->index_of(op_branch->ublock()) != -1, "branch target not valid"); + } + -+ virtual void emit_code(LIR_Assembler* masm); -+ virtual LIR_Op4* as_Op4() { return this; } -+ virtual void print_instr(outputStream* out) const PRODUCT_RETURN; -+}; ++ LIR_OpCmpBranch* op_cmp_branch = instructions->at(j)->as_OpCmpBranch(); + - //-------------------------------- - class LabelObj: public CompilationResourceObj { - private: -@@ -2141,17 +2222,9 @@ - - void safepoint(LIR_Opr tmp, CodeEmitInfo* info) { append(new LIR_Op1(lir_safepoint, tmp, info)); } - --#ifdef PPC -- void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, LIR_Opr tmp1, LIR_Opr tmp2) { append(new LIR_OpConvert(code, left, dst, NULL, tmp1, tmp2)); } --#endif --#if defined(AARCH64) -- void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, -- ConversionStub* stub = NULL, LIR_Opr tmp1 = LIR_OprDesc::illegalOpr()) { -- append(new LIR_OpConvert(code, left, dst, stub, tmp1, LIR_OprDesc::illegalOpr())); -+ void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, ConversionStub* stub = NULL, LIR_Opr tmp = LIR_OprFact::illegalOpr) { -+ append(new LIR_OpConvert(code, left, dst, stub, tmp)); - } --#else -- void convert(Bytecodes::Code code, LIR_Opr left, LIR_Opr dst, ConversionStub* stub = NULL/*, bool is_32bit = false*/) { append(new LIR_OpConvert(code, left, dst, stub)); } --#endif ++ if (op_cmp_branch != NULL) { ++ assert(op_cmp_branch->block() == NULL || code->find(op_cmp_branch->block()) != -1, "branch target not valid"); ++ assert(op_cmp_branch->ublock() == NULL || code->find(op_cmp_branch->ublock()) != -1, "branch target not valid"); ++ } + } - void logical_and (LIR_Opr left, LIR_Opr right, LIR_Opr dst) { append(new LIR_Op2(lir_logic_and, left, right, dst)); } - void logical_or (LIR_Opr left, LIR_Opr right, LIR_Opr dst) { append(new LIR_Op2(lir_logic_or, left, right, dst)); } -@@ -2256,6 +2329,48 @@ - append(new LIR_OpBranch(cond, type, block, unordered)); - } + for (j = 0; j < block->number_of_sux() - 1; j++) { +@@ -6571,6 +6630,24 @@ void LinearScanStatistic::collect(LinearScan* allocator) { + break; + } -+#if defined(X86) || defined(AARCH64) -+ -+ template -+ void cmp_branch(LIR_Condition condition, LIR_Opr left, LIR_Opr right, BasicType type, T tgt, CodeEmitInfo* info = NULL) { -+ cmp(condition, left, right, info); -+ branch(condition, type, tgt); -+ } -+ -+ void cmp_branch(LIR_Condition condition, LIR_Opr left, LIR_Opr right, BasicType type, BlockBegin* block, BlockBegin* unordered) { -+ cmp(condition, left, right); -+ branch(condition, type, block, unordered); -+ } -+ -+ void cmp_cmove(LIR_Condition condition, LIR_Opr left, LIR_Opr right, LIR_Opr src1, LIR_Opr src2, LIR_Opr dst, BasicType type) { -+ cmp(condition, left, right); -+ cmove(condition, src1, src2, dst, type); -+ } -+ -+#endif -+ -+#ifdef LOONGARCH -+ -+ template -+ void cmp_branch(LIR_Condition condition, LIR_Opr left, LIR_Opr right, BasicType type, T tgt, CodeEmitInfo* info = NULL) { -+ append(new LIR_OpCmpBranch(condition, left, right, tgt, info)); -+ } ++ case lir_cmp_branch: ++ case lir_cmp_float_branch: { ++ LIR_OpCmpBranch* branch = op->as_OpCmpBranch(); ++ if (branch->block() == NULL) { ++ inc_counter(counter_stub_branch); ++ } else { ++ inc_counter(counter_cond_branch); ++ } ++ inc_counter(counter_cmp); ++ break; ++ } + -+ void cmp_branch(LIR_Condition condition, LIR_Opr left, LIR_Opr right, BasicType type, BlockBegin* block, BlockBegin* unordered) { -+ append(new LIR_OpCmpBranch(condition, left, right, block, unordered)); -+ } ++ case lir_cmp_cmove: { ++ inc_counter(counter_misc_inst); ++ inc_counter(counter_cmp); ++ break; ++ } + -+ void cmp_cmove(LIR_Condition condition, LIR_Opr left, LIR_Opr right, LIR_Opr src1, LIR_Opr src2, LIR_Opr dst, BasicType type) { -+ append(new LIR_Op4(lir_cmp_cmove, condition, left, right, src1, src2, dst, type)); -+ } + case lir_neg: + case lir_add: + case lir_sub: +diff --git a/hotspot/src/share/vm/c1/c1_LinearScan.hpp b/hotspot/src/share/vm/c1/c1_LinearScan.hpp +index 96e6b3ba..576a07d7 100644 +--- a/hotspot/src/share/vm/c1/c1_LinearScan.hpp ++++ b/hotspot/src/share/vm/c1/c1_LinearScan.hpp +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2022. These ++ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ + + #ifndef SHARE_VM_C1_C1_LINEARSCAN_HPP + #define SHARE_VM_C1_C1_LINEARSCAN_HPP + +@@ -976,6 +982,9 @@ class LinearScanTimers : public StackObj { + #ifdef TARGET_ARCH_x86 + # include "c1_LinearScan_x86.hpp" + #endif ++#ifdef TARGET_ARCH_loongarch ++# include "c1_LinearScan_loongarch.hpp" +#endif -+ -+ template -+ void cmp_branch(LIR_Condition condition, LIR_Opr left, int right, BasicType type, T tgt, CodeEmitInfo* info = NULL) { -+ cmp_branch(condition, left, LIR_OprFact::intConst(right), type, tgt, info); -+ } -+ - void shift_left(LIR_Opr value, LIR_Opr count, LIR_Opr dst, LIR_Opr tmp); - void shift_right(LIR_Opr value, LIR_Opr count, LIR_Opr dst, LIR_Opr tmp); - void unsigned_shift_right(LIR_Opr value, LIR_Opr count, LIR_Opr dst, LIR_Opr tmp); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp ---- a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp 2023-12-20 09:23:19.918146502 +0800 + #ifdef TARGET_ARCH_aarch64 + # include "c1_LinearScan_aarch64.hpp" + #endif +diff --git a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp +index 7e22bbaa..12aca7bf 100644 +--- a/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp ++++ b/hotspot/src/share/vm/c1/c1_MacroAssembler.hpp @@ -22,6 +22,12 @@ * */ @@ -112466,7 +113658,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_C1_C1_MACROASSEMBLER_HPP #define SHARE_VM_C1_C1_MACROASSEMBLER_HPP -@@ -50,6 +56,9 @@ +@@ -50,6 +56,9 @@ class C1_MacroAssembler: public MacroAssembler { #ifdef TARGET_ARCH_x86 # include "c1_MacroAssembler_x86.hpp" #endif @@ -112476,9 +113668,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "c1_MacroAssembler_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp ---- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp 2023-12-20 09:23:19.918146502 +0800 +diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp +index aebc3775..f1253506 100644 +--- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp ++++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -22,6 +22,12 @@ * */ @@ -112492,7 +113685,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "asm/codeBuffer.hpp" #include "c1/c1_CodeStubs.hpp" -@@ -710,6 +716,7 @@ +@@ -710,6 +716,7 @@ JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread)) // Return to the now deoptimized frame. JRT_END @@ -112500,7 +113693,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp static Klass* resolve_field_return_klass(methodHandle caller, int bci, TRAPS) { Bytecode_field field_access(caller, bci); -@@ -1186,6 +1193,47 @@ +@@ -1186,6 +1193,47 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i } JRT_END @@ -112548,9 +113741,37 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // // Entry point for compiled code. We want to patch a nmethod. // We don't do a normal VM transition here because we want to -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp ---- a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp 2023-12-20 09:23:19.924813093 +0800 +diff --git a/hotspot/src/share/vm/c1/c1_globals.hpp b/hotspot/src/share/vm/c1/c1_globals.hpp +index 8f7f9f61..0e2d926b 100644 +--- a/hotspot/src/share/vm/c1/c1_globals.hpp ++++ b/hotspot/src/share/vm/c1/c1_globals.hpp +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2022. These ++ * modifications are Copyright (c) 2015, 2022, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ ++ + #ifndef SHARE_VM_C1_C1_GLOBALS_HPP + #define SHARE_VM_C1_C1_GLOBALS_HPP + +@@ -29,6 +35,9 @@ + #ifdef TARGET_ARCH_x86 + # include "c1_globals_x86.hpp" + #endif ++#ifdef TARGET_ARCH_loongarch ++# include "c1_globals_loongarch.hpp" ++#endif + #ifdef TARGET_ARCH_aarch64 + # include "c1_globals_aarch64.hpp" + #endif +diff --git a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp +index f067419f..5aa19dc8 100644 +--- a/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp ++++ b/hotspot/src/share/vm/classfile/bytecodeAssembler.cpp @@ -22,6 +22,12 @@ * */ @@ -112577,9 +113798,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_sparc # include "bytes_sparc.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/classfile/classFileStream.hpp b/hotspot/src/share/vm/classfile/classFileStream.hpp ---- a/hotspot/src/share/vm/classfile/classFileStream.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/classfile/classFileStream.hpp 2023-12-20 09:23:19.928146388 +0800 +diff --git a/hotspot/src/share/vm/classfile/classFileStream.hpp b/hotspot/src/share/vm/classfile/classFileStream.hpp +index 9632c8c8..fad25c44 100644 +--- a/hotspot/src/share/vm/classfile/classFileStream.hpp ++++ b/hotspot/src/share/vm/classfile/classFileStream.hpp @@ -22,6 +22,12 @@ * */ @@ -112606,9 +113828,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytes_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/classfile/stackMapTable.hpp b/hotspot/src/share/vm/classfile/stackMapTable.hpp ---- a/hotspot/src/share/vm/classfile/stackMapTable.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/classfile/stackMapTable.hpp 2023-12-20 09:23:19.931479683 +0800 +diff --git a/hotspot/src/share/vm/classfile/stackMapTable.hpp b/hotspot/src/share/vm/classfile/stackMapTable.hpp +index a36a7ba3..d7c1f086 100644 +--- a/hotspot/src/share/vm/classfile/stackMapTable.hpp ++++ b/hotspot/src/share/vm/classfile/stackMapTable.hpp @@ -22,6 +22,12 @@ * */ @@ -112635,9 +113858,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytes_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp ---- a/hotspot/src/share/vm/classfile/verifier.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/classfile/verifier.cpp 2024-01-30 13:54:24.836041846 +0800 +diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp +index 2dddd1fd..4a20d15f 100644 +--- a/hotspot/src/share/vm/classfile/verifier.cpp ++++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -22,6 +22,12 @@ * */ @@ -112664,9 +113888,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytes_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/code/codeBlob.cpp b/hotspot/src/share/vm/code/codeBlob.cpp ---- a/hotspot/src/share/vm/code/codeBlob.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/code/codeBlob.cpp 2023-12-20 09:23:19.931479683 +0800 +diff --git a/hotspot/src/share/vm/code/codeBlob.cpp b/hotspot/src/share/vm/code/codeBlob.cpp +index aff2aaf0..9ba76007 100644 +--- a/hotspot/src/share/vm/code/codeBlob.cpp ++++ b/hotspot/src/share/vm/code/codeBlob.cpp @@ -22,6 +22,12 @@ * */ @@ -112693,9 +113918,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/code/compiledIC.hpp b/hotspot/src/share/vm/code/compiledIC.hpp ---- a/hotspot/src/share/vm/code/compiledIC.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/code/compiledIC.hpp 2023-12-20 09:23:19.934812978 +0800 +diff --git a/hotspot/src/share/vm/code/compiledIC.hpp b/hotspot/src/share/vm/code/compiledIC.hpp +index f910f118..e282a3f3 100644 +--- a/hotspot/src/share/vm/code/compiledIC.hpp ++++ b/hotspot/src/share/vm/code/compiledIC.hpp @@ -22,6 +22,12 @@ * */ @@ -112722,9 +113948,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp //----------------------------------------------------------------------------- // The CompiledIC represents a compiled inline cache. -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/code/relocInfo.hpp b/hotspot/src/share/vm/code/relocInfo.hpp ---- a/hotspot/src/share/vm/code/relocInfo.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/code/relocInfo.hpp 2023-12-20 09:23:19.934812978 +0800 +diff --git a/hotspot/src/share/vm/code/relocInfo.hpp b/hotspot/src/share/vm/code/relocInfo.hpp +index ad55a2fd..81350482 100644 +--- a/hotspot/src/share/vm/code/relocInfo.hpp ++++ b/hotspot/src/share/vm/code/relocInfo.hpp @@ -22,6 +22,12 @@ * */ @@ -112738,7 +113965,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_CODE_RELOCINFO_HPP #define SHARE_VM_CODE_RELOCINFO_HPP -@@ -261,7 +267,11 @@ +@@ -261,7 +267,11 @@ class relocInfo VALUE_OBJ_CLASS_SPEC { poll_return_type = 11, // polling instruction for safepoints at return metadata_type = 12, // metadata that used to be oops trampoline_stub_type = 13, // stub-entry for trampoline @@ -112750,7 +113977,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp data_prefix_tag = 15, // tag for a prefix (carries data arguments) type_mask = 15 // A mask which selects only the above values }; -@@ -288,6 +298,7 @@ +@@ -288,6 +298,7 @@ class relocInfo VALUE_OBJ_CLASS_SPEC { ; #endif @@ -112758,7 +113985,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #define APPLY_TO_RELOCATIONS(visitor) \ visitor(oop) \ visitor(metadata) \ -@@ -300,9 +311,26 @@ +@@ -300,9 +311,26 @@ class relocInfo VALUE_OBJ_CLASS_SPEC { visitor(internal_word) \ visitor(poll) \ visitor(poll_return) \ @@ -112786,20 +114013,20 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp public: enum { -@@ -433,6 +461,12 @@ +@@ -432,6 +460,12 @@ class relocInfo VALUE_OBJ_CLASS_SPEC { + #endif #ifdef TARGET_ARCH_ppc # include "relocInfo_ppc.hpp" - #endif ++#endif +#ifdef TARGET_ARCH_mips +# include "relocInfo_mips.hpp" +#endif +#ifdef TARGET_ARCH_loongarch +# include "relocInfo_loongarch.hpp" -+#endif + #endif - protected: -@@ -1024,6 +1058,15 @@ +@@ -1024,6 +1058,15 @@ class metadata_Relocation : public DataRelocation { // Note: metadata_value transparently converts Universe::non_metadata_word to NULL. }; @@ -112815,9 +114042,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp class virtual_call_Relocation : public CallRelocation { relocInfo::relocType type() { return relocInfo::virtual_call_type; } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/code/vmreg.hpp b/hotspot/src/share/vm/code/vmreg.hpp ---- a/hotspot/src/share/vm/code/vmreg.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/code/vmreg.hpp 2023-12-20 09:23:19.938146274 +0800 +diff --git a/hotspot/src/share/vm/code/vmreg.hpp b/hotspot/src/share/vm/code/vmreg.hpp +index 07b595b6..5bc7131a 100644 +--- a/hotspot/src/share/vm/code/vmreg.hpp ++++ b/hotspot/src/share/vm/code/vmreg.hpp @@ -22,6 +22,12 @@ * */ @@ -112844,7 +114072,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif //------------------------------VMReg------------------------------------------ -@@ -158,6 +170,12 @@ +@@ -158,6 +170,12 @@ public: #ifdef TARGET_ARCH_x86 # include "vmreg_x86.hpp" #endif @@ -112857,9 +114085,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "vmreg_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/compiler/disassembler.cpp b/hotspot/src/share/vm/compiler/disassembler.cpp ---- a/hotspot/src/share/vm/compiler/disassembler.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/compiler/disassembler.cpp 2023-12-20 09:23:19.938146274 +0800 +diff --git a/hotspot/src/share/vm/compiler/disassembler.cpp b/hotspot/src/share/vm/compiler/disassembler.cpp +index dfdd5f77..2dd0ff69 100644 +--- a/hotspot/src/share/vm/compiler/disassembler.cpp ++++ b/hotspot/src/share/vm/compiler/disassembler.cpp @@ -22,6 +22,12 @@ * */ @@ -112886,9 +114115,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef SHARK #include "shark/sharkEntry.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/compiler/disassembler.hpp b/hotspot/src/share/vm/compiler/disassembler.hpp ---- a/hotspot/src/share/vm/compiler/disassembler.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/compiler/disassembler.hpp 2023-12-20 09:23:19.938146274 +0800 +diff --git a/hotspot/src/share/vm/compiler/disassembler.hpp b/hotspot/src/share/vm/compiler/disassembler.hpp +index 168851cc..8b632748 100644 +--- a/hotspot/src/share/vm/compiler/disassembler.hpp ++++ b/hotspot/src/share/vm/compiler/disassembler.hpp @@ -22,6 +22,12 @@ * */ @@ -112902,23 +114132,24 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_COMPILER_DISASSEMBLER_HPP #define SHARE_VM_COMPILER_DISASSEMBLER_HPP -@@ -96,6 +102,12 @@ +@@ -95,6 +101,12 @@ class Disassembler { + #endif #ifdef TARGET_ARCH_ppc # include "disassembler_ppc.hpp" - #endif ++#endif +#ifdef TARGET_ARCH_mips +# include "disassembler_mips.hpp" +#endif +#ifdef TARGET_ARCH_loongarch +# include "disassembler_loongarch.hpp" -+#endif + #endif - public: -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp ---- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp 2023-12-20 09:23:19.958146045 +0800 -@@ -86,6 +86,9 @@ +diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp +index 733b5c91..678a1ee8 100644 +--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp ++++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/cardTableExtension.hpp +@@ -86,6 +86,9 @@ class CardTableExtension : public CardTableModRefBS { void inline_write_ref_field_gc(void* field, oop new_val) { jbyte* byte = byte_for(field); *byte = youngergen_card; @@ -112928,10 +114159,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } // Adaptive size policy support -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp ---- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp 2023-12-20 09:23:19.958146045 +0800 -@@ -105,6 +105,9 @@ +diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp +index 1dde1074..8b800b31 100644 +--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp ++++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/parMarkBitMap.cpp +@@ -105,6 +105,9 @@ ParMarkBitMap::mark_obj(HeapWord* addr, size_t size) assert(end_bit_ok, "concurrency problem"); DEBUG_ONLY(Atomic::inc_ptr(&mark_bitmap_count)); DEBUG_ONLY(Atomic::add_ptr(size, &mark_bitmap_size)); @@ -112941,10 +114173,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp return true; } return false; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp ---- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp 2023-12-20 09:23:19.958146045 +0800 -@@ -33,6 +33,9 @@ +diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp +index 6cf76353..4d34bc20 100644 +--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp ++++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.inline.hpp +@@ -33,6 +33,9 @@ void ParCompactionManager::push_objarray(oop obj, size_t index) ObjArrayTask task(obj, index); assert(task.is_valid(), "bad ObjArrayTask"); _objarray_stack.push(task); @@ -112954,7 +114187,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } void ParCompactionManager::push_region(size_t index) -@@ -44,6 +47,9 @@ +@@ -44,6 +47,9 @@ void ParCompactionManager::push_region(size_t index) assert(region_ptr->_pushed++ == 0, "should only be pushed once"); #endif region_stack()->push(index); @@ -112964,10 +114197,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } #endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSCOMPACTIONMANAGER_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp ---- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp 2023-12-20 09:23:19.961479341 +0800 -@@ -499,6 +499,9 @@ +diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp +index 0fa980ef..2f66493e 100644 +--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp ++++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.cpp +@@ -499,6 +499,9 @@ void ParallelCompactData::add_obj(HeapWord* addr, size_t len) if (beg_region == end_region) { // All in one region. _region_data[beg_region].add_live_obj(len); @@ -112977,7 +114211,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp return; } -@@ -517,6 +520,9 @@ +@@ -517,6 +520,9 @@ void ParallelCompactData::add_obj(HeapWord* addr, size_t len) const size_t end_ofs = region_offset(addr + len - 1); _region_data[end_region].set_partial_obj_size(end_ofs + 1); _region_data[end_region].set_partial_obj_addr(addr); @@ -112987,7 +114221,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } void -@@ -3229,6 +3235,9 @@ +@@ -3229,6 +3235,9 @@ void PSParallelCompact::fill_blocks(size_t region_idx) if (new_block != cur_block) { cur_block = new_block; sd.block(cur_block)->set_offset(bitmap->bits_to_words(live_bits)); @@ -112997,10 +114231,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } const size_t end_bit = bitmap->find_obj_end(beg_bit, range_end); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp ---- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp 2023-12-20 09:23:19.961479341 +0800 -@@ -1329,6 +1329,9 @@ +diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp +index 881f380c..461b8393 100644 +--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp ++++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psParallelCompact.hpp +@@ -1329,6 +1329,9 @@ inline bool PSParallelCompact::mark_obj(oop obj) { const int obj_size = obj->size(); if (mark_bitmap()->mark_obj(obj, obj_size)) { _summary_data.add_obj(obj, obj_size); @@ -113010,7 +114245,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp return true; } else { return false; -@@ -1363,6 +1366,9 @@ +@@ -1363,6 +1366,9 @@ inline void PSParallelCompact::mark_and_push(ParCompactionManager* cm, T* p) { oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); if (mark_bitmap()->is_unmarked(obj) && mark_obj(obj)) { cm->push(obj); @@ -113020,10 +114255,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } } } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp ---- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp 2023-12-20 09:23:19.961479341 +0800 -@@ -41,8 +41,9 @@ +diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp +index a3313200..29101966 100644 +--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp ++++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psPromotionManager.inline.hpp +@@ -41,8 +41,9 @@ template inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) { if (p != NULL) { // XXX: error if p != NULL here oop o = oopDesc::load_decode_heap_oop_not_null(p); @@ -113035,7 +114271,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Card mark if (PSScavenge::is_obj_in_young(o)) { PSScavenge::card_table()->inline_write_ref_field_gc(p, o); -@@ -102,11 +103,19 @@ +@@ -102,11 +103,19 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) { oop new_obj = NULL; @@ -113055,7 +114291,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // The same test as "o->is_forwarded()" if (!test_mark->is_marked()) { bool new_obj_is_tenured = false; -@@ -141,6 +150,10 @@ +@@ -141,6 +150,10 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) { } } } @@ -113066,7 +114302,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } } -@@ -200,6 +213,9 @@ +@@ -200,6 +213,9 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) { // Copy obj Copy::aligned_disjoint_words((HeapWord*)o, (HeapWord*)new_obj, new_obj_size); @@ -113076,7 +114312,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Now we have to CAS in the header. if (o->cas_forward_to(new_obj, test_mark)) { -@@ -247,6 +263,10 @@ +@@ -247,6 +263,10 @@ oop PSPromotionManager::copy_to_survivor_space(oop o) { // don't update this before the unallocation! new_obj = o->forwardee(); } @@ -113087,10 +114323,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } else { assert(o->is_forwarded(), "Sanity"); new_obj = o->forwardee(); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp ---- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp 2023-12-20 09:23:19.961479341 +0800 -@@ -71,14 +71,22 @@ +diff --git a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp +index 1a722a7c..4980be39 100644 +--- a/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp ++++ b/hotspot/src/share/vm/gc_implementation/parallelScavenge/psScavenge.inline.hpp +@@ -71,14 +71,22 @@ inline void PSScavenge::copy_and_push_safe_barrier(PSPromotionManager* pm, assert(should_scavenge(p, true), "revisiting object?"); oop o = oopDesc::load_decode_heap_oop_not_null(p); @@ -113117,7 +114354,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp gclog_or_tty->print_cr("{%s %s " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", "forwarding", new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); -@@ -138,8 +146,9 @@ +@@ -138,8 +146,9 @@ class PSScavengeFromKlassClosure: public OopClosure { oop o = *p; oop new_obj; @@ -113129,9 +114366,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } else { new_obj = _pm->copy_to_survivor_space(o); } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp ---- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp +index e14c50bf..8b386007 100644 +--- a/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp ++++ b/hotspot/src/share/vm/interpreter/abstractInterpreter.hpp @@ -22,6 +22,12 @@ * */ @@ -113156,9 +114394,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif // This file contains the platform-independent parts -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/bytecode.hpp b/hotspot/src/share/vm/interpreter/bytecode.hpp ---- a/hotspot/src/share/vm/interpreter/bytecode.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/bytecode.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/bytecode.hpp b/hotspot/src/share/vm/interpreter/bytecode.hpp +index 7e55fd00..a06dcd58 100644 +--- a/hotspot/src/share/vm/interpreter/bytecode.hpp ++++ b/hotspot/src/share/vm/interpreter/bytecode.hpp @@ -22,6 +22,12 @@ * */ @@ -113185,9 +114424,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytes_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp ---- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp +index 28843715..c17fe8d7 100644 +--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp ++++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.hpp @@ -22,6 +22,12 @@ * */ @@ -113211,7 +114451,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytes_aarch64.hpp" #endif -@@ -592,6 +601,12 @@ +@@ -592,6 +601,12 @@ void print(); #ifdef TARGET_ARCH_x86 # include "bytecodeInterpreter_x86.hpp" #endif @@ -113224,9 +114464,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytecodeInterpreter_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp ---- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp +index f5db0b4d..8adbf95a 100644 +--- a/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp ++++ b/hotspot/src/share/vm/interpreter/bytecodeInterpreter.inline.hpp @@ -22,6 +22,12 @@ * */ @@ -113253,9 +114494,40 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytecodeInterpreter_aarch64.inline.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/bytecodes.cpp b/hotspot/src/share/vm/interpreter/bytecodes.cpp ---- a/hotspot/src/share/vm/interpreter/bytecodes.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp 2024-01-30 13:54:24.866041540 +0800 +diff --git a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp +index b814b88d..e1f24216 100644 +--- a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp ++++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2020. These ++ * modifications are Copyright (c) 2015, 2020, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ ++ + #ifndef SHARE_VM_INTERPRETER_BYTECODESTREAM_HPP + #define SHARE_VM_INTERPRETER_BYTECODESTREAM_HPP + +@@ -32,6 +38,12 @@ + #ifdef TARGET_ARCH_x86 + # include "bytes_x86.hpp" + #endif ++#ifdef TARGET_ARCH_mips ++# include "bytes_mips.hpp" ++#endif ++#ifdef TARGET_ARCH_loongarch ++# include "bytes_loongarch.hpp" ++#endif + #ifdef TARGET_ARCH_aarch64 + # include "bytes_aarch64.hpp" + #endif +diff --git a/hotspot/src/share/vm/interpreter/bytecodes.cpp b/hotspot/src/share/vm/interpreter/bytecodes.cpp +index ce5632ea..7f8e8801 100644 +--- a/hotspot/src/share/vm/interpreter/bytecodes.cpp ++++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp @@ -22,6 +22,12 @@ * */ @@ -113282,9 +114554,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytes_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/bytecodes.hpp b/hotspot/src/share/vm/interpreter/bytecodes.hpp ---- a/hotspot/src/share/vm/interpreter/bytecodes.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/bytecodes.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/bytecodes.hpp b/hotspot/src/share/vm/interpreter/bytecodes.hpp +index c3463cd7..bdf4c487 100644 +--- a/hotspot/src/share/vm/interpreter/bytecodes.hpp ++++ b/hotspot/src/share/vm/interpreter/bytecodes.hpp @@ -22,6 +22,12 @@ * */ @@ -113298,7 +114571,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_INTERPRETER_BYTECODES_HPP #define SHARE_VM_INTERPRETER_BYTECODES_HPP -@@ -292,6 +298,12 @@ +@@ -292,6 +298,12 @@ class Bytecodes: AllStatic { #ifdef TARGET_ARCH_x86 # include "bytecodes_x86.hpp" #endif @@ -113311,9 +114584,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "bytecodes_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp ---- a/hotspot/src/share/vm/interpreter/bytecodeStream.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/bytecodeStream.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp +index 6a644750..f9c540fb 100644 +--- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp ++++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp @@ -22,6 +22,12 @@ * */ @@ -113324,25 +114598,26 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * available on the same license terms set forth above. + */ + - #ifndef SHARE_VM_INTERPRETER_BYTECODESTREAM_HPP - #define SHARE_VM_INTERPRETER_BYTECODESTREAM_HPP + #ifndef SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP + #define SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP -@@ -32,6 +38,12 @@ +@@ -84,6 +90,12 @@ class CppInterpreter: public AbstractInterpreter { #ifdef TARGET_ARCH_x86 - # include "bytes_x86.hpp" + # include "cppInterpreter_x86.hpp" #endif +#ifdef TARGET_ARCH_mips -+# include "bytes_mips.hpp" ++# include "cppInterpreter_mips.hpp" +#endif +#ifdef TARGET_ARCH_loongarch -+# include "bytes_loongarch.hpp" ++# include "cppInterpreter_loongarch.hpp" +#endif #ifdef TARGET_ARCH_aarch64 - # include "bytes_aarch64.hpp" + # include "cppInterpreter_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp ---- a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp +index 6a08a3f4..1fd19994 100644 +--- a/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp ++++ b/hotspot/src/share/vm/interpreter/cppInterpreterGenerator.hpp @@ -22,6 +22,12 @@ * */ @@ -113356,7 +114631,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_INTERPRETER_CPPINTERPRETERGENERATOR_HPP #define SHARE_VM_INTERPRETER_CPPINTERPRETERGENERATOR_HPP -@@ -50,6 +56,12 @@ +@@ -50,6 +56,12 @@ class CppInterpreterGenerator: public AbstractInterpreterGenerator { #ifdef TARGET_ARCH_x86 # include "cppInterpreterGenerator_x86.hpp" #endif @@ -113369,9 +114644,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "cppInterpreterGenerator_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp ---- a/hotspot/src/share/vm/interpreter/cppInterpreter.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/cppInterpreter.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/interpreter.hpp b/hotspot/src/share/vm/interpreter/interpreter.hpp +index ebfb68d3..610949f3 100644 +--- a/hotspot/src/share/vm/interpreter/interpreter.hpp ++++ b/hotspot/src/share/vm/interpreter/interpreter.hpp @@ -22,6 +22,12 @@ * */ @@ -113382,25 +114658,26 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * available on the same license terms set forth above. + */ + - #ifndef SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP - #define SHARE_VM_INTERPRETER_CPPINTERPRETER_HPP + #ifndef SHARE_VM_INTERPRETER_INTERPRETER_HPP + #define SHARE_VM_INTERPRETER_INTERPRETER_HPP -@@ -84,6 +90,12 @@ +@@ -148,6 +154,12 @@ class Interpreter: public CC_INTERP_ONLY(CppInterpreter) NOT_CC_INTERP(TemplateI #ifdef TARGET_ARCH_x86 - # include "cppInterpreter_x86.hpp" + # include "interpreter_x86.hpp" #endif +#ifdef TARGET_ARCH_mips -+# include "cppInterpreter_mips.hpp" ++# include "interpreter_mips.hpp" +#endif +#ifdef TARGET_ARCH_loongarch -+# include "cppInterpreter_loongarch.hpp" ++# include "interpreter_loongarch.hpp" +#endif #ifdef TARGET_ARCH_aarch64 - # include "cppInterpreter_aarch64.hpp" + # include "interpreter_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp ---- a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp +index 1dc7cb29..92bbe6b4 100644 +--- a/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp ++++ b/hotspot/src/share/vm/interpreter/interpreterGenerator.hpp @@ -22,6 +22,12 @@ * */ @@ -113414,7 +114691,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_INTERPRETER_INTERPRETERGENERATOR_HPP #define SHARE_VM_INTERPRETER_INTERPRETERGENERATOR_HPP -@@ -44,6 +50,12 @@ +@@ -44,6 +50,12 @@ InterpreterGenerator(StubQueue* _code); #ifdef TARGET_ARCH_x86 # include "interpreterGenerator_x86.hpp" #endif @@ -113427,38 +114704,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "interpreterGenerator_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/interpreter.hpp b/hotspot/src/share/vm/interpreter/interpreter.hpp ---- a/hotspot/src/share/vm/interpreter/interpreter.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/interpreter.hpp 2023-12-20 09:23:19.968145932 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2020. These -+ * modifications are Copyright (c) 2015, 2020, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #ifndef SHARE_VM_INTERPRETER_INTERPRETER_HPP - #define SHARE_VM_INTERPRETER_INTERPRETER_HPP - -@@ -148,6 +154,12 @@ - #ifdef TARGET_ARCH_x86 - # include "interpreter_x86.hpp" - #endif -+#ifdef TARGET_ARCH_mips -+# include "interpreter_mips.hpp" -+#endif -+#ifdef TARGET_ARCH_loongarch -+# include "interpreter_loongarch.hpp" -+#endif - #ifdef TARGET_ARCH_aarch64 - # include "interpreter_aarch64.hpp" - #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp ---- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +index cad9d290..85303e4b 100644 +--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp ++++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -22,6 +22,12 @@ * */ @@ -113485,7 +114734,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "vm_version_aarch64.hpp" #endif -@@ -1290,7 +1302,7 @@ +@@ -1290,7 +1302,7 @@ IRT_ENTRY(void, InterpreterRuntime::prepare_native_call(JavaThread* thread, Meth // preparing the same method will be sure to see non-null entry & mirror. IRT_END @@ -113494,9 +114743,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp IRT_LEAF(void, InterpreterRuntime::popframe_move_outgoing_args(JavaThread* thread, void* src_address, void* dest_address)) if (src_address == dest_address) { return; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp ---- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp 2023-12-20 09:23:19.968145932 +0800 +diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp +index 472bf4d9..9a98d555 100644 +--- a/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp ++++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.hpp @@ -22,6 +22,12 @@ * */ @@ -113510,7 +114760,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_INTERPRETER_INTERPRETERRUNTIME_HPP #define SHARE_VM_INTERPRETER_INTERPRETERRUNTIME_HPP -@@ -156,7 +162,7 @@ +@@ -156,7 +162,7 @@ class InterpreterRuntime: AllStatic { Method* method, intptr_t* from, intptr_t* to); @@ -113519,7 +114769,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Popframe support (only needed on x86, AMD64 and ARM) static void popframe_move_outgoing_args(JavaThread* thread, void* src_address, void* dest_address); #endif -@@ -165,6 +171,12 @@ +@@ -165,6 +171,12 @@ class InterpreterRuntime: AllStatic { #ifdef TARGET_ARCH_x86 # include "interpreterRT_x86.hpp" #endif @@ -113532,9 +114782,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "interpreterRT_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp ---- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp 2023-12-20 09:23:19.971479225 +0800 +diff --git a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp +index 5f76dca8..757860f4 100644 +--- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp ++++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp @@ -22,6 +22,12 @@ * */ @@ -113545,25 +114796,26 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * available on the same license terms set forth above. + */ + - #ifndef SHARE_VM_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP - #define SHARE_VM_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP + #ifndef SHARE_VM_INTERPRETER_TEMPLATEINTERPRETER_HPP + #define SHARE_VM_INTERPRETER_TEMPLATEINTERPRETER_HPP -@@ -89,6 +95,12 @@ +@@ -190,6 +196,12 @@ class TemplateInterpreter: public AbstractInterpreter { #ifdef TARGET_ARCH_x86 - # include "templateInterpreterGenerator_x86.hpp" + # include "templateInterpreter_x86.hpp" #endif +#ifdef TARGET_ARCH_mips -+# include "templateInterpreterGenerator_mips.hpp" ++# include "templateInterpreter_mips.hpp" +#endif +#ifdef TARGET_ARCH_loongarch -+# include "templateInterpreterGenerator_loongarch.hpp" ++# include "templateInterpreter_loongarch.hpp" +#endif #ifdef TARGET_ARCH_aarch64 - # include "templateInterpreterGenerator_aarch64.hpp" + # include "templateInterpreter_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp ---- a/hotspot/src/share/vm/interpreter/templateInterpreter.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/templateInterpreter.hpp 2023-12-20 09:23:19.971479225 +0800 +diff --git a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp +index bd94bd02..28ca437e 100644 +--- a/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp ++++ b/hotspot/src/share/vm/interpreter/templateInterpreterGenerator.hpp @@ -22,6 +22,12 @@ * */ @@ -113574,25 +114826,26 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * available on the same license terms set forth above. + */ + - #ifndef SHARE_VM_INTERPRETER_TEMPLATEINTERPRETER_HPP - #define SHARE_VM_INTERPRETER_TEMPLATEINTERPRETER_HPP + #ifndef SHARE_VM_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP + #define SHARE_VM_INTERPRETER_TEMPLATEINTERPRETERGENERATOR_HPP -@@ -190,6 +196,12 @@ +@@ -89,6 +95,12 @@ class TemplateInterpreterGenerator: public AbstractInterpreterGenerator { #ifdef TARGET_ARCH_x86 - # include "templateInterpreter_x86.hpp" + # include "templateInterpreterGenerator_x86.hpp" #endif +#ifdef TARGET_ARCH_mips -+# include "templateInterpreter_mips.hpp" ++# include "templateInterpreterGenerator_mips.hpp" +#endif +#ifdef TARGET_ARCH_loongarch -+# include "templateInterpreter_loongarch.hpp" ++# include "templateInterpreterGenerator_loongarch.hpp" +#endif #ifdef TARGET_ARCH_aarch64 - # include "templateInterpreter_aarch64.hpp" + # include "templateInterpreterGenerator_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp ---- a/hotspot/src/share/vm/interpreter/templateTable.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/interpreter/templateTable.hpp 2023-12-20 09:23:19.971479225 +0800 +diff --git a/hotspot/src/share/vm/interpreter/templateTable.hpp b/hotspot/src/share/vm/interpreter/templateTable.hpp +index 60d243c1..1b73822a 100644 +--- a/hotspot/src/share/vm/interpreter/templateTable.hpp ++++ b/hotspot/src/share/vm/interpreter/templateTable.hpp @@ -22,6 +22,12 @@ * */ @@ -113617,7 +114870,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif #ifndef CC_INTERP -@@ -367,6 +377,10 @@ +@@ -367,6 +377,10 @@ class TemplateTable: AllStatic { # include "templateTable_zero.hpp" #elif defined TARGET_ARCH_MODEL_ppc_64 # include "templateTable_ppc_64.hpp" @@ -113628,10 +114881,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif }; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp b/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp ---- a/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp 2023-12-20 09:23:19.984812406 +0800 -@@ -116,7 +116,7 @@ +diff --git a/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp b/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp +index 6d9ab39f..f4e9a4ca 100644 +--- a/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp ++++ b/hotspot/src/share/vm/jfr/utilities/jfrBigEndian.hpp +@@ -116,7 +116,7 @@ inline T JfrBigEndian::read_unaligned(const address location) { inline bool JfrBigEndian::platform_supports_unaligned_reads(void) { #if defined(IA32) || defined(AMD64) || defined(PPC) || defined(S390) return true; @@ -113640,9 +114894,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp return false; #else #warning "Unconfigured platform" -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp b/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp ---- a/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp 2023-12-20 09:23:19.984812406 +0800 +diff --git a/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp b/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp +index 42a8b719..f08f6ee1 100644 +--- a/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp ++++ b/hotspot/src/share/vm/jfr/writers/jfrEncoders.hpp @@ -22,6 +22,12 @@ * */ @@ -113669,9 +114924,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // // The Encoding policy prescribes a template -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/memory/barrierSet.hpp b/hotspot/src/share/vm/memory/barrierSet.hpp ---- a/hotspot/src/share/vm/memory/barrierSet.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/memory/barrierSet.hpp 2023-12-20 09:23:19.988145701 +0800 +diff --git a/hotspot/src/share/vm/memory/barrierSet.hpp b/hotspot/src/share/vm/memory/barrierSet.hpp +index 13ff9b27..081b7074 100644 +--- a/hotspot/src/share/vm/memory/barrierSet.hpp ++++ b/hotspot/src/share/vm/memory/barrierSet.hpp @@ -27,6 +27,7 @@ #include "memory/memRegion.hpp" @@ -113680,7 +114936,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // This class provides the interface between a barrier implementation and // the rest of the system. -@@ -95,8 +96,16 @@ +@@ -95,8 +96,16 @@ private: // Keep this private so as to catch violations at build time. virtual void write_ref_field_pre_work( void* field, oop new_val) { guarantee(false, "Not needed"); }; protected: @@ -113699,7 +114955,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp public: // ...then the post-write version. -@@ -132,9 +141,17 @@ +@@ -132,9 +141,17 @@ public: // Below length is the # array elements being written virtual void write_ref_array_pre(oop* dst, int length, @@ -113719,10 +114975,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Below count is the # array elements being written, starting // at the address "start", which may not necessarily be HeapWord-aligned inline void write_ref_array(HeapWord* start, size_t count); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp ---- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp 2023-12-20 09:23:19.988145701 +0800 -@@ -316,6 +316,9 @@ +diff --git a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp +index 01e46888..80bd1518 100644 +--- a/hotspot/src/share/vm/memory/cardTableModRefBS.hpp ++++ b/hotspot/src/share/vm/memory/cardTableModRefBS.hpp +@@ -316,6 +316,9 @@ public: inline void inline_write_ref_array(MemRegion mr) { dirty_MemRegion(mr); @@ -113732,7 +114989,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } protected: void write_ref_array_work(MemRegion mr) { -@@ -329,7 +332,11 @@ +@@ -329,7 +332,11 @@ public: // *** Card-table-barrier-specific things. @@ -113745,7 +115002,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp template inline void inline_write_ref_field(T* field, oop newVal, bool release) { jbyte* byte = byte_for((void*)field); -@@ -339,6 +346,9 @@ +@@ -339,6 +346,9 @@ public: } else { *byte = dirty_card; } @@ -113755,10 +115012,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } // These are used by G1, when it uses the card table as a temporary data -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/memory/cardTableRS.cpp b/hotspot/src/share/vm/memory/cardTableRS.cpp ---- a/hotspot/src/share/vm/memory/cardTableRS.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/memory/cardTableRS.cpp 2023-12-20 09:23:19.988145701 +0800 -@@ -252,6 +252,9 @@ +diff --git a/hotspot/src/share/vm/memory/cardTableRS.cpp b/hotspot/src/share/vm/memory/cardTableRS.cpp +index fb33a708..da22acba 100644 +--- a/hotspot/src/share/vm/memory/cardTableRS.cpp ++++ b/hotspot/src/share/vm/memory/cardTableRS.cpp +@@ -252,6 +252,9 @@ void ClearNoncleanCardWrapper::do_MemRegion(MemRegion mr) { // cur_youngergen_and_prev_nonclean_card ==> no change. void CardTableRS::write_ref_field_gc_par(void* field, oop new_val) { jbyte* entry = ct_bs()->byte_for(field); @@ -113768,7 +115026,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp do { jbyte entry_val = *entry; // We put this first because it's probably the most common case. -@@ -266,7 +269,12 @@ +@@ -266,7 +269,12 @@ void CardTableRS::write_ref_field_gc_par(void* field, oop new_val) { jbyte new_val = cur_youngergen_and_prev_nonclean_card; jbyte res = Atomic::cmpxchg(new_val, entry, entry_val); // Did the CAS succeed? @@ -113782,10 +115040,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Otherwise, retry, to see the new value. continue; } else { -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/memory/cardTableRS.hpp b/hotspot/src/share/vm/memory/cardTableRS.hpp ---- a/hotspot/src/share/vm/memory/cardTableRS.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/memory/cardTableRS.hpp 2023-12-20 09:23:19.988145701 +0800 -@@ -121,7 +121,14 @@ +diff --git a/hotspot/src/share/vm/memory/cardTableRS.hpp b/hotspot/src/share/vm/memory/cardTableRS.hpp +index 25884fea..5d4e77f2 100644 +--- a/hotspot/src/share/vm/memory/cardTableRS.hpp ++++ b/hotspot/src/share/vm/memory/cardTableRS.hpp +@@ -121,7 +121,14 @@ public: void inline_write_ref_field_gc(void* field, oop new_val) { jbyte* byte = _ct_bs->byte_for(field); @@ -113801,9 +115060,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } void write_ref_field_gc_work(void* field, oop new_val) { inline_write_ref_field_gc(field, new_val); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp ---- a/hotspot/src/share/vm/memory/metaspace.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/memory/metaspace.cpp 2023-12-20 09:23:19.991478997 +0800 +diff --git a/hotspot/src/share/vm/memory/metaspace.cpp b/hotspot/src/share/vm/memory/metaspace.cpp +index fb0564ac..9cec7d43 100644 +--- a/hotspot/src/share/vm/memory/metaspace.cpp ++++ b/hotspot/src/share/vm/memory/metaspace.cpp @@ -21,6 +21,13 @@ * questions. * @@ -113818,7 +115078,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "gc_interface/collectedHeap.hpp" #include "memory/allocation.hpp" -@@ -3065,12 +3072,12 @@ +@@ -3065,12 +3072,12 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a // Don't use large pages for the class space. bool large_pages = false; @@ -113833,7 +115093,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp ReservedSpace metaspace_rs; // Our compressed klass pointers may fit nicely into the lower 32 -@@ -3107,7 +3114,7 @@ +@@ -3107,7 +3114,7 @@ void Metaspace::allocate_metaspace_compressed_klass_ptrs(char* requested_addr, a } } @@ -113842,9 +115102,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp if (!metaspace_rs.is_reserved()) { #if INCLUDE_CDS -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp ---- a/hotspot/src/share/vm/oops/constantPool.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/oops/constantPool.hpp 2023-12-20 09:23:19.998145587 +0800 +diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp +index 635bf6d1..18822d9f 100644 +--- a/hotspot/src/share/vm/oops/constantPool.hpp ++++ b/hotspot/src/share/vm/oops/constantPool.hpp @@ -22,6 +22,12 @@ * */ @@ -113872,9 +115133,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // A constantPool is an array containing class constants as described in the // class file. -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp ---- a/hotspot/src/share/vm/oops/klass.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/oops/klass.hpp 2023-12-20 09:23:20.001478882 +0800 +diff --git a/hotspot/src/share/vm/oops/klass.hpp b/hotspot/src/share/vm/oops/klass.hpp +index acef3348..23fc0b99 100644 +--- a/hotspot/src/share/vm/oops/klass.hpp ++++ b/hotspot/src/share/vm/oops/klass.hpp @@ -32,6 +32,9 @@ #include "oops/klassPS.hpp" #include "oops/metadata.hpp" @@ -113885,7 +115147,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "utilities/accessFlags.hpp" #include "utilities/macros.hpp" #if INCLUDE_ALL_GCS -@@ -289,8 +292,18 @@ +@@ -289,8 +292,18 @@ protected: // The Klasses are not placed in the Heap, so the Card Table or // the Mod Union Table can't be used to mark when klasses have modified oops. // The CT and MUT bits saves this information for the individual Klasses. @@ -113906,10 +115168,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp bool has_modified_oops() { return _modified_oops == 1; } void accumulate_modified_oops() { if (has_modified_oops()) _accumulated_modified_oops = 1; } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp ---- a/hotspot/src/share/vm/oops/oop.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/oops/oop.hpp 2023-12-20 09:23:20.001478882 +0800 -@@ -72,7 +72,13 @@ +diff --git a/hotspot/src/share/vm/oops/oop.hpp b/hotspot/src/share/vm/oops/oop.hpp +index 0678c6b3..1cb20e35 100644 +--- a/hotspot/src/share/vm/oops/oop.hpp ++++ b/hotspot/src/share/vm/oops/oop.hpp +@@ -72,7 +72,13 @@ class oopDesc { markOop mark() const { return _mark; } markOop* mark_addr() const { return (markOop*) &_mark; } @@ -113924,9 +115187,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp void release_set_mark(markOop m); markOop cas_set_mark(markOop new_mark, markOop old_mark); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp ---- a/hotspot/src/share/vm/oops/oop.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/oops/oop.inline.hpp 2023-12-20 09:23:20.001478882 +0800 +diff --git a/hotspot/src/share/vm/oops/oop.inline.hpp b/hotspot/src/share/vm/oops/oop.inline.hpp +index beec739d..8660c1e3 100644 +--- a/hotspot/src/share/vm/oops/oop.inline.hpp ++++ b/hotspot/src/share/vm/oops/oop.inline.hpp @@ -22,6 +22,12 @@ * */ @@ -113953,9 +115217,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Implementation of all inlined member functions defined in oop.hpp // We need a separate file to avoid circular references -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp ---- a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp 2023-12-20 09:23:20.001478882 +0800 +diff --git a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp +index 8a460394..b28bb991 100644 +--- a/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp ++++ b/hotspot/src/share/vm/oops/oop.pcgc.inline.hpp @@ -22,6 +22,12 @@ * */ @@ -113969,7 +115234,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP #define SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP -@@ -75,7 +81,7 @@ +@@ -75,7 +81,7 @@ inline oop oopDesc::forward_to_atomic(oop p) { // forwarding pointer. oldMark = curMark; } @@ -113978,9 +115243,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } #endif // SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp ---- a/hotspot/src/share/vm/opto/buildOopMap.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/buildOopMap.cpp 2023-12-20 09:23:20.004812178 +0800 +diff --git a/hotspot/src/share/vm/opto/buildOopMap.cpp b/hotspot/src/share/vm/opto/buildOopMap.cpp +index 91642f1d..5df185df 100644 +--- a/hotspot/src/share/vm/opto/buildOopMap.cpp ++++ b/hotspot/src/share/vm/opto/buildOopMap.cpp @@ -22,6 +22,12 @@ * */ @@ -114007,10 +115273,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // The functions in this file builds OopMaps after all scheduling is done. // -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/bytecodeInfo.cpp b/hotspot/src/share/vm/opto/bytecodeInfo.cpp ---- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp 2023-12-20 09:23:20.004812178 +0800 -@@ -361,9 +361,20 @@ +diff --git a/hotspot/src/share/vm/opto/bytecodeInfo.cpp b/hotspot/src/share/vm/opto/bytecodeInfo.cpp +index 7fd615d3..ad472e87 100644 +--- a/hotspot/src/share/vm/opto/bytecodeInfo.cpp ++++ b/hotspot/src/share/vm/opto/bytecodeInfo.cpp +@@ -361,9 +361,20 @@ bool InlineTree::try_to_inline(ciMethod* callee_method, ciMethod* caller_method, } else if (forced_inline()) { // Inlining was forced by CompilerOracle, ciReplay or annotation } else if (profile.count() == 0) { @@ -114031,36 +115298,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp ---- a/hotspot/src/share/vm/opto/c2compiler.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/c2compiler.cpp 2023-12-20 09:23:20.004812178 +0800 -@@ -22,6 +22,12 @@ - * - */ - -+/* -+ * This file has been modified by Loongson Technology in 2020. These -+ * modifications are Copyright (c) 2015, 2020, Loongson Technology, and are made -+ * available on the same license terms set forth above. -+ */ -+ - #include "precompiled.hpp" - #include "opto/c2compiler.hpp" - #include "opto/runtime.hpp" -@@ -39,6 +45,10 @@ - # include "adfiles/ad_zero.hpp" - #elif defined TARGET_ARCH_MODEL_ppc_64 - # include "adfiles/ad_ppc_64.hpp" -+#elif defined TARGET_ARCH_MODEL_mips_64 -+# include "adfiles/ad_mips_64.hpp" -+#elif defined TARGET_ARCH_MODEL_loongarch_64 -+# include "adfiles/ad_loongarch_64.hpp" - #endif - - // register information defined by ADLC -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/c2_globals.hpp b/hotspot/src/share/vm/opto/c2_globals.hpp ---- a/hotspot/src/share/vm/opto/c2_globals.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/c2_globals.hpp 2023-12-20 09:23:20.004812178 +0800 +diff --git a/hotspot/src/share/vm/opto/c2_globals.hpp b/hotspot/src/share/vm/opto/c2_globals.hpp +index 82d2efef..d373b204 100644 +--- a/hotspot/src/share/vm/opto/c2_globals.hpp ++++ b/hotspot/src/share/vm/opto/c2_globals.hpp @@ -22,6 +22,12 @@ * */ @@ -114087,9 +115328,38 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_arm # include "c2_globals_arm.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/chaitin.hpp b/hotspot/src/share/vm/opto/chaitin.hpp ---- a/hotspot/src/share/vm/opto/chaitin.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/chaitin.hpp 2023-12-20 09:23:20.008145473 +0800 +diff --git a/hotspot/src/share/vm/opto/c2compiler.cpp b/hotspot/src/share/vm/opto/c2compiler.cpp +index 137f4960..f689d64a 100644 +--- a/hotspot/src/share/vm/opto/c2compiler.cpp ++++ b/hotspot/src/share/vm/opto/c2compiler.cpp +@@ -22,6 +22,12 @@ + * + */ + ++/* ++ * This file has been modified by Loongson Technology in 2020. These ++ * modifications are Copyright (c) 2015, 2020, Loongson Technology, and are made ++ * available on the same license terms set forth above. ++ */ ++ + #include "precompiled.hpp" + #include "opto/c2compiler.hpp" + #include "opto/runtime.hpp" +@@ -39,6 +45,10 @@ + # include "adfiles/ad_zero.hpp" + #elif defined TARGET_ARCH_MODEL_ppc_64 + # include "adfiles/ad_ppc_64.hpp" ++#elif defined TARGET_ARCH_MODEL_mips_64 ++# include "adfiles/ad_mips_64.hpp" ++#elif defined TARGET_ARCH_MODEL_loongarch_64 ++# include "adfiles/ad_loongarch_64.hpp" + #endif + + // register information defined by ADLC +diff --git a/hotspot/src/share/vm/opto/chaitin.hpp b/hotspot/src/share/vm/opto/chaitin.hpp +index de6d443c..0b27dc93 100644 +--- a/hotspot/src/share/vm/opto/chaitin.hpp ++++ b/hotspot/src/share/vm/opto/chaitin.hpp @@ -22,6 +22,12 @@ * */ @@ -114103,7 +115373,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_OPTO_CHAITIN_HPP #define SHARE_VM_OPTO_CHAITIN_HPP -@@ -136,8 +142,12 @@ +@@ -136,8 +142,12 @@ public: // Number of registers this live range uses when it colors private: @@ -114116,7 +115386,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp public: int num_regs() const { return _num_regs; } void set_num_regs( int reg ) { assert( _num_regs == reg || !_num_regs, "" ); _num_regs = reg; } -@@ -145,7 +155,11 @@ +@@ -145,7 +155,11 @@ public: private: // Number of physical registers this live range uses when it colors // Architecture and register-set dependent @@ -114128,9 +115398,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp public: void set_reg_pressure(int i) { _reg_pressure = i; } int reg_pressure() const { return _reg_pressure; } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp ---- a/hotspot/src/share/vm/opto/compile.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/compile.cpp 2023-12-20 09:23:20.008145473 +0800 +diff --git a/hotspot/src/share/vm/opto/compile.cpp b/hotspot/src/share/vm/opto/compile.cpp +index ae22ba84..9004dc0d 100644 +--- a/hotspot/src/share/vm/opto/compile.cpp ++++ b/hotspot/src/share/vm/opto/compile.cpp @@ -22,6 +22,12 @@ * */ @@ -114155,10 +115426,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif // -------------------- Compile::mach_constant_base_node ----------------------- -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp ---- a/hotspot/src/share/vm/opto/compile.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/compile.hpp 2023-12-20 09:23:20.008145473 +0800 -@@ -1025,7 +1025,7 @@ +diff --git a/hotspot/src/share/vm/opto/compile.hpp b/hotspot/src/share/vm/opto/compile.hpp +index b4f4cfef..d263ee2f 100644 +--- a/hotspot/src/share/vm/opto/compile.hpp ++++ b/hotspot/src/share/vm/opto/compile.hpp +@@ -1025,7 +1025,7 @@ class Compile : public Phase { bool in_scratch_emit_size() const { return _in_scratch_emit_size; } enum ScratchBufferBlob { @@ -114167,9 +115439,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp MAX_locs_size = 128, // number of relocInfo elements MAX_const_size = 128, MAX_stubs_size = 128 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp ---- a/hotspot/src/share/vm/opto/gcm.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/gcm.cpp 2023-12-20 09:23:20.011478768 +0800 +diff --git a/hotspot/src/share/vm/opto/gcm.cpp b/hotspot/src/share/vm/opto/gcm.cpp +index f51484ef..12457b7c 100644 +--- a/hotspot/src/share/vm/opto/gcm.cpp ++++ b/hotspot/src/share/vm/opto/gcm.cpp @@ -22,6 +22,12 @@ * */ @@ -114194,9 +115467,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp ---- a/hotspot/src/share/vm/opto/lcm.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/lcm.cpp 2023-12-20 09:23:20.011478768 +0800 +diff --git a/hotspot/src/share/vm/opto/lcm.cpp b/hotspot/src/share/vm/opto/lcm.cpp +index c6178a71..2d492568 100644 +--- a/hotspot/src/share/vm/opto/lcm.cpp ++++ b/hotspot/src/share/vm/opto/lcm.cpp @@ -22,6 +22,12 @@ * */ @@ -114221,9 +115495,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif // Optimization - Graph Style -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/locknode.hpp b/hotspot/src/share/vm/opto/locknode.hpp ---- a/hotspot/src/share/vm/opto/locknode.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/locknode.hpp 2023-12-20 09:23:20.014812063 +0800 +diff --git a/hotspot/src/share/vm/opto/locknode.hpp b/hotspot/src/share/vm/opto/locknode.hpp +index b320f6bf..4bfb0ff0 100644 +--- a/hotspot/src/share/vm/opto/locknode.hpp ++++ b/hotspot/src/share/vm/opto/locknode.hpp @@ -22,6 +22,12 @@ * */ @@ -114248,9 +115523,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif //------------------------------BoxLockNode------------------------------------ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp ---- a/hotspot/src/share/vm/opto/matcher.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/matcher.cpp 2023-12-20 09:23:20.018145359 +0800 +diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp +index 6660b4b4..dec46861 100644 +--- a/hotspot/src/share/vm/opto/matcher.cpp ++++ b/hotspot/src/share/vm/opto/matcher.cpp @@ -22,6 +22,12 @@ * */ @@ -114275,9 +115551,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif OptoReg::Name OptoReg::c_frame_pointer; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp ---- a/hotspot/src/share/vm/opto/output.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/output.cpp 2023-12-20 09:23:20.018145359 +0800 +diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp +index 6032b72a..7fb4dea2 100644 +--- a/hotspot/src/share/vm/opto/output.cpp ++++ b/hotspot/src/share/vm/opto/output.cpp @@ -22,6 +22,12 @@ * */ @@ -114291,7 +115568,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "asm/assembler.inline.hpp" #include "code/compiledIC.hpp" -@@ -844,6 +850,27 @@ +@@ -844,6 +850,27 @@ void Compile::Process_OopMap_Node(MachNode *mach, int current_offset) { // Add the safepoint in the DebugInfoRecorder if( !mach->is_MachCall() ) { mcall = NULL; @@ -114319,7 +115596,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp debug_info()->add_safepoint(safepoint_pc_offset, sfn->_oop_map); } else { mcall = mach->as_MachCall(); -@@ -1502,6 +1529,22 @@ +@@ -1502,6 +1529,22 @@ void Compile::fill_buffer(CodeBuffer* cb, uint* blk_starts) { DEBUG_ONLY( uint instr_offset = cb->insts_size(); ) n->emit(*cb, _regalloc); current_offset = cb->insts_size(); @@ -114342,9 +115619,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Above we only verified that there is enough space in the instruction section. // However, the instruction may emit stubs that cause code buffer expansion. -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/output.hpp b/hotspot/src/share/vm/opto/output.hpp ---- a/hotspot/src/share/vm/opto/output.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/output.hpp 2023-12-20 09:23:20.018145359 +0800 +diff --git a/hotspot/src/share/vm/opto/output.hpp b/hotspot/src/share/vm/opto/output.hpp +index ba728413..37f954de 100644 +--- a/hotspot/src/share/vm/opto/output.hpp ++++ b/hotspot/src/share/vm/opto/output.hpp @@ -22,6 +22,12 @@ * */ @@ -114369,9 +115647,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif class Arena; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/regmask.cpp b/hotspot/src/share/vm/opto/regmask.cpp ---- a/hotspot/src/share/vm/opto/regmask.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/regmask.cpp 2023-12-20 09:23:20.021478654 +0800 +diff --git a/hotspot/src/share/vm/opto/regmask.cpp b/hotspot/src/share/vm/opto/regmask.cpp +index 352ccfb9..9a656d03 100644 +--- a/hotspot/src/share/vm/opto/regmask.cpp ++++ b/hotspot/src/share/vm/opto/regmask.cpp @@ -22,6 +22,12 @@ * */ @@ -114396,9 +115675,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif #define RM_SIZE _RM_SIZE /* a constant private to the class RegMask */ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/regmask.hpp b/hotspot/src/share/vm/opto/regmask.hpp ---- a/hotspot/src/share/vm/opto/regmask.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/regmask.hpp 2023-12-20 09:23:20.021478654 +0800 +diff --git a/hotspot/src/share/vm/opto/regmask.hpp b/hotspot/src/share/vm/opto/regmask.hpp +index 5ceebb3f..6d08b687 100644 +--- a/hotspot/src/share/vm/opto/regmask.hpp ++++ b/hotspot/src/share/vm/opto/regmask.hpp @@ -22,6 +22,12 @@ * */ @@ -114423,9 +115703,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif // Some fun naming (textual) substitutions: -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp ---- a/hotspot/src/share/vm/opto/runtime.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/runtime.cpp 2023-12-20 09:23:20.021478654 +0800 +diff --git a/hotspot/src/share/vm/opto/runtime.cpp b/hotspot/src/share/vm/opto/runtime.cpp +index a43b37f2..f2bcafa2 100644 +--- a/hotspot/src/share/vm/opto/runtime.cpp ++++ b/hotspot/src/share/vm/opto/runtime.cpp @@ -22,6 +22,12 @@ * */ @@ -114450,9 +115731,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp ---- a/hotspot/src/share/vm/opto/type.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/opto/type.cpp 2023-12-20 09:23:20.024811948 +0800 +diff --git a/hotspot/src/share/vm/opto/type.cpp b/hotspot/src/share/vm/opto/type.cpp +index 58572f13..299d48b1 100644 +--- a/hotspot/src/share/vm/opto/type.cpp ++++ b/hotspot/src/share/vm/opto/type.cpp @@ -22,6 +22,12 @@ * */ @@ -114466,7 +115748,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "ci/ciMethodData.hpp" #include "ci/ciTypeFlow.hpp" -@@ -68,6 +74,16 @@ +@@ -68,6 +74,16 @@ const Type::TypeInfo Type::_type_info[Type::lastype] = { { Bad, T_ILLEGAL, "vectord:", false, Op_RegD, relocInfo::none }, // VectorD { Bad, T_ILLEGAL, "vectorx:", false, 0, relocInfo::none }, // VectorX { Bad, T_ILLEGAL, "vectory:", false, 0, relocInfo::none }, // VectorY @@ -114483,9 +115765,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #elif defined(PPC64) { Bad, T_ILLEGAL, "vectors:", false, 0, relocInfo::none }, // VectorS { Bad, T_ILLEGAL, "vectord:", false, Op_RegL, relocInfo::none }, // VectorD -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/prims/jniCheck.cpp b/hotspot/src/share/vm/prims/jniCheck.cpp ---- a/hotspot/src/share/vm/prims/jniCheck.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/prims/jniCheck.cpp 2023-12-20 09:23:20.028145243 +0800 +diff --git a/hotspot/src/share/vm/prims/jniCheck.cpp b/hotspot/src/share/vm/prims/jniCheck.cpp +index 593ca8a1..82813b71 100644 +--- a/hotspot/src/share/vm/prims/jniCheck.cpp ++++ b/hotspot/src/share/vm/prims/jniCheck.cpp @@ -22,6 +22,12 @@ * */ @@ -114512,9 +115795,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Complain every extra number of unplanned local refs #define CHECK_JNI_LOCAL_REF_CAP_WARN_THRESHOLD 32 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/prims/jni_md.h b/hotspot/src/share/vm/prims/jni_md.h ---- a/hotspot/src/share/vm/prims/jni_md.h 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/prims/jni_md.h 2023-12-20 09:23:20.028145243 +0800 +diff --git a/hotspot/src/share/vm/prims/jni_md.h b/hotspot/src/share/vm/prims/jni_md.h +index 6209a664..271715d4 100644 +--- a/hotspot/src/share/vm/prims/jni_md.h ++++ b/hotspot/src/share/vm/prims/jni_md.h @@ -22,6 +22,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. @@ -114541,9 +115825,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp /* -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp ---- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp 2023-12-20 09:23:20.031478538 +0800 +diff --git a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp +index ab31d0d9..0d8570b7 100644 +--- a/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp ++++ b/hotspot/src/share/vm/prims/jvmtiClassFileReconstituter.cpp @@ -22,6 +22,12 @@ * */ @@ -114570,9 +115855,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // FIXME: add Deprecated attribute // FIXME: fix Synthetic attribute // FIXME: per Serguei, add error return handling for ConstantPool::copy_cpool_bytes() -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/prims/methodHandles.hpp b/hotspot/src/share/vm/prims/methodHandles.hpp ---- a/hotspot/src/share/vm/prims/methodHandles.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/prims/methodHandles.hpp 2023-12-20 09:23:20.034811834 +0800 +diff --git a/hotspot/src/share/vm/prims/methodHandles.hpp b/hotspot/src/share/vm/prims/methodHandles.hpp +index db6e0618..84108285 100644 +--- a/hotspot/src/share/vm/prims/methodHandles.hpp ++++ b/hotspot/src/share/vm/prims/methodHandles.hpp @@ -22,6 +22,12 @@ * */ @@ -114586,7 +115872,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_PRIMS_METHODHANDLES_HPP #define SHARE_VM_PRIMS_METHODHANDLES_HPP -@@ -198,6 +204,13 @@ +@@ -198,6 +204,13 @@ public: #ifdef TARGET_ARCH_ppc # include "methodHandles_ppc.hpp" #endif @@ -114600,9 +115886,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Tracing static void trace_method_handle(MacroAssembler* _masm, const char* adaptername) PRODUCT_RETURN; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/atomic.inline.hpp b/hotspot/src/share/vm/runtime/atomic.inline.hpp ---- a/hotspot/src/share/vm/runtime/atomic.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/atomic.inline.hpp 2023-12-20 09:23:20.038145129 +0800 +diff --git a/hotspot/src/share/vm/runtime/atomic.inline.hpp b/hotspot/src/share/vm/runtime/atomic.inline.hpp +index 222f29cb..7c7c6edb 100644 +--- a/hotspot/src/share/vm/runtime/atomic.inline.hpp ++++ b/hotspot/src/share/vm/runtime/atomic.inline.hpp @@ -22,6 +22,12 @@ * */ @@ -114629,9 +115916,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_OS_ARCH_linux_sparc # include "atomic_linux_sparc.inline.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp ---- a/hotspot/src/share/vm/runtime/deoptimization.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/deoptimization.cpp 2023-12-20 09:23:20.038145129 +0800 +diff --git a/hotspot/src/share/vm/runtime/deoptimization.cpp b/hotspot/src/share/vm/runtime/deoptimization.cpp +index f91afdc4..36a924fd 100644 +--- a/hotspot/src/share/vm/runtime/deoptimization.cpp ++++ b/hotspot/src/share/vm/runtime/deoptimization.cpp @@ -22,6 +22,12 @@ * */ @@ -114671,9 +115959,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif // COMPILER2 PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp ---- a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp 2023-12-20 09:23:20.038145129 +0800 +diff --git a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp +index db568def..490c5f5a 100644 +--- a/hotspot/src/share/vm/runtime/dtraceJSDT.hpp ++++ b/hotspot/src/share/vm/runtime/dtraceJSDT.hpp @@ -22,6 +22,12 @@ * */ @@ -114700,9 +115989,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp class RegisteredProbes; typedef jlong OpaqueProbes; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/frame.cpp b/hotspot/src/share/vm/runtime/frame.cpp ---- a/hotspot/src/share/vm/runtime/frame.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/frame.cpp 2023-12-20 09:23:20.041478424 +0800 +diff --git a/hotspot/src/share/vm/runtime/frame.cpp b/hotspot/src/share/vm/runtime/frame.cpp +index 338b7ad3..5a161133 100644 +--- a/hotspot/src/share/vm/runtime/frame.cpp ++++ b/hotspot/src/share/vm/runtime/frame.cpp @@ -22,6 +22,12 @@ * */ @@ -114730,9 +116020,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/frame.hpp b/hotspot/src/share/vm/runtime/frame.hpp ---- a/hotspot/src/share/vm/runtime/frame.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/frame.hpp 2023-12-20 09:23:20.041478424 +0800 +diff --git a/hotspot/src/share/vm/runtime/frame.hpp b/hotspot/src/share/vm/runtime/frame.hpp +index 2d80ecc2..4a9e6edb 100644 +--- a/hotspot/src/share/vm/runtime/frame.hpp ++++ b/hotspot/src/share/vm/runtime/frame.hpp @@ -22,6 +22,12 @@ * */ @@ -114757,7 +116048,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif #endif // COMPILER2 #ifdef TARGET_ARCH_zero -@@ -489,6 +499,12 @@ +@@ -489,6 +499,12 @@ class frame VALUE_OBJ_CLASS_SPEC { #ifdef TARGET_ARCH_x86 # include "frame_x86.hpp" #endif @@ -114770,9 +116061,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "frame_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/frame.inline.hpp b/hotspot/src/share/vm/runtime/frame.inline.hpp ---- a/hotspot/src/share/vm/runtime/frame.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/frame.inline.hpp 2023-12-20 09:23:20.041478424 +0800 +diff --git a/hotspot/src/share/vm/runtime/frame.inline.hpp b/hotspot/src/share/vm/runtime/frame.inline.hpp +index 710b8230..704cc8df 100644 +--- a/hotspot/src/share/vm/runtime/frame.inline.hpp ++++ b/hotspot/src/share/vm/runtime/frame.inline.hpp @@ -22,6 +22,12 @@ * */ @@ -114799,7 +116091,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_zero # include "entryFrame_zero.hpp" # include "fakeStubFrame_zero.hpp" -@@ -115,6 +127,12 @@ +@@ -115,6 +127,12 @@ inline oop* frame::interpreter_frame_temp_oop_addr() const { #ifdef TARGET_ARCH_ppc # include "frame_ppc.inline.hpp" #endif @@ -114812,9 +116104,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif // SHARE_VM_RUNTIME_FRAME_INLINE_HPP -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp ---- a/hotspot/src/share/vm/runtime/globals.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/globals.hpp 2023-12-20 09:23:20.041478424 +0800 +diff --git a/hotspot/src/share/vm/runtime/globals.hpp b/hotspot/src/share/vm/runtime/globals.hpp +index 23ce8af5..f36137aa 100644 +--- a/hotspot/src/share/vm/runtime/globals.hpp ++++ b/hotspot/src/share/vm/runtime/globals.hpp @@ -55,6 +55,12 @@ #ifdef TARGET_ARCH_ppc # include "globals_ppc.hpp" @@ -114867,7 +116160,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_arm # include "c2_globals_arm.hpp" #endif -@@ -3209,7 +3233,7 @@ +@@ -3209,7 +3233,7 @@ class CommandLineFlags { product(uintx, InitialHeapSize, 0, \ "Initial heap size (in bytes); zero means use ergonomics") \ \ @@ -114876,9 +116169,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp "Maximum heap size (in bytes)") \ \ product(uintx, OldSize, ScaleForWordSize(4*M), \ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/icache.hpp b/hotspot/src/share/vm/runtime/icache.hpp ---- a/hotspot/src/share/vm/runtime/icache.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/icache.hpp 2023-12-20 09:23:20.041478424 +0800 +diff --git a/hotspot/src/share/vm/runtime/icache.hpp b/hotspot/src/share/vm/runtime/icache.hpp +index ba81a06f..9c0cfdb7 100644 +--- a/hotspot/src/share/vm/runtime/icache.hpp ++++ b/hotspot/src/share/vm/runtime/icache.hpp @@ -22,6 +22,12 @@ * */ @@ -114892,7 +116186,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_RUNTIME_ICACHE_HPP #define SHARE_VM_RUNTIME_ICACHE_HPP -@@ -86,7 +92,12 @@ +@@ -86,7 +92,12 @@ class AbstractICache : AllStatic { #ifdef TARGET_ARCH_ppc # include "icache_ppc.hpp" #endif @@ -114906,9 +116200,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp class ICacheStubGenerator : public StubCodeGenerator { -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/javaCalls.hpp b/hotspot/src/share/vm/runtime/javaCalls.hpp ---- a/hotspot/src/share/vm/runtime/javaCalls.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/javaCalls.hpp 2023-12-20 09:23:20.041478424 +0800 +diff --git a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp +index 0a263b01..9ba0deca 100644 +--- a/hotspot/src/share/vm/runtime/java.cpp ++++ b/hotspot/src/share/vm/runtime/java.cpp @@ -22,6 +22,12 @@ * */ @@ -114919,25 +116214,26 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * available on the same license terms set forth above. + */ + - #ifndef SHARE_VM_RUNTIME_JAVACALLS_HPP - #define SHARE_VM_RUNTIME_JAVACALLS_HPP - -@@ -49,6 +55,12 @@ + #include "precompiled.hpp" + #include "classfile/classLoader.hpp" + #include "classfile/symbolTable.hpp" +@@ -84,6 +90,12 @@ #ifdef TARGET_ARCH_ppc - # include "jniTypes_ppc.hpp" + # include "vm_version_ppc.hpp" #endif +#ifdef TARGET_ARCH_mips -+# include "jniTypes_mips.hpp" ++# include "vm_version_mips.hpp" +#endif +#ifdef TARGET_ARCH_loongarch -+# include "jniTypes_loongarch.hpp" ++# include "vm_version_loongarch.hpp" +#endif - - // A JavaCallWrapper is constructed before each JavaCall and destructed after the call. - // Its purpose is to allocate/deallocate a new handle block and to save/restore the last -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/java.cpp b/hotspot/src/share/vm/runtime/java.cpp ---- a/hotspot/src/share/vm/runtime/java.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/java.cpp 2023-12-20 09:23:20.041478424 +0800 + #if INCLUDE_ALL_GCS + #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" + #include "gc_implementation/parallelScavenge/psScavenge.hpp" +diff --git a/hotspot/src/share/vm/runtime/javaCalls.hpp b/hotspot/src/share/vm/runtime/javaCalls.hpp +index 6126bbe7..1747e2b2 100644 +--- a/hotspot/src/share/vm/runtime/javaCalls.hpp ++++ b/hotspot/src/share/vm/runtime/javaCalls.hpp @@ -22,6 +22,12 @@ * */ @@ -114948,25 +116244,26 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp + * available on the same license terms set forth above. + */ + - #include "precompiled.hpp" - #include "classfile/classLoader.hpp" - #include "classfile/symbolTable.hpp" -@@ -84,6 +90,12 @@ + #ifndef SHARE_VM_RUNTIME_JAVACALLS_HPP + #define SHARE_VM_RUNTIME_JAVACALLS_HPP + +@@ -49,6 +55,12 @@ #ifdef TARGET_ARCH_ppc - # include "vm_version_ppc.hpp" + # include "jniTypes_ppc.hpp" #endif +#ifdef TARGET_ARCH_mips -+# include "vm_version_mips.hpp" ++# include "jniTypes_mips.hpp" +#endif +#ifdef TARGET_ARCH_loongarch -+# include "vm_version_loongarch.hpp" ++# include "jniTypes_loongarch.hpp" +#endif - #if INCLUDE_ALL_GCS - #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" - #include "gc_implementation/parallelScavenge/psScavenge.hpp" -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp ---- a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp 2023-12-20 09:23:20.044811719 +0800 + + // A JavaCallWrapper is constructed before each JavaCall and destructed after the call. + // Its purpose is to allocate/deallocate a new handle block and to save/restore the last +diff --git a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp +index 129a01e2..c2b1b2e6 100644 +--- a/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp ++++ b/hotspot/src/share/vm/runtime/javaFrameAnchor.hpp @@ -22,6 +22,12 @@ * */ @@ -114980,7 +116277,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP #define SHARE_VM_RUNTIME_JAVAFRAMEANCHOR_HPP -@@ -80,6 +86,12 @@ +@@ -80,6 +86,12 @@ friend class JavaCallWrapper; #ifdef TARGET_ARCH_x86 # include "javaFrameAnchor_x86.hpp" #endif @@ -114993,10 +116290,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_ARCH_aarch64 # include "javaFrameAnchor_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp ---- a/hotspot/src/share/vm/runtime/os.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/os.cpp 2023-12-20 09:23:20.044811719 +0800 -@@ -1122,7 +1122,8 @@ +diff --git a/hotspot/src/share/vm/runtime/os.cpp b/hotspot/src/share/vm/runtime/os.cpp +index 96eed036..28c78409 100644 +--- a/hotspot/src/share/vm/runtime/os.cpp ++++ b/hotspot/src/share/vm/runtime/os.cpp +@@ -1122,7 +1122,8 @@ bool os::is_first_C_frame(frame* fr) { uintptr_t old_fp = (uintptr_t)fr->link(); if ((old_fp & fp_align_mask) != 0) return true; @@ -115006,9 +116304,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // stack grows downwards; if old_fp is below current fp or if the stack // frame is too large, either the stack is corrupted or fp is not saved -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp ---- a/hotspot/src/share/vm/runtime/os.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/os.hpp 2023-12-20 09:23:20.044811719 +0800 +diff --git a/hotspot/src/share/vm/runtime/os.hpp b/hotspot/src/share/vm/runtime/os.hpp +index 836c231b..0ca6e645 100644 +--- a/hotspot/src/share/vm/runtime/os.hpp ++++ b/hotspot/src/share/vm/runtime/os.hpp @@ -22,6 +22,12 @@ * */ @@ -115022,7 +116321,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_RUNTIME_OS_HPP #define SHARE_VM_RUNTIME_OS_HPP -@@ -857,6 +863,12 @@ +@@ -857,6 +863,12 @@ class os: AllStatic { #ifdef TARGET_OS_ARCH_linux_x86 # include "os_linux_x86.hpp" #endif @@ -115035,9 +116334,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_OS_ARCH_linux_aarch64 # include "os_linux_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/prefetch.inline.hpp b/hotspot/src/share/vm/runtime/prefetch.inline.hpp ---- a/hotspot/src/share/vm/runtime/prefetch.inline.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/prefetch.inline.hpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/prefetch.inline.hpp b/hotspot/src/share/vm/runtime/prefetch.inline.hpp +index f4e30de3..fec16f84 100644 +--- a/hotspot/src/share/vm/runtime/prefetch.inline.hpp ++++ b/hotspot/src/share/vm/runtime/prefetch.inline.hpp @@ -46,6 +46,12 @@ #ifdef TARGET_OS_ARCH_linux_ppc # include "prefetch_linux_ppc.inline.hpp" @@ -115051,9 +116351,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Solaris #ifdef TARGET_OS_ARCH_solaris_x86 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/registerMap.hpp b/hotspot/src/share/vm/runtime/registerMap.hpp ---- a/hotspot/src/share/vm/runtime/registerMap.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/registerMap.hpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/registerMap.hpp b/hotspot/src/share/vm/runtime/registerMap.hpp +index 67ef212d..1e26dfcb 100644 +--- a/hotspot/src/share/vm/runtime/registerMap.hpp ++++ b/hotspot/src/share/vm/runtime/registerMap.hpp @@ -22,6 +22,12 @@ * */ @@ -115080,7 +116381,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp class JavaThread; -@@ -156,6 +168,12 @@ +@@ -156,6 +168,12 @@ class RegisterMap : public StackObj { #ifdef TARGET_ARCH_ppc # include "registerMap_ppc.hpp" #endif @@ -115093,9 +116394,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp }; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/relocator.hpp b/hotspot/src/share/vm/runtime/relocator.hpp ---- a/hotspot/src/share/vm/runtime/relocator.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/relocator.hpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/relocator.hpp b/hotspot/src/share/vm/runtime/relocator.hpp +index bb19c75f..53f3c9f6 100644 +--- a/hotspot/src/share/vm/runtime/relocator.hpp ++++ b/hotspot/src/share/vm/runtime/relocator.hpp @@ -22,6 +22,12 @@ * */ @@ -115122,9 +116424,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // This code has been converted from the 1.1E java virtual machine // Thanks to the JavaTopics group for using the code -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp ---- a/hotspot/src/share/vm/runtime/safepoint.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/safepoint.cpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/safepoint.cpp b/hotspot/src/share/vm/runtime/safepoint.cpp +index 440617c8..be0e4dd1 100644 +--- a/hotspot/src/share/vm/runtime/safepoint.cpp ++++ b/hotspot/src/share/vm/runtime/safepoint.cpp @@ -22,6 +22,12 @@ * */ @@ -115153,9 +116456,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #if INCLUDE_ALL_GCS #include "gc_implementation/concurrentMarkSweep/concurrentMarkSweepThread.hpp" #include "gc_implementation/shared/suspendibleThreadSet.hpp" -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp ---- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp +index 5f540247..abcd6066 100644 +--- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp ++++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp @@ -22,6 +22,12 @@ * */ @@ -115185,7 +116489,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef COMPILER1 #include "c1/c1_Runtime1.hpp" #endif -@@ -220,7 +235,6 @@ +@@ -220,7 +235,6 @@ void SharedRuntime::print_ic_miss_histogram() { } } #endif // PRODUCT @@ -115193,9 +116497,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #if INCLUDE_ALL_GCS // G1 write-barrier pre: executed before a pointer store. -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp b/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp ---- a/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp b/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp +index 37880d8a..3987880b 100644 +--- a/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp ++++ b/hotspot/src/share/vm/runtime/sharedRuntimeTrig.cpp @@ -22,6 +22,12 @@ * */ @@ -115209,7 +116514,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "prims/jni.h" #include "runtime/interfaceSupport.hpp" -@@ -534,6 +540,15 @@ +@@ -534,6 +540,15 @@ static SAFEBUF int __ieee754_rem_pio2(double x, double *y) { * then 3 2 * sin(x) = x + (S1*x + (x *(r-y/2)+y)) */ @@ -115225,9 +116530,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp static const double S1 = -1.66666666666666324348e-01, /* 0xBFC55555, 0x55555549 */ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/stackValueCollection.cpp b/hotspot/src/share/vm/runtime/stackValueCollection.cpp ---- a/hotspot/src/share/vm/runtime/stackValueCollection.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/stackValueCollection.cpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/stackValueCollection.cpp b/hotspot/src/share/vm/runtime/stackValueCollection.cpp +index 87747683..fe81c1bf 100644 +--- a/hotspot/src/share/vm/runtime/stackValueCollection.cpp ++++ b/hotspot/src/share/vm/runtime/stackValueCollection.cpp @@ -22,6 +22,12 @@ * */ @@ -115254,9 +116560,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp PRAGMA_FORMAT_MUTE_WARNINGS_FOR_GCC -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/statSampler.cpp b/hotspot/src/share/vm/runtime/statSampler.cpp ---- a/hotspot/src/share/vm/runtime/statSampler.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/statSampler.cpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/statSampler.cpp b/hotspot/src/share/vm/runtime/statSampler.cpp +index 41f46962..3b430890 100644 +--- a/hotspot/src/share/vm/runtime/statSampler.cpp ++++ b/hotspot/src/share/vm/runtime/statSampler.cpp @@ -22,6 +22,12 @@ * */ @@ -115283,9 +116590,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // -------------------------------------------------------- // StatSamplerTask -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp ---- a/hotspot/src/share/vm/runtime/stubRoutines.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp 2023-12-20 09:23:20.048145015 +0800 +diff --git a/hotspot/src/share/vm/runtime/stubRoutines.hpp b/hotspot/src/share/vm/runtime/stubRoutines.hpp +index e18b9127..9bf93376 100644 +--- a/hotspot/src/share/vm/runtime/stubRoutines.hpp ++++ b/hotspot/src/share/vm/runtime/stubRoutines.hpp @@ -22,6 +22,12 @@ * */ @@ -115312,7 +116620,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // StubRoutines provides entry points to assembly routines used by // compiled code and the run-time system. Platform-specific entry -@@ -116,6 +128,10 @@ +@@ -116,6 +128,10 @@ class StubRoutines: AllStatic { # include "stubRoutines_zero.hpp" #elif defined TARGET_ARCH_MODEL_ppc_64 # include "stubRoutines_ppc_64.hpp" @@ -115323,9 +116631,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif static jint _verify_oop_count; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp ---- a/hotspot/src/share/vm/runtime/thread.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/thread.cpp 2023-12-20 09:23:20.051478310 +0800 +diff --git a/hotspot/src/share/vm/runtime/thread.cpp b/hotspot/src/share/vm/runtime/thread.cpp +index e6586c40..3db678ff 100644 +--- a/hotspot/src/share/vm/runtime/thread.cpp ++++ b/hotspot/src/share/vm/runtime/thread.cpp @@ -22,6 +22,12 @@ * */ @@ -115339,9 +116648,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include "precompiled.hpp" #include "classfile/classLoader.hpp" #include "classfile/javaClasses.hpp" -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp ---- a/hotspot/src/share/vm/runtime/thread.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/thread.hpp 2023-12-20 09:23:20.051478310 +0800 +diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp +index 1c19ab72..aa69217e 100644 +--- a/hotspot/src/share/vm/runtime/thread.hpp ++++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -22,6 +22,12 @@ * */ @@ -115355,7 +116665,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_RUNTIME_THREAD_HPP #define SHARE_VM_RUNTIME_THREAD_HPP -@@ -1711,6 +1717,12 @@ +@@ -1711,6 +1717,12 @@ public: #ifdef TARGET_OS_ARCH_linux_x86 # include "thread_linux_x86.hpp" #endif @@ -115368,9 +116678,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_OS_ARCH_linux_aarch64 # include "thread_linux_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/threadLocalStorage.hpp b/hotspot/src/share/vm/runtime/threadLocalStorage.hpp ---- a/hotspot/src/share/vm/runtime/threadLocalStorage.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/threadLocalStorage.hpp 2023-12-20 09:23:20.051478310 +0800 +diff --git a/hotspot/src/share/vm/runtime/threadLocalStorage.hpp b/hotspot/src/share/vm/runtime/threadLocalStorage.hpp +index 58c1afc8..0938b2ed 100644 +--- a/hotspot/src/share/vm/runtime/threadLocalStorage.hpp ++++ b/hotspot/src/share/vm/runtime/threadLocalStorage.hpp @@ -22,6 +22,12 @@ * */ @@ -115384,7 +116695,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_RUNTIME_THREADLOCALSTORAGE_HPP #define SHARE_VM_RUNTIME_THREADLOCALSTORAGE_HPP -@@ -51,6 +57,12 @@ +@@ -51,6 +57,12 @@ class ThreadLocalStorage : AllStatic { #ifdef TARGET_OS_ARCH_linux_x86 # include "threadLS_linux_x86.hpp" #endif @@ -115397,9 +116708,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifdef TARGET_OS_ARCH_linux_aarch64 # include "threadLS_linux_aarch64.hpp" #endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/virtualspace.cpp b/hotspot/src/share/vm/runtime/virtualspace.cpp ---- a/hotspot/src/share/vm/runtime/virtualspace.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/virtualspace.cpp 2023-12-20 09:23:20.051478310 +0800 +diff --git a/hotspot/src/share/vm/runtime/virtualspace.cpp b/hotspot/src/share/vm/runtime/virtualspace.cpp +index 66392b75..5ced38d8 100644 +--- a/hotspot/src/share/vm/runtime/virtualspace.cpp ++++ b/hotspot/src/share/vm/runtime/virtualspace.cpp @@ -1,5 +1,6 @@ /* * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. @@ -115407,7 +116719,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it -@@ -147,6 +148,15 @@ +@@ -147,6 +148,15 @@ void ReservedSpace::initialize(size_t size, size_t alignment, bool large, bool special = large && !os::can_commit_large_page_memory(); char* base = NULL; @@ -115423,7 +116735,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp if (requested_address != 0) { requested_address -= noaccess_prefix; // adjust requested address assert(requested_address != NULL, "huge noaccess prefix?"); -@@ -193,6 +203,12 @@ +@@ -193,6 +203,12 @@ void ReservedSpace::initialize(size_t size, size_t alignment, bool large, if (failed_to_reserve_as_requested(base, requested_address, size, false)) { // OS ignored requested address. Try different address. base = NULL; @@ -115436,9 +116748,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } } else { base = os::reserve_memory(size, NULL, alignment); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp ---- a/hotspot/src/share/vm/runtime/vmStructs.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/vmStructs.cpp 2023-12-20 09:23:20.054811605 +0800 +diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp +index 32e3921b..c6cc4c43 100644 +--- a/hotspot/src/share/vm/runtime/vmStructs.cpp ++++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -22,6 +22,12 @@ * */ @@ -115489,9 +116802,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #endif #endif // COMPILER2 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp ---- a/hotspot/src/share/vm/runtime/vm_version.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/runtime/vm_version.cpp 2023-12-20 09:23:20.054811605 +0800 +diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp +index 91f9c70f..d8dcfcfc 100644 +--- a/hotspot/src/share/vm/runtime/vm_version.cpp ++++ b/hotspot/src/share/vm/runtime/vm_version.cpp @@ -22,6 +22,12 @@ * */ @@ -115518,7 +116832,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp const char* Abstract_VM_Version::_s_vm_release = Abstract_VM_Version::vm_release(); const char* Abstract_VM_Version::_s_internal_vm_info_string = Abstract_VM_Version::internal_vm_info_string(); -@@ -193,6 +205,14 @@ +@@ -193,6 +205,14 @@ const char* Abstract_VM_Version::jre_release_version() { #else #define CPU "ppc64" #endif @@ -115533,9 +116847,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #else #define CPU IA32_ONLY("x86") \ IA64_ONLY("ia64") \ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/utilities/copy.hpp b/hotspot/src/share/vm/utilities/copy.hpp ---- a/hotspot/src/share/vm/utilities/copy.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/utilities/copy.hpp 2024-01-30 13:54:24.896041236 +0800 +diff --git a/hotspot/src/share/vm/utilities/copy.hpp b/hotspot/src/share/vm/utilities/copy.hpp +index c1d82c70..73b858b8 100644 +--- a/hotspot/src/share/vm/utilities/copy.hpp ++++ b/hotspot/src/share/vm/utilities/copy.hpp @@ -22,6 +22,12 @@ * */ @@ -115549,7 +116864,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_UTILITIES_COPY_HPP #define SHARE_VM_UTILITIES_COPY_HPP -@@ -350,6 +356,13 @@ +@@ -350,6 +356,13 @@ class Copy : AllStatic { #ifdef TARGET_ARCH_ppc # include "copy_ppc.hpp" #endif @@ -115563,10 +116878,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp }; -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp ---- a/hotspot/src/share/vm/utilities/debug.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/utilities/debug.cpp 2023-12-20 09:23:20.061478196 +0800 -@@ -690,6 +690,7 @@ +diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp +index 58a32a2b..1026585f 100644 +--- a/hotspot/src/share/vm/utilities/debug.cpp ++++ b/hotspot/src/share/vm/utilities/debug.cpp +@@ -690,6 +690,7 @@ void help() { tty->print_cr(" pns($sp, $ebp, $pc) on Linux/x86 or"); tty->print_cr(" pns($sp, $fp, $pc) on Linux/AArch64 or"); tty->print_cr(" pns($sp, 0, $pc) on Linux/ppc64 or"); @@ -115574,9 +116890,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp tty->print_cr(" pns($sp + 0x7ff, 0, $pc) on Solaris/SPARC"); tty->print_cr(" - in gdb do 'set overload-resolution off' before calling pns()"); tty->print_cr(" - in dbx do 'frame 1' before calling pns()"); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp ---- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp 2023-12-20 09:23:20.064811491 +0800 +diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp +index 81866b84..61fc0c48 100644 +--- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp ++++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -22,6 +22,12 @@ * */ @@ -115590,7 +116907,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #ifndef SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP #define SHARE_VM_UTILITIES_GLOBALDEFINITIONS_HPP -@@ -455,6 +461,12 @@ +@@ -455,6 +461,12 @@ enum RTMState { #ifdef TARGET_ARCH_ppc # include "globalDefinitions_ppc.hpp" #endif @@ -115603,9 +116920,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp /* * If a platform does not support native stack walking -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/utilities/macros.hpp b/hotspot/src/share/vm/utilities/macros.hpp ---- a/hotspot/src/share/vm/utilities/macros.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/utilities/macros.hpp 2023-12-20 09:23:20.064811491 +0800 +diff --git a/hotspot/src/share/vm/utilities/macros.hpp b/hotspot/src/share/vm/utilities/macros.hpp +index 599e1074..41ef06e2 100644 +--- a/hotspot/src/share/vm/utilities/macros.hpp ++++ b/hotspot/src/share/vm/utilities/macros.hpp @@ -22,6 +22,12 @@ * */ @@ -115650,10 +116968,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #if defined(PPC32) || defined(PPC64) #ifndef PPC #define PPC -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/utilities/taskqueue.hpp b/hotspot/src/share/vm/utilities/taskqueue.hpp ---- a/hotspot/src/share/vm/utilities/taskqueue.hpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/utilities/taskqueue.hpp 2023-12-20 09:23:20.068144786 +0800 -@@ -121,11 +121,22 @@ +diff --git a/hotspot/src/share/vm/utilities/taskqueue.hpp b/hotspot/src/share/vm/utilities/taskqueue.hpp +index bc06cacc..46be35a3 100644 +--- a/hotspot/src/share/vm/utilities/taskqueue.hpp ++++ b/hotspot/src/share/vm/utilities/taskqueue.hpp +@@ -121,11 +121,22 @@ protected: Age(const Age& age) { _data = age._data; } Age(idx_t top, idx_t tag) { _fields._top = top; _fields._tag = tag; } @@ -115676,7 +116995,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // Increment top; if it wraps, increment tag also. void increment() { -@@ -195,23 +206,50 @@ +@@ -195,23 +206,50 @@ protected: public: TaskQueueSuper() : _bottom(0), _age() {} @@ -115728,7 +117047,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp _age.set(0); } -@@ -263,7 +301,9 @@ +@@ -263,7 +301,9 @@ protected: typedef typename TaskQueueSuper::Age Age; typedef typename TaskQueueSuper::idx_t idx_t; @@ -115738,7 +117057,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp using TaskQueueSuper::_age; using TaskQueueSuper::increment_index; using TaskQueueSuper::decrement_index; -@@ -327,7 +367,11 @@ +@@ -327,7 +367,11 @@ template void GenericTaskQueue::oops_do(OopClosure* f) { // tty->print_cr("START OopTaskQueue::oops_do"); uint iters = size(); @@ -115750,7 +117069,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp for (uint i = 0; i < iters; ++i) { index = decrement_index(index); // tty->print_cr(" doing entry %d," INTPTR_T " -> " INTPTR_T, -@@ -345,14 +389,22 @@ +@@ -345,14 +389,22 @@ template bool GenericTaskQueue::push_slow(E t, uint dirty_n_elems) { if (dirty_n_elems == N - 1) { // Actually means 0, so do the push. @@ -115773,7 +117092,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp TASKQUEUE_STATS_ONLY(stats.record_push()); return true; } -@@ -407,7 +459,11 @@ +@@ -407,7 +459,11 @@ bool GenericTaskQueue::pop_global(volatile E& t) { #if !(defined SPARC || defined IA32 || defined AMD64) OrderAccess::fence(); #endif @@ -115785,7 +117104,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp uint n_elems = size(localBot, oldAge.top()); if (n_elems == 0) { return false; -@@ -662,7 +718,11 @@ +@@ -662,7 +718,11 @@ public: template inline bool GenericTaskQueue::push(E t) { @@ -115797,7 +117116,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp assert(localBot < N, "_bottom out of range."); idx_t top = _age.top(); uint dirty_n_elems = dirty_size(localBot, top); -@@ -674,7 +734,11 @@ +@@ -674,7 +734,11 @@ GenericTaskQueue::push(E t) { // assignment. However, casting to E& means that we trigger an // unused-value warning. So, we cast the E& to void. (void) const_cast(_elems[localBot] = t); @@ -115809,7 +117128,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp TASKQUEUE_STATS_ONLY(stats.record_push()); return true; } else { -@@ -684,7 +748,11 @@ +@@ -684,7 +748,11 @@ GenericTaskQueue::push(E t) { template inline bool GenericTaskQueue::pop_local(volatile E& t) { @@ -115821,7 +117140,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // This value cannot be N-1. That can only occur as a result of // the assignment to bottom in this method. If it does, this method // resets the size to 0 before the next call (which is sequential, -@@ -693,7 +761,11 @@ +@@ -693,7 +761,11 @@ GenericTaskQueue::pop_local(volatile E& t) { assert(dirty_n_elems != N - 1, "Shouldn't be possible..."); if (dirty_n_elems == 0) return false; localBot = decrement_index(localBot); @@ -115833,9 +117152,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp // This is necessary to prevent any read below from being reordered // before the store just above. OrderAccess::fence(); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp ---- a/hotspot/src/share/vm/utilities/vmError.cpp 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/src/share/vm/utilities/vmError.cpp 2023-12-20 09:23:20.068144786 +0800 +diff --git a/hotspot/src/share/vm/utilities/vmError.cpp b/hotspot/src/share/vm/utilities/vmError.cpp +index fa7a3250..7098a98a 100644 +--- a/hotspot/src/share/vm/utilities/vmError.cpp ++++ b/hotspot/src/share/vm/utilities/vmError.cpp @@ -22,6 +22,13 @@ * */ @@ -115850,7 +117170,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp #include #include "precompiled.hpp" #include "compiler/compileBroker.hpp" -@@ -488,7 +495,12 @@ +@@ -488,7 +495,12 @@ void VMError::report(outputStream* st) { JDK_Version::runtime_name() : ""; const char* runtime_version = JDK_Version::runtime_version() != NULL ? JDK_Version::runtime_version() : ""; @@ -115864,9 +117184,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp st->print_cr("# Java VM: %s (%s %s %s %s)", Abstract_VM_Version::vm_name(), Abstract_VM_Version::vm_release(), -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh b/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh ---- a/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh 2023-12-20 09:23:20.104811033 +0800 +diff --git a/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh b/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh +index fcf1d04b..5b8e7dcc 100644 +--- a/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh ++++ b/hotspot/test/compiler/criticalnatives/argumentcorruption/Test8167409.sh @@ -24,6 +24,12 @@ # questions. # @@ -115880,7 +117201,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp ## @test Test8167409.sh ## @bug 8167409 ## @summary Invalid value passed to critical JNI function -@@ -68,6 +74,18 @@ +@@ -68,6 +74,18 @@ if [ $VM_CPU = "aarch64" ]; then exit 0; fi @@ -115899,10 +117220,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp THIS_DIR=. cp ${TESTSRC}${FS}*.java ${THIS_DIR} -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java ---- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java 2023-12-20 09:23:20.114810919 +0800 -@@ -34,11 +34,12 @@ +diff --git a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java +index fa9a6f20..885957cf 100644 +--- a/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java ++++ b/hotspot/test/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java +@@ -34,11 +34,12 @@ import com.oracle.java.testlibrary.cli.predicate.OrPredicate; public class GenericTestCaseForOtherCPU extends SHAOptionsBase.TestCase { public GenericTestCaseForOtherCPU(String optionName) { @@ -115917,10 +117239,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp } @Override -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java b/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java ---- a/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java 2023-12-20 09:23:20.128144100 +0800 -@@ -62,18 +62,24 @@ +diff --git a/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java b/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java +index dc8c3984..2427b2bf 100644 +--- a/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java ++++ b/hotspot/test/compiler/testlibrary/sha/predicate/IntrinsicPredicates.java +@@ -62,18 +62,24 @@ public class IntrinsicPredicates { = new OrPredicate( new CPUSpecificPredicate("sparc.*", new String[] { "sha1" }, null), @@ -115947,10 +117270,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp public static final BooleanSupplier SHA512_INSTRUCTION_AVAILABLE = new OrPredicate( -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/test/runtime/6929067/Test6929067.sh b/hotspot/test/runtime/6929067/Test6929067.sh ---- a/hotspot/test/runtime/6929067/Test6929067.sh 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/test/runtime/6929067/Test6929067.sh 2023-12-20 09:23:20.144810575 +0800 -@@ -97,6 +97,10 @@ +diff --git a/hotspot/test/runtime/6929067/Test6929067.sh b/hotspot/test/runtime/6929067/Test6929067.sh +index 2bbb3401..1a5482e6 100644 +--- a/hotspot/test/runtime/6929067/Test6929067.sh ++++ b/hotspot/test/runtime/6929067/Test6929067.sh +@@ -97,6 +97,10 @@ case "$ARCH" in i686) ARCH=i386 ;; @@ -115961,10 +117285,20 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp # Assuming other ARCH values need no translation esac -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/test/runtime/Unsafe/RangeCheck.java b/hotspot/test/runtime/Unsafe/RangeCheck.java ---- a/hotspot/test/runtime/Unsafe/RangeCheck.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/test/runtime/Unsafe/RangeCheck.java 2023-12-20 09:23:20.154810460 +0800 -@@ -43,6 +43,7 @@ +diff --git a/hotspot/test/runtime/Unsafe/RangeCheck.java b/hotspot/test/runtime/Unsafe/RangeCheck.java +index 9ded944c..0c8bcfb9 100644 +--- a/hotspot/test/runtime/Unsafe/RangeCheck.java ++++ b/hotspot/test/runtime/Unsafe/RangeCheck.java +@@ -28,6 +28,8 @@ + * @library /testlibrary + */ + ++import org.jcp.xml.dsig.internal.dom.Utils; ++ + import com.oracle.java.testlibrary.*; + import sun.misc.Unsafe; + +@@ -43,6 +45,7 @@ public class RangeCheck { true, "-Xmx32m", "-XX:-TransmitErrorReport", @@ -115972,10 +117306,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp DummyClassWithMainRangeCheck.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/test/test_env.sh b/hotspot/test/test_env.sh ---- a/hotspot/test/test_env.sh 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/test/test_env.sh 2023-12-20 09:23:20.161477051 +0800 -@@ -211,6 +211,29 @@ +diff --git a/hotspot/test/test_env.sh b/hotspot/test/test_env.sh +index 5ba4f28c..d9d8bb6b 100644 +--- a/hotspot/test/test_env.sh ++++ b/hotspot/test/test_env.sh +@@ -211,6 +211,29 @@ if [ $? = 0 ] then VM_CPU="aarch64" fi @@ -116005,10 +117340,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp export VM_TYPE VM_BITS VM_OS VM_CPU echo "VM_TYPE=${VM_TYPE}" echo "VM_BITS=${VM_BITS}" -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java ---- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java 2023-12-20 09:23:20.164810346 +0800 -@@ -126,6 +126,10 @@ +diff --git a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java +index 6a140793..56a6375b 100644 +--- a/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java ++++ b/hotspot/test/testlibrary/com/oracle/java/testlibrary/Platform.java +@@ -126,6 +126,10 @@ public class Platform { return isArch("aarch64"); } @@ -116019,7 +117355,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp private static boolean isArch(String archnameRE) { return Pattern.compile(archnameRE, Pattern.CASE_INSENSITIVE) .matcher(osArch) -@@ -136,6 +140,10 @@ +@@ -136,6 +140,10 @@ public class Platform { return osArch; } @@ -116030,10 +117366,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp /** * Return a boolean for whether we expect to be able to attach * the SA to our own processes on this system. -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java ---- a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java 2023-12-20 09:23:20.168143641 +0800 -@@ -43,7 +43,7 @@ +diff --git a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java +index 7d56a4a3..41825e18 100644 +--- a/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java ++++ b/hotspot/test/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java +@@ -43,7 +43,7 @@ import java.util.Set; */ public class TestMutuallyExclusivePlatformPredicates { private static enum MethodGroup { @@ -116042,33 +117379,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/hotsp BITNESS("is32bit", "is64bit"), OS("isAix", "isLinux", "isSolaris", "isWindows", "isOSX"), VM_TYPE("isClient", "isServer", "isGraal", "isMinimal"), -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/make/gensrc/GensrcMisc.gmk b/jdk/make/gensrc/GensrcMisc.gmk ---- a/jdk/make/gensrc/GensrcMisc.gmk 2024-01-11 09:53:23.000000000 +0800 -+++ b/jdk/make/gensrc/GensrcMisc.gmk 2023-12-20 09:23:20.694804279 +0800 -@@ -23,6 +23,12 @@ - # questions. - # - -+# -+# This file has been modified by Loongson Technology in 2018. These -+# modifications are Copyright (c) 2018, Loongson Technology, and are made -+# available on the same license terms set forth above. -+# -+ - include ProfileNames.gmk - - ################################################################################ -@@ -39,6 +45,7 @@ - $(SED) -e 's/@@launcher_name@@/$(LAUNCHER_NAME)/g' \ - -e 's/@@java_version@@/$(RELEASE)/g' \ - -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \ -+ -e 's/@@loongson_runtime_name@@/$(LOONGSON_RUNTIME_NAME)/g' \ - -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \ - -e 's/@@java_profile_name@@/$(call profile_version_name, $@)/g' \ - $< > $@.tmp -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/make/Images.gmk b/jdk/make/Images.gmk ---- a/jdk/make/Images.gmk 2024-01-11 09:53:23.000000000 +0800 -+++ b/jdk/make/Images.gmk 2023-12-20 09:23:20.618138492 +0800 +diff --git a/jdk/make/Images.gmk b/jdk/make/Images.gmk +index 991c0af7..91716856 100644 +--- a/jdk/make/Images.gmk ++++ b/jdk/make/Images.gmk @@ -23,6 +23,12 @@ # questions. # @@ -116082,7 +117396,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/m include $(SPEC) include MakeBase.gmk include JavaCompilation.gmk -@@ -650,6 +656,11 @@ +@@ -650,6 +656,11 @@ $(JDK_IMAGE_DIR)/src.zip: $(IMAGES_OUTPUTDIR)/src.zip $(ECHO) $(LOG_INFO) Copying $(patsubst $(OUTPUT_ROOT)/%,%,$@) $(install-file) @@ -116094,10 +117408,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/m ################################################################################ # Post processing (strip etc) -@@ -729,6 +740,14 @@ +@@ -728,6 +739,14 @@ ifneq ($(POST_STRIP_CMD), ) + endif - ################################################################################ ++################################################################################ +# Loongson added list, architecture dependent files +ifeq ($(OPENJDK_TARGET_CPU), mips64) + ifeq ($(OPENJDK_TARGET_CPU_ENDIAN), little) @@ -116105,11 +117420,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/m + endif +endif + -+################################################################################ + ################################################################################ # Include the custom makefile right here, after all variables have been defined - # so that they may be overridden, but before the main targets are declared, so -@@ -753,6 +772,7 @@ +@@ -753,6 +772,7 @@ jdk-image: $(JDK_BIN_TARGETS) $(JDKJRE_BIN_TARGETS) \ $(JDKJRE_DOC_TARGETS) $(JDK_DOC_TARGETS) \ $(JDK_INFO_FILE) $(JDKJRE_STRIP_LIST) $(JDK_BIN_STRIP_LIST) \ $(JDK_IMAGE_DIR)/src.zip \ @@ -116117,9 +117431,48 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/m $(JDK_BIN_ISADIR_LINK_TARGETS) $(JDKJRE_BIN_ISADIR_LINK_TARGETS) jre-overlay-image: $(JRE_OVERLAY_BIN_TARGETS) $(JRE_OVERLAY_LIB_TARGETS) \ -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/make/lib/SoundLibraries.gmk b/jdk/make/lib/SoundLibraries.gmk ---- a/jdk/make/lib/SoundLibraries.gmk 2024-01-11 09:53:23.000000000 +0800 -+++ b/jdk/make/lib/SoundLibraries.gmk 2023-12-20 09:23:20.694804279 +0800 +diff --git a/jdk/make/gensrc/GensrcMisc.gmk b/jdk/make/gensrc/GensrcMisc.gmk +index 0e3dee5c..d428ac8c 100644 +--- a/jdk/make/gensrc/GensrcMisc.gmk ++++ b/jdk/make/gensrc/GensrcMisc.gmk +@@ -23,6 +23,12 @@ + # questions. + # + ++# ++# This file has been modified by Loongson Technology in 2018. These ++# modifications are Copyright (c) 2018, Loongson Technology, and are made ++# available on the same license terms set forth above. ++# ++ + include ProfileNames.gmk + + ################################################################################ +@@ -30,6 +36,11 @@ include ProfileNames.gmk + # string and the runtime name into the Version.java file. + # To be printed by java -version + ++company_name = ++ifneq ($(COMPANY_NAME),N/A) ++ company_name=($(COMPANY_NAME)) ++endif ++ + $(JDK_OUTPUTDIR)/gensrc/sun/misc/Version.java \ + $(PROFILE_VERSION_JAVA_TARGETS): \ + $(JDK_TOPDIR)/src/share/classes/sun/misc/Version.java.template +@@ -41,6 +52,8 @@ $(PROFILE_VERSION_JAVA_TARGETS): \ + -e 's/@@java_runtime_version@@/$(FULL_VERSION)/g' \ + -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \ + -e 's/@@java_profile_name@@/$(call profile_version_name, $@)/g' \ ++ -e 's/@@company_name@@/$(company_name)/g' \ ++ -e 's/@@loongson_runtime_name@@/$(LOONGSON_RUNTIME_NAME)/g' \ + $< > $@.tmp + $(MV) $@.tmp $@ + +diff --git a/jdk/make/lib/SoundLibraries.gmk b/jdk/make/lib/SoundLibraries.gmk +index b59a9462..8ce97dc8 100644 +--- a/jdk/make/lib/SoundLibraries.gmk ++++ b/jdk/make/lib/SoundLibraries.gmk @@ -23,6 +23,12 @@ # questions. # @@ -116133,7 +117486,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/m LIBJSOUND_SRC_DIRS := \ $(JDK_TOPDIR)/src/share/native/com/sun/media/sound \ $(JDK_TOPDIR)/src/$(OPENJDK_TARGET_OS_API_DIR)/native/com/sun/media/sound -@@ -136,6 +142,14 @@ +@@ -136,6 +142,14 @@ else LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC endif @@ -116148,9 +117501,10 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/m ifeq ($(OPENJDK_TARGET_CPU), ppc64) LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC64 endif -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/src/share/classes/sun/misc/Version.java.template b/jdk/src/share/classes/sun/misc/Version.java.template ---- a/jdk/src/share/classes/sun/misc/Version.java.template 2024-01-11 09:53:23.000000000 +0800 -+++ b/jdk/src/share/classes/sun/misc/Version.java.template 2023-12-20 09:23:21.388129678 +0800 +diff --git a/jdk/src/share/classes/sun/misc/Version.java.template b/jdk/src/share/classes/sun/misc/Version.java.template +index 32e2586e..16b43a39 100644 +--- a/jdk/src/share/classes/sun/misc/Version.java.template ++++ b/jdk/src/share/classes/sun/misc/Version.java.template @@ -23,6 +23,13 @@ * questions. */ @@ -116165,22 +117519,26 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/s package sun.misc; import java.io.PrintStream; -@@ -44,6 +51,9 @@ +@@ -43,6 +50,12 @@ public class Version { + private static final String java_runtime_version = "@@java_runtime_version@@"; - ++ ++ private static final String company_name = ++ "@@company_name@@"; ++ + private static final String loongson_runtime_name = + "@@loongson_runtime_name@@"; -+ + static { init(); - } -@@ -103,7 +113,11 @@ +@@ -103,7 +116,12 @@ public class Version { /* Second line: runtime version (ie, libraries). */ - ps.print(java_runtime_name + " (build " + java_runtime_version); -+ ps.print(java_runtime_name); ++ ps.print(java_runtime_name + " "); ++ + if (loongson_runtime_name.length() > 0) { + ps.print(" ("+ loongson_runtime_name +")"); + } @@ -116188,9 +117546,20 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/s if (java_profile_name.length() > 0) { // profile name -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/src/solaris/bin/loongarch64/jvm.cfg b/jdk/src/solaris/bin/loongarch64/jvm.cfg ---- a/jdk/src/solaris/bin/loongarch64/jvm.cfg 1970-01-01 08:00:00.000000000 +0800 -+++ b/jdk/src/solaris/bin/loongarch64/jvm.cfg 2023-12-20 09:23:21.804791575 +0800 +@@ -120,7 +138,7 @@ public class Version { + String java_vm_name = System.getProperty("java.vm.name"); + String java_vm_version = System.getProperty("java.vm.version"); + String java_vm_info = System.getProperty("java.vm.info"); +- ps.println(java_vm_name + " (build " + java_vm_version + ", " + ++ ps.println(java_vm_name + " " + company_name + " " + "(build " + java_vm_version + ", " + + java_vm_info + ")"); + } + +diff --git a/jdk/src/solaris/bin/loongarch64/jvm.cfg b/jdk/src/solaris/bin/loongarch64/jvm.cfg +new file mode 100644 +index 00000000..42a06755 +--- /dev/null ++++ b/jdk/src/solaris/bin/loongarch64/jvm.cfg @@ -0,0 +1,36 @@ +# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. @@ -116228,9 +117597,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/s +# +-server KNOWN +-client IGNORE -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/src/solaris/bin/mips64/jvm.cfg b/jdk/src/solaris/bin/mips64/jvm.cfg ---- a/jdk/src/solaris/bin/mips64/jvm.cfg 1970-01-01 08:00:00.000000000 +0800 -+++ b/jdk/src/solaris/bin/mips64/jvm.cfg 2023-12-20 09:23:21.804791575 +0800 +diff --git a/jdk/src/solaris/bin/mips64/jvm.cfg b/jdk/src/solaris/bin/mips64/jvm.cfg +new file mode 100644 +index 00000000..42a06755 +--- /dev/null ++++ b/jdk/src/solaris/bin/mips64/jvm.cfg @@ -0,0 +1,36 @@ +# Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. @@ -116268,10 +117639,11 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/s +# +-server KNOWN +-client IGNORE -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/test/jdk/jfr/event/os/TestCPUInformation.java b/jdk/test/jdk/jfr/event/os/TestCPUInformation.java ---- a/jdk/test/jdk/jfr/event/os/TestCPUInformation.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/jdk/test/jdk/jfr/event/os/TestCPUInformation.java 2024-01-30 13:54:25.486035237 +0800 -@@ -54,8 +54,8 @@ +diff --git a/jdk/test/jdk/jfr/event/os/TestCPUInformation.java b/jdk/test/jdk/jfr/event/os/TestCPUInformation.java +index 17c8419c..a8b76cb7 100644 +--- a/jdk/test/jdk/jfr/event/os/TestCPUInformation.java ++++ b/jdk/test/jdk/jfr/event/os/TestCPUInformation.java +@@ -54,8 +54,8 @@ public class TestCPUInformation { Events.assertField(event, "hwThreads").atLeast(1); Events.assertField(event, "cores").atLeast(1); Events.assertField(event, "sockets").atLeast(1); @@ -116282,49 +117654,16 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/t } } } -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher b/jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher ---- a/jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher 1970-01-01 08:00:00.000000000 +0800 -+++ b/jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher 2023-12-20 09:23:22.678114913 +0800 -@@ -0,0 +1,8 @@ -+ELF @XJ@8 @@@ @ 88 8   PP@ > ~  ~ x@0>0~ 0~ HH H DDPtd  QtdRtd > ~  ~ /lib64/ld.so.1GNUGNUka43b 2v   -+  k|  |nagHYBu(  x  T    libdl.so.2_ITM_deregisterTMCloneTable_ITM_registerTMCloneTabledlsymdlopenlibc.so.6sprintfabortstrlenmallocstderrfwritefprintf__libc_start_mainGLIBC_2.27__libc_csu_fini__libc_csu_init OP X ` h p  x       ( 0 8  @  -+A(aAE!(L( L( L( L( L( La( LA( L Т 0 8e(f cEcA  0 8 P 1 8j 0 !0 8!L  !0 8!L@X( @L@ L@@  IEI@( @L L@cw'b*a )DwW )a (w&c@ LS@c@a)v)vb)b(WĢ)̢( D PĢ({Wa(v(c Lca`)v@)vł)@̲)̲( 5`(&̂(&W P̂(A&WMW̢)̂(A&Ģ(W̢()  ")B) 2) b>)̂(!&Ŵ)̂(1D(&PW P"΢͂̂(Lr)r(1dA(&TW P̢(&(΢(͂(a&LB)B(@̢(&!(͢(B(L")"(@̢(&(͢( L)(@̢(&(͢(L)̢(&(͢(((L)(E@̢(&(͢(("(B(L P@P@P@P@̢(&(͢(L@̢(&(͢(L̂(&a(͂(L a`(v@(c L@cw)y)r9s9a)x)z`){@)| )9I ;@@&eDL"8_a(w(x(y(z`({@(| (c L@ L@JNI_CreateJavaVMUsage: %s jvm-path classpath class -+-Djava.class.path=%s%scan't get address of JNI_CreateJavaVM -+Can't create Java VM -+([Ljava/lang/String;)Vmain from C!java/lang/String;,zR|    O ~ (~  o    -+    h o oo` 0 0 0 0 0 0 0 0~ GCC: (Loongnix 8.3.0-6.lnd.vec.24+b1) 8.3.08 H h     `    -+    0       ~ (~ 0~  H     H  x !  7 F(~ m  y ~ L (~ 0~  ~  H   + GZm t  \   x   6  1 = T  BUH a crtstuff.cderegister_tm_clones__do_global_dtors_auxcompleted.6858__do_global_dtors_aux_fini_array_entryframe_dummy__frame_dummy_init_array_entrylauncher.c__FRAME_END____init_array_end_DYNAMIC__init_array_start__GNU_EH_FRAME_HDR_GLOBAL_OFFSET_TABLE___libc_csu_finifprintf@@GLIBC_2.27_ITM_deregisterTMCloneTablefwrite@@GLIBC_2.27malloc@@GLIBC_2.27_edata__libc_start_main@@GLIBC_2.27abort@@GLIBC_2.27strlen@@GLIBC_2.27JNU_FindCreateJavaVM__dso_handle_IO_stdin_useddlopen@@GLIBC_2.27__libc_csu_initsprintf@@GLIBC_2.27dlsym@@GLIBC_2.27__bss_startmainstderr@@GLIBC_2.27__TMC_END___ITM_registerTMCloneTable.symtab.strtab.shstrtab.interp.note.ABI-tag.note.gnu.build-id.gnu.hash.dynsym.dynstr.gnu.version.gnu.version_r.rela.dyn.rela.plt.text.rodata.eh_frame_hdr.eh_frame.init_array.fini_array.dynamic.got.plt.got.sdata.bss.comment8 8#H H 1h h$H TDo 0N  V ^o` ` ko @z B 0 0 X    8 ~  >(~ (>0~ 0> @HH H@H @ @0@,@* F{[I -\ 文件末尾没有换行符 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher b/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher ---- a/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher 1970-01-01 08:00:00.000000000 +0800 -+++ b/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher 2023-12-20 09:23:22.678114913 +0800 -@@ -0,0 +1,22 @@ -+ELF` @"@8 @! @@@   p888TTXXX0H@@$$444 @(((((<((p?((GNUTEo"MPL# X`   -+< 5p -+@ppp -+pppp -+oo -+ooL -+ -+   , X 0   I & y  <N"p`] "_DYNAMIC_LINKING__RLD_MAP__libc_csu_init__libc_csu_fini__libc_start_main__gmon_start___ITM_deregisterTMCloneTable_ITM_registerTMCloneTable__cxa_finalize_Jv_RegisterClassesdlopendlsymstderrfprintfstrlenmallocsprintfJNU_FindCreateJavaVMfwritelibdl.so.2libc.so.6_IO_stdin_usedGLIBC_2.0GLIBC_2.20ii (ii 2ii (ii 2X`g<-`gȀ@Ȁ g%%Ȁ<'-% g$$(0%H@%P <-ycd8d@b܈dBd/DB,@y  <-yxcd8d@e܈d/((-(E{(y  g<-(g8 @@H DP 9g$ gg<-g8hDd@P 9gg  Pg80(%<-Pg$%@ @%P0Edߨ%@ %80(@gPg%<-g%¯B(@耂C܈B%0@PHEd% `%@ $BdB% @%@ Bd% @Ѐ%@ BdB%8@PpFdP߈Edߘ%@ h<B4P¯hgX$T¯$`£BdB% @X%@@耂B%8@&$$PߐDd؀%@ $Pg@gHg%0%(% `%@ ¯A耂B%8@$$P߸Dd؀%@ $x@B0B@߈cdc%(`%@ D@@B܈B@PgdPfd%@  7@@B8B@Ped%@ ((-@@B0B@Ped%@ 0@B`B@(0$% `%@ 88@@BhB@8 % `%@  @BxB@% `%@  @@B܀B@% `%@ HBBH% `%@ %%ߠߘ߰gg0<-Ђg`hp/P( 8%%H% -+@%%0%(% ` 1fQf80( @g%x d%x d%x d%x d%x d%x d%x  d%x  dg<-ggJNI_CreateJavaVMUsage: %s jvm-path classpath class -+-Djava.class.path=%s%scan't get address of JNI_CreateJavaVM -+Can't create Java VM -+([Ljava/lang/String;)Vmain from C!java/lang/String/lib64/ld.so.1GNU X X0 `X p`GCC: (Debian 6.3.0-18+deb9u1) 6.3.0 201705160 @ ?@XAgnu8P  L -+ -+ -+ -+  `  `  04X`hpQ U`hm o   X ` XU0h `+`<IRXeq X" H!p` p1 0 FpS"b qpx 7  `  `  ,2  /usr/lib/gcc/mips64el-linux-gnuabi64/6/../../../mips64el-linux-gnuabi64/Scrt1.ohltcrtstuff.c__JCR_LIST__deregister_tm_clones__do_global_dtors_auxcompleted.6216__do_global_dtors_aux_fini_array_entryframe_dummy__frame_dummy_init_array_entrylauncher.c__FRAME_END____JCR_END___MIPS_STUBS___init_array_end__dso_handle_DYNAMIC__init_array_start__TMC_END___GLOBAL_OFFSET_TABLE__gp__libc_csu_fini__cxa_finalize@@GLIBC_2.2_DYNAMIC_LINKING_ITM_deregisterTMCloneTablestderr@@GLIBC_2.0_edatadlopen@@GLIBC_2.2fwrite@@GLIBC_2.0malloc@@GLIBC_2.0JNU_FindCreateJavaVM__data_start__gmon_start___IO_stdin_used_fdatastrlen@@GLIBC_2.0__libc_start_main@@GLIBC_2.0fprintf@@GLIBC_2.0__RLD_MAP__libc_csu_initdlsym@@GLIBC_2.0__bss_startmain__start_ftext_Jv_RegisterClassessprintf@@GLIBC_2.0_fbss_ITM_registerTMCloneTable.symtab.strtab.shstrtab.MIPS.abiflags.MIPS.options.note.gnu.build-id.dynamic.hash.dynsym.dynstr.gnu.version.gnu.version_r.rel.dyn.init.text.MIPS.stubs.fini.rodata.interp.eh_frame.note.ABI-tag.init_array.fini_array.jcr.data.rld_map.got.sdata.bss.comment.pdr.gnu.attributes*p88* pPPh8$K@T  Z @b  <joL -+L -+0wo -+ -+`  -+ -+@ @` ` ``(    0044 XX``hhpp 0- o8H6 XL!0 -\ 文件末尾没有换行符 -diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/test/sun/security/pkcs11/PKCS11Test.java b/jdk/test/sun/security/pkcs11/PKCS11Test.java ---- a/jdk/test/sun/security/pkcs11/PKCS11Test.java 2024-01-11 09:53:23.000000000 +0800 -+++ b/jdk/test/sun/security/pkcs11/PKCS11Test.java 2023-12-20 09:23:22.824779901 +0800 +diff --git a/jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher b/jdk/test/sun/management/jmxremote/bootstrap/linux-loongarch64/launcher +new file mode 100644 +index 00000000..e69de29b +diff --git a/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher b/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher +new file mode 100644 +index 00000000..e69de29b +diff --git a/jdk/test/sun/security/pkcs11/PKCS11Test.java b/jdk/test/sun/security/pkcs11/PKCS11Test.java +index 5fc9c605..9db6a17d 100644 +--- a/jdk/test/sun/security/pkcs11/PKCS11Test.java ++++ b/jdk/test/sun/security/pkcs11/PKCS11Test.java @@ -21,6 +21,11 @@ * questions. */ @@ -116337,7 +117676,7 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/t // common infrastructure for SunPKCS11 tests -@@ -589,6 +594,9 @@ +@@ -589,6 +594,9 @@ public abstract class PKCS11Test { "/usr/lib64/"}); osMap.put("Linux-ppc64-64", new String[]{"/usr/lib64/"}); osMap.put("Linux-ppc64le-64", new String[]{"/usr/lib64/"}); @@ -116347,3 +117686,6 @@ diff -Naur -x .git -x .github -x .gitattributes -x .gitignore -x .jcheck a/jdk/t osMap.put("Windows-x86-32", new String[]{ PKCS11_BASE + "/nss/lib/windows-i586/".replace('/', SEP)}); osMap.put("Windows-amd64-64", new String[]{ +-- +2.33.0 + diff --git a/add-missing-test-case.patch b/add-missing-test-case.patch index 1cdbfb9f33a1775e29ecf4a5b93848b7f68468b5..6e71d6cb01256f2e8fc579b861751c8500bc7c4f 100644 --- a/add-missing-test-case.patch +++ b/add-missing-test-case.patch @@ -91,7 +91,7 @@ index 00000000..9b614024 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ -+8.402.8.0.13 ++8.412.8.0.13 -- 2.23.0 diff --git a/add-riscv64-support.patch b/add-riscv64-support.patch index 2e1d7ab449e8500c014c98b29e9a8b9468fd90f0..8dda639edb126fd67e2c9647ca17501be2921039 100644 --- a/add-riscv64-support.patch +++ b/add-riscv64-support.patch @@ -33,12 +33,12 @@ index 1aab2b30..662b002a 100644 | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 -index 51df988f..1cce0e4f 100644 +index f54942ac..790e28aa 100644 --- a/common/autoconf/platform.m4 +++ b/common/autoconf/platform.m4 -@@ -96,6 +96,12 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU], +@@ -102,6 +102,12 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU], VAR_CPU_BITS=64 - VAR_CPU_ENDIAN=big + VAR_CPU_ENDIAN=little ;; + riscv64) + VAR_CPU=riscv64 @@ -49,19 +49,19 @@ index 51df988f..1cce0e4f 100644 *) AC_MSG_ERROR([unsupported cpu $1]) ;; -@@ -381,6 +387,7 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], +@@ -387,6 +393,7 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], sparc*) ZERO_ARCHDEF=SPARC ;; x86_64*) ZERO_ARCHDEF=AMD64 ;; x86) ZERO_ARCHDEF=IA32 ;; -+ riscv*) ZERO_ARCHDEF=RISCV ;; ++ riscv*) ZERO_ARCHDEF=RISCV ;; *) ZERO_ARCHDEF=$(echo "${OPENJDK_TARGET_CPU_LEGACY_LIB}" | tr a-z A-Z) esac AC_SUBST(ZERO_ARCHDEF) diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp -index 2d3880b3..6ec35ec1 100644 +index 54cfcdd1..88eb8acd 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp -@@ -367,7 +367,7 @@ void os::init_system_properties_values() { +@@ -363,7 +363,7 @@ void os::init_system_properties_values() { // 1: ... // ... // 7: The default directories, normally /lib and /usr/lib. @@ -70,38 +70,38 @@ index 2d3880b3..6ec35ec1 100644 #define DEFAULT_LIBPATH "/usr/lib64:/lib64:/lib:/usr/lib" #else #define DEFAULT_LIBPATH "/lib:/usr/lib" -@@ -1953,6 +1953,9 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) +@@ -1949,6 +1949,9 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) #ifndef EM_AARCH64 #define EM_AARCH64 183 /* ARM AARCH64 */ #endif + #ifndef EM_RISCV + #define EM_RISCV 243 /* RISC-V */ + #endif - - static const arch_t arch_array[]={ - {EM_386, EM_386, ELFCLASS32, ELFDATA2LSB, (char*)"IA 32"}, + #ifndef EM_LOONGARCH + #define EM_LOONGARCH 258 /* LoongArch */ + #endif @@ -1976,6 +1979,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) - {EM_PARISC, EM_PARISC, ELFCLASS32, ELFDATA2MSB, (char*)"PARISC"}, {EM_68K, EM_68K, ELFCLASS32, ELFDATA2MSB, (char*)"M68k"}, {EM_AARCH64, EM_AARCH64, ELFCLASS64, ELFDATA2LSB, (char*)"AARCH64"}, + {EM_LOONGARCH, EM_LOONGARCH, ELFCLASS64, ELFDATA2LSB, (char*)"LoongArch"}, + {EM_RISCV, EM_RISCV, ELFCLASSNONE, ELFDATA2MSB, (char*)"RISCV"}, }; #if (defined IA32) -@@ -2008,9 +2012,11 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) - static Elf32_Half running_arch_code=EM_68K; - #elif (defined AARCH64) +@@ -2010,9 +2014,11 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) static Elf32_Half running_arch_code=EM_AARCH64; + #elif (defined LOONGARCH) + static Elf32_Half running_arch_code=EM_LOONGARCH; + #elif (defined RISCV) + static Elf32_Half running_arch_code=EM_RISCV; #else #error Method os::dll_load requires that one of following is defined:\ -- IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64 -+ IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64, RISCV +- IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64, LOONGARCH ++ IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64, LOONGARCH, RISCV #endif // Identify compatability class for VM's architecture and library's architecture -@@ -2043,10 +2049,12 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) +@@ -2045,10 +2051,12 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) } #ifndef S390 @@ -114,5 +114,3 @@ index 2d3880b3..6ec35ec1 100644 #endif // !S390 if (lib_arch.compat_class != arch_array[running_arch_index].compat_class) { --- -2.17.1 diff --git a/fix-GCC-12-build-jdk8-fastdebug-error.patch b/fix-GCC-12-build-jdk8-fastdebug-error.patch new file mode 100644 index 0000000000000000000000000000000000000000..1120a3a5856586ddd8322d9d4dd205fa31863ab9 --- /dev/null +++ b/fix-GCC-12-build-jdk8-fastdebug-error.patch @@ -0,0 +1,45 @@ +Subject: Fix GCC 12 build jdk8 fastdebug error +--- + .../vm/gc_implementation/g1/concurrentMark.cpp | 13 ++++++++++++- + 1 file changed, 12 insertions(+), 1 deletion(-) + +diff --git a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +index df901a52d..1347a7e16 100644 +--- a/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp ++++ b/hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp +@@ -2914,13 +2914,23 @@ void ConcurrentMark::print_reachable(const char* str, + return; + } + +- char file_name[JVM_MAXPATHLEN]; ++ // fix gcc 12 build jdk8 fastdebug compiler error: ++ // directive writing up to 4096 bytes into a region of size between 0 and 4096 [-Werror=format-overflow=] ++ // about old code: ++ // char file_name[JVM_MAXPATHLEN]; ++ // Leave L 2911~2915 code unchanged, so not affect original logic. ++ char *file_name = (char *) NEW_C_HEAP_ARRAY(char, strlen(G1PrintReachableBaseFile) + 2 + strlen(str), mtGC); ++ if (NULL == file_name) { ++ gclog_or_tty->print_cr(" #### error: NEW_C_HEAP_ARRAY failed."); ++ return; ++ } + sprintf(file_name, "%s.%s", G1PrintReachableBaseFile, str); + gclog_or_tty->print_cr(" dumping to file %s", file_name); + + fileStream fout(file_name); + if (!fout.is_open()) { + gclog_or_tty->print_cr(" #### error: could not open file"); ++ FREE_C_HEAP_ARRAY(char, file_name, mtGC); + return; + } + +@@ -2936,6 +2946,7 @@ void ConcurrentMark::print_reachable(const char* str, + + gclog_or_tty->print_cr(" done"); + gclog_or_tty->flush(); ++ FREE_C_HEAP_ARRAY(char, file_name, mtGC); + } + + #endif // PRODUCT +-- +2.22.0 + diff --git a/fix-the-length-value-of-ciBlock-in-ciMethodBlocks.cp.patch b/fix-the-length-value-of-ciBlock-in-ciMethodBlocks.cp.patch deleted file mode 100644 index d1490858b052c1c8b8b231d470b42651663622f5..0000000000000000000000000000000000000000 --- a/fix-the-length-value-of-ciBlock-in-ciMethodBlocks.cp.patch +++ /dev/null @@ -1,23 +0,0 @@ -From 102b398cc59e95cb4f5327b9c8fc9a3c5594acce Mon Sep 17 00:00:00 2001 -From: eapen -Date: Tue, 29 Nov 2022 09:23:01 +0800 -Subject: [PATCH 29/33] I68TO2: fix the length value of ciBlock in ciMethodBlocks.cpp ---- - hotspot/src/share/vm/ci/ciMethodBlocks.cpp | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/hotspot/src/share/vm/ci/ciMethodBlocks.cpp b/hotspot/src/share/vm/ci/ciMethodBlocks.cpp -index 614e75d..3ce828e 100644 ---- a/hotspot/src/share/vm/ci/ciMethodBlocks.cpp -+++ b/hotspot/src/share/vm/ci/ciMethodBlocks.cpp -@@ -372,7 +372,7 @@ static const char *flagnames[] = { - - void ciBlock::dump() { - tty->print(" [%d .. %d), {", _start_bci, _limit_bci); -- for (int i = 0; i < 8; i++) { -+ for (int i = 0; i < 7; i++) { - if ((_flags & (1 << i)) != 0) { - tty->print(" %s", flagnames[i]); - } --- -1.8.3.1 diff --git a/fix_X509TrustManagerImpl_symantec_distrust.patch b/fix_X509TrustManagerImpl_symantec_distrust.patch index 83426e6ae5e3a329c39b1e5ad9760d05bcb97ff2..65eeab574e11fab612e15f7535da3be6218528fa 100644 --- a/fix_X509TrustManagerImpl_symantec_distrust.patch +++ b/fix_X509TrustManagerImpl_symantec_distrust.patch @@ -40,16 +40,16 @@ index 54e1bfa0d..c1423dc5b 100644 // The numbers of certs now. - private static final int COUNT = 83; -+ private static final int COUNT = 100; ++ private static final int COUNT = 102; // SHA-256 of cacerts, can be generated with // shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95 private static final String CHECKSUM - = "2D:04:88:6C:52:53:54:EB:38:2D:BC:E0:AF:B7:82:F4:9E:32:A8:1A:1B:A3:AE:CF:25:CB:C2:F6:0F:4E:E1:20"; -+ = "30:6A:9A:00:BF:95:59:BC:FB:4C:ED:89:F6:DB:50:25:8D:F6:D6:F0:BC:C8:FC:A3:E6:AF:62:7A:FD:F6:89:51"; ++ = "2F:92:41:50:3B:2B:F2:AD:86:54:AB:2B:D4:AB:A2:92:8B:B6:1C:2B:58:A1:E3:1A:CE:43:43:FB:3E:94:2E:7E"; + // map of cert alias to SHA-256 fingerprint @SuppressWarnings("serial") - private static final Map FINGERPRINT_MAP @@ -111,7 +111,9 @@ public class VerifyCACerts { "7E:37:CB:8B:4C:47:09:0C:AB:36:55:1B:A6:F4:5D:B8:40:68:0F:BA:16:6A:95:2D:B1:00:71:7F:43:05:3F:C2"); put("digicerthighassuranceevrootca [jdk]", diff --git a/jdk8u-jdk8u402-b06.tar.xz b/jdk8u-jdk8u412-b08.tar.xz similarity index 82% rename from jdk8u-jdk8u402-b06.tar.xz rename to jdk8u-jdk8u412-b08.tar.xz index f7e09c919061fab0a2f8a0a4b2092fda656b8fa5..41cfa2c9f1415ac1eb687d9ce7f4919ee9e95725 100644 Binary files a/jdk8u-jdk8u402-b06.tar.xz and b/jdk8u-jdk8u412-b08.tar.xz differ diff --git a/kae-phase2.patch b/kae-phase2.patch index 0717b274e592b9adf25250913ac8c37addbef25e..3bdc0cafc73cdcdd911e045ad2d61f20f400c3d3 100644 --- a/kae-phase2.patch +++ b/kae-phase2.patch @@ -6480,8 +6480,8 @@ index 9733e17c..d1b13922 100644 --- a/jdk/test/TEST.groups +++ b/jdk/test/TEST.groups @@ -180,6 +180,9 @@ jdk_security = \ - jdk_security_infra = \ - security/infra/java/security/cert/CertPathValidator/certification + security/infra/java/security/cert/CertPathValidator/certification \ + sun/security/lib/cacerts +jdk_kae_security = \ + org/openeuler/security/openssl diff --git a/openjdk-1.8.0.spec b/openjdk-1.8.0.spec index 548a53dce5a626635113c39dea8b014b988bdf37..9c49d6d5f31186827295eb5e3d3a2a2db1bcab50 100644 --- a/openjdk-1.8.0.spec +++ b/openjdk-1.8.0.spec @@ -53,9 +53,10 @@ %global aarch64 aarch64 %global riscv64 riscv64 -%global jit_arches x86_64 %{aarch64} loongarch64 +%global ppc64le ppc64le +%global jit_arches x86_64 %{aarch64} loongarch64 ppc64le %global sa_arches x86_64 %{aarch64} loongarch64 -%global jfr_arches x86_64 %{aarch64} loongarch64 +%global jfr_arches x86_64 %{aarch64} loongarch64 ppc64le # By default, we build a debug build during main build on JIT architectures %global include_debug_build 1 @@ -126,6 +127,11 @@ %global stapinstall loongarch64 %endif +%ifarch ppc64le +%global archinstall ppc64le +%global stapinstall powerpc64le +%endif + %ifarch %{jit_arches} %global with_systemtap 1 %else @@ -160,13 +166,13 @@ %global origin_nice OpenJDK %global top_level_dir_name %{origin} %global repo jdk8u -%global revision jdk8u402-b06 +%global revision jdk8u412-b08 %global full_revision %{repo}-%{revision} # Define IcedTea version used for SystemTap tapsets and desktop files %global icedteaver 3.15.0 -%global updatever 402 -%global buildver b06 +%global updatever 412 +%global buildver b08 # priority must be 7 digits in total. The expression is workarounding tip %global priority 1800%{updatever} @@ -930,7 +936,7 @@ Provides: java-%{javaver}-%{origin}-accessibility%{?1} = %{epoch}:%{version}-%{r Name: java-%{javaver}-%{origin} Version: %{javaver}.%{updatever}.%{buildver} -Release: 1 +Release: 5 # java-1.5.0-ibm from jpackage.org set Epoch to 1 for unknown reasons # and this change was brought into RHEL-4. java-1.5.0-ibm packages # also included the epoch in their virtual provides. This created a @@ -1179,7 +1185,6 @@ Patch288: 8200720-Print-additional-information-in-thread-dump-.patch Patch289: support-numactl-for-hadoop-yarn.patch Patch290: 8232069-enable-shutdown-UseCompressedClassPointers-U.patch Patch291: 8065402-G1-does-not-expand-marking-stack-when-mark-s.patch -Patch292: fix-the-length-value-of-ciBlock-in-ciMethodBlocks.cp.patch Patch293: 8140594-Various-minor-code-improvements-compiler.patch Patch294: Fix-the-crash-that-occurs-when-the-process-exits-due.patch Patch295: Fix-AsyncGCLog-s-content-consistent-bug.patch @@ -1303,6 +1308,20 @@ Patch416: 8260923-Add-more-tests-for-SSLSocket-input-output-sh.patch Patch417: 8057967-CallSite-dependency-tracking-scales-devastat.patch Patch418: 8079205-CallSite-dependency-tracking-is-broken-after.patch +#402 +Patch421: 8220175-serviceability-dcmd-framework-VMVersionTest..patch +Patch422: 8149343-assert-rp-num_q-no_of_gc_workers-failed-sani.patch +Patch423: 8139595-MethodHandles-remove_dependent_nmethod-is-no.patch +Patch424: 8143408-Crash-during-InstanceKlass-unloading-when-cl.patch +Patch425: GCC-12-reports-some-compiler-warnings.patch +Patch426: fix-GCC-12-build-jdk8-fastdebug-error.patch +Patch427: 8223485-C2-PhaseIdealLoop-create_new_if_for_predicat.patch +Patch428: 8223486-split-if-update_uses-accesses-stale-idom-dat.patch + +#412 +Patch429: 8256488-Use-ldpq-stpq-instead-of-ld4-st4-for-small-c.patch +Patch430: DependencyContext-mark_dependent_nmethods-crash-in-Dynamic-cds-mode.patch +Patch431: 8138922-StubCodeDesc-constructor-publishes-partially-constructed.patch ############################################# # # Upstreamable patches @@ -1411,6 +1430,9 @@ BuildRequires: nss-softokn-freebl-devel >= 3.16.1 BuildRequires: systemtap-sdt-devel %endif +# Didn't pick this up while building +BuildRequires: libffi-devel + # this is always built, also during debug-only build # when it is built in debug-only this package is just placeholder %{java_rpo %{nil}} @@ -1648,7 +1670,7 @@ ln -s %{top_level_dir_name} jdk8 pushd %{top_level_dir_name} # OpenJDK patches -%ifnarch loongarch64 +%ifnarch loongarch64 ppc64le %patch8 -p1 %patch10 -p1 @@ -1819,7 +1841,6 @@ pushd %{top_level_dir_name} %patch289 -p1 %patch290 -p1 %patch291 -p1 -%patch292 -p1 %patch293 -p1 %patch294 -p1 %patch295 -p1 @@ -1934,6 +1955,17 @@ pushd %{top_level_dir_name} %patch416 -p1 %patch417 -p1 %patch418 -p1 +%patch421 -p1 +%patch422 -p1 +%patch423 -p1 +%patch424 -p1 +%patch425 -p1 +%patch426 -p1 +%patch427 -p1 +%patch428 -p1 +%patch429 -p1 +%patch430 -p1 +%patch431 -p1 %endif %ifarch loongarch64 @@ -2039,6 +2071,9 @@ fi # Variable used in hs_err hook on build failures top_srcdir_abs_path=$(pwd)/%{top_level_dir_name} +ARCH=$(uname -m) +BOOTJDKPATH=/usr/lib/jvm/java-%{majorver}-openjdk + mkdir -p %{buildoutputdir -- $suffix} pushd %{buildoutputdir -- $suffix} @@ -2058,7 +2093,7 @@ bash ${top_srcdir_abs_path}/configure \ --with-milestone="fcs" \ --with-update-version=%{updatever} \ --with-build-number=%{buildver} \ -%ifnarch loongarch64 +%ifnarch loongarch64 ppc64le --with-company-name="Bisheng" \ --with-vendor-name="Bisheng" \ %endif @@ -2206,6 +2241,7 @@ EOF # Check src.zip has all sources. See RHBZ#1130490 jar -tf $JAVA_HOME/src.zip | grep 'sun.misc.Unsafe' + # Check class files include useful debugging information $JAVA_HOME/bin/javap -l java.lang.Object | grep "Compiled from" $JAVA_HOME/bin/javap -l java.lang.Object | grep LineNumberTable @@ -2587,8 +2623,55 @@ cjc.mainProgram(args) %endif %changelog -* Tue Jan 30 2024 Leslie Zhai - 1:1.8.0.402-b06.1 -- Rebase LoongArch64 patch +* Thu May 23 2024 Dingli Zhang -1:1.8.0.412-b08.5 +- Fix build on riscv64 in prep stage + +* Wed May 15 2024 songliyang -1:1.8.0.412-b08.4 +- fix LoongArch64-support.patch error that apply patch on loongarch64 in prep stage +- fix loongson vendor error + +* Tue May 7 2024 kuenking111 -1:1.8.0.412-b08.3 +- add DependencyContext-mark_dependent_nmethods-crash-in-Dynamic-cds-mode.patch +- add 8138922-StubCodeDesc-constructor-publishes-partially-constructed.patch + +* Tue May 07 2024 zhangxianting -1:1.8.0.412-b08.2 +- fix LoongArch64-support.patch for prep error + +* Sun Apr 28 2024 Autistic_boyya -1:1.8.0.412-b08.1 +- add 8256488-Use-ldpq-stpq-instead-of-ld4-st4-for-small-c.patch + +* Thu Apr 18 2024 Autistic_boyya -1:1.8.0.412-b08.0 +- del 8322725-tz-Update-Timezone-Data-to-2023d.patch +- del 8325150-tz-Update-Timezone-Data-to-2024a.patch +- del fix-the-length-value-of-ciBlock-in-ciMethodBlocks.cp.patch +- modified 8014628-Support-AES-Encryption-with-HMAC-SHA2-for-Ke.patch +- modified 8057743-process-Synchronize-exiting-of-threads-and-p.patch +- modified add-missing-test-case.patch +- modified fix_X509TrustManagerImpl_symantec_distrust.patch +- modified kae-phase2.patch +- modified support-numactl-for-hadoop-yarn.patch +- modified update-cacerts-and-VerifyCACerts.java-test.patch + +* Tue Apr 2 2024 kuenking111 - 1:1.8.0.402-b06.5 +- add fix-GCC-12-build-jdk8-fastdebug-error.patch + +* Sat Mar 30 2024 Benshuai5D - 1:1.8.0.402-b06.4 +- add 8322725-tz-Update-Timezone-Data-to-2023d.patch +- add 8325150-tz-Update-Timezone-Data-to-2024a.patch +- add 8220175-serviceability-dcmd-framework-VMVersionTest..patch +- add 8149343-assert-rp-num_q-no_of_gc_workers-failed-sani.patch +- add 8139595-MethodHandles-remove_dependent_nmethod-is-no.patch +- add 8143408-Crash-during-InstanceKlass-unloading-when-cl.patch +- add GCC-12-reports-some-compiler-warnings.patch + +* Tue Mar 12 2024 jiahua.yu - 1:1.8.0.402-b06.3 +- Init support for arch ppc64le + +* Mon Feb 26 2024 misaka00251 - 1:1.8.0.402-b06.2 +- Fix build on riscv64 + +* Wed Jan 31 2024 Leslie Zhai - 1:1.8.0.402-b06.1 +- Init support of LoogArch64 * Wed Jan 17 2024 Autistic_boyya - 1:1.8.0.402-b06.0 - modified 0019-8040213-C2-does-not-put-all-modified-nodes-on-IGVN-w.patch diff --git a/support-numactl-for-hadoop-yarn.patch b/support-numactl-for-hadoop-yarn.patch index 80c7d61fa13f5eab38bce6fb487f306596605014..bd619d3c8d41e69bdc71b7d7876f347053f0ea21 100644 --- a/support-numactl-for-hadoop-yarn.patch +++ b/support-numactl-for-hadoop-yarn.patch @@ -353,7 +353,7 @@ index dde3975..dd40c2c 100644 + argv_for_execvp = (const char**)raw_argv; +} + - _JNI_IMPORT_OR_EXPORT_ jint JNICALL JNI_CreateJavaVM(JavaVM **vm, void **penv, void *args) { + static jint JNI_CreateJavaVM_inner(JavaVM **vm, void **penv, void *args) { #ifndef USDT2 HS_DTRACE_PROBE3(hotspot_jni, CreateJavaVM__entry, vm, penv, args); diff --git a/hotspot/src/share/vm/prims/jni.h b/hotspot/src/share/vm/prims/jni.h diff --git a/update-cacerts-and-VerifyCACerts.java-test.patch b/update-cacerts-and-VerifyCACerts.java-test.patch index 22fc8c65fd42e99ff7b432222aea0a87311afdb2..4128a07b63afd355bbe18e3a7cfd327cd31e7e86 100644 --- a/update-cacerts-and-VerifyCACerts.java-test.patch +++ b/update-cacerts-and-VerifyCACerts.java-test.patch @@ -257,17 +257,17 @@ index dd107fc..791ddb6 100644 + File.separator + "security" + File.separator + "cacerts"; // The numbers of certs now. -- private static final int COUNT = 106; +- private static final int COUNT = 108; + private static final int COUNT = 83; // SHA-256 of cacerts, can be generated with // shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95 private static final String CHECKSUM -- = "61:5F:6D:C5:9C:A3:8A:65:3F:CB:F9:F5:26:04:23:F4:53:A6:8C:B3:8B:2B:0A:F0:66:7D:9E:67:B9:4D:AC:B7"; +- = "81:D4:84:F6:92:78:A4:82:25:06:DC:42:25:C9:5D:6C:63:E4:99:CE:BC:ED:66:B3:8C:BA:E6:BA:6B:34:0F:01"; + = "2D:04:88:6C:52:53:54:EB:38:2D:BC:E0:AF:B7:82:F4:9E:32:A8:1A:1B:A3:AE:CF:25:CB:C2:F6:0F:4E:E1:20"; + // map of cert alias to SHA-256 fingerprint @SuppressWarnings("serial") - private static final Map FINGERPRINT_MAP @@ -93,12 +93,6 @@ public class VerifyCACerts { "E7:93:C9:B0:2F:D8:AA:13:E2:1C:31:22:8A:CC:B0:81:19:64:3B:74:9C:89:89:64:B1:74:6D:46:C3:D4:CB:D2"); put("usertrusteccca [jdk]",