aoqi@0: /* aoqi@0: * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: * aoqi@0: */ aoqi@0: aoqi@1: /* aoqi@1: * This file has been modified by Loongson Technology in 2015. These aoqi@1: * modifications are Copyright (c) 2015 Loongson Technology, and are made aoqi@1: * available on the same license terms set forth above. aoqi@1: */ aoqi@1: aoqi@0: #ifndef SHARE_VM_RUNTIME_STUBROUTINES_HPP aoqi@0: #define SHARE_VM_RUNTIME_STUBROUTINES_HPP aoqi@0: aoqi@0: #include "code/codeBlob.hpp" aoqi@0: #include "memory/allocation.hpp" aoqi@0: #include "runtime/frame.hpp" aoqi@0: #include "runtime/mutexLocker.hpp" aoqi@0: #include "runtime/stubCodeGenerator.hpp" aoqi@0: #include "utilities/top.hpp" aoqi@0: #ifdef TARGET_ARCH_x86 aoqi@0: # include "nativeInst_x86.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_sparc aoqi@0: # include "nativeInst_sparc.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_zero aoqi@0: # include "nativeInst_zero.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_arm aoqi@0: # include "nativeInst_arm.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_ppc aoqi@0: # include "nativeInst_ppc.hpp" aoqi@0: #endif aoqi@1: #ifdef TARGET_ARCH_mips aoqi@1: # include "nativeInst_mips.hpp" aoqi@1: #endif aoqi@0: aoqi@0: // StubRoutines provides entry points to assembly routines used by aoqi@0: // compiled code and the run-time system. Platform-specific entry aoqi@0: // points are defined in the platform-specific inner class. aoqi@0: // aoqi@0: // Class scheme: aoqi@0: // aoqi@0: // platform-independent platform-dependent aoqi@0: // aoqi@0: // stubRoutines.hpp <-- included -- stubRoutines_.hpp aoqi@0: // ^ ^ aoqi@0: // | | aoqi@0: // implements implements aoqi@0: // | | aoqi@0: // | | aoqi@0: // stubRoutines.cpp stubRoutines_.cpp aoqi@0: // stubRoutines_.cpp stubGenerator_.cpp aoqi@0: // stubRoutines_.cpp aoqi@0: // aoqi@0: // Note 1: The important thing is a clean decoupling between stub aoqi@0: // entry points (interfacing to the whole vm; i.e., 1-to-n aoqi@0: // relationship) and stub generators (interfacing only to aoqi@0: // the entry points implementation; i.e., 1-to-1 relationship). aoqi@0: // This significantly simplifies changes in the generator aoqi@0: // structure since the rest of the vm is not affected. aoqi@0: // aoqi@0: // Note 2: stubGenerator_.cpp contains a minimal portion of aoqi@0: // machine-independent code; namely the generator calls of aoqi@0: // the generator functions that are used platform-independently. aoqi@0: // However, it comes with the advantage of having a 1-file aoqi@0: // implementation of the generator. It should be fairly easy aoqi@0: // to change, should it become a problem later. aoqi@0: // aoqi@0: // Scheme for adding a new entry point: aoqi@0: // aoqi@0: // 1. determine if it's a platform-dependent or independent entry point aoqi@0: // a) if platform independent: make subsequent changes in the independent files aoqi@0: // b) if platform dependent: make subsequent changes in the dependent files aoqi@0: // 2. add a private instance variable holding the entry point address aoqi@0: // 3. add a public accessor function to the instance variable aoqi@0: // 4. implement the corresponding generator function in the platform-dependent aoqi@0: // stubGenerator_.cpp file and call the function in generate_all() of that file aoqi@0: aoqi@0: aoqi@0: class StubRoutines: AllStatic { aoqi@0: aoqi@0: public: aoqi@0: enum platform_independent_constants { aoqi@0: max_size_of_parameters = 256 // max. parameter size supported by megamorphic lookups aoqi@0: }; aoqi@0: aoqi@0: // Dependencies aoqi@0: friend class StubGenerator; aoqi@0: #ifdef TARGET_ARCH_MODEL_x86_32 aoqi@0: # include "stubRoutines_x86_32.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_MODEL_x86_64 aoqi@0: # include "stubRoutines_x86_64.hpp" aoqi@0: #endif aoqi@1: #ifdef TARGET_ARCH_MODEL_mips_64 aoqi@1: # include "stubRoutines_mips_64.hpp" aoqi@1: #endif aoqi@0: #ifdef TARGET_ARCH_MODEL_sparc aoqi@0: # include "stubRoutines_sparc.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_MODEL_zero aoqi@0: # include "stubRoutines_zero.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_MODEL_arm aoqi@0: # include "stubRoutines_arm.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_MODEL_ppc_32 aoqi@0: # include "stubRoutines_ppc_32.hpp" aoqi@0: #endif aoqi@0: #ifdef TARGET_ARCH_MODEL_ppc_64 aoqi@0: # include "stubRoutines_ppc_64.hpp" aoqi@0: #endif aoqi@0: aoqi@0: aoqi@0: static jint _verify_oop_count; aoqi@0: static address _verify_oop_subroutine_entry; aoqi@0: aoqi@0: static address _call_stub_return_address; // the return PC, when returning to a call stub aoqi@0: static address _call_stub_entry; aoqi@0: static address _forward_exception_entry; aoqi@0: static address _catch_exception_entry; aoqi@0: static address _throw_AbstractMethodError_entry; aoqi@0: static address _throw_IncompatibleClassChangeError_entry; aoqi@0: static address _throw_NullPointerException_at_call_entry; aoqi@0: static address _throw_StackOverflowError_entry; aoqi@0: static address _handler_for_unsafe_access_entry; aoqi@0: aoqi@0: static address _atomic_xchg_entry; aoqi@0: static address _atomic_xchg_ptr_entry; aoqi@0: static address _atomic_store_entry; aoqi@0: static address _atomic_store_ptr_entry; aoqi@0: static address _atomic_cmpxchg_entry; aoqi@0: static address _atomic_cmpxchg_ptr_entry; aoqi@0: static address _atomic_cmpxchg_long_entry; aoqi@0: static address _atomic_add_entry; aoqi@0: static address _atomic_add_ptr_entry; aoqi@0: static address _fence_entry; aoqi@0: static address _d2i_wrapper; aoqi@0: static address _d2l_wrapper; aoqi@0: aoqi@0: static jint _fpu_cntrl_wrd_std; aoqi@0: static jint _fpu_cntrl_wrd_24; aoqi@0: static jint _fpu_cntrl_wrd_64; aoqi@0: static jint _fpu_cntrl_wrd_trunc; aoqi@0: static jint _mxcsr_std; aoqi@0: static jint _fpu_subnormal_bias1[3]; aoqi@0: static jint _fpu_subnormal_bias2[3]; aoqi@0: aoqi@0: static BufferBlob* _code1; // code buffer for initial routines aoqi@0: static BufferBlob* _code2; // code buffer for all other routines aoqi@0: aoqi@0: // Leaf routines which implement arraycopy and their addresses aoqi@0: // arraycopy operands aligned on element type boundary aoqi@0: static address _jbyte_arraycopy; aoqi@0: static address _jshort_arraycopy; aoqi@0: static address _jint_arraycopy; aoqi@0: static address _jlong_arraycopy; aoqi@0: static address _oop_arraycopy, _oop_arraycopy_uninit; aoqi@0: static address _jbyte_disjoint_arraycopy; aoqi@0: static address _jshort_disjoint_arraycopy; aoqi@0: static address _jint_disjoint_arraycopy; aoqi@0: static address _jlong_disjoint_arraycopy; aoqi@0: static address _oop_disjoint_arraycopy, _oop_disjoint_arraycopy_uninit; aoqi@0: aoqi@0: // arraycopy operands aligned on zero'th element boundary aoqi@0: // These are identical to the ones aligned aligned on an aoqi@0: // element type boundary, except that they assume that both aoqi@0: // source and destination are HeapWord aligned. aoqi@0: static address _arrayof_jbyte_arraycopy; aoqi@0: static address _arrayof_jshort_arraycopy; aoqi@0: static address _arrayof_jint_arraycopy; aoqi@0: static address _arrayof_jlong_arraycopy; aoqi@0: static address _arrayof_oop_arraycopy, _arrayof_oop_arraycopy_uninit; aoqi@0: static address _arrayof_jbyte_disjoint_arraycopy; aoqi@0: static address _arrayof_jshort_disjoint_arraycopy; aoqi@0: static address _arrayof_jint_disjoint_arraycopy; aoqi@0: static address _arrayof_jlong_disjoint_arraycopy; aoqi@0: static address _arrayof_oop_disjoint_arraycopy, _arrayof_oop_disjoint_arraycopy_uninit; aoqi@0: aoqi@0: // these are recommended but optional: aoqi@0: static address _checkcast_arraycopy, _checkcast_arraycopy_uninit; aoqi@0: static address _unsafe_arraycopy; aoqi@0: static address _generic_arraycopy; aoqi@0: aoqi@0: static address _jbyte_fill; aoqi@0: static address _jshort_fill; aoqi@0: static address _jint_fill; aoqi@0: static address _arrayof_jbyte_fill; aoqi@0: static address _arrayof_jshort_fill; aoqi@0: static address _arrayof_jint_fill; aoqi@0: aoqi@0: // zero heap space aligned to jlong (8 bytes) aoqi@0: static address _zero_aligned_words; aoqi@0: aoqi@0: static address _aescrypt_encryptBlock; aoqi@0: static address _aescrypt_decryptBlock; aoqi@0: static address _cipherBlockChaining_encryptAESCrypt; aoqi@0: static address _cipherBlockChaining_decryptAESCrypt; aoqi@0: aoqi@0: static address _updateBytesCRC32; aoqi@0: static address _crc_table_adr; aoqi@0: aoqi@0: // These are versions of the java.lang.Math methods which perform aoqi@0: // the same operations as the intrinsic version. They are used for aoqi@0: // constant folding in the compiler to ensure equivalence. If the aoqi@0: // intrinsic version returns the same result as the strict version aoqi@0: // then they can be set to the appropriate function from aoqi@0: // SharedRuntime. aoqi@0: static double (*_intrinsic_log)(double); aoqi@0: static double (*_intrinsic_log10)(double); aoqi@0: static double (*_intrinsic_exp)(double); aoqi@0: static double (*_intrinsic_pow)(double, double); aoqi@0: static double (*_intrinsic_sin)(double); aoqi@0: static double (*_intrinsic_cos)(double); aoqi@0: static double (*_intrinsic_tan)(double); aoqi@0: aoqi@0: // Safefetch stubs. aoqi@0: static address _safefetch32_entry; aoqi@0: static address _safefetch32_fault_pc; aoqi@0: static address _safefetch32_continuation_pc; aoqi@0: static address _safefetchN_entry; aoqi@0: static address _safefetchN_fault_pc; aoqi@0: static address _safefetchN_continuation_pc; aoqi@0: aoqi@0: public: aoqi@0: // Initialization/Testing aoqi@0: static void initialize1(); // must happen before universe::genesis aoqi@0: static void initialize2(); // must happen after universe::genesis aoqi@0: aoqi@0: static bool is_stub_code(address addr) { return contains(addr); } aoqi@0: aoqi@0: static bool contains(address addr) { aoqi@0: return aoqi@0: (_code1 != NULL && _code1->blob_contains(addr)) || aoqi@0: (_code2 != NULL && _code2->blob_contains(addr)) ; aoqi@0: } aoqi@0: aoqi@0: static CodeBlob* code1() { return _code1; } aoqi@0: static CodeBlob* code2() { return _code2; } aoqi@0: aoqi@0: // Debugging aoqi@0: static jint verify_oop_count() { return _verify_oop_count; } aoqi@0: static jint* verify_oop_count_addr() { return &_verify_oop_count; } aoqi@0: // a subroutine for debugging the GC aoqi@0: static address verify_oop_subroutine_entry_address() { return (address)&_verify_oop_subroutine_entry; } aoqi@0: aoqi@0: static address catch_exception_entry() { return _catch_exception_entry; } aoqi@0: aoqi@0: // Calls to Java aoqi@0: typedef void (*CallStub)( aoqi@0: address link, aoqi@0: intptr_t* result, aoqi@0: BasicType result_type, aoqi@0: Method* method, aoqi@0: address entry_point, aoqi@0: intptr_t* parameters, aoqi@0: int size_of_parameters, aoqi@0: TRAPS aoqi@0: ); aoqi@0: aoqi@0: static CallStub call_stub() { return CAST_TO_FN_PTR(CallStub, _call_stub_entry); } aoqi@0: aoqi@0: // Exceptions aoqi@0: static address forward_exception_entry() { return _forward_exception_entry; } aoqi@0: // Implicit exceptions aoqi@0: static address throw_AbstractMethodError_entry() { return _throw_AbstractMethodError_entry; } aoqi@0: static address throw_IncompatibleClassChangeError_entry(){ return _throw_IncompatibleClassChangeError_entry; } aoqi@0: static address throw_NullPointerException_at_call_entry(){ return _throw_NullPointerException_at_call_entry; } aoqi@0: static address throw_StackOverflowError_entry() { return _throw_StackOverflowError_entry; } aoqi@0: aoqi@0: // Exceptions during unsafe access - should throw Java exception rather aoqi@0: // than crash. aoqi@0: static address handler_for_unsafe_access() { return _handler_for_unsafe_access_entry; } aoqi@0: aoqi@0: static address atomic_xchg_entry() { return _atomic_xchg_entry; } aoqi@0: static address atomic_xchg_ptr_entry() { return _atomic_xchg_ptr_entry; } aoqi@0: static address atomic_store_entry() { return _atomic_store_entry; } aoqi@0: static address atomic_store_ptr_entry() { return _atomic_store_ptr_entry; } aoqi@0: static address atomic_cmpxchg_entry() { return _atomic_cmpxchg_entry; } aoqi@0: static address atomic_cmpxchg_ptr_entry() { return _atomic_cmpxchg_ptr_entry; } aoqi@0: static address atomic_cmpxchg_long_entry() { return _atomic_cmpxchg_long_entry; } aoqi@0: static address atomic_add_entry() { return _atomic_add_entry; } aoqi@0: static address atomic_add_ptr_entry() { return _atomic_add_ptr_entry; } aoqi@0: static address fence_entry() { return _fence_entry; } aoqi@0: aoqi@0: static address d2i_wrapper() { return _d2i_wrapper; } aoqi@0: static address d2l_wrapper() { return _d2l_wrapper; } aoqi@0: static jint fpu_cntrl_wrd_std() { return _fpu_cntrl_wrd_std; } aoqi@0: static address addr_fpu_cntrl_wrd_std() { return (address)&_fpu_cntrl_wrd_std; } aoqi@0: static address addr_fpu_cntrl_wrd_24() { return (address)&_fpu_cntrl_wrd_24; } aoqi@0: static address addr_fpu_cntrl_wrd_64() { return (address)&_fpu_cntrl_wrd_64; } aoqi@0: static address addr_fpu_cntrl_wrd_trunc() { return (address)&_fpu_cntrl_wrd_trunc; } aoqi@0: static address addr_mxcsr_std() { return (address)&_mxcsr_std; } aoqi@0: static address addr_fpu_subnormal_bias1() { return (address)&_fpu_subnormal_bias1; } aoqi@0: static address addr_fpu_subnormal_bias2() { return (address)&_fpu_subnormal_bias2; } aoqi@0: aoqi@0: aoqi@0: static address select_arraycopy_function(BasicType t, bool aligned, bool disjoint, const char* &name, bool dest_uninitialized); aoqi@0: aoqi@0: static address jbyte_arraycopy() { return _jbyte_arraycopy; } aoqi@0: static address jshort_arraycopy() { return _jshort_arraycopy; } aoqi@0: static address jint_arraycopy() { return _jint_arraycopy; } aoqi@0: static address jlong_arraycopy() { return _jlong_arraycopy; } aoqi@0: static address oop_arraycopy(bool dest_uninitialized = false) { aoqi@0: return dest_uninitialized ? _oop_arraycopy_uninit : _oop_arraycopy; aoqi@0: } aoqi@0: static address jbyte_disjoint_arraycopy() { return _jbyte_disjoint_arraycopy; } aoqi@0: static address jshort_disjoint_arraycopy() { return _jshort_disjoint_arraycopy; } aoqi@0: static address jint_disjoint_arraycopy() { return _jint_disjoint_arraycopy; } aoqi@0: static address jlong_disjoint_arraycopy() { return _jlong_disjoint_arraycopy; } aoqi@0: static address oop_disjoint_arraycopy(bool dest_uninitialized = false) { aoqi@0: return dest_uninitialized ? _oop_disjoint_arraycopy_uninit : _oop_disjoint_arraycopy; aoqi@0: } aoqi@0: aoqi@0: static address arrayof_jbyte_arraycopy() { return _arrayof_jbyte_arraycopy; } aoqi@0: static address arrayof_jshort_arraycopy() { return _arrayof_jshort_arraycopy; } aoqi@0: static address arrayof_jint_arraycopy() { return _arrayof_jint_arraycopy; } aoqi@0: static address arrayof_jlong_arraycopy() { return _arrayof_jlong_arraycopy; } aoqi@0: static address arrayof_oop_arraycopy(bool dest_uninitialized = false) { aoqi@0: return dest_uninitialized ? _arrayof_oop_arraycopy_uninit : _arrayof_oop_arraycopy; aoqi@0: } aoqi@0: aoqi@0: static address arrayof_jbyte_disjoint_arraycopy() { return _arrayof_jbyte_disjoint_arraycopy; } aoqi@0: static address arrayof_jshort_disjoint_arraycopy() { return _arrayof_jshort_disjoint_arraycopy; } aoqi@0: static address arrayof_jint_disjoint_arraycopy() { return _arrayof_jint_disjoint_arraycopy; } aoqi@0: static address arrayof_jlong_disjoint_arraycopy() { return _arrayof_jlong_disjoint_arraycopy; } aoqi@0: static address arrayof_oop_disjoint_arraycopy(bool dest_uninitialized = false) { aoqi@0: return dest_uninitialized ? _arrayof_oop_disjoint_arraycopy_uninit : _arrayof_oop_disjoint_arraycopy; aoqi@0: } aoqi@0: aoqi@0: static address checkcast_arraycopy(bool dest_uninitialized = false) { aoqi@0: return dest_uninitialized ? _checkcast_arraycopy_uninit : _checkcast_arraycopy; aoqi@0: } aoqi@0: static address unsafe_arraycopy() { return _unsafe_arraycopy; } aoqi@0: static address generic_arraycopy() { return _generic_arraycopy; } aoqi@0: aoqi@0: static address jbyte_fill() { return _jbyte_fill; } aoqi@0: static address jshort_fill() { return _jshort_fill; } aoqi@0: static address jint_fill() { return _jint_fill; } aoqi@0: static address arrayof_jbyte_fill() { return _arrayof_jbyte_fill; } aoqi@0: static address arrayof_jshort_fill() { return _arrayof_jshort_fill; } aoqi@0: static address arrayof_jint_fill() { return _arrayof_jint_fill; } aoqi@0: aoqi@0: static address aescrypt_encryptBlock() { return _aescrypt_encryptBlock; } aoqi@0: static address aescrypt_decryptBlock() { return _aescrypt_decryptBlock; } aoqi@0: static address cipherBlockChaining_encryptAESCrypt() { return _cipherBlockChaining_encryptAESCrypt; } aoqi@0: static address cipherBlockChaining_decryptAESCrypt() { return _cipherBlockChaining_decryptAESCrypt; } aoqi@0: aoqi@0: static address updateBytesCRC32() { return _updateBytesCRC32; } aoqi@0: static address crc_table_addr() { return _crc_table_adr; } aoqi@0: aoqi@0: static address select_fill_function(BasicType t, bool aligned, const char* &name); aoqi@0: aoqi@0: static address zero_aligned_words() { return _zero_aligned_words; } aoqi@0: aoqi@0: static double intrinsic_log(double d) { aoqi@0: assert(_intrinsic_log != NULL, "must be defined"); aoqi@0: return _intrinsic_log(d); aoqi@0: } aoqi@0: static double intrinsic_log10(double d) { aoqi@0: assert(_intrinsic_log != NULL, "must be defined"); aoqi@0: return _intrinsic_log10(d); aoqi@0: } aoqi@0: static double intrinsic_exp(double d) { aoqi@0: assert(_intrinsic_exp != NULL, "must be defined"); aoqi@0: return _intrinsic_exp(d); aoqi@0: } aoqi@0: static double intrinsic_pow(double d, double d2) { aoqi@0: assert(_intrinsic_pow != NULL, "must be defined"); aoqi@0: return _intrinsic_pow(d, d2); aoqi@0: } aoqi@0: static double intrinsic_sin(double d) { aoqi@0: assert(_intrinsic_sin != NULL, "must be defined"); aoqi@0: return _intrinsic_sin(d); aoqi@0: } aoqi@0: static double intrinsic_cos(double d) { aoqi@0: assert(_intrinsic_cos != NULL, "must be defined"); aoqi@0: return _intrinsic_cos(d); aoqi@0: } aoqi@0: static double intrinsic_tan(double d) { aoqi@0: assert(_intrinsic_tan != NULL, "must be defined"); aoqi@0: return _intrinsic_tan(d); aoqi@0: } aoqi@0: aoqi@0: // aoqi@0: // Safefetch stub support aoqi@0: // aoqi@0: aoqi@0: typedef int (*SafeFetch32Stub)(int* adr, int errValue); aoqi@0: typedef intptr_t (*SafeFetchNStub) (intptr_t* adr, intptr_t errValue); aoqi@0: aoqi@0: static SafeFetch32Stub SafeFetch32_stub() { return CAST_TO_FN_PTR(SafeFetch32Stub, _safefetch32_entry); } aoqi@0: static SafeFetchNStub SafeFetchN_stub() { return CAST_TO_FN_PTR(SafeFetchNStub, _safefetchN_entry); } aoqi@0: aoqi@0: static bool is_safefetch_fault(address pc) { aoqi@0: return pc != NULL && aoqi@0: (pc == _safefetch32_fault_pc || aoqi@0: pc == _safefetchN_fault_pc); aoqi@0: } aoqi@0: aoqi@0: static address continuation_for_safefetch_fault(address pc) { aoqi@0: assert(_safefetch32_continuation_pc != NULL && aoqi@0: _safefetchN_continuation_pc != NULL, aoqi@0: "not initialized"); aoqi@0: aoqi@0: if (pc == _safefetch32_fault_pc) return _safefetch32_continuation_pc; aoqi@0: if (pc == _safefetchN_fault_pc) return _safefetchN_continuation_pc; aoqi@0: aoqi@0: ShouldNotReachHere(); aoqi@0: return NULL; aoqi@0: } aoqi@0: aoqi@0: // aoqi@0: // Default versions of the above arraycopy functions for platforms which do aoqi@0: // not have specialized versions aoqi@0: // aoqi@0: static void jbyte_copy (jbyte* src, jbyte* dest, size_t count); aoqi@0: static void jshort_copy (jshort* src, jshort* dest, size_t count); aoqi@0: static void jint_copy (jint* src, jint* dest, size_t count); aoqi@0: static void jlong_copy (jlong* src, jlong* dest, size_t count); aoqi@0: static void oop_copy (oop* src, oop* dest, size_t count); aoqi@0: static void oop_copy_uninit(oop* src, oop* dest, size_t count); aoqi@0: aoqi@0: static void arrayof_jbyte_copy (HeapWord* src, HeapWord* dest, size_t count); aoqi@0: static void arrayof_jshort_copy (HeapWord* src, HeapWord* dest, size_t count); aoqi@0: static void arrayof_jint_copy (HeapWord* src, HeapWord* dest, size_t count); aoqi@0: static void arrayof_jlong_copy (HeapWord* src, HeapWord* dest, size_t count); aoqi@0: static void arrayof_oop_copy (HeapWord* src, HeapWord* dest, size_t count); aoqi@0: static void arrayof_oop_copy_uninit(HeapWord* src, HeapWord* dest, size_t count); aoqi@0: }; aoqi@0: aoqi@0: // Safefetch allows to load a value from a location that's not known aoqi@0: // to be valid. If the load causes a fault, the error value is returned. aoqi@0: inline int SafeFetch32(int* adr, int errValue) { aoqi@0: assert(StubRoutines::SafeFetch32_stub(), "stub not yet generated"); aoqi@0: return StubRoutines::SafeFetch32_stub()(adr, errValue); aoqi@0: } aoqi@0: inline intptr_t SafeFetchN(intptr_t* adr, intptr_t errValue) { aoqi@0: assert(StubRoutines::SafeFetchN_stub(), "stub not yet generated"); aoqi@0: return StubRoutines::SafeFetchN_stub()(adr, errValue); aoqi@0: } aoqi@0: aoqi@0: #endif // SHARE_VM_RUNTIME_STUBROUTINES_HPP